MSFN Forum: IP Sig - MSFN Forum

Jump to content


  • 8 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • This topic is locked

IP Sig how do u do it? Rate Topic: -----

#61 User is offline   Shotgun 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 462
  • Joined: 07-November 03

Posted 03 December 2003 - 11:56 AM

Just found this on php.net under the imagecreatefromgif entry:

Quote

imagecreatefromgif() returns an empty string on failure. It also outputs an error message, which unfortunately displays as a broken link in a browser.
also:

Quote

dpetrov at nchcapital dot cm
26-Aug-1999 01:37
Support for PNG images was added to GD with the removal of GIF support. Latest patches for PHP 3.0 add new functions, in particular ImageCreateFromPng() and ImagePng(). At the time of writing, for some odd reason, PHP 4.0 does NOT have these functions.
  • check the PHP version on the server the script is running from.
  • check there for a function to output an error message in case the imagecreate functions bails out with an error.
  • Can you read a GIF to output a PNG? I've only done reading from the same type as the output (read GIF->Output GIF, read JPG -> Output JPG, and so on)



#62 User is offline   bman3022 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 22-November 03

Posted 03 December 2003 - 07:00 PM

Flynn, on Dec 3 2003, 12:47 AM, said:

Report back if this works as I have never had a ME machine and the other person had yet to report back if the patch worked.

nope it didnt work it still says windows 98

But if anybody is interested heres how to show the browser name
Use $browser to call it
   //browser type	
    $agent = $HTTP_USER_AGENT;
    if ( strstr($agent, "MSIE 5") ) $browser = "using IE 5";
    elseif ( strstr($agent, "MSIE 6") ) $browser = "using IE 6";
    elseif ( strstr($agent, "MSIE 4") ) $browser = "using IE 4";
    elseif ( strstr($agent, "Firebird") ) $browser = "using Firebird";
    elseif ( strstr($agent, "Safari") ) $browser = "using Safari";
    elseif ( strstr($agent, "Mozilla/5") ) $browser = "using Mozilla/Netscape 5";
    elseif ( strstr($agent, "Mozilla/6") ) $browser = "using Netscape 6";
    elseif ( strstr($agent, "Mozilla/4") ) $browser = "using Netscape 4";
    elseif ( strstr($agent, "Opera") ) $browser = "using Opera";
    else $browser = "";


#63 User is offline   gamehead200 

  • SEARCH!!! SEARCH!!!
  • Group: Super Moderator
  • Posts: 7,036
  • Joined: 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 03 December 2003 - 07:14 PM

Sweet! Now we can make our own IP sigs! :rolleyes:

Now to find out how to rotate backgrounds... :)

#64 User is offline   Flynn 

  • Group: Members
  • Posts: 6
  • Joined: 01-December 03

Posted 03 December 2003 - 11:18 PM

gamehead200, on Dec 3 2003, 07:14 PM, said:

Now to find out how to rotate backgrounds... :rolleyes:

This snippent of code will rotate (random) backgrounds :)

Of course you need to change it around a bit to match your script (image type and names) maybe, notice the first variable in the array is left blank "", I did this just to make the image numbers match the array number without using 0 as an image number.

You also need to change your "createfrom" line to include the new random variable.

The only problem with this is that the browser doesn't refresh all the time because the linked image name remains the same, depending on your browser settings of course.

// random background

$random_image = array("",
                    "bg1.png",
                    "bg2.png",
                    "bg3.png",
                    "bg4.png");

srand ((double) microtime() * 1000000);
$rnd = rand(1,4);

// create the image
$image = imagecreatefrompng($random_image[$rnd]);


#65 User is offline   renaxgade 

  • Group: Members
  • Posts: 5
  • Joined: 07-December 03

  Posted 08 December 2003 - 03:50 PM

Ok, well I'm trying to follow all of this. I have a file called .htaccess and it looks like this
<Files ipaddress.jpg>
ForceType application/x-httpd-php
</Files>

I also have a file called ipaddress.jpg that looks like this:
<?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 = imagecreatefrompng("bg.png");

// 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 font and print text
$font = 'Arial.ttf'

ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);

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

?>

When I open the jpg through a php enabled browser, it just gives me the code back for ipaddress. No image just code. The bg.png is also in that folder. :)
BTW: I am using a Windows Apache server with php, and in my php info I can't find anything with "GD" in it, I searched.

#66 User is offline   bman3022 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 22-November 03

Posted 08 December 2003 - 07:04 PM

you need to replace the png things since your going to use a jpg file so try this:
<?php
Header ('Content-type: image/jpg');
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 = imagecreatefrompng("bg.png");

// 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 font and print text
$font = 'Arial.ttf'

ImageTTFText ($image, 8, 0, 10, 17, $white, $font, "Your IP Address is... ".$REMOTE_ADDR);

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

?>


This should work. Report back if it doesnt

#67 User is offline   gamehead200 

  • SEARCH!!! SEARCH!!!
  • Group: Super Moderator
  • Posts: 7,036
  • Joined: 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 December 2003 - 04:47 PM

Anyone know how to center text on a PHP sig?

#68 User is offline   Datalore 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 852
  • Joined: 05-October 03

Posted 09 December 2003 - 05:54 PM

Anyone know how to stream a movie file into a sig? :) It should be possible. Just tell the player application to output the move to a 30 frame animated gif every second. Whoosh, 100 kb streaming gif movie player. I have no idea what I'm talking about.

#69 User is offline   bman3022 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 22-November 03

Posted 09 December 2003 - 06:18 PM

I dont think thats possible using this script
Its easier just to make a gif out of the clip using an animator :)

#70 User is offline   Sunil 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 596
  • Joined: 24-June 03

Posted 09 December 2003 - 06:18 PM

I think to achive this you would need to create a script that would automatically create the SIG from the new image output. This could be done by simply deleting the old one and renaming the new one the same as the old, but to create the stream, i donno.

#71 User is offline   Datalore 

  • Friend of MSFN
  • PipPipPipPipPip
  • Group: Members
  • Posts: 852
  • Joined: 05-October 03

Posted 09 December 2003 - 08:06 PM

It would be pretty cool to have entire movies playing in your sig, movies that normally couldn't be turned into a regular gif.

#72 User is offline   renaxgade 

  • Group: Members
  • Posts: 5
  • Joined: 07-December 03

Posted 10 December 2003 - 09:09 PM

I'm not sure if my php is configured correctly. Can someone check if
http://renaxgade.net/test.php
is enabled for these kind of sigs?

#73 User is offline   bman3022 

  • Newbie
  • Group: Members
  • Posts: 26
  • Joined: 22-November 03

Posted 11 December 2003 - 01:13 AM

yes GD is enabled on there so the sig should work

#74 User is offline   renaxgade 

  • Group: Members
  • Posts: 5
  • Joined: 07-December 03

Posted 11 December 2003 - 05:43 AM

Hrmm, it doesn't seem to be working. The sig just displays me code of php, so I don't think that the .htaccess is working. The weird thing is, it doesn't look like it's in the directory, but If i type it in from command line it works. Do I have to tell my http.conf to look for .htaccess ?

#75 User is offline   gamehead200 

  • SEARCH!!! SEARCH!!!
  • Group: Super Moderator
  • Posts: 7,036
  • Joined: 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 11 December 2003 - 06:38 AM

renaxgade, on Dec 11 2003, 06:43 AM, said:

Hrmm, it doesn't seem to be working. The sig just displays me code of php, so I don't think that the .htaccess is working. The weird thing is, it doesn't look like it's in the directory, but If i type it in from command line it works. Do I have to tell my http.conf to look for .htaccess ?

Yes... I think there's an option for it in the httpd.conf file... :)

#76 User is offline   tawxic 

  • Newbie
  • Group: Members
  • Posts: 35
  • Joined: 02-November 03

Posted 11 December 2003 - 10:14 PM

eh - anyone know why it's tellin me:

[Fri Dec 12 04:11:40 2003] [error] [client 68.116.78.89] Premature end of script headers: /home/phazm/public_html/sig/siggy.jpg

I just got a new host.. they have the latest version of PHP :)

#77 User is offline   tawxic 

  • Newbie
  • Group: Members
  • Posts: 35
  • Joined: 02-November 03

Posted 11 December 2003 - 10:15 PM

oi, here's my code:

<?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');

$textfile ="quotes.txt"; // change to the filename/path of your file with quotes.
$quotes = file("$textfile");
$quote = rand(0, sizeof($quotes)-1);
$getquote =  wordwrap($quotes[$quote], 55, "\n", 1);
$ipad = getenv("REMOTE_ADDR");
$dns = strtolower(@gethostbyaddr(getenv("REMOTE_ADDR")));
$today = date("m-d-Y");

// 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);
$info = "$today - You are $dns ($ipad)";
$counter = "$views people informed - © 2003 Phazm Graphics - http://www.phazm.net/";

// define geek code
$nerd = $getquote;

// line style line
$line = "___________________________________________________________";

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

ImageTTFText ($image, 10, 0, 45, 35, $white, $font, $nerd);
ImageTTFText ($image, 8, 0, 27, 126, $white, $font, $info);
ImageTTFText ($image, 8, 0, 27, 130, $white, $font, $line);
ImageTTFText ($image, 8, 0, 27, 143, $white, $font, $counter);

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

?>


#78 User is offline   Vega 

  • Group: Members
  • Posts: 1
  • Joined: 11-December 03

Posted 12 December 2003 - 12:02 AM

Is this sopposed to be like, in php or something? I have never programmed in php but I have thought about it. If it is, can someone give me resources where I could learn to program in php and get a compiler (if one is required)?

#79 User is offline   tawxic 

  • Newbie
  • Group: Members
  • Posts: 35
  • Joined: 02-November 03

Posted 13 December 2003 - 02:47 PM

I made a dynamic avatar :)

Posted Image

#80 User is offline   tawxic 

  • Newbie
  • Group: Members
  • Posts: 35
  • Joined: 02-November 03

Posted 20 December 2003 - 10:22 PM

What's the code for makign a random IMAGE (not background) - I want to be able to position it, also.

Share this topic:


  • 8 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy