IP Sig how do u do it?
#41
Posted 06 November 2003 - 02:32 PM
#42
Posted 06 November 2003 - 03:04 PM
un4given1, on Nov 6 2003, 02:32 PM, said:
after I get this thing fine tuned, I will make a smaller version.. this will be my version for other pages.
#43
Posted 07 November 2003 - 06:42 AM
#44
Posted 22 November 2003 - 09:25 PM
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

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
Posted 23 November 2003 - 07:16 PM
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
Posted 23 November 2003 - 08:10 PM
I got it to work
I had to edit it a little bit but it works now
is there anyway to change the font size?
#47
Posted 23 November 2003 - 08:27 PM
bman3022, on Nov 23 2003, 09:10 PM, said:
I got it to work
I had to edit it a little bit but it works now
is there anyway to change the font size?
Quote
Change the 8 to an even number...
Can we see the final result?
#48
Posted 23 November 2003 - 09:39 PM
o and i have one little problem sometimes the qoute wraps on top of it self.
any way to fix it?

Have you found any thing on how to put the browser and os name ?
#49
Posted 24 November 2003 - 06:34 AM
bman3022, on Nov 23 2003, 10:39 PM, said:
o and i have one little problem sometimes the qoute wraps on top of it self.
any way to fix it?

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
Posted 24 November 2003 - 07:42 PM
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
Posted 24 November 2003 - 08:43 PM
bman3022, on Nov 24 2003, 08:42 PM, said:
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
Posted 01 December 2003 - 10:23 PM
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
Posted 02 December 2003 - 01:02 AM
Quote
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
Posted 02 December 2003 - 01:06 AM
#55
Posted 02 December 2003 - 01:09 AM
Quote
I guess then your IP isn't resolving and it's just ripping the last part of your IP
#56
Posted 02 December 2003 - 01:43 AM
$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";
}
}
#58
Posted 02 December 2003 - 11:19 PM

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
Posted 03 December 2003 - 12:47 AM
Quote
You know someone else pointed that out to me today
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
Posted 03 December 2003 - 10:41 AM
<?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:
Can't figure it out :-/



Help
This topic is locked

Back to top









