Może ktoś mi wyjaśnić jak krok po kroku zrobić własną sygnaturę na podstawie tego skryptu? Chodzi mi o zrobienie z informacji wyświetlanych w php obrazka np w .png
  1. <pre>
  2. <?
  3. /*
  4.   * readUserStats(userid)
  5.   *  - Read WhatPulse user statistics from the webapi into an array.
  6.   *
  7.   * Author: wasted@whatpulse.org
  8.   */
  9. function readUserStats($userid)
  10. {
  11.   // prepare an array to hold your stats
  12.   $WhatPulseStats = array();
  13.   
  14.   // types of statistics 
  15.   $stat_types = array("UserID", "AccountName", "Country",
  16.       "DateJoined", "Homepage", "LastPulse", 
  17.       "Pulses", "TotalKeyCount", "TotalMouseClicks",
  18.       "AvKeysPerPulse", "AvClicksPerPulse", 
  19.       "AvKPS", "AvCPS", "Rank", "TeamID", 
  20.       "TeamName", "TeamMembers", "TeamKeys", 
  21.       "TeamClicks", "TeamDescription", 
  22.       "TeamDateFormed", "RankInTeam", "GeneratedTime");
  23.       
  24.      // init the xml parser and read the data into an array
  25.      $data = implode("", file("http://whatpulse.org/api/users/".$userid.".xml"));
  26.      $parser = xml_parser_create();
  27.      xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
  28.      xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
  29.      xml_parse_into_struct($parser, $data, $values, $tags);
  30.      xml_parser_free($parser);
  31.     
  32.      // loop through the structures
  33.      foreach ($tags as $key => $val) 
  34.      {
  35.       // only process stuff between the <UserStats> tags
  36.          if ($key == "UserStats") 
  37.          {
  38.           // loop through the tags inside <UserStats>
  39.              $ranges = $val;
  40.              for ($i = 0; $i < count($ranges); $i += 2) 
  41.              {
  42.      $offset = $ranges[$i] + 1;
  43.      $len = $ranges[$i + 1] - $offset;
  44.      $statsarray = array_slice($values, $offset, $len);
  45.     
  46.      // loop through the structure of the xml tag
  47.      foreach($statsarray as $key => $value)
  48.      {
  49.       // match to a stats_type
  50.       for($i = 0; $i < count($stat_types); $i++)
  51.       {
  52.        if($value['tag'] == $stat_types[$i]) 
  53.        {
  54.         // remember the value of the stats_type
  55.         $type = $stat_types[$i];
  56.         $WhatPulseStats[$type] = $value['value'];
  57.        }
  58.       } 
  59.      } 
  60.     } 
  61.    } 
  62.    else {
  63.     continue;
  64.    }
  65.   } 
  66.   
  67.   return $WhatPulseStats;
  68. } 
  69.  
  70. // read statistics
  71. $stats = readUserStats(155348);
  72.  
  73.               print_r($stats);
  74. ?> 
  75. </pre>


Z góry thx za pomoc

----------
Dla kodu php uzywaj [php] nie [code]
-- dr_bonzo