PDA

View Full Version : Quick Style Choose via button


Sin City
02-17-2005, 05:42 AM
ok i've seen the "quick style chooser" edit which makes the drop down.... but can someone tell me how i'd go about setting up the same kind of quick style chooser, but by process of a button to be placed with "User CP, Home, FAQ" etc. buttons at the top of the forums that when clicked would make the list drop down like, for example, the search feature does?.... thanks in advance :smoke:

Sin City
03-04-2005, 09:49 PM
bump :o

why-not
03-05-2005, 11:23 AM
Hi

You will not be able to do this with just template edits! The reason why is that the template 'option' is used by many of the other templates to create drop boxes! You could hard code each of the styles in the 'navbar' template, but what good is that if you change style order or add new styles!

Here is quick mod.....

Follow me...

Open Admin Panel


Go to Styles & Templates >> Style Manager

In the the select box for the style you want to add "NAVBAR STYLE SELECTOR", select Add New Template

When the new template page opens, add the following!


title

navbar_style_bit

template


<tr>
<td class='vbmenu_option' style='white-space : nowrap'><if condition="$httptype"><a href='$httpurls'>$httplink</a><else /><strong>$httplink</strong></if></td>
</tr>


Save it...

Go to Styles & Templates >> Search in Templates


Search in Style: select the stle you are adding "NAVBAR STYLE SELECTOR",

Search for text: chooser

Click >> Find

Style Manager >> Opens

Click on the template footer

template >> footer >> Opens

Click on the Find button

Now Find This...

<if condition="$show['quickchooser']">
<td class="tfoot">
<select name="styleid" id="ressel" onchange="switch_styleid(this)">
<optgroup label="$vbphrase[quick_style_chooser]">
$quickchooserbits
</optgroup>
</select>
</td>
</if>

Replace With

<td class="tfoot">&nbsp;</td>


Click >> Save


Style Manager >> Opens

Click on the template navbar

template >> navbar >> Opens

Search for this!!!

<if condition="$show['popups']">

Now Find This...

<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->

Replace With

<if condition="$show['popups']">
<!-- NAVBAR POPUP MENUS -->
<if condition="$show['quickchooser']"><!-- s / header styles changer -->
<div class='vbmenu_popup' id='navbar_styles_menu' style='display : none'>
<table cellpadding='4' cellspacing='1' border='0'>
<tr>
<td class='thead' align='center'>$vbphrase[select_styles]</td>
</tr>
$navbarstylesbits
</table>
</div>
<!-- e / header styles changer --></if>

Search for this!!!

vbmenu_register("navbar_search")

Now Find This...

<script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</if>

Replace With

<script type="text/javascript"> vbmenu_register("navbar_search"); </script></td>
</if>
<if condition="$show['quickchooser']"><td id="navbar_styles" class="vbmenu_control"><a name='vb_styles' accesskey='5'>$vbphrase[navbar_styles]</a><script type='text/javascript'> vbmenu_register('navbar_styles');</script></td></if>

Click >> Save

Go to Languages & Phrases >> Phrase Manager

Phrase Type GLOBAL (add (2) new phrases)


1.

varname: navbar_styles
text: Styles

2.

varname: select_styles
text: Select Style



Now the Script edits!!!

open (./global.php)

Find This...

$quickchooserbits = construct_style_options(-1, '--', true, true);

Replace With

$quickchooserbits = construct_style_options(-1, '--', true, true);
$navbarstylesbits = navbar_styles_builder ( $session[sessionurl], $vboptions['styleid'] );

Save changes, close './global.php'

open ( ./includes/functions.php)

Find This...

return $stylesetlist;
}

Replace With

return $stylesetlist;
}


function navbar_styles_builder ( $sess, $csid )
{
$out = '';

if ( is_array ( $GLOBALS['stylechoosercache'][-1][1] ) )
{
$cs = $GLOBALS['stylechoosercache'][-1][1];

for ( $i = 0; $i < sizeof ( $cs ); $i++ )
{
if ( $csid != $cs[$i]['styleid'] )
{
$httptype = true;
}
else
{
$httptype = false;
}

$httpurls = $_SERVER['PHP_SELF'] . "?" . $sess . "styleid=" . $cs[$i]['styleid'] . "#style";
$httplink = $cs[$i]['title'];

eval ( '$out .= "' . fetch_template ( 'navbar_style_bit' ) . '";' );
}
}
return ( $out );
}


Save changes, close './includes/functions.php'


You now have NAVBAR STYLE SELECTOR installed


C, ya...

Sonia

Sin City
03-05-2005, 06:44 PM
i was starting to think i'd never get help, but after checking out the number of steps, i see why no one wanted to tackle it lol.... once i get home i am definitely going to get cracking on your steps.... thank you for the reply why-not.. i appreciate it greatly :)