View previous topic :: View next topic |
Author |
Message |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Fri Dec 16, 2005 2:21 pm Post subject: |
|
|
Is the use of "wise guy" deliberete to coincide with your username by any chance? Just wondered.
And honestly, you should expect wise comments, cause my good friends google, and search.php could help you greatly.
But, firstly, that image doesn't work because you don't have png to be processed by php. (You'd need to add a virtualhost to do this on abyss.)
Secondly, to install, open your php configuration file (php.ini) and add/uncomment module=php_gd2.dll under the modules header, then be sure you have the matching dll in your extensions folder. (Set with extension_dir, in php.ini.) _________________
 |
|
Back to top |
 |
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Fri Dec 16, 2005 2:24 pm Post subject: |
|
|
I have "umcommented" it actually and all the nescessqary files are in place where they should be according several websites from google anf now wise guy has nothing to do with my name.
P.S. Your being counted as a bit of a wise guy at the moment.. =|
EDIT: It's also nice to see such a fast reply with no actual insults thanks alot. |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Fri Dec 16, 2005 2:30 pm Post subject: |
|
|
OMG Forget this post, will someone please just walk me through setting up a fully operational dynamic sig like Andys |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Fri Dec 16, 2005 2:32 pm Post subject: |
|
|
Rename the .png to .php. _________________
 |
|
Back to top |
 |
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Fri Dec 16, 2005 2:34 pm Post subject: |
|
|
Smart Ass lol Thank You so much!!!!! Andy even tryed to help me and I didnt understand a thing he said lol |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Fri Dec 16, 2005 3:10 pm Post subject: |
|
|
MrWiseOne wrote: | Smart Ass lol Thank You so much!!!!! Andy even tryed to help me and I didnt understand a thing he said lol |
I dont remember this... ? _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Fri Dec 16, 2005 3:13 pm Post subject: |
|
|
You semmed to be busy that day, I asked you on MSN after I did what you told me I never ot a reply and I havnt been able to talk to you since.
http://www.mrwiseone.com/sigs/my_sig.php
Although your help will still be usefull for this. All I want is plain old arial yet I have all this -1 2 -7 crap lol
Can you help me out here?
P.S. Your forum has replys in it lol http://www.abysspanel.co.uk/forum/index.php |
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Fri Dec 16, 2005 3:23 pm Post subject: |
|
|
Also, don't forget to alias it as some type of image file. |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Fri Dec 16, 2005 3:34 pm Post subject: |
|
|
Could you please xplain to me how actually what to type in as the settings for the alias?
And does anyone know the number for Arial? |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Fri Dec 16, 2005 3:37 pm Post subject: |
|
|
MrWiseOne wrote: | Could you please xplain to me how actually what to type in as the settings for the alias?
And does anyone know the number for Arial? |
As far as I know, none of the functions use numbers to represent fonts. The numbers are more likely alignment or font size. Try using a different function if you want a custom font. _________________
 |
|
Back to top |
 |
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
|
Back to top |
|
 |
p3 -
Joined: 17 Jun 2005 Posts: 615
|
Posted: Fri Dec 16, 2005 9:53 pm Post subject: |
|
|
Fonts, you ask?
Take a look at this section from the dynamic signature of mine that is coming soon:
Code: |
imagettftext($image, 10, 0, 10, 10, $textcolor, "C:/Windows/Fonts/Arial.ttf", $message);
|
See the part with "C:/Windows..."? That's where you define the font. |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 17, 2005 12:50 am Post subject: |
|
|
Yes fonts, I know what i'm referring to if people just made things easy as 1 2 3 lol no one would have problems although this would be difficult sometimes.
Anyway here is my code:
Code: |
<?php
$image_info = array(
'image' => 'sample_signature.gif'
);
$image_text_ary = array();
$image_text_ary[] = array(
array(
'x' => 19,
'y' => 21,
'color' => array(0, 0, 0),
'font' => -4,
'text' => " This is my second dynamic signature!"
),
array(
'x' => 19,
'y' => 42,
'color' => array(0, 0, 0),
'font' => -4,
'text' => " It could be used to show your favorite quotes."
)
);
$image_text_ary[] = array(
array(
'x' => 19,
'y' => 21,
'color' => array(0, 0, 0),
'font' => -4,
'text' => " This is ALSO my second dynamic signature!"
),
array(
'x' => 19,
'y' => 42,
'color' => array(0, 0, 0),
'font' => -4,
'text' => " It all depends on your imagination "
)
);
$random = time() % count($image_text_ary);
$image_text = $image_text_ary[$random];
include('./includes/dynamic_gd_image.php');
?>
|
And the Included file:
Code: | <?php
$gdfonts = array(
'8x13iso', '9x15iso', 'andale12', 'atommicclock', 'bmreceipt',
'chowfun', 'courier8', 'dimurph', 'georgia8', 'proggyclean',
'proggysquare', 'systemex', 'terminal6', 'trisk'
);
//
//
//
if( !isset($image_info) || !isset($image_text) )
{
exit;
}
//
//
//
$sz = @getimagesize('./images/'.$image_info['image']);
if( !$sz )
{
exit;
}
$image_w = $sz[0];
$image_h = $sz[1];
//
//
//
@header('Content-type: image/png');
$im = @imagecreatefromgif('./images/'.$image_info['image']);
$rgb = ( isset($image_info['color']) ? $image_info['color'] : array(255, 255, 255) );
$bgColor = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]);
for( $i = 0; $i < count($image_text); $i++ )
{
if( !is_numeric($image_text[$i]['font']) )
{
$font = 1;
}
else if( $image_text[$i]['font'] < 0 )
{
$font = $image_text[$i]['font'] * -1;
}
else
{
if( !($font = @imageloadfont('./gd_fonts/'.$gdfonts[$image_text[$i]['font']].'.gdf')) )
{
$font = 1;
}
}
$rgb = $image_text[$i]['color'];
$fgColor = imagecolorallocate($im, $rgb[0], $rgb[1], $rgb[2]);
imagestring($im, $font, $image_text[$i]['x'], $image_text[$i]['y'], $image_text[$i]['text'], $fgColor);
}
imagepng($im);
imagedestroy($im);
?>
|
See what you all make of it then |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sat Dec 17, 2005 12:52 am Post subject: |
|
|
You seem to have made your code very complex for what it needs to do... _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 17, 2005 1:00 am Post subject: |
|
|
I asked here On the forums but look what I got. Right then ahh I cant seem to find post but it doesnt really matter but Not all replys were as nice as they could hvae been. I did not right that code I uset evryones fave google (my fav too =P) and thjats what I got.
Couldnt please just walk mw thrrough it code and all |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 2:17 pm Post subject: |
|
|
Right, I'd like to restart my post =P!
This is what I have
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("yoda-logo.jpg");
// dimensions of the image used
$img_width = 440;
$img_height = 210;
// set the colours0
$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, 0, 255, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
// set the font and print text
$font = '/fonts/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, 6, 12, $green, $font, "Your IP Address is ".$REMOTE_ADDR);
// the above will display your IP address
// counter - CHMOD your counter file to 777
$viewss = file("views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "$views people viewed this since 11/5/03!";
// output and destroy
imagepng($image);
imagedestroy($image);
?> |
And as you can see below the counter isnt working why not?
EDIT: It also appears that I cant get the image in my sig area thingy to work thats the pic tho address that is..
EDIT NUMBER 2: Oh and hers a screenshot of my sigs directory...
 |
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Sat Dec 24, 2005 2:31 pm Post subject: |
|
|
Because you're not telling it to add the text to your image.
Code: | ImageTTFText ($image, 8, 0, 6, 12, $green, $font, $views." people viewed this since 11/5/03!"); |
And php is not a valid image extension, so the bbcode won't show it. _________________
 |
|
Back to top |
 |
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 2:33 pm Post subject: |
|
|
I thought that it was sumthin like that so i messed around with and then it wouldnt load thanks Monkey =D, also how do I make it so bbcode will show (in other words how do I set up my sigs directory?). |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 2:38 pm Post subject: |
|
|
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("yoda-logo.jpg");
// dimensions of the image used
$img_width = 440;
$img_height = 210;
// set the colours0
$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, 0, 255, 0);
$blue = imagecolorallocate($image, 0, 0, 255);
// set the font and print text
$font = '/fonts/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, 6, 12, $green, $font, "Your IP Address is ".$REMOTE_ADDR);
ImageTTFText ($image, 8, 0, 50, 24, $green, $font, $views."people viewed this since 24/12/05!");
// the above will display your IP address
// counter - CHMOD your counter file to 777
$viewss = file("views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "$views people viewed this since 24/12/05!";
// output and destroy
imagepng($image);
imagedestroy($image);
?> |
Still doesnt work. =( |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 2:43 pm Post subject: |
|
|
I just learnt a valuble php leson lol
Code: |
// counter - CHMOD your counter file to 777
$viewss = file("views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "$views people viewed this since 24/12/05!";
ImageTTFText ($image, 8, 0, 50, 24, $green, $font, $views." people viewed this since 24/12/05!"); |
The actuall thinking code thingy must go before since the file is read from top to bottom otherwise it will be ignored yes. |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
|
Back to top |
|
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
Posted: Sat Dec 24, 2005 3:41 pm Post subject: |
|
|
A htaccess file is the default apache control file. (I.E. Good luck making it work on abyss.)
You'll have to make a folder called mysig.jpg and put your image as index.php in it, or make an alias for it. _________________
 |
|
Back to top |
 |
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 3:42 pm Post subject: |
|
|
lol I thought about that |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sat Dec 24, 2005 3:45 pm Post subject: |
|
|
Awesome.. Thanks alot for your help! |
|
Back to top |
|
 |
Computer-Pro -
Joined: 14 Dec 2005 Posts: 111
|
Posted: Sun Dec 25, 2005 4:07 am Post subject: |
|
|
How did you get $endos to work? I keep geting Your OS IS Unknown.
Heres my code:
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');
// set the dimensions
$img_width = 240;
$img_height = 25;
$image = imagecreatefromjpeg("Computer-Pro Logo.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 the font and print text
$font = 'C:/WINDOWS/fonts/verdana.ttf';
// now i will create a line with font size 8, with no angle, 10 pixels to the right, and 17 pixels down
// the above will display your IP address
// counter - CHMOD your counter file to 777
$viewss = file("/views.txt");
$views = $viewss[0]; $views++;
$fp = fopen("/views.txt", "w");
fwrite($fp, $views);
fclose($fp);
$counter = "$views People Cliked This Link";
// get IP and resolve IP
$ip = $_SERVER['REMOTE_ADDR'];
$resolved = gethostbyaddr ($REMOTE_ADDR);
$text = "Your IP address is $ip!";
// 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
*/
ImageTTFText ($image, 8, 0, 10, 17, $white, $font, $text);
ImageTTFTEXT ($image, 8, 0, 10, 100, $white, $font, "Amount Of Times Viewed =" .$views);
ImageTTFTEXT ($image, 8, 0, 10, 200, $white, $font, "Your OS Is $endos");
// output and destroy
imagepng($image);
imagedestroy($image);
?> |
Heres a link to the .php file http://24.251.242.165:8080/sig/index.php |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sun Dec 25, 2005 4:10 am Post subject: |
|
|
I have no idea =( |
|
Back to top |
|
 |
Computer-Pro -
Joined: 14 Dec 2005 Posts: 111
|
Posted: Sun Dec 25, 2005 4:15 am Post subject: |
|
|
What is the OS detection part of your code like? Maybe I am doing something Wrong.
EDIT; I think it has to do with the Unknown in this part of the code:
Code: |
foreach ($oslist as $osnow) {
$osnow = explode ("|", $osnow);
if (eregi ($osnow[0], $os)) {
$endos = $osnow[1];
$check = "No";
} elseif ($check != "No") {
$endos = "Unknown"; |
|
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sun Dec 25, 2005 4:19 am Post subject: |
|
|
Here my code: =)
Code: | // 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
*/
ImageTTFText ($image, 10, 0, 20, 80, $black, $font, $endos." you run I say");
ImageTTFText ($image, 10, 0, 20, 100, $black, $font, $ip." is your IP Address");
ImageTTFText ($image, 10, 0, 20, 120, $black, $font, "Your IP resolved is ".$resolved);
|
|
|
Back to top |
|
 |
Computer-Pro -
Joined: 14 Dec 2005 Posts: 111
|
Posted: Sun Dec 25, 2005 4:54 am Post subject: |
|
|
Dang it, I still can't get it to work. I'm going too give up. It's really not that important. |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sun Dec 25, 2005 4:55 am Post subject: |
|
|
Ok =) |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sun Dec 25, 2005 5:06 am Post subject: |
|
|
What code do you use for uptime and ram? Andy? |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sun Dec 25, 2005 9:20 am Post subject: |
|
|
Uptime is PHP code but the RAM uses a small exe file that php processes. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
Tom Chapman -
Joined: 09 Jul 2005 Posts: 933 Location: Australia
|
Posted: Sun Dec 25, 2005 1:38 pm Post subject: |
|
|
Um ok the code and file is the same as the the one in your v2 script? |
|
Back to top |
|
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Sun Dec 25, 2005 1:46 pm Post subject: |
|
|
Yes it is. Feel free to use it.
Thanks to MonkeyNation for that, It was orignally taken from a gd sig script.
EDIT: You should use jpeg not png for your sig, png is very large, especially for your connection. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|