Jump to content

IP Sig


eXPerience-XP

Recommended Posts

now it wont show anything but a red x again (when viewed as a php file) and nothing at all as a jpg (but you can view source my code)..

this is frustrating... it should work fine...

my about-bg.gif:

about-bg.gif

my siggy.php code:

<?php

Header ('Content-type: image/png');
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 = imagecreatefromgif("/var/www/html/signature/about-bg.gif");

// set the colours
$cool = imagecolorallocate($image, 87, 87, 87);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// counter
$viewss = file("/var/www/html/signature/views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("/var/www/html/signature/views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "Phazm Graphics - $views people served since 11/5/03!";

// define geek code
$nerd = "-----BEGIN NERD CODE BLOCK-----
Version: 1.2a
010011010111100100100000011100110110100101100111
011001110111100100100000011101110110100101101100
011011000010000001110011011011110110111101101110
001000000111001001101111011000110110101100100001
00100000
------END NERD CODE BLOCK------";

// line style line
$line = "________________________________________________________";

// set the font and print text
$font = '/var/www/html/verdana.ttf';

ImageTTFText ($image, 8, 0, 12, 45, $black, $font, $nerd);
ImageTTFText ($image, 8, 0, 12, 148, $black, $font, $line);
ImageTTFText ($image, 8, 0, 12, 180, $black, $font, $counter);

// output and destroy
imagepng($image);
imagedestroy($image);

?>

(note that I tried using relative links again, no difference that I could see)

and that's really all I need to have... htaccess would be if I viewed it a a jpg, so it opened it as a php document instead of a jpg file.. but It already has a php extension...

(I added it anyway)

Link to comment
Share on other sites


I know exactly what the problem is...Make sure there is a file called "view.txt" in the same folder and make you CHMOD it to 666 or esle it won't work... :)

And also make sure your image is 128 colors...GD will not work properly if you have an image with over 128 colors...Yours had over that many, so I edited it in Photoshop for you...It looks extremely similar...

Here is the code I used for YOUR about.png:

<?php

Header ('Content-type: image/png');
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 = imagecreatefromgif("about-bg.gif");

// set the colours
$cool = imagecolorallocate($image, 87, 87, 87);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// counter
$viewss = file("views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "Phazm Graphics - $views people served since 11/5/03!";

// define geek code
$nerd = "-----BEGIN NERD CODE BLOCK-----
Version: 1.2a
010011010111100100100000011100110110100101100111
011001110111100100100000011101110110100101101100
011011000010000001110011011011110110111101101110
001000000111001001101111011000110110101100100001
00100000
------END NERD CODE BLOCK------";

// line style line
$line = "________________________________________________________";

// set the font and print text
$font = 'verdana.ttf';

ImageTTFText ($image, 8, 0, 45, 35, $white, $font, $nerd);
ImageTTFText ($image, 8, 0, 45, 138, $white, $font, $line);
ImageTTFText ($image, 8, 0, 45, 170, $white, $font, $counter);

// output and destroy
imagepng($image);
imagedestroy($image);

?>

And here is the edited background:

post-77-1068073453_thumb.png

Link to comment
Share on other sites

nope! That didn't work either..

this is the error I'm getting in my errorlog(I should've checked this a log time ago)

[05-Nov-2003 17:17:33] PHP Fatal error: Call to undefined function: imagecreatefromgif() in /var/www/html/signature/siggy.php on line 9

no idea why that fuction wouldn't be supported...

Link to comment
Share on other sites

lol, I don't plan on keeping the design, don't worry, it's just a placeholder :-P

Anyhow, I figured out that my GD version is the one that createimagefromgif doesn't work (d'oh!) so I made it "createimagefrompng" and now it works, but for some odd reason it indents to text:

http://www.phazm.net/signature/siggy.php

however, I cannot view anything other than .php, (e.g. jpg or png) - so I think my host has htaccess disabled maybe? not sure... I'll email em tonight...

Hey, I just want to say I'm greatful for all your help gamehead, I couldn't have gotten close to this far without you!

Link to comment
Share on other sites

lol, I don't plan on keeping the design, don't worry, it's just a placeholder :-P

Anyhow, I figured out that my GD version is the one that createimagefromgif doesn't work (d'oh!) so I made it "createimagefrompng" and now it works, but for some odd reason it indents to text:

http://www.phazm.net/signature/siggy.php

however, I cannot view anything other than .php, (e.g. jpg or png) - so I think my host has htaccess disabled maybe?  not sure... I'll email em tonight...

Hey, I just want to say I'm greatful for all your help gamehead, I couldn't have gotten close to this far without you!

tawxic, its impossible that your host disabled .htaccess files, or else the image would not have been parsed...In this case, it was, so .htaccess was enabled...

And BTW, you should have been there to see what I had to go through to figure out how to do this on other forums...I even showed XPerties how to do one for eMax Hosting which he got rid of (I think...) :) !

Link to comment
Share on other sites

tawxic: hate to burst your bubble dewd, but the new sig policy doesn't allow you to have a sig that big.

after I get this thing fine tuned, I will make a smaller version.. this will be my version for other pages.

Link to comment
Share on other sites

  • 3 weeks later...

Hi :rolleyes:

can some one help me with this?

I made it using this to make it

<?php
header ("Content-type: image/png");
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');


$image = imagecreatefromgif("bg.gif");
$back_color = ImageColorAllocate ($image, 0, 10, 10);
$white = ImageColorAllocate($im, 255, 255, 255);
$ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR );


ImageString ($image, 10, 12, 50, "Your ip is $ip", $white);
ImageString ($image, 10, 12, 80,  "Your ip is ", $white);
ImageString ($image, 10, 12, 100,  "Your ip is $ip", $white);
Imagepng($image);
imagedestroy($image);
?>

It came out looking like this test.jpg

As you can see so far ive only been able to put the ip thing in. Each time i try to put something else in to it i get a blank screen.

I wanted to add a random quote thing like tawxic's but each time i put in that code i keep getting a blank screen can sombody please help me?

O and does anybody know the code that tells you your browser and OS

Something like this

""you are running on windows xp and using IE 6.0"

Thanks in advance :)

Link to comment
Share on other sites

OK, so for the random quotes, you would need a TXT file called "quotes.txt" with all the quotes on each line...

Then you would create a JPG file with the following:

<?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 colours
$cool = imagecolorallocate($image, 81, 86, 96);
$black = imagecolorallocate($image, 0, 0, 0);
$white = imagecolorallocate($image, 255, 255, 255);
$red = imagecolorallocate($image, 255, 0, 0);
$grey = imagecolorallocate($image, 204, 204, 204);
$green = imagecolorallocate($image, 206, 129, 18);
$blue = imagecolorallocate($image, 0, 0, 255);

// set quote file
$quotes = file('quotes.txt');
$quote = array_rand($quotes);

// set the font and print text
$font = '/path/to/your/ttf/font';

$joke = wordwrap($quotes[$quote], 60, "\n", 1);
$joke = explode("\n", $joke);

for($i=0; $i<count($joke); $i++) {
ImageTTFText ($image, 8, 0, 14, (23+($i*15)), $white, $font, $joke[$i]);
}

// output and destroy
imagepng($image);
imagedestroy($image);

?>

You would also need a background picture called "background.jpg" and the htaccess file mentioned in this topic... This code should be pretty simple to understand...

I've tried including the OS and browser but it has never come out properly for me... I'll post it in here as soon as I find out... :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...