Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   General Discussions (http://forums.winamp.com/forumdisplay.php?f=1)
-   -   Can Some1 Make A PHP Script For Me Please (http://forums.winamp.com/showthread.php?t=89796)

Bizzeh 3rd June 2002 01:41

Can Some1 Make A PHP Script For Me Please
 
i have a txt file that has a lot of 1 line quotes but i put em on different lines.. i was wandering if some1 could make a php script for me that will display a diff1 each time it is loaded (show as img)... can some1 do this, pm me if so...

griffinn 3rd June 2002 06:49

pm is for closed-source bastards.
PHP Code:

<?php

// Initialize, rand seed, chores...
srand ((double) microtime() * 1000000);
$font 1// You may also try other integer values for $font
// Put your quotes in quotes.txt in the same directory. One per line.
$phrases file("quotes.txt");

// Choose a random phrase
// Note-to-self: trim() takes away the trailing \n. Don't remove.
$sentence trim($phrases[rand(0count($phrases) - 1)]);

// create the image
$im ImageCreate(ImageFontWidth($font) * strlen($sentence),
                  
ImageFontHeight($font));
$white ImageColorAllocate($im,255,255,255); // First color allocated is bg
// $green = ImageColorAllocate($im,0,192,0);
$black ImageColorAllocate($im,0,0,0);
ImageString($im$font00strtoupper($sentence), $black);

// send the image
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header("Content-Type: image/png");
ImagePNG($im);

?>

Enjoy. :)

liquidmotion 3rd June 2002 07:40

leet!


All times are GMT. The time now is 10:08.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.