Current location: Hot Scripts Forums » Programming Languages » PHP » First php script I ever made :D


First php script I ever made :D

Reply
  #1 (permalink)  
Old 02-04-04, 01:37 PM
XxXoldsaltXxX XxXoldsaltXxX is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
First php script I ever made :D

The first PHP script i have ever made (that is'nt gay). It uses www.onlinestatus.org and www.audiomatch.net to retrieve the information.

http://s91276774.onlinehome.us/music.php

PHP Code:

<?php // Script created by XxXoldsaltXxX (XxXoldsaltXxX@hotmail.com)

$musicname "XxXoldsaltXxX"// [url]www.audiomatch.net[/url] username (the site is usually restricting registration, so please donate)
$AIMname "XxXoldsaltXxX"// Your AIM/AOL username
$ip $_SERVER['REMOTE_ADDR'];
$port $_SERVER['REMOTE_PORT'];
$iptxt "Your ip is $ip using port $port ..";
$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"
$musicfile "http://www.audiomatch.net/text/".$musicname.".txt";
$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 ( 
$song == NULL ){ // Check to see if there is a song currently being played
$disp "Current jamz: None currently";
}
elseif (
$song[1] != NULL) { // Check to see if there is a 2nd line
$song[0] = substr($song[0], 0, -1); // Take the last letter (endline char) out of the first line
$disp =  "Current jamz: $song[0] - $song[1]";
}
elseif (
$song[1] == NULL) { 
$disp =  "Current jamz: $song[0]";
}
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
$backcolor imagecolorallocate($img_disp,0,0,0); // Assign the background color
$textcolor imagecolorallocate($img_disp,255,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);
imagestring($img_disp,10,5,30,$onoff,$textcolor);
imagestring($img_disp,10,5,55,$disp,$textcolor); // Put the text into the image with the color
imagestring($img_disp,10,5,80,$iptxt,$textcolor);
header("Content-type: image/png");
imagepng($img_disp); 
imagedestroy($img_disp); 
?>
Please leave some comments or if you find any bugs.
You can use and edit this script as much as you want, just dont forget me

Last edited by XxXoldsaltXxX; 02-04-04 at 02:19 PM. Reason: bug in the code
Reply With Quote
  #2 (permalink)  
Old 02-04-04, 05:02 PM
dD|Fusion dD|Fusion is offline
Newbie Coder
 
Join Date: Jan 2004
Location: Brazil
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I didn't got what is it supposed to be but i liked your code 'cuz i learned a bit with it on how to edit images...

Great Job anyway...

100+
__________________
"O google é meu pastor e nada me faltará!"
http://www.25-design.com
Reply With Quote
  #3 (permalink)  
Old 02-04-04, 09:31 PM
Ryan Sanders Ryan Sanders is offline
New Member
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Yeah I liked the code too.. I could really use it and I am!
Reply With Quote
  #4 (permalink)  
Old 02-05-04, 06:16 PM
XxXoldsaltXxX XxXoldsaltXxX is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
:)

Thanks for the comments
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
Looking for an online radio php script Swifty Script Requests 3 10-10-09 05:03 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
PHP News script similar to aspHeadlines!! Hideki Script Requests 0 01-22-04 04:25 AM
100 Web Templates & 10 PHP Scripts for sale! HostersUK.co.uk General Advertisements 0 01-10-04 12:31 AM
Affiliate script (PHP) whtiebear Job Offers & Assistance 2 12-21-03 12:12 AM


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