I use my own smilies around the web but I always forget the full link to the pics whenever I’m posting to a forum or whatever. I don’t need to remember them though as a long time ago I made the script below, saved it as index.php and put it in the folder where I hold my smilies… Now I just click a bookmark and open that page for a quick copy/paste. Feel free to use for your own uses, it’s essentially making a list of files in the directory and displaying them as per the html in the echo statements…

















<script>
function SelectAll(element)
{
element.focus();
element.select();
}
</script>
<?php
$path = getcwd() ;
$dir_handle = @opendir($path) or die("Error opening $path");
echo "<table style='text-align:center;font-family:sans-serif;'><tr><th>Image</th><th>Web Link</th><th>Forum Link</th><th>Image</th></tr>\n";
while ($file = readdir($dir_handle)) {
if ("$file" != "." && "$file" != ".." && "$file" != "index.php") {
echo "<tr><td><a href=\"http://the-kid.org/images/smilies/".htmlspecialchars(urlencode($file))." \"><img src=\"".htmlspecialchars(urlencode($file))."\" /></a></td>";
echo "<td><input onClick=\"SelectAll(this);\" size=\"50\" type=\"text\" value=\"<img src='http://the-kid.org/images/smilies/".htmlspecialchars(urlencode($file))."'/>\" /></td>";
echo "<td><input onClick=\"SelectAll(this);\" size=\"50\" type=\"text\" value=\"[img]http://the-kid.org/images/smilies/".htmlspecialchars(urlencode($file))."[/img]\" /></td>
<td><a href=\"http://the-kid.org/images/smilies/".htmlspecialchars(urlencode($file))." \"><img src=\"".htmlspecialchars(urlencode($file))."\" /></a></td>
</tr>\n";
}
}
echo "</table>";
closedir($dir_handle);
?>