4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: JeanLuc on August 19, 2008, 11:22:16 PM

Title: alfabetic links
Post by: JeanLuc on August 19, 2008, 11:22:16 PM
Hello,

How can i add in to the categories.php a alfabetic link order like
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

If you klik on the A you will see all images that start white A

Thanks  :D
Title: Re: alfabetic links
Post by: V@no on August 20, 2008, 01:28:01 AM
Hello and welcome to 4images forum.

Unfortunately the way 4images is designed this is not possible (without heavy modifications) , because 4images uses keywords for search and the keywords have no information if they represent image name, description etc nor if its a first word or last word.
Title: Re: alfabetic links
Post by: JeanLuc on August 20, 2008, 07:46:18 PM
Ohh ok.

I have some code maby you can look at it:

Code: [Select]
if ($_GET["letter"])
{
$letter = trim($_GET["letter"]);
  if (strlen($letter) > 1)
    die;

  if ($letter == "" || strpos("abcdefghijklmnopqrstuvwxyz", $letter) === false)
    $letter = "a";
  $query = "image_name LIKE '$letter%' > '0'";
  $q = "letter=$letter";
}

Code: [Select]
($i = 97; $i < 123; ++$i){
$l = chr($i);
$L = chr($i - 32);
if ($l == $letter)
    echo("<b>$L</b>\n");
else
    echo("<a href=?letter=$l><b>$L</b></a>\n");
}

echo("</p>\n");