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

How to make a dynamic signature (IP sig)

- - - - -

  • Please log in to reply
74 replies to this topic

#51
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Thanks for the reply, I think I have it worked out.

For some reason, when I was moving the XML data into a variable to be used, some of the data that was passed was blank (not sure why). So when I tried to use that Variable, it would not display anything and I assumed it wasn't working.

When I decided to try using an ARRAY instead, then I noticed every other array field was blank, so data was only in 0, 2, 4 & 6. I'm still not sure why, but at least it's working.



This is a great topic and I thank you for sharing it.

I have it working as intended, but I want to make it more dynamice and change some of the Text in the Image when I read a XML file.

Any chance I can post my code (that isn't working) and have some see if they can spot my error?


Go right ahead. I'll try to look at it when I get back home later tonight or tomorrow when I have a chance. :)

It's possible you set your code to use a delimiter without a space (making the space a value), when in fact, the delimiter contained a certain character AND a space.

Post your code and the XML data you were trying to grab. I have a feeling this is what the problem was.


How to remove advertisement from MSFN

#52
RevRaz

RevRaz
  • Member
  • 4 posts
Here is the code I have working now, you can see where I'm only using every other Array. I actually had 4 different variables before I changed it to the one $pilot array, and I would move each value under name/flights/hours/miles into variables $pname/$flights/$hours/$miles.

Edited by RevRaz, 06 December 2006 - 07:52 PM.


#53
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag
Everything looks fine. I would just keep quotation marks consistent. You're also missing one for the fonts.

#54
RevRaz

RevRaz
  • Member
  • 4 posts
Thanks, I'm still puzzled on how blanks are getting in there. Should I add a check to ignore the value if it's blank or a space?

Also about the quotes, I removed some paths after I pasted, so I probably just deleted it by accident here, but the code is correct on the server.

#55
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Thanks, I'm still puzzled on how blanks are getting in there. Should I add a check to ignore the value if it's blank or a space?

Also about the quotes, I removed some paths after I pasted, so I probably just deleted it by accident here, but the code is correct on the server.


Try adding the check and see what happens. That is really weird. :}

#56
bullboykennels

bullboykennels
  • Member
  • 1 posts
Hi i'm trying to get this part to show up but I guess I must be doing something wrong cause i get a bland box.
could someone let me know what I may be doing wrong,.. I do have the .htaccess part done already.


gd
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled


// get IP and resolve IP
$ip = $REMOTE_ADDR;
$resolved = gethostbyaddr ($REMOTE_ADDR);

// check for non resolve of IP and rip domain if resolved
if ($resolved == $ip) {
$isp = ".. Can't Resolve IP";
}
else
{
$str = preg_split("/\./", $resolved);
$i = count($str);
$x = $i - 1;
$n = $i - 2;
$isp = $str[$n] . "." . $str[$x];
}

// Simple OS Detection
$os = $HTTP_USER_AGENT;
$oslist = Array (

// Windows
"Win|Windows",
"Win16|Windows",
"Win95|Windows 95",
"Win98|Windows 98",
"WinME|Windows ME",
"Win32|Windows",
"WinNT|Windows NT",
"Windows 3.1|Windows 3.1",
"Windows 95|Windows 95",
"Windows CE|Windows CE",
"Windows 98|Windows 98",
"Windows ME|Windows ME",
"Windows NT|Windows NT",
"Windows NT 5.0|Windows 2000",
"Windows NT 5.1|Windows XP",

// Macintosh
"Mac_68000|MacOS m68K",
"Mac_68K|MacOS m68K",
"Mac_PowerPC|MacOS PPC",
"Mac_PPC|MacOS PPC",
"Macintosh|MacOS",

// Unices
"X11|UNIX",
"BSD|BSD",
"SunOS|SunOS",
"IRIX|IRIX",
"HP-UX|HP-UX",
"AIX|AIX",
"QNX|QNX",
"SCO_SV|SCO UNIX",
"FreeBSD|FreeBSD",
"NetBSD|NetBSD",

// Linux
"Linux|Linux",
"Debian|Debian GNU/Linux",

// Other
"BeOS|BeOS",
"OS/2|OS/2",
"AmigaOS|AmigaOS",

);

foreach ($oslist as $osnow) {
$osnow = explode ("|", $osnow);
if (eregi ($osnow[0], $os)) {
$endos = $osnow[1];
$check = "No";
} elseif ($check != "No") {
$endos = "Unknown";
}
}

/*
to output the OS, use $endos
to output the IP, use $ip
to output the resolved IP, use $resolved
*/


Edited by bullboykennels, 02 May 2007 - 08:47 PM.


#57
Sir.Frogster

Sir.Frogster
  • Member
  • 1 posts
Hi there, having problems with it, I used your samples from the main post, and I uploaded them onto my host, and all I can see when I look at the image is a blue box, is this what I'm meant to be seeing, or what?

Also, say I wanted to add the show the persons browser thing, where would I put the coding, which place, I know in the mysig.jpg file, but where in it? Does it have to go over the top of something?

And finally, as far as I can tell I have Apache and GD on my host, here: www.primehabbo.com/phpinfo.php .

Thanks.

#58
Zxian

Zxian

    Scroll up - see the Google bar?

  • Super Moderator
  • 5,066 posts
  • OS:none specified
  • Country: Country Flag
@Sir.Frogster - You'll have to edit the given sample files to give the proper path to the font files. Otherwise, the script won't find the font and won't be able to insert it into the image.

#59
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

Hi there, having problems with it, I used your samples from the main post, and I uploaded them onto my host, and all I can see when I look at the image is a blue box, is this what I'm meant to be seeing, or what?


Like Zxian mentioned, you have to edit the path to your font. It should usually be something like /home/username/public_html/sig/font.ttf. If that doesn't work, just try putting in the name of the font file (font.ttf).

Also, say I wanted to add the show the persons browser thing, where would I put the coding, which place, I know in the mysig.jpg file, but where in it? Does it have to go over the top of something?


It should go somewhere before you start parsing the text (before the ImageTTFText lines).

And finally, as far as I can tell I have Apache and GD on my host, here: www.primehabbo.com/phpinfo.php .


Yes, it's installed! :thumbup

Thanks.


No problem. :)

#60
Mhhh

Mhhh
  • Member
  • 1 posts
Hey, Im kinda new to Php. Just a few questions.

After Ive found a host site how do I host my picture there. Like for the one sir.frogster was using. What do I do once im there lol.

And what do I upload, the htaccess thing or the mysig.jpg thing.

Im a noob i know lol, but itd be greatly appreciated if you could help me!

#61
Zxian

Zxian

    Scroll up - see the Google bar?

  • Super Moderator
  • 5,066 posts
  • OS:none specified
  • Country: Country Flag
You'll need both the htaccess file and the filename of the image that you want. The only catch is that the "image" will actually be a PHP script.

#62
Emissary77

Emissary77
  • Member
  • 1 posts
How do you make a dynamic sig that reads information from a website highscores? For online gaming clans etc...so the sig shows their kill xp combat lvl etc...

#63
NutsAndyy

NutsAndyy
  • Member
  • 1 posts
I've just tried following this tutorial and it hasn't completely worked.

At the moment I have the basic code with a few alterations for the font and what not, but all the page will display is the location of its self on my domain instead of an actual image.

Ive found one weird thing though, if i comment out / delete the "ImageTTFText($image, 8, 0, 10, 17, $white, $font, $text);" line, it will crete an image as its supposed to, but without the text. Also, when i view the page in IE (with the code there) it shows an error about the "ImageTTFText". I have tried a few things including altering the case of some things and a few file paths for the font, but it doesn't seem to be working.

Here is the current 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');

$ip = $_SERVER['REMOTE_ADDR'];

$text = "Your IP address is $ip!";

// set the dimensions
$img_width = 240;
$img_height = 100;

// 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
// number or is top left pixel x, top left pixel y, bottom right pixel x, bottom right pixel y
imagefilledrectangle($image, 0, 0, $img_width, $img_height, $cool);

// set the font and print text
$font = '/usr/local/psa/home/vhosts/mydomain.co.uk/httpdocs/sig/ozhandin.ttf';

// now i will create a line with font size 8, with no angle, 10 pixels to the right, and 17 pixels down
ImageTTFText($image, 8, 0, 10, 17, $white, $font, $text);


// the above will display your IP address

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

?>

EDIT:
Okay problem solved!. It turns out that making the file path for the font to just ozhandin.ttf cured it. I realy thoguht i'd tried every possibility. Guess not, and sorry for reviving, maybe this could serve as a reminder to check through everything more than 10 times :)

Edited by NutsAndyy, 13 September 2007 - 02:46 PM.


#64
Futurist

Futurist
  • Member
  • 4 posts
hey, i make something but all info is in one row! how to fix that?

and one more question.. any way for random font?

sry for English and thanks

#65
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

hey, i make something but all info is in one row! how to fix that?

and one more question.. any way for random font?

sry for English and thanks

Hi Futurist,

First off, welcome to MSFN! :)

To not make everything in one row, add \n where you want the row to end and everything will then appear on the row below it.

For a random font, remove this line:

$font = '/path/to/your/ttf/font/verdana.ttf';

And replace it with this piece of code:

$random_font = array('',
				  '/path/to/your/first/font.ttf',
				  '/path/to/your/second/font.ttf',
				  '/path/to/your/third/font.ttf',
				  '/path/to/your/fourth/font.ttf');

srand ((double) microtime() * 1000000);
$rnd = rand(1,count($random_font)-1);

$font = $random_font[$rnd];

Hope it works! If not, post back here with the error you get and/or a screenshot of what you're getting and I'll reply back.

#66
Futurist

Futurist
  • Member
  • 4 posts
thanks.. working

but how can i go to next row in random message?

i have
Test1
Test2
Test3
Test4, Test5

i want test5 in new row, possible?

#67
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

thanks.. working

but how can i go to next row in random message?

i have
Test1
Test2
Test3
Test4, Test5

i want test5 in new row, possible?

Yes, it is. You can add a line break in the message like this:
Test4, \nTest5


#68
Futurist

Futurist
  • Member
  • 4 posts
thanks :) i will try

anyone have newest list of OS? because when someone have vista, writes XP

#69
shakala

shakala
  • Member
  • 1 posts
Alright. I am not sure if you would do this for me but it would be highly appreciated. Could you put this xml file from this site ---> http://ladderslasher...har.php?i=92170 onto a dynamic signature? you seem to know what you are doing and i have been messing around with the code and a bunch of other sites and i just cant get it. I have already gone and deleted what i had because i had given up :realmad: . I the came to this forum and i thought i might ask. If this is possible please e-mail me at bballkid192837@aol.com :thumbup



http://ragnarok.lilf...s/shotkill.png/

This is an example of what i have been looking for. :thumbup

please send the PHP file to my email if you are able to do this.

#70
Futurist

Futurist
  • Member
  • 4 posts
hello, i have a question!

i have this 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');


// Dobij sliku
$slika_pret = $_GET['image'];

// Dobij ime
$ime_korisnika = $_GET['nick'];

// Napravi sliku koristenjem postojece pozdadine

$image = imagecreatefromjpeg($slika_pret);



// Format datuma

$date = date("F j. Y");



// Razlicit font

$random_font = array("",

"/font/Font1.ttf",

"/font/Font2.ttf",

"/font/Font3.ttf",

"/font/Font5.ttf");



srand ((double) microtime() * 1000000);

$rnd = rand(1,4);




// Odredi file u kojem su poruke

$quotes = file('quote.txt');

$quote = array_rand($quotes);




// Saznaj IP i hostame

$ip = $REMOTE_ADDR;

$resolved = gethostbyaddr ($REMOTE_ADDR);



// Provjeri IP

if ($resolved == $ip) {

$isp = "can't reslove IP";

}

else

{

$str = preg_split("/\./", $resolved);

$i = count($str);

$x = $i - 1;

$n = $i - 2;

$isp = $str[$n] . "." . $str[$x];

}



// Jednostavna detekcija operativnog sistema

$os = $HTTP_USER_AGENT;

$oslist = Array (



// Windows

"Win|Windows",

"Win16|Windows",

"Win95|Windows 95",

"Win98|Windows 98",

"WinME|Windows ME",

"Win32|Windows",

"WinNT|Windows NT",

"Windows 3.1|Windows 3.1",

"Windows 95|Windows 95",

"Windows CE|Windows CE",

"Windows 98|Windows 98",

"Windows ME|Windows ME",

"Windows NT|Windows NT",

"Windows NT 5.0|Windows 2000",

"Windows NT 5.1|Windows XP",



// Macintosh

"Mac_68000|MacOS m68K",

"Mac_68K|MacOS m68K",

"Mac_PowerPC|MacOS PPC",

"Mac_PPC|MacOS PPC",

"Macintosh|MacOS",



// Unices

"X11|UNIX",

"BSD|BSD",

"SunOS|SunOS",

"IRIX|IRIX",

"HP-UX|HP-UX",

"AIX|AIX",

"QNX|QNX",

"SCO_SV|SCO UNIX",

"FreeBSD|FreeBSD",

"NetBSD|NetBSD",



// Linux

"Linux|Linux",

"Debian|Debian GNU/Linux",



// Ostalo

"BeOS|BeOS",

"OS/2|OS/2",

"AmigaOS|AmigaOS",



);



foreach ($oslist as $osnow) {

$osnow = explode ("|", $osnow);

if (eregi ($osnow[0], $os)) {

$endos = $osnow[1];

$check = "No";

} elseif ($check != "No") {

$endos = "unknown";

}

}



/*

to output the OS, use $endos

to output the IP, use $ip

to output the resolved IP, use $resolved

to output the browser, use $browser

*/



// Tip preglednika

$agent = $HTTP_USER_AGENT;

if ( strstr($agent, "MSIE 5") ) $browser = "IE 5";

elseif ( strstr($agent, "MSIE 6") ) $browser = "IE 6";

elseif ( strstr($agent, "MSIE 4") ) $browser = "IE 4";

elseif ( strstr($agent, "Firebird") ) $browser = "Firebird";

elseif ( strstr($agent, "Safari") ) $browser = "Safari";

elseif ( strstr($agent, "Mozilla/5") ) $browser = "Mozilla FireFox";

elseif ( strstr($agent, "Mozilla/6") ) $browser = "Netscape 6";

elseif ( strstr($agent, "Mozilla/4") ) $browser = "Netscape 4";

elseif ( strstr($agent, "Opera") ) $browser = "Opera";

else $browser = "unknown";





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

$joke = explode("\n", $joke);





// Boje

$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);





// Font path na serveru

$font = $random_font[$rnd];

// Font za ime
$ime_font = $random_font[$rnd];



// IP adresa

ImageTTFText ($image, 11, 0, 10, 20, $white, $font, "Hey! Your IP is $ip,");



// Hostname

ImageTTFText ($image, 11, 0, 10, 40, $white, $font, "your hostname is $resolved,");



// Preglednik

ImageTTFText ($image, 11, 0, 10, 60, $white, $font, "you're using $browser,");



// Operativni sustav

ImageTTFText ($image, 11, 0, 10, 80, $white, $font, "on $endos OS,");



// Datum

ImageTTFText ($image, 11, 0, 10, 100, $white, $font, "today is $date");



// Ime

ImageTTFText ($image, 17, 0, 345, 80, $white, $ime_font, "$ime_korisnika");



// Poruka - Generator

for($i=0; $i<count($joke); $i++) {

ImageTTFText ($image, 10, 0, 10, 130, $white, $font, $joke[$i]);}





// Otvori i Unisti sliku

imagepng($image);

imagedestroy($image);



?>


how can I make to script resize image
with this
<?php

// Load image
$image = open_image('flower.jpg');
if ($image === false) { die ('Unable to open image'); }

// Get original width and height
$width = imagesx($image);
$height = imagesy($image);

// New width and height
$new_width = 150;
$new_height = 100;

// Resample
$image_resized = imagecreatetruecolor($new_width, $new_height);
imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);

// Display resized image
header('Content-type: image/jpeg');
imagejpeg($image_resized);
die();

?>

Edited by Futurist, 23 June 2008 - 10:46 AM.


#71
bax

bax
  • Member
  • 5 posts
Hi Everyone , I Just Want To Make A Dynamic Signature , But This Looks Too Advanced For Me ... I Have 10 Signatures In png. Format , And I Want Them To Be displayed Randomely When Changing Forum , Noticing That I Have No Knowledge In Php , And I Don't Have A Website ... So Could You Please Help Me ? Thank You !! :blushing:

#72
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag
For everyone's benefit, I have released my original "Jeremy" signature (i.e., the source code, graphics, etc.) under a GPL license. Use it as you wish. :) Grab it here!

My original post has been edited with this info.

#73
evandro

evandro
  • Member
  • 2 posts

For everyone's benefit, I have released my original "Jeremy" signature (i.e., the source code, graphics, etc.) under a GPL license. Use it as you wish. :) Grab it here!

My original post has been edited with this info.



Link is OFF, fix plsssssssssssssssssssss

Edited by gamehead200, 06 July 2009 - 07:55 PM.
Fixed link.


#74
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • OS:Windows 7 x64
  • Country: Country Flag

For everyone's benefit, I have released my original "Jeremy" signature (i.e., the source code, graphics, etc.) under a GPL license. Use it as you wish. :) Grab it here!

My original post has been edited with this info.



Link is OFF, fix plsssssssssssssssssssss

Forgot to update it... Here is the new link (scroll down).

#75
evandro

evandro
  • Member
  • 2 posts

Forgot to update it... Here is the new link (scroll down).


THANKSSSSSSSSSSSSSSSSSSS




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN