Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

IP Sig

- - - - -

  • This topic is locked This topic is locked
150 replies to this topic

#26
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
siggy.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');
$COUNT_FILE = "hitcounter.dat";

if (file_exists($COUNT_FILE)) {
$fp = fopen("$COUNT_FILE", "r+");
flock($fp, 1);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fputs($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Can't find file, check '\$file'<BR>";
}
// set the dimensions
$img_width = 240;
$img_height = 25;

// create the image
$image = imagecreate($img_width, $img_height);

// 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 the background colour and border
imagefilledrectangle($image, 0, 0, $img_width, $img_height, $blue);

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

// ImageTTFText ($image, 8, 0, 10, 17, $black, $font, "Your IP Address is... ".$visitors);
ImageTTFText ($image, 8, 0, 10, 17, $black, $font, "Views: ".$count);

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

?>

END

This will just put a blue bar with a nice counter on there :) (if you have the hitcounter.dat file in the same dir)

example: http://www.phazm.net...ature/siggy.php
Posted Image


How to remove advertisement from MSFN

#27
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
I added what tou said to htaccess... still isn't parsing

http://www.phazm.net...ature/siggy.jpg
Posted Image

#28
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
Can you do me a fav?

d/l http://www.phazm.net/siggy.rar and u/l it to your own webspace? (just the 3 files) so I can see if it's a compatibility issue with my hoster?
Posted Image

#29
Carmon

Carmon

    MSFN's Local Mental Case

  • Member
  • PipPipPipPipPipPipPip
  • 1,598 posts
  • Joined 08-June 03

crowman Posted on Nov 5 2003, 01:40 AM
  wow this sounds and looks very hard and confusing, I had a look at a site which was a tutorial for PHP and my god i think i will skip it


am wiv u crowman lol :)
Posted Image

#30
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

siggy.php ::

...

END

This will just put a blue bar with a nice counter on there :rolleyes:  (if you have the hitcounter.dat file in the same dir)

example:  http://www.phazm.net...ature/siggy.php

Mine's simpler:

<?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 = "GAMEHEAD200 || This sig has been viewed $views times!";

// define geek code
$geek = "-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d+ s+:+ a---- C++ !U !P L+ E-- W+++$ N+ !o K- w++$
O--- M$ V? PS PE++ Y+ !PGP !t !5 !X !R tv+++ b++ DI !D
G e- h! r-- !y
------END GEEK CODE BLOCK------";

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

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

 ImageTTFText ($image, 8, 0, 12, 45, $black, $font, $geek);
 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);

?>

Try to find out how it works! :) I'll try using yours tonight because right now I don't have the time...

#31
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
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:

Posted Image

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)
Posted Image

#32
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag
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:

Attached Files



#33
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
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...
Posted Image

#34
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
okay, it IS somethign with my host, because I have it on my companies website just fine...


www.rfstorm.com/sig/siggy.php
Posted Image

#35
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
got it to work in jpg and png format on my companies host :-/

Posted Image
Posted Image

#36
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

got it to work in jpg and png format on my companies host :-/

Posted Image

Copy cat! :rolleyes: :)

#37
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
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...ature/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!
Posted Image

#38
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

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...ature/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...) :) !

#39
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
hehe.

Well, what do you think it could be then? It works fine on another host, but not this one? obviously something is different that is causing mine to be uncompatible
Posted Image

#40
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03
I updated my script, not it displays a random quote:

Posted Image

but is there any way to center the quote vertically? (so it's the same distance from the top to the bar)
Posted Image

#41
un4given1

un4given1

    Elaborate Dreamer

  • Member
  • PipPipPipPipPipPipPip
  • 1,796 posts
  • Joined 25-September 03
tawxic: hate to burst your bubble dewd, but the new sig policy doesn't allow you to have a sig that big.
What if everything around you, isn't quite as it seems...
What if all the world you used to know, is an elaborate dream...
And if you look at your reflection, Is that all you want to be?
What if you could look right through the cracks, Would you find yourself... find yourself afraid to see?

#42
tawxic

tawxic

    Newbie

  • Member
  • 35 posts
  • Joined 02-November 03

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.
Posted Image

#43
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag
Don't worry, the sig rule changed back AGAIN...You can keep that sig...

#44
bman3022

bman3022

    Newbie

  • Member
  • 26 posts
  • Joined 22-November 03
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 Posted Image
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 :)
Sig Oversized - Removed by Admin

#45
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag
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... :)

#46
bman3022

bman3022

    Newbie

  • Member
  • 26 posts
  • Joined 22-November 03
Thanks man :)
I got it to work
I had to edit it a little bit but it works now :rolleyes:
is there anyway to change the font size?
Sig Oversized - Removed by Admin

#47
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Thanks man :rolleyes:
I got it to work
I had to edit it a little bit but it works now :D
is there anyway to change the font size?

ImageTTFText ($image, 8, 0, 14, (23+($i*15)), $white, $font, $joke[$i]);

Change the 8 to an even number...

Can we see the final result? :)

#48
bman3022

bman3022

    Newbie

  • Member
  • 26 posts
  • Joined 22-November 03
im still working on it but here it is
o and i have one little problem sometimes the qoute wraps on top of it self.
any way to fix it?

Posted Image
Have you found any thing on how to put the browser and os name ?
Sig Oversized - Removed by Admin

#49
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

im still working on it but here it is
o and i have one little problem sometimes the qoute wraps on top of it self.
any way to fix it?

Posted Image
Have you found any thing on how to put the browser and os name ?

The quote shouldn't wrap on itself... It should automatically go to the next line...

No, I haven't found out yet... :)

#50
bman3022

bman3022

    Newbie

  • Member
  • 26 posts
  • Joined 22-November 03
well the qoutes not wrapping to the next line
Heres the code i used im i doing something wrong?
<?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, 5, 5);
$white = ImageColorAllocate($im, 255, 255, 255);
$ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR );
$quotes = file('quotes.txt');
$quote = array_rand($quotes);
$joke = wordwrap($quotes[$quote], 40, "\n", 1);
$joke = explode("\n", $joke);


ImageString  ($image, 2, 12, 50, "You are $ip", $white);
ImageString ($image, 2, 12, 70,  "Your Running:", $white);
ImageString  ($image, 2, 12, 90, "$HTTP_USER_AGENT", $white);
for($i=0; $i<count($joke); $i++) {
ImageString  ($image, 2, 12, 110,  $joke[$i], $white);}
Imagepng($image);
imagedestroy($image);
?>

Sig Oversized - Removed by Admin




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users