Forum Moderators: coopster
As you may see... I am a total newbie :)
<a href="icon.ext">download the icon</a>
Depending on many things, when a user clicks on the link either the icon will be shown or a download dialogue will appear.
If the icons are images in a common web format - .jpg, .gif or .png - you might try
<img src="icon.ext" alt="I'm an icon" width="16" height="16">
That will display the icon on the web page, and users can use standard browser functions to save the image on their hard disk.
No need for PHP, IMHO ;)
What exactly do you mean with 'icons'? Religious ones like in Russian Orthodox churches, or favicons in browsers' address bars?
I want to do a gallery with AIM Buddy Icons.
Lets say for example that my domain is www.example.com
My icons are in a folder called coolicons
One of the icons is called cooldog.gif.
The command to insert the icon to your AIM would be
aim:BuddyIcon?scr=http://www.example.com/coolicons/cooldog.gif.
So, when you click the cooldog.gif icon, it will be inserted as your new buddy icon.
What I want to know is if there is a script that can help me insert the command automatically into hundreds of icons, instead of having to link each one by hand.
I don't even know if I need a php script, or another kind.
<?php
$deDir = '/path/to/image/directory';
$d = @dir($deDir) or die("fatal error: directory '$deDir' does not exist");
while (false!== ($entry = $d->read())) {
$entries[] .= $entry;
}
$d->close();
sort($entries);
while (list(, $val) = each ($entries)) {
if (is_file($deDir . "/" . $val)) {
echo "<a href='aim:BuddyIcon?src=$val'><img src='$val'></a><br>\n";
}
}
?>