Current location: Hot Scripts Forums » Programming Languages » PHP » Randome Quote and user info sig (dynamic)


Randome Quote and user info sig (dynamic)

Reply
  #1 (permalink)  
Old 04-10-04, 04:32 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Randome Quote and user info sig (dynamic)

PHP Code:

<?php

/*******************************************************
 *                               SIG.PNG(PHP)
 *         This is a dynamic siginutre created by GFX-PRO group
 *                          [url]http://gfx-pro.ath.cx[/url]
 *
 *           Note: The image size of your .png file (mysig.png)
 *     Must be 400x80 (if your text is longer, you have to make your
 *         image's width longer also) And it has to be in png format
 *
/*******************************************************/

/* Config settings */
$main_font 'C:/windows/fonts/arial.ttf';
$second_font 'C:/windows/fonts/verdana.ttf';
$myimage "mysig.png";

$quote[] = 'There are no stupid questions, just stupid people';
$quote[] = 'M$ works!';
$quote[] = 'Go shoot your self';
$quote[] = 'Is that the best turing can do?';
$quote[] = 'All your base are belong to us - CATS';
$quote[] = 'Turing? huh?';
$quote[] = 'Im with stupid';

$rand_quote array_rand($quote);


///////////////////////////////////////////////////////////////////////////
//
//   Begin getting the users info
//   The script below has been taken from the php-nuke webportal.
//   (only the part where the borwser and os data is gotten from)
//
///////////////////////////////////////////////////////////////////////////

/* Get the users browser data */

if((ereg("Nav"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Gold"$_SERVER["HTTP_USER_AGENT"])) || (ereg("X11"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Mozilla"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Netscape"$_SERVER["HTTP_USER_AGENT"])) AND (!ereg("MSIE"$_SERVER["HTTP_USER_AGENT"]) AND (!ereg("Konqueror"$_SERVER["HTTP_USER_AGENT"])))) $browser "Netscape (Mozilla)";
elseif(
ereg("MSIE"$_SERVER["HTTP_USER_AGENT"])) $browser "MSIE";
elseif(
ereg("Lynx"$_SERVER["HTTP_USER_AGENT"])) $browser "Lynx";
elseif(
ereg("Opera"$_SERVER["HTTP_USER_AGENT"])) $browser "Opera";
elseif(
ereg("WebTV"$_SERVER["HTTP_USER_AGENT"])) $browser "WebTV";
elseif(
ereg("Konqueror"$_SERVER["HTTP_USER_AGENT"])) $browser "Konqueror";
elseif((
eregi("bot"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Google"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Slurp"$_SERVER["HTTP_USER_AGENT"])) || (ereg("Scooter"$_SERVER["HTTP_USER_AGENT"])) || (eregi("Spider"$_SERVER["HTTP_USER_AGENT"])) || (eregi("Infoseek"$_SERVER["HTTP_USER_AGENT"]))) $browser "Bot";
else 
$browser "Other";

/* Get the Operating System data */

if(ereg("Win"$_SERVER["HTTP_USER_AGENT"])) $os "Windows";
elseif((
ereg("Mac"$_SERVER["HTTP_USER_AGENT"])) || (ereg("PPC"$_SERVER["HTTP_USER_AGENT"]))) $os "Mac";
elseif(
ereg("Linux"$_SERVER["HTTP_USER_AGENT"])) $os "Linux";
elseif(
ereg("FreeBSD"$_SERVER["HTTP_USER_AGENT"])) $os "FreeBSD";
elseif(
ereg("SunOS"$_SERVER["HTTP_USER_AGENT"])) $os "SunOS";
elseif(
ereg("IRIX"$_SERVER["HTTP_USER_AGENT"])) $os "IRIX";
elseif(
ereg("BeOS"$_SERVER["HTTP_USER_AGENT"])) $os "BeOS";
elseif(
ereg("OS/2"$_SERVER["HTTP_USER_AGENT"])) $os "OS/2";
elseif(
ereg("AIX"$_SERVER["HTTP_USER_AGENT"])) $os "AIX";
else 
$os "Other";
//////////////////////////////////////////////////
//           End getting the users info
//////////////////////////////////////////////////

$im ImageCreateFromPNG($myimage);
$white ImageColorAllocate($im255255255);
$darkblue ImageColorAllocate($im0689);
$darkred ImageColorAllocate($im12800);

$prebackcolor imagecolorallocate($im,255,255,255); // Assign the background color

$backcolor imagecolortransparent($im,$prebackcolor); // Make the bg transparent, if the page is alone, make it black

//
// And now to build the info.
// First to create it
//

$quote = array();

/* These are the quotes, you may add new quotes 
   by simply following the pattern */

$ip "Hey ".$_SERVER["REMOTE_ADDR"] .','// IP
$browser 'You are using '.$browser.' to view this page';
$operatingsystem 'and your operating system is '.$os;
$quote_say 'Random quote:';
$website 'Visit: http://gfx-pro.ath.cx';

//
// Create the text and display the image
//
imagettftext($im8010017$darkblue$second_font$ip); // Display ip address
imagettftext($im8010027$darkblue$second_font$browser); // Display users browser
imagettftext($im8010037$darkblue$second_font$operatingsystem); // Display users operating system
imagettftext($im8010057$darkblue$second_font$quote_say); // Display users operating system
imagettftext($im7.8010071$darkblue$second_font$quote[$rand_quote]); // Display users operating system

Header("Content-Type: image/png");
Imagepng($im,'',100);
ImageDestroy ($im);
?>

Hey, Just wanted to share with everyone the dynamic signiture i created (demo is in my signiture).

Now I also wanted to know if this works for anyones elses servers... because up to know, 1 person couldn't seem to get it to work.
Remember you must have GD installed on your server inorder for this to work.

Thanks,
EjoY!
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png

Last edited by Infinite_Hackers; 04-10-04 at 04:35 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-10-04, 05:16 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
thats awesome man! I'm really impressed.
__________________
God save us from the religious fanatics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-10-04, 05:35 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks,
Does it work for you?
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 04-10-04, 05:46 PM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Remember you must have GD installed on your server inorder for this to work.

I don't think I have GD installed on my server, I don't know what it is. and its a local apache server so sorry I didn't try.
__________________
God save us from the religious fanatics
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 04-11-04, 01:16 PM
Apoc's Avatar
Apoc Apoc is offline
Newbie Coder
 
Join Date: Apr 2004
Location: UK
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Cool cheers i have one on my server for a similar thing but never delved into it that much, managed to get my server up time, OS of user and browser but formatting the thing became to laboursome :-)

Will check this out ta.

Apoc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 04-11-04, 02:12 PM
Apoc's Avatar
Apoc Apoc is offline
Newbie Coder
 
Join Date: Apr 2004
Location: UK
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Works had to change one thing though to work for me:
PHP Code:

$main_font 'C:/windows/fonts/arial.ttf';

$second_font 'C:/windows/fonts/verdana.ttf'
to
added a /
PHP Code:

$main_font 'C://windows//fonts//arial.ttf';

$second_font 'C://windows//fonts//verdana.ttf'
Apoc
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 04-11-04, 02:41 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Ah, okay maby that's the reason!
Thanks
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 04-12-04, 11:18 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
AHH, never knew this till now :S
http://freetype.sourceforge.net/download.html#stable

...
http://ca.php.net/imagettftext
Quote:
Originally Posted by php.net
This function requires both the GD library and the FreeType librar
*idiot as i am..* lol
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 04-12-04, 01:56 PM
Nexus Nexus is offline
New Member
 
Join Date: Apr 2004
Location: 9th Gate of Hell
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
The sig I'm using was made by me. It's kind of like the one he posted about, but it is PHP and doesn't require the GD library. The only problem is that to use it, you need to have HTML enabled on the forum you wish to use it on. If anyone wants the code, or a chat about it, please email me at phate@knetworks.co.uk! That address is compatible with MSN Messenger too, and I'm almost always on there!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 01:55 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.