EchoNoise Posted July 18, 2006 Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 Follow my guide here:http://www.msfn.org/board/index.php?showtopic=47730then define the variable:$status = file_get_contents("http://progressquest.com/robot.php?name=undeadsoldier&realm=Expodrine&style=pretty");and output it somewhere in the image like so:ImageTTFText ($image, 8, 0, 10, 17, $white, $font, $status);Should work. It's working in my sig below... See the little green (or red) dot on the top right? That's basically giving my computer's online status by grabbing it from the text output at the Hamachi status site. Edit: I just realized the file_get_contents will not work because it will grab the entire HTML of that page... Working on a solution... Edit2:Here we go!!!<?phpHeader ('Content-type: image/jpeg');Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');Header('Pragma: no-cache');// create the image$image = imagecreatefromjpeg("background.jpg");// set the colors$black = imagecolorallocate($image, 0, 0, 0);$blue = imagecolorallocate($image, 63, 70, 88);$red = imagecolorallocate($image, 255, 0, 0);// set the font$font = 'verdana.ttf';$size = 8;// grab status$grab = file_get_contents("http://progressquest.com/robot.php?name=undeadsoldier&realm=Expodrine");$split = preg_split("/[\n]+/", $grab);$line1 = $split[0] . " of Expodrine (" . $split[4] . ")";$line2 = "Level " . $split[3] . " " . $split[1] . " " . $split[2];$line3 = $split[5] . " / " . $split[6] . " / " . $split[7];$combine = $line1 . "\n" . $line2 . "\n" . $line3;// put text togetherImageTTFText($image, $size, 0, 8, 16, $black, $font, $combine);// output and destroyimagejpeg($image);imagedestroy($image);?>This is the background image used:And the contents of the .htaccess file:Options All -Indexes<Files sig.jpg>SetHandler application/x-httpd-php</Files>I used the Verdana font because I had already saved it somewhere on my machine.Please try to host this on your own server if you're going to use it since I am now hosting it on one that isn't very reliable and because I use it for other things that usually slow it down (compiling/home music sharing/etc.) Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 (edited) Its not working unfortunately, thanks for the info though *starts to pull hair out*Never mind... I hope that's what you wanted. Also, you might have to play around with it a bit as it is too big, according to forum rules, to be used as a sig. Edited July 18, 2006 by gamehead200 Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 It works when I test it on my own server But when I go and upload it, it gives me a "Error 500"I'm guessing its something to do with the .htaccess file... My host is on linux You might have to put this instead in your .htaccess file:Options All -Indexes<Files sig.jpg>AddHandler application/x-httpd-php .jpg</Files>ORYou might not have GD enabled. Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 GD is enabled, I've talked to the host admin peopleI'll try that method above, and i'll let you know...EDIT: nope... It doesn't seem to work... Unlesssssssssss.. *idea* (taking out "options")Taking out the options tag, just gives me the result of whats in the address bar... Which is very odd...Hehe... This has happened to me before... Did you by any chance rename the sig.jpg file and forget to change it in the .htaccess file? Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 Nope... I have not changed anything at allCheck your error log? Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 I just got informed that file_get_contents is not supported So is there anywhere I can put my dynamic signature that IS supported?I have edited Gameheads files a bit, I just need somebody to upload and I'll be as good to go What version of PHP does your host have? He should upgrade to at least PHP 4.4.2 for this to work, if not, PHP 5.1.4. Link to comment Share on other sites More sharing options...
gamehead200 Posted July 18, 2006 Share Posted July 18, 2006 Ah, some new code generates this :Try the following out:<?php Header ('Content-type: image/jpeg');Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT');Header('Pragma: no-cache'); // create the image$image = imagecreatefromjpeg("background.jpg"); // set the colors$black = imagecolorallocate($image, 0, 0, 0); // set the font$font = 'verdana.ttf';$size = 8; // grab status and split it up$handle = @fopen("http://progressquest.com/robot.php?name=undeadsoldier&realm=Expodrine", "r");if($handle){ for( $i = 0; !feof($handle); $i++ ){ $get = fgets($handle, 4096); $split[$i] = trim($get, "\n"); } fclose($handle);} $line1 = $split[0] . " of Expodrine (" . $split[4] . ")";$line2 = "Level " . $split[3] . " " . $split[1] . " " . $split[2];$line3 = $split[5] . " / " . $split[6] . " / " . $split[7]; $combine = $line1 . "\n" . $line2 . "\n" . $line3; // put text togetherImageTTFText($image, $size, 0, 8, 16, $black, $font, $combine); // output and destroyimagejpeg($image);imagedestroy($image); ?> Link to comment Share on other sites More sharing options...
EchoNoise Posted July 18, 2006 Author Share Posted July 18, 2006 (edited) [deleted] Edited September 29, 2022 by EchoNoise Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now