Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2009, 05:09 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default is there a way to put a description in the theme chooser rather than the current ?

is there a way to put a description in the theme chooser rather than the current theme ?

The dropdown I have (optgroup label tag), is appearing as second entry in a dropdown list ($vbphrase[quick_style_chooser]) . I want it to be the first entry instead of the actual theme.

Is it possible?
Reply With Quote
  #2  
Old 04-10-2009, 06:52 AM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump :/
Reply With Quote
  #3  
Old 04-10-2009, 03:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand what you want. Do you have an image to show what you want?
Reply With Quote
  #4  
Old 04-10-2009, 03:27 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See attachement. I took screenshot of vbulletin.com board itself at the bottom of topic lists.

By default, the name of the current running theme is shown on the box, when you click for scroll the legend of the box only appear as the second item. I want the contrary of this, I want the legend to be the selector title and the list of the available items showing next.

thanks.
Attached Images
File Type: jpg vbulletin.jpg (120.4 KB, 0 views)
Reply With Quote
  #5  
Old 04-10-2009, 03:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, if the selected style is "vBulletin 3 White Liquid", then that is what is going to show in the dropdown box. That is the way that element works in a form. If you don't want it to show the selected item, I suppose you could try modifying the option template to not show it. However, that template gets used in many places. So, perhaps you should just modify the code itself to not show selected="selected"
Reply With Quote
  #6  
Old 04-10-2009, 04:17 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Hmmm, if the selected style is "vBulletin 3 White Liquid", then that is what is going to show in the dropdown box. That is the way that element works in a form. If you don't want it to show the selected item, I suppose you could try modifying the option template to not show it. However, that template gets used in many places. So, perhaps you should just modify the code itself to not show selected="selected"
I can only see $quickchooserbits as the option display in templates.

If I go deeper, I can see it declared in global.php:
PHP Code:
if ($vbulletin->options['allowchangestyles'] AND empty($_POST['do']))
{
    
$stylecount 0;
    
$quickchooserbits construct_style_options(-1'--'truetrue);
    
$show['quickchooser'] = ($stylecount true false);
    unset(
$stylecount);
}
else
{
    
$show['quickchooser'] = false;

it been build by the function construct_style_options, your 'selected' tag is called in includes/functions.php. So I tried to duplicate the function to my own personnal customization :
PHP Code:
// myfunctions.php

function construct_style_options_myf($styleid = -1$depthmark ''$init true$quickchooser false)
{
    global 
$vbulletin$stylevar$vbphrase$stylecount;

    
$thisstyleid iif($quickchooser$vbulletin->userinfo['styleid'], $vbulletin->userinfo['realstyleid']);
    if (
$thisstyleid == AND $quickchooser)
    {
        
$thisstyleid $vbulletin->options['styleid'];
    }

    
// initialize various vars
    
if ($init)
    {
        
$stylesetlist '';
        
// set the user's 'real style id'
        
if (!isset($vbulletin->userinfo['realstyleid']))
        {
            
$vbulletin->userinfo['realstyleid'] = $vbulletin->userinfo['styleid'];
        }

        if (!
$quickchooser)
        {
            if (
$thisstyleid == 0)
            {
                
//$optionselected = 'selected="selected"';
            
}
            
$optionvalue 0;
            
$optiontitle $vbphrase['use_forum_default'];
            eval (
'$stylesetlist .= "' fetch_template('option') . '";');
        }
    }

    
// check to see that the current styleid exists
    // and workaround a very very odd bug (#2079)
    
if (is_array($vbulletin->stylecache["$styleid"]))
    {
        
$cache =& $vbulletin->stylecache["$styleid"];
    }
    else if (
is_array($vbulletin->stylecache[$styleid]))
    {
        
$cache =& $vbulletin->stylecache[$styleid];
    }
    else
    {
        return;
    }

    
// loop through the stylecache to get results
    
foreach ($cache AS $x)
    {
        foreach (
$x AS $style)
        {
            if (
$style['userselect'] OR $vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])
            {
                
$stylecount++;
                if (
$thisstyleid == $style['styleid'])
                {
                    
// $optionselected = 'selected="selected"';
                
}
                else
                {
                    
$optionselected '';
                }
                
$optionvalue $style['styleid'];
                
$optiontitle $depthmark ' ' $style['title'];
                eval (
'$stylesetlist .= "' fetch_template('option') . '";');
                
$stylesetlist .= construct_style_options($style['styleid'], $depthmark '--'false$quickchooser);
            }
            else
            {
                
$stylesetlist .= construct_style_options($style['styleid'], $depthmarkfalse$quickchooser);
            }
        }
    }

    return 
$stylesetlist;

I commented out where the 'selected' are declared.

then on my php module where I build my $quickchooserbits = construct_style_options_myf(-1, '--', true, true);

I still get a dropdown list where the legend appear when you click on it. I'm weak in php programmation, I still don't see why it doesn't work.


I also noticed that these option tags are nested in a optgroup tag, WHICH contain the label that generate the quick_style_chooser phrase legend. I can remove it, but I won't have any legends in the selector.
Reply With Quote
  #7  
Old 04-10-2009, 07:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you simply saying you don't want it to say Quick Style Chooser in the dropdown? Or are you saying you want it to say Quick Style Chooser at the top of the dropdown list (and not the actual style)? I am still totally unclear on what you want.
Reply With Quote
  #8  
Old 04-10-2009, 07:56 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Or are you saying you want it to say Quick Style Chooser at the top of the dropdown list (and not the actual style)?
^This.

I want the selector to show the legend on top of the list rather than the actual theme running under the user. When the user click on the selector, or the legend, the dropdown options are the themes available.


I almost done it. I had to do is to add an empty <option> tag with the vbphrase in it. It showing first like I tried to described, the only problem is it selectable, I wish it wasn't selectable like the original legend when it was placed second. But that's in Firefox, in IE, the selected theme still appear first.

HTML Code:
	<select  class="forumselector" name="newstyleset" id="sel_newstyleset" onchange="switch_id(this, 'style')">
		     <optgroup>
             	<option><?= echo $vbphrase[quick_style_chooser] ?> </option>
                <?php echo $quickchooserbits ?>
             </optgroup>            
	</select>
Reply With Quote
  #9  
Old 04-10-2009, 08:14 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Basically, you want to change it from this (sample):
HTML Code:
<optgroup label="Quick Style Chooser">
<option value="2" class="" >-- vBulletin Default</option>
<option value="30" class="" selected="selected">---- Testing</option>
<option value="28" class="" >-- Mobile, Cell, Phone, PDA, iPhone Style</option>
</optgroup>
To this:
HTML Code:
<option value="" class="" >Quick Style Chooser</option>
<option value="2" class="" >-- vBulletin Default</option>
<option value="30" class="" >---- Testing</option>
<option value="28" class="" >-- Mobile, Cell, Phone, PDA, iPhone Style</option>
Got rid of the optgroup, the selected statement, and added the Quick Style as a blank value as first in the option list.
Reply With Quote
  #10  
Old 04-10-2009, 08:23 PM
JonZ JonZ is offline
 
Join Date: Apr 2009
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it almost working

I need to get rid of the 'selected' popup. When users come in the page it still show the current running theme first, the legend second.


I tried to commenting out the $optionselected = 'selected="selected"'; in my myfunctions.php (see my code above) and it still have a selected theme as default showing.

HTML Code:
<select  class="forumselector" name="newstyleset" id="sel_newstyleset" onchange="switch_id(this, 'style')">
       	<option value="" selected="selected" disabled="disabled" ><?php echo $vbphrase[quick_style_chooser]; ?> </option>
   	    <?php echo $quickchooserbits; ?>
                    
</select>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:55 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.04415 seconds
  • Memory Usage 2,309KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_html
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete