MSFN Forum: IP Sig - MSFN Forum

Jump to content


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

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

#41 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 06 November 2003 - 02:32 PM

tawxic: hate to burst your bubble dewd, but the new sig policy doesn't allow you to have a sig that big.


#42 User is offline   tawxic 

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

Posted 06 November 2003 - 03:04 PM

un4given1, on Nov 6 2003, 02:32 PM, said:

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.

#43 User is offline   gamehead200 

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

Posted 07 November 2003 - 06:42 AM

Don't worry, the sig rule changed back AGAIN...You can keep that sig...

#44 User is offline   bman3022 

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

Posted 22 November 2003 - 09:25 PM

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

#45 User is offline   gamehead200 

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

Posted 23 November 2003 - 07:16 PM

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 User is offline   bman3022 

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

Posted 23 November 2003 - 08:10 PM

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?

#47 User is offline   gamehead200 

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

Posted 23 November 2003 - 08:27 PM

bman3022, on Nov 23 2003, 09:10 PM, said:

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?

Quote

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 User is offline   bman3022 

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

Posted 23 November 2003 - 09:39 PM

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 ?

#49 User is offline   gamehead200 

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

Posted 24 November 2003 - 06:34 AM

bman3022, on Nov 23 2003, 10:39 PM, said:

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 User is offline   bman3022 

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

Posted 24 November 2003 - 07:42 PM

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


#51 User is offline   gamehead200 

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

Posted 24 November 2003 - 08:43 PM

bman3022, on Nov 24 2003, 08:42 PM, said:

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

Looks fine to me! :)

#52 User is offline   tawxic 

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

Posted 01 December 2003 - 10:23 PM

howdy again...

I have a question.. since we stopped using the imagettftext for text, and went on to imagestring.. maybe the option is available.. how do I center a text string? thanks :)

#53 User is offline   Flynn 

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

Posted 02 December 2003 - 01:02 AM

Quote

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


Well since this site was invaluable to me in figuring out how that signature image worked, here you go for OS and browser detection. This isn't my code but snips I located on the web in several places so I don't know who the original author is. It might not be perfect, but it's a really good start.

Code removed due to a bug,  new code with bugcatcher is a few post down


#54 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 02 December 2003 - 01:06 AM

Flynn: your IP sig says... "Your ISP is: www.85.31" needless to say... that's wrong. just thought you should know.

#55 User is offline   Flynn 

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

Posted 02 December 2003 - 01:09 AM

Quote

Flynn: your IP sig says... "Your ISP is: www.85.31" needless to say... that's wrong. just thought you should know.


I guess then your IP isn't resolving and it's just ripping the last part of your IP

#56 User is offline   Flynn 

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

Posted 02 December 2003 - 01:43 AM

Ok here is the code with a bug catcher to catch non-resolved IPs as un4given1 pointed out.

$ip = The IP
$isp = The domain you need to prefix it with "www."
$endos = The OS

// 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";
}
}


#57 User is offline   gamehead200 

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

Posted 02 December 2003 - 06:36 AM

Thanks Flynn! Very useful! :rolleyes:

And welcome to MSFN! :)

#58 User is offline   bman3022 

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

Posted 02 December 2003 - 11:19 PM

**** i wish you had postted sonner i had to find out how to do it by asking the creator of the dansoft script
Posted Image

One question tho is there any way to make it say windows me?
CAuse i use winme and it says im using windows 98

#59 User is offline   Flynn 

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

Posted 03 December 2003 - 12:47 AM

Quote

One question tho is there any way to make it say windows me?


You know someone else pointed that out to me today :) I have no idea why the author of the code left out Me but it should be a simple fix

Add these two like line one each just under the 98 entries the resemble

Just under "Win98|Windows 98", insert this

"WinME|Windows ME",


Just under "Windows 98|Windows 98", insert this

"Windows ME|Windows ME",


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.

#60 User is offline   tawxic 

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

Posted 03 December 2003 - 10:41 AM

what's wrong with this code? it just gives me the red x image box.

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

define("OFFSET", 0);

define("YSECS", 365*24*60*60);
define("DSECS", 24*60*60);
define("HSECS", 60*60);
define("MSECS", 60);

function countdown($detail, $year, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0) {
	$years = $days = $hours = $minutes = $seconds = 0;
	$now = mktime() + OFFSET*60*60;	
	$then = mktime($hour, $minute, $second, $month, $day, $year);	
	$cdown = abs($then - $now);
	
	if ($detail == 1) $years = round($cdown/YSECS);
	else $years = floor($cdown/YSECS);
	$cdown %= YSECS;
	if ($detail == 2) $days = round($cdown/DSECS);
	else $days = floor($cdown/DSECS);
	$cdown %= DSECS;
	if ($detail == 3) $hours = round($cdown/HSECS);
	else $hours = floor($cdown/HSECS);
	$cdown %= HSECS;
	if ($detail == 4) $minutes = round($cdown/MSECS);
	else $minutes = floor($cdown/MSECS);
	$cdown %= MSECS;
	$seconds = $cdown;
	
	$tnums = array($years, $days, $hours, $minutes, $seconds);
	$ttext = array("year", "day", "hour", "minute", "second");
	
	$shown = 0;
	
	for ($i=0;$i<$detail;$i++) {
  if ($tnums[$i]) {
 	 echo "$tnums[$i] $ttext[$i]";
 	 $shown++;
 	 if ($tnums[$i] != 1) echo "s";
 	 $count = 0;
 	 for ($j=$i+1;$j<$detail;$j++) {
    if ($tnums[$j]) $count++;
 	 }
 	 switch($count) {
    case 0: break 2;
    case 1: if ($shown>1) echo ","; echo " and "; break;
    default: echo ", "; break;
 	 }
  }
	}
	if ($now > $then) echo " ago";
	if ($now == $then) echo "now";
}
$tilxmas = countdown(2, 2003,12,25);

$image = imagecreatefromgif("xmas.gif");

$white = imagecolorallocate($image, 255, 255, 255);

$font = "candycane.ttf";

imagettftext ($image, 24, 0, 5, 5, $white, $font, $tilxmas);

imagepng($image);
imagedestroy($image);

?>


here's the image:

Posted Image

Can't figure it out :-/

Share this topic:


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

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



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