PDA


View Full Version : Letterband search in subcategories


HenrikHansen
08-28-2007, 04:57 PM
My letterband only searches in the current category,
even though it has very few or zero links.

Most of my categories do not have more than 10-20 links
(so the letterband is not that useful)
but I think it could be quite useful if the letterband also
searched in sub-categories below the category where the letterband is
shown. In this the letterband could be more useful as a search tool without
need for users to fill out search formulas.

Any idea how to do this?

Brian
08-28-2007, 06:01 PM
Should be easy enough... Look in your links/browselinks.php file for this code:
$wherequery[] = 'links.catid = ' . $catid;

And replace with this:
if ($ltr)
{
if ($privatecatids = fetch_private_categories())
{
$wherequery[] = 'links.catid NOT IN(' . $privatecatids . ')';
}

$catinfo['title'] = 'Links that start with the letter <i>' . $ltr . '</i>';
}
else
{
$wherequery[] = 'links.catid = ' . $catid;
}

HenrikHansen
08-29-2007, 10:07 AM
Thanks very much, this works perfectly!
Now there can be more use of the letter-band in practice

nostalgia
08-30-2007, 02:35 AM
Thanks. :)