Current location: Hot Scripts Forums » Programming Languages » PHP » AIM Script


AIM Script

Reply
  #1 (permalink)  
Old 04-10-04, 12:59 AM
rainydayproject rainydayproject is offline
Newbie Coder
 
Join Date: Oct 2003
Location: tennessee
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
AIM Script

I have this script that makes an image that shows your AIM online/offline status and shows users ip and makes it into a png

here it is
PHP Code:

<?php
$AIMname 
"Angry *** Eaters"// Your AIM/AOL username 
$ip $_SERVER['REMOTE_ADDR']; 
$port $_SERVER['REMOTE_PORT']; 
$iptxt "Your ip is $ip"
$statfile1 "[url="http://www.the-server.net/osi3/aim/"]http://www.the-server.net/osi3/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt[/url]"; // Don't touch any of the lines below, unless you know what your doing 
$statfile2 "[url="http://www.eliott-ness.com:2324/aim/"]http://www.eliott-ness.com:2324/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt[/url]"; 
$statfile3 "[url="http://mightymichelob.tcworks.net:8080/aim/"]http://mightymichelob.tcworks.net:8080/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt[/url]";  
$status file($statfile1); 
$song file($musicfile); // Get the current song playing 
$header $AIMname."'s current stats:"
if ( 
$status[0] == NULL ) { // Due to the unreliability of the stat sites, i put in a few backups :) 
$status file($statfile2); 
if ( 
$status[0] == NULL ) { 
$status file($statfile3); 


if ( 
$status[0] == NULL ) { 
$onoff "AIM online status: ERROR"

if ( 
$status[0] == '1' ) { 
$onoff "AIM online status: ONLINE"

elseif ( 
$status[0] == '0' ) { 
$onoff "AIM online status: OFFLINE"

if (
strlen($disp) < strlen($iptxt)) { 
$width strlen($iptxt) * 16// Count how many characters need to be displayed, and change the width accordingly 

else{ 
$width strlen($disp) * 16// Same as above.. 

$img_disp imagecreate($width,100); // Create the image 
$prebackcolor imagecolorallocate($img_disp,0,0,0); // Assign the background color 
$backcolor imagecolortransparent($imgdisp,$prebackcolor// Make the bg transparent, if the page is alone, make it black 
$textcolor imagecolorallocate($img_disp,255,255,255); // Assign the text color 
imagefill($img_disp,0,0,$backcolor); // Fill the image with the background color 
imagestring($img_disp,10,5,5,$header,$textcolor); // Put the text into the image with the color 
imagestring($img_disp,10,5,30,$onoff,$textcolor); // ~ 
imagestring($img_disp,10,5,55,$disp,$textcolor);  // ~ 
imagestring($img_disp,10,5,80,$iptxt,$textcolor); // ~ 
header("Content-type: image/png"); 
imagepng($img_disp); // Draw the image 
imagedestroy($img_disp); // Delete the image from the server's memory 
?>
when i upload it i get
Parse error: parse error in /home/pridebmx/public_html/sig2.php on line 36

anyone know whats wrong?
Reply With Quote
  #2 (permalink)  
Old 04-10-04, 01:26 AM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
";" always check semi colons
$backcolor = imagecolortransparent($imgdisp,$prebackcolor)
should be
$backcolor = imagecolortransparent($imgdisp,$prebackcolor); //blah
__________________
God save us from the religious fanatics
Reply With Quote
  #3 (permalink)  
Old 04-10-04, 01:40 AM
rainydayproject rainydayproject is offline
Newbie Coder
 
Join Date: Oct 2003
Location: tennessee
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, same script different problem..

That fixed the parse error, thanks!
but now when i go to view it the page times out :-(

check it here http://pridebmx.com/sig2.php

why?
Reply With Quote
  #4 (permalink)  
Old 04-10-04, 01:52 AM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
I had a quick look and didn't see anything, but it might be that your AIM name has spaces in it, try replacing those with %20... then tell me what happens
__________________
God save us from the religious fanatics
Reply With Quote
  #5 (permalink)  
Old 04-10-04, 02:03 AM
rainydayproject rainydayproject is offline
Newbie Coder
 
Join Date: Oct 2003
Location: tennessee
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
:'( still not working
Reply With Quote
  #6 (permalink)  
Old 04-10-04, 02:10 AM
rainydayproject rainydayproject is offline
Newbie Coder
 
Join Date: Oct 2003
Location: tennessee
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
it doesnt seem to be timing out any more but it just takes really long to load and gives me the same parse error as before :-/

Parse error: parse error in /home/pridebmx/public_html/sig2.php on line 36
Reply With Quote
  #7 (permalink)  
Old 04-10-04, 02:29 AM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
sorry, some of this is beyond me, butI can't see anything so I would suspect the pages are down.
__________________
God save us from the religious fanatics
Reply With Quote
  #8 (permalink)  
Old 04-10-04, 02:37 AM
Mister B.'s Avatar
Mister B. Mister B. is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
it seems to be giving me a red x as if an image should be there.
__________________
God save us from the religious fanatics
Reply With Quote
  #9 (permalink)  
Old 04-10-04, 06:45 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
err, where is the variable $musicfile set? hmm
$song = file($musicfile); // Get the current song playing

that same with $disp, $imgdisp....
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png

Last edited by Infinite_Hackers; 04-10-04 at 06:50 AM.
Reply With Quote
  #10 (permalink)  
Old 04-10-04, 07:00 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

<?php

$AIMname 
"catelyest"// Your AIM/AOL username
$ip $_SERVER['REMOTE_ADDR'];
$port $_SERVER['REMOTE_PORT'];
$iptxt "Your ip is $ip";
if(!isset(
$disp)) {
$disp 25;
}
$statfile1 "http://www.the-server.net/osi3/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt"// Don't touch any of the lines below, unless you know what your doing
$statfile2 "http://www.eliott-ness.com:2324/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt";
$statfile3 "http://mightymichelob.tcworks.net:8080/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt";  
$status file($statfile1);
$header $AIMname."'s current stats:";
if ( 
$status[0] == NULL ) { // Due to the unreliability of the stat sites, i put in a few backups :)
$status file($statfile2);
if ( 
$status[0] == NULL ) {
$status file($statfile3);
}
}
if ( 
$status[0] == NULL ) {
$onoff "AIM online status: ERROR";
}
if ( 
$status[0] == '1' ) {
$onoff "AIM online status: ONLINE";
}
elseif ( 
$status[0] == '0' ) {
$onoff "AIM online status: OFFLINE";
}
if (
$disp strlen($iptxt)) {
$width strlen($iptxt) * 16// Count how many characters need to be displayed, and change the width accordingly
}
else{
$width $disp 16// Same as above..
}
$img_disp imagecreate($width,100); // Create the image
$prebackcolor imagecolorallocate($img_disp,0,0,0); // Assign the background color
$backcolor imagecolortransparent($img_disp,$prebackcolor); // Make the bg transparent, if the page is alone, make it black
$textcolor imagecolorallocate($img_disp,0,0,0); // Assign the text color
imagefill($img_disp,0,0,$backcolor); // Fill the image with the background color
imagestring($img_disp,10,5,5,$header,$textcolor); // Put the text into the image with the color
imagestring($img_disp,10,5,30,$onoff,$textcolor); // ~
imagestring($img_disp,10,5,55,$disp,$textcolor);  // ~
imagestring($img_disp,10,5,80,$iptxt,$textcolor); // ~
header("Content-type: image/png");
imagepng($img_disp); // Draw the image
imagedestroy($img_disp); // Delete the image from the server's memory
?>
I fixed your width problems also. :S
Hope that works
http://gfx-pro.ath.cx/tests/aim.php?aim=
( i did some editing so it uses fonts.. )
PHP Code:

<?php


if(empty($_GET['aim'])) {
    die(
'Sorry, you must enter your AIM/AOL name');
}

$AIMname $_GET['aim']; // Your AIM/AOL username

$ip $_SERVER['REMOTE_ADDR'];
$port $_SERVER['REMOTE_PORT'];
$iptxt "Your ip is $ip";
if(!isset(
$disp)) {
$disp 5;
}
$statfile1 "http://www.the-server.net/osi3/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt"// Don't touch any of the lines below, unless you know what your doing
$statfile2 "http://www.eliott-ness.com:2324/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt";
$statfile3 "http://mightymichelob.tcworks.net:8080/aim/".$AIMname."/onurl=www.s91276774.onlinehome.us/online.txt/offurl=www.s91276774.onlinehome.us/offline.txt";  
$status file($statfile1);
$AIMname ucfirst(strtolower($AIMname));
$header $AIMname."'s current stats:";
if ( 
$status[0] == NULL ) { // Due to the unreliability of the stat sites, i put in a few backups :)
$status file($statfile2);
if ( 
$status[0] == NULL ) {
$status file($statfile3);
}
}
if (
$disp strlen($iptxt)) {
$width strlen($iptxt) * 16// Count how many characters need to be displayed, and change the width accordingly
}
else{
$width $disp 16// Same as above..
}
$img_disp imagecreate($width,80); // Create the image

if ( $status[0] == NULL ) {
$onoff "ERROR";
$onoffcolor ImageColorAllocate($img_disp12800);
}
if ( 
$status[0] == '1' ) {
$onoff "ONLINE";
$onoffcolor ImageColorAllocate($img_disp01280);
}
elseif ( 
$status[0] == '0' ) {
$onoff "OFFLINE";
$onoffcolor ImageColorAllocate($img_disp1783434);
}


$main_font 'C:/windows/fonts/arial.ttf';
$second_font 'C:/windows/fonts/verdana.ttf';
$white ImageColorAllocate($img_disp255255255);
$black ImageColorAllocate($img_disp000);
$darkred ImageColorAllocate($img_disp12800);

$prebackcolor imagecolorallocate($img_disp,255,255,255); // Assign the background color

$backcolor imagecolortransparent($img_disp,$prebackcolor); // Make the bg transparent, if the page is alone, make it black

imagefill($img_disp,0,0,$backcolor); // Fill the image with the background color

imagettftext($img_disp901020$black$second_font$header);
imagettftext($img_disp901040$black$second_font'AIM online status: ');
imagettftext($img_disp9012040$onoffcolor$second_font$onoff);
imagettftext($img_disp901060$black$second_font$iptxt);


header("Content-type: image/png");
imagepng($img_disp); // Draw the image
imagedestroy($img_disp); // Delete the image from the server's memory
?>
that's the edited one...
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png

Last edited by Infinite_Hackers; 04-10-04 at 07:35 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with my largest perl script. Grabbing data from a file. Sunnmann Perl 2 04-23-08 03:27 AM
Looking for a good review management script griz_fan Script Requests 10 07-29-07 05:08 AM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 12:12 AM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 08:30 PM
Affiliate script (PHP) whtiebear Job Offers & Assistance 2 12-21-03 12:12 AM


All times are GMT -5. The time now is 10:25 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.