View Single Post
  #3  
Old 03-05-2005, 11:23 AM
why-not why-not is offline
 
Join Date: Feb 2004
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Code:
navbar_style_bit
template

Code:
   <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...

Code:
	<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

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

Click >> Save


Style Manager >> Opens

Click on the template navbar

template >> navbar >> Opens

Search for this!!!

Code:
<if condition="$show['popups']">
Now Find This...

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

Code:
<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!!!

Code:
vbmenu_register("navbar_search")
Now Find This...

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

Code:
<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)

Code:
1.

varname: navbar_styles
text: Styles

2.

varname: select_styles
text: Select Style

Now the Script edits!!!

open (./global.php)

Find This...

Code:
	$quickchooserbits = construct_style_options(-1, '--', true, true);
Replace With

Code:
	$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...

Code:
	return $stylesetlist;
}
Replace With

Code:
	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
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01125 seconds
  • Memory Usage 1,803KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (15)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete