View Single Post
Old 10-20-2002, 05:42 PM  
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,600
Smiley Script :)

Hey there... Just thought I'd post this little script in case anyone wants it. It will read the current directory and display all of your pics/smiles in a formatted table w/ the [IMG] tag code to copy/past into your messages.

PHP Code:
[SIZE=1]
<?php
function flist() {
$website="www.YOURSITE.com/smiles";   //No trailing slashes, no [url]http://[/url]
$dirgetcwd();
$d=dir("$dir");
echo 
"<div align=\"center\"><table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">";
 
while (
false !== ($entry=$d->read())) 
{
$x=is_file($entry);
 
if(
$entry[0] !="."
{
if(
$entry != $x) {
 
$path "$entry";
$file basename ($path,".php"); // $file is set to "index"
 
if(($entry != $x)&&($entry != "index.php")) {
echo 
"<tr><td width=\"184\" align=\"right\" valign=\"middle\"><img src=\"$entry\" border=0></td><td
 width=\"516\" align=\"left\" valign=\"middle\"><font size=\"1\" face=\"Verdana\">"
."["."img"."]"."http://$website/$entry"."["."/img"."]"."</font></td></tr>";
}}
else {echo 
"";}}}
echo 
"</table></div>";
$d->close();
}
flist();
?>[/SIZE]


Just copy/paste this into a plain text file, and save as index.php,
upload to your smiles directory, and point your browser to that page.

Hope you like it.
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."

Last edited by Voodoo; 10-20-2002 at 05:44 PM..
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote