I have some 'unique' tags, e.g there is only one instance of such a tag.
using printAllTagsAs() clicking such a tag first takes you to the search php from where only, since it is unique, one image or album shows up.
what I wanted is for these 'unique' tags to go straight to the image or album page.
I kind of hustled together something that works for albums with a 'unique' tag.
in the function printAlltagsAs() I added an if condition for the '$val', so if a tag occures only once a different link is printed, one straight to the album or image;
`
if ($val==1){
$sql="SELECT * FROM ". prefix("albums") ." WHERE tags LIKE '%".$key."%'";
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
$path=rewrite_path("/index.php?album=" . urlencode($a[2]));
echo "t<li style=\"display:inline;\"><a href=\"".$path."\">".$key."</a></li>n";
}else{
$key = str_replace('"', '', $key);
echo "t<li style=\"display:inline;\"><a href=\"".
getSearchURL($key, '', SEARCH_TAGS, 0, 0)."\"$size rel=\"nofollow\">".
$key.$counter."</a></li>n";
}
`
this works well for albums with only one unique tag, you can see it at www.bertsimons.nl e.g the tags 18+ or wishlist take you straight to these albums
unfortunatly my sql query knowledge is not enough to write a query that also queries the images and returns their location if the single tag matches the key.
any suggestions?