Webmastersite.net
Register Log In

A-Z Menu

Comments on A-Z Menu

barrykilby
Member

Usergroup: Customer
Joined: Jun 30, 2003
Location: England

Total Topics: 7
Total Comments: 48
Posted Nov 30, 2005 - 8:57 AM:

Any idea what the simple way to do a A-Z menu would be? i.e. You click A and get all cats the begin A.. I thought i could do this with search but its got me beat. shaking head
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 03, 2005 - 12:18 PM:

I don't see a way to search by first letter.
barrykilby
Member

Usergroup: Customer
Joined: Jun 30, 2003
Location: England

Total Topics: 7
Total Comments: 48
Posted Dec 03, 2005 - 12:30 PM:

thats what i thought... is there any other way of doing this?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Dec 05, 2005 - 5:01 PM:

field LIKE 'A%' should do it. Now to get that into a search option... open search.php, replace
    else if ($condition == 'not')
{
$generatesearch .= '(';
$generatesearch .= "$searchfields[$count] != '$search'";
$generatesearch .= ')';
if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }
}
with
    else if ($condition == 'not')
{
$generatesearch .= '(';
$generatesearch .= "$searchfields[$count] != '$search'";
$generatesearch .= ')';
if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }
}
else if ($condition == 'start')
{
$generatesearch .= '(';
$generatesearch .= "$searchfields[$count] LIKE '$search%'";
$generatesearch .= ')';
if ($count < ($num-1)) { if ($action == 'filter') $generatesearch .= " AND "; else $generatesearch .= " OR "; }
}


Then use start instead of like as your condition.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.