vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   is there a way to put a description in the theme chooser rather than the current ? (https://vborg.vbsupport.ru/showthread.php?t=210678)

JonZ 04-08-2009 05:09 PM

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?

JonZ 04-10-2009 06:52 AM

bump :/

Lynne 04-10-2009 03:00 PM

I don't understand what you want. Do you have an image to show what you want?

JonZ 04-10-2009 03:27 PM

1 Attachment(s)
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.

Lynne 04-10-2009 03:47 PM

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"

JonZ 04-10-2009 04:17 PM

Quote:

Originally Posted by Lynne (Post 1788287)
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.

Lynne 04-10-2009 07:48 PM

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.

JonZ 04-10-2009 07:56 PM

Quote:

Originally Posted by Lynne (Post 1788430)
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>


Lynne 04-10-2009 08:14 PM

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.

JonZ 04-10-2009 08:23 PM

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>



All times are GMT. The time now is 02:44 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.02224 seconds
  • Memory Usage 1,792KB
  • 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
  • (4)bbcode_html_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete