Author Topic: alfabetic links  (Read 4822 times)

0 Members and 1 Guest are viewing this topic.

Offline JeanLuc

  • Pre-Newbie
  • Posts: 2
    • View Profile
alfabetic links
« 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: alfabetic links
« Reply #1 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline JeanLuc

  • Pre-Newbie
  • Posts: 2
    • View Profile
Re: alfabetic links
« Reply #2 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");