PDA

View Full Version : How do I create a alphabetical search menu


veenuisthebest
06-14-2008, 07:31 AM
hii..

plz see the screenshot

https://vborg.vbsupport.ru/attachment.php?attachmentid=82282&d=1213432232

i want to create an alphabetical search menu for one of my custom pages exactly like we see in any vB site's memberlist page.

I looked at memberlist.php and found this that has a role in generating this menu but am not able to get it work. I am definitely missing more of code or something.

$ltr = $vbulletin->input->clean_gpc('r', 'ltr', TYPE_NOHTML);
if ($ltr != '')
{
if ($ltr == '#')
{
$condition = "username NOT REGEXP(\"^[a-zA-Z]\")";
}
else
{
$ltr = chr(intval(ord($ltr)));
$condition = 'username LIKE("' . $db->escape_string_like($ltr) . '%")';
}
}
$selectedletter =& $ltr;

// build letter selector
// start with non-alpha characters
$currentletter = '#';
$linkletter = urlencode('#');
$show['selectedletter'] = $selectedletter == '#' ? true : false;
eval('$letterbits = "' . fetch_template('memberlist_letter') . '";');
// now do alpha-characters
for ($i=65; $i < 91; $i++)
{
$currentletter = chr($i);
$linkletter =& $currentletter;
$show['selectedletter'] = $selectedletter == $currentletter ? true : false;
eval('$letterbits .= "' . fetch_template('memberlist_letter') . '";');
}
$sortaddon .= ($ltr != '') ? 'ltr=' . urlencode($ltr) . '&amp;' : '';
$sortaddon .= ($urladd != '') ? $urladd : '';

$sortaddon = preg_replace('#&amp;$#s', '', $sortaddon);

$sorturl = 'memberlist.php?' . $vbulletin->session->vars['sessionurl'] . $sortaddon;

I hope someone can help me get it done !! thank you

veenuisthebest
06-15-2008, 07:43 AM
i'm still waiting !!

veenuisthebest
06-17-2008, 03:10 PM
This is the code I got from arcade.php, just need some help now on how to implement the same on my custom page.

// alpha-navbar by MrZeropage
$alphabet = array( "ALL", "0-9" , "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" );
$alphabar = ""; $currentfilter="ALL";
if ($ibforums->input['gsearch'] != "")
{
$currentfilter = $ibforums->input['gsearch'];
}

foreach ($alphabet as $letter)
{
$style="alt1"; $boldon=""; $boldoff=""; $width="18";

$urlstring="act=Arcade&amp;gsearch=".$letter."&amp;search_type=";
if ($letter == "0-9")
{
$urlstring.="3";
$width="24";
}
else
{
$urlstring.="1";
}

if ($letter == $currentfilter)
{
$style="alt2";
$boldon="<b>";
$boldoff="</b>";
}

if ($letter == "ALL")
{
$urlstring="";
$letter=$ibforums->lang['acp_all'];
$width="26";
}

if (isset($ibforums->input['cat']))
{
$urlstring .= "&amp;cat=".intval($ibforums->input['cat']);
}

$alphabar .= '<td class="'.$style.'" width="'.$width.'" height="20"><div align="center"><a class="smallfont" href="'.$ibforums->base_url.$urlstring.'">'.$boldon.$letter.$boldoff.'</a></div></td>';
}

$this->arcade->links['alphabar'] = $alphabar;
// end alpha-navbar

veenuisthebest
06-19-2008, 09:53 AM
still need help !!

veenuisthebest
06-25-2008, 01:58 PM
I swear, I am still waiting !!

ade_dnb
06-25-2008, 02:28 PM
This is something i've been looking into as well.

I have not seen a modification for this, put the query that fetches them would probably be pretty simple.

https://vborg.vbsupport.ru/showthread.php?p=1557516

veenuisthebest
08-01-2008, 05:23 PM
is there any solution for this ??

thanks