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

#26
tj007s13

tj007s13

    Newbie

  • Member
  • 23 posts
  • Joined 06-March 05
ohhh... darn...


How to remove advertisement from MSFN

#27
megafan

megafan
  • Member
  • 1 posts
  • Joined 21-June 05
Hey how do u install the GD plugin? After uploading u'r sample thsi is what I am getting http://govinda.us/sig/mysig.jpg

So i am guessing its because of the GD plugin. Can u help me. THanks

#28
SoKoOLz

SoKoOLz
  • Member
  • 9 posts
  • Joined 23-February 05
I have verys trange problem, when I have created my sig. It works perfectly on my test server(with Appserv installed). But when I put it on my host, it the forced me to download the image instead of showing the image. With an error inside saying that
"<b>Fatal error</b>: Call to undefined function: imagettftext() in <b>/usr/local/xxx/home/vhosts/xxx.com/httpdocs/sig/test.jpg</b> on line <b>133</b><br />"

#29
theodonnells

theodonnells
  • Member
  • 1 posts
  • Joined 30-August 05
Posted Image
I tried this tutorial but cant get it to work....
When i used the zip files all i got was a red x where pic should be,so tried with my own graphic but no joy.....
My sig
Heres 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');

// create the image using your own background
$image = imagecreatefromjpeg("background.jpg");

// dimensions of the image used
$img_width = 380;
$img_height = 50;

// 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 = 'verdana.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, "Your IP Address is... ".$REMOTE_ADDR);

// the above will display your IP address

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

?>
Do you just upload the fonts from your windows fonts folder?

#30
SuperBleeder

SuperBleeder
  • Member
  • 1 posts
  • Joined 04-August 05

Posted Image
I tried this tutorial but cant get it to work....
When i used the zip files all i got was a red x where pic should be,so tried with my own graphic but no joy.....
My sig
Heres my code,
[code here]
Do you just upload the fonts from your windows fonts folder?

<{POST_SNAPBACK}>

The erroryou are getting now I used to get until I setup .htaccess correctly :P

Pretty simple to do when you have it setup right (I killed my host setting up GD2 not knowing I already had it installed :lol: )

http://www.psychoman.../test/mysig.png

;):P

#31
Brazen1

Brazen1
  • Member
  • 8 posts
  • Joined 01-March 05
This is great, a fantastic starting off script for anyone interested in learning php, like me, thanks for posting it :D
Ive been learning php and mysql for a few months now and altho they say its easy its pretty comprehensive to say the least, php.net proves that!

Would it be possible to add another couple of lines to this code so it could show other stuff? what would be the code to use to display the uptime of my pc/cpu?
also id like to be able to incorporate other things into it like what youre currently playing in winamp by using something like AMIP dynamic sig.

i think you need to play around with the function calc_uptime() as ive been using ampsig.com's ampsig. http://ampsig.com and its all in the code.

ive been playing around with some various scripts over the last few days as, ultimately what id like to create is one mutiple stat'd sig.
heres my attempt at using the code from here > [multisig] - A work in progress LOL
Id like to be able to merge it with something like this: [AMIP_sig]
[Here] is the sigamp sig by the way.
I like it and all and you can use your own images and totally tweek it but for some parts it needs a MYSQL table and i want to try and keep it as simple as possible.

well thanks for any insite anyone :thumbup

Brazen1

Edited by Brazen1, 01 November 2005 - 07:47 PM.


#32
Bas

Bas

    I. V.

  • Member
  • Pip
  • 77 posts
  • Joined 02-July 05
  • OS:Windows 7 x64
  • Country: Country Flag

heres my attempt at using the code from here > [multisig] - A work in progress LOL

Firefox not detected
change
elseif ( strstr($agent, "Firebird") ) $browser = "using Firebird";
to this
elseif ( strstr($agent, "Firefox") ) $browser = "using Firefox";


#33
Mamoun

Mamoun

    MSFN forever!

  • Member
  • Pip
  • 75 posts
  • Joined 23-May 05
Hii
How can I put a script in my dynamic signature, like a script to get a number from an asp page, for example this one.


Posted Image


#34
tj007s13

tj007s13

    Newbie

  • Member
  • 23 posts
  • Joined 06-March 05
is there a different way to get the ISP besides gethostaddr? I get some IP4 and IP6 error if i use the gethostaddr command...???

#35
Martijn

Martijn

    It's-a-me, Mario!

  • Member
  • PipPipPipPip
  • 524 posts
  • Joined 28-July 04
I would like my sig to output the browser and OS but I don't understand how to put this code in my sig, it is working but where do I add for instance $endos ?

Edit:
Btw, for those who might have problems with the signature, a admin of my hosting fixed my .htaccess file for me:
#<Files mysig.jpg>
#ForceType application/x-httpd-php
#</Files>
#These lines should have caused the error.

AddHandler application/x-httpd-php .jpg
Edit2: found out how to add $endos
// 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,"Your IP Address is ".$REMOTE_ADDR. " and you are using ".$endos);
I would like to know how I can break lines, like you do with the html tag <br />, but that doesn't work...

Edited by Martijn, 10 February 2006 - 08:47 AM.


#36
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

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

I would like my sig to output the browser and OS but I don't understand how to put this code in my sig, it is working but where do I add for instance $endos ?

Edit:
Btw, for those who might have problems with the signature, a admin of my hosting fixed my .htaccess file for me:

#<Files mysig.jpg>
#ForceType application/x-httpd-php
#</Files>
#These lines should have caused the error.

AddHandler application/x-httpd-php .jpg
Edit2: found out how to add $endos
// 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,"Your IP Address is ".$REMOTE_ADDR. " and you are using ".$endos);
I would like to know how I can break lines, like you do with the html tag <br />, but that doesn't work...


It might be a bit late for an answer, but you can put in a line break by adding this to your text within the quotation marks: \n

If anyone is still interested in this type of signature, view mine below, and any and all questions will be answered to fit everyone's needs. :D

#37
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag
Anyone ever wanted to add their computer's online status to their sig using Hamachi? Here's my way of doing it:

First off, install the beta version of Hamachi (v1.0.0.0 or whatever), and make sure that you set the following as shown:

Attached File  hamachiweb.JPG   27.03KB   43 downloads

Now, you need to put in the following in your GD image's code in order for it to work:

<?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("signew.png");  // my background image

// hamachi online status
$fileget = file_get_contents("http://my.hamachi.cc/status/text.php?5.x.x.x");  // replace 5.x.x.x with your hamachi ip

if( preg_match( "/online/i", $fileget ) ) {
	$status = imagecreatefrompng("online.png");
}elseif( preg_match( "/offline/i", $fileget ) ) {
	$status = imagecreatefrompng("offline.png");
}else{
	$status = imagecreatefrompng("unknown.png");
}

$status_x = imagesx($status);
$status_y = imagesy($status);

// put it all together

// starting out with the status
imagecopymerge($image, $status, 287, 3, 0, 0, $status_x, $status_y,100);

// and the text
/////////////// i dont have any in my sig

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

?>
That's all there is to it! The end result is something that looks like what's in my sig, in the top right-hand corner! :D The required images are attached!

For a list of all your computers' Hamachi online statuses, refer to this: http://www.astromike.../hamachistatus/

:D

Attached Files



#38
tain

tain

    Cyber Ops

  • Super Moderator
  • 3,683 posts
  • Joined 24-September 05
  • OS:none specified
  • Country: Country Flag

Donator

Nice. Thanks for posting this info :thumbup

#39
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

  • Super Moderator
  • 7,039 posts
  • Joined 02-September 02
  • OS:Windows 7 x64
  • Country: Country Flag
No problem. Hopefully it works as expected. I was in a rush when writing that down. :P

#40
tain

tain

    Cyber Ops

  • Super Moderator
  • 3,683 posts
  • Joined 24-September 05
  • OS:none specified
  • Country: Country Flag

Donator

Yup, it works! I am changing the code around a bit and playing with some other ideas. Thanks!

#41
RexxCrow

RexxCrow
  • Member
  • 6 posts
  • Joined 18-November 06
I was hoping I could get some guidance with issues I am having working this out, I have been through about 1/2 a dozen tutorials on how to do this and have been unable to get one to work at all, I believe I am having an issue with the .htaccess file, I keep getting a HTTP error 500, whatever this is, when I remove the htaccess file I can view other files in that directory though while it is there only this error displays.

I tried using the file that was uploaded to this site on the first page of this thread, with no luck I also tried using it with just the "AddHandler application/x-httpd-php .jpg", still same problem either way. I use an IPOWER WinPro for my web server, though do not know if they have GL installed, I did upload the verada.ttf though.

All I am really wanting to do is have a line of text display in either white or lime green stating "Total Players Currently Online: " and then merging this with a number from another file that will be updated every so many minutes i.e. 12. This will then be displayed in a Administrator's sig for a gaming website and support forums. I have had no luck with this as of yet, any ideas or suggestions would be great, thank you for your time.


UPDATE: I just got of the phone with tech support and they advised their Windows servers do not use Apache they use IIS (?), so is there an alternative for this function or do I need to downgrade my service to their Linux servers that use Apache?

Edited by RexxCrow, 18 November 2006 - 01:59 AM.


#42
MGadAllah

MGadAllah

    Brain Voice

  • Member
  • PipPipPipPipPip
  • 786 posts
  • Joined 03-January 06
But for a one PC stand a lone, can I make it? :}
Flash and animated signatures and avatars are not permitted.

#43
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

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

UPDATE: I just got of the phone with tech support and they advised their Windows servers do not use Apache they use IIS (?), so is there an alternative for this function or do I need to downgrade my service to their Linux servers that use Apache?


Probably, but I have no knowledge of it. Downgrading service to Linux? Everyone out there knows that Linux is way more secure than Windows when it comes to hosting a website. You should be upgrading to Linux.

@ MGadAllah: Yes, you can. Search the network forum on how to setup an account at DynDNS.org or a similar service. (Dynamic IP Service)

#44
RexxCrow

RexxCrow
  • Member
  • 6 posts
  • Joined 18-November 06
Sorry, that is just actually sort of funny you MOD for these MS forums and yet you trash Windwos, laff. As well sorry, though I am coming here for help not to debate Win vs. Lin. Although, I will say that there is a reason Linux is more secure then Windwos, which I am sure you are aware of those reasons. By downgrading my service I meant the WinPro package offers much more then the latter Linux packages, Bandwidth, accessibility, storage size, plugins, email accounts, etc.

Personally, I hate Windwos, and I hate BG and everything that spoon feeder is about, but I use his software because, well BG has successfully monopolized the entire computer industry, sure program such as Linux and BartPE are nice alternatives, though they do not permit the necessary foundation to enable the full abilities that most software was built upon specifically for well, you know.

#45
RexxCrow

RexxCrow
  • Member
  • 6 posts
  • Joined 18-November 06
Alright, after tweeking the examples in this thread this is what I have come up to hopefully work with my application, I am making this for an Admin for a site that I believe does use Apache, I just won’t be able to test anything myself, if I have errors in this code please advise me of them, if anybody is willing to do so. I may not have understood everything fully, as this is the first time that I have actually played around with PHP code.

I am planning on setting these files in directory labeled: POAN, server side; this directory will also contain an HTML file that is used by the script I am trying to make this sig for. I have included these files to help paint the picture and limit any confusion. This is to work by having a script create the POAN.HTML and PC.txt files those are then FTP'ed to the server, the POAN.HTML will be accessed by players and the PC.txt is just for the sig, these files will be updated at a set period of time by the admin. the sig will then be linked to by the games support site and the Admins own site, etc. This is for an old online door game known as TradeWars 2002 now TradeWars 2002/TWGS, the script is for a helper called TWXProxy that allows users to make scripts to automate game play for them. This project I am working on though is more admin related, though to the players benefit. Thanks again for any assistance.


An example of the code used by TWXProxy to create the needed file for PC.TXT locally on the admins computer prior to FTPing to their website (these are excerpts from the file, as they are actually written throughout the file in various functions.)
# sets up the file path and name to be used:
setVar $sigPath $POANPath & "PC.TXT"

# if no users are online:
setVar $sig "None"

# else $X is the number of users online.
setVar $sig $X

# checks for the old file, removes it and writes a new one PC.TXT:
fileExists $fc $sigPath
IF $fc
 DELETE $sigPath
END
WRITE $sigPath $sig

POAN.HTML
[displays the game and player information via website]

PC.TXT
[contains the number of players currently online, so this would just contain a number i.e. 10 (I put a little function at the bottom of the Sig.JPG file, which I modified from the random quote code, to read from this file so not sure if I have this correct? Also, does the CHMOD setting for this file matter to make this work?)]

verdana.ttf
[obvious]

.htaccess file:
AddHandler application/x-httpd-php .JPG
Sig.JPG file:
<?php
Header('Content-type: image/jpeg');
Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
Header('Pragma: no-cache');

// set the dimensions
$img_width = 200;
$img_height = 25;

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

// set the colours
$cool  = imagecolorallocate($image, 81, 86, 96);
$green = imagecolorallocate($image, 0, 255, 0);

// 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 = 'verdana.ttf';

// reading from the Player Count text file to obtain the number of players currently online.
// Still need to change CHMOD to 777 also?
$count = file('PC.txt');

// now i will create a line with font size 10, with no angle, 10 pixels to the right, and 15 pixels down
ImageTTFText ($image, 10, 0, 10, 17, $green, $font, "Total Players Currently Online: ".$count);

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

This is the basic result I am hoping for (except in lime green):

Total Players Currently Online: 10



As and alterative option how would you make the number a different color? just put a defined color $ as:

$white=imagecolorallocate($image, 255, 255, 255);
ImageTTFText ($image, 10, 0, 10, 17, $green, $font, "Total Players Currently Online: ".$white.$count);

Edited by RexxCrow, 19 November 2006 - 01:52 AM.


#46
RexxCrow

RexxCrow
  • Member
  • 6 posts
  • Joined 18-November 06
Okey dokey lil’ smokies, ya'll discard my prior posts in this here thread, my issues seem to be resolved, (in another forum, BTW.) Posting if anybody else needs to know. As getting assistance here is apparently like pulling teeth.


[ QUOTE ]
ImageTTFText ($image, 10, 0, 10, 17, $green, $font, "Place Text Here: "); 
ImageTTFText ($image, 10, 0, *, 17, $PlaceNewColorCodeVarHere, $font, $PlaceVarNameHere); 
// Replace the * with the number of pixels between the left side of the image and the start of the number.
[ /QUOTE ]

[ INSERT SARCASM ] Again, thanks you all for your wonderful help and attitudez onboard this here MSFN board, outstanding work guyz, ya'll r just sooo l33t! w00t! w00t! U go boyz! laff … These forums are actually eerily similar to calling MS tech support, lolol, newayz I am so outtie, kthxbye [ /INSERT SARCASM ] :hello:

#47
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

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

Okey dokey lil’ smokies, ya'll discard my prior posts in this here thread, my issues seem to be resolved, (in another forum, BTW.) Posting if anybody else needs to know. As getting assistance here is apparently like pulling teeth.


[ QUOTE ]

ImageTTFText ($image, 10, 0, 10, 17, $green, $font, "Place Text Here: "); 
ImageTTFText ($image, 10, 0, *, 17, $PlaceNewColorCodeVarHere, $font, $PlaceVarNameHere); 
// Replace the * with the number of pixels between the left side of the image and the start of the number.
[ /QUOTE ]

[ INSERT SARCASM ] Again, thanks you all for your wonderful help and attitudez onboard this here MSFN board, outstanding work guyz, ya'll r just sooo l33t! w00t! w00t! U go boyz! laff … These forums are actually eerily similar to calling MS tech support, lolol, newayz I am so outtie, kthxbye [ /INSERT SARCASM ] :hello:

I hope you realize we all have lives away from this board and more than half our time is spent AWAY from MSFN. I am currently still in school and don't have much time to reply to or even discuss stuff like this on a daily basis; I just don't have the time to go through every single post and make sure that every single little thing is taken care of during every single second of every day; that's why we have more than one moderator.

Your sarcasm is not welcome here if that's the way you're going to be. And you shouldn't be saying something such as "OMFG!!! A MOD DISSING WINDOZE!!" either because we all have our personal opinions regarding technology. It's not too surprising in my opinion to see someone saying something of that sort, and I'm sure my fellow colleagues would agree with me.

In either case, I'm glad you resolved your problem, but behaviour of that sort (sarcasm towards others) will not be tolerated here. Seeing as you are a new member here, I suggest you take another good read at the rules located beneath the MSFN logo before continuing to post. Something you might have missed:

7.b This community is built upon mutual respect. You are not allowed to flame other members. People who do not respect personal opinions and/or personal work will be warned in first instance. If you ignore the warning and keep on flaming, you will be banned without notice.

If you feel the need to reply to this small bit of information, please feel free to PM me. Do NOT, under any cirumstances, reply to this post in this thread.

#48
RevRaz

RevRaz
  • Member
  • 4 posts
  • Joined 04-December 06
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?

#49
gamehead200

gamehead200

    SEARCH!!! SEARCH!!!

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

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. :)

#50
RevRaz

RevRaz
  • Member
  • 4 posts
  • Joined 04-December 06
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. :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users