vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do I create a alphabetical search menu (https://vborg.vbsupport.ru/showthread.php?t=182445)

veenuisthebest 06-14-2008 07:31 AM

How do I create a alphabetical search menu
 
1 Attachment(s)
hii..

plz see the screenshot

https://vborg.vbsupport.ru/attachmen...2&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.

PHP Code:

$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) . '&' '';
    
$sortaddon .= ($urladd != '') ? $urladd '';

    
$sortaddon preg_replace('#&$#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.

PHP Code:

    // 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&gsearch=".$letter."&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.

Quote:

Originally Posted by Dismounted (Post 1557516)
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


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01068 seconds
  • Memory Usage 1,767KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete