What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Images... I can't make one. :(

PHP Images... I can't make one. :(
Author: Message:
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: PHP Images... I can't make one. :(
quote:
Originally posted by Guillaume
its too hard... i need something like XML

Is it possible to just take a picture (like 5 secs after object is loaded) of a swf object?

ok I've added a simple parseing thing to the code i gave before

code:
<?
$handle = fopen("http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003", "rb");
$contents = '';
while (!feof($handle)) {
  $contents .= fread($handle, 8192);
}
fclose($handle);



$match = InsideTags('<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">','</div></div>',$contents); // uses a regular expression and gets the stuff inbetween those two points and returns it


foreach ($match[1] as $stat){  //just echo's all your stats
echo "$stat <br>";
}
   

function InsideTags($tag1,$tag2,$html){ //function to grab text inbetween two points
$tag2 = str_replace('/', "\/" ,$tag2);
preg_match_all("/$tag1(.*)$tag2/i", $html, $match);
return $match;
}
?>


now when that script above is run it will goto http://www.bungie.net/Stats/PlayerStats.aspx?player=guyguyme2003   download the whole page and inserts it into $contents.
then because the stats are displayed in the html like so
code:
<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">3</div></div>


my code grabs the text  inbetween the points
code:
<div class="ExpBar" style="width:50"><div class="ExpBarText" style="left:20">
and
code:
</div></div>


and then puts then in a varible called $match[1]  ( $match[0] array holds the whole html of the stat lines )
then it prints all the stats out in order

so currently the script will print out
code:
3
4
1
9
5

It should be easy for you to assign every thing in $match[1] to varibles then print it to your image.

edit:
and also you will need to cache the stats because you dont want it to download your stat page everytime someone vists your image.

This post was edited on 01-20-2005 at 07:06 AM by -dt-.
[Image: dt2.0v2.png]      Happy Birthday, WDZ
01-20-2005 07:04 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 12:07 AM
RE: PHP Images... I can't make one. :( - by fluffy_lobster on 01-19-2005 at 04:51 PM
RE: PHP Images... I can't make one. :( - by -dt- on 01-19-2005 at 05:32 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 09:06 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-19-2005 at 09:12 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 09:19 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-19-2005 at 09:34 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 09:36 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-19-2005 at 09:42 PM
RE: RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 09:51 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 09:59 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-19-2005 at 10:37 PM
RE: PHP Images... I can't make one. :( - by -dt- on 01-20-2005 at 07:04 AM
RE: PHP Images... I can't make one. :( - by Moo on 01-20-2005 at 10:24 PM
RE: RE: PHP Images... I can't make one. :( - by -dt- on 01-21-2005 at 04:36 AM
RE: PHP Images... I can't make one. :( - by WDZ on 01-21-2005 at 04:29 AM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 08:30 PM
RE: PHP Images... I can't make one. :( - by segosa on 01-21-2005 at 09:02 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 09:08 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-21-2005 at 09:29 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 09:38 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 09:56 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-21-2005 at 10:01 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 10:05 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 10:07 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-21-2005 at 10:12 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 10:13 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 10:43 PM
RE: PHP Images... I can't make one. :( - by WDZ on 01-21-2005 at 10:59 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-21-2005 at 11:03 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-22-2005 at 12:35 AM
RE: PHP Images... I can't make one. :( - by -dt- on 01-22-2005 at 11:11 AM
RE: PHP Images... I can't make one. :( - by Moo on 01-22-2005 at 03:48 PM
RE: PHP Images... I can't make one. :( - by Moo on 01-22-2005 at 04:25 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On