Back to vBulletin 3.0 Add-Ons

Users Can create their own drop down list in navbar
Mod Version: 1.00, by Michael Morris

This modification is in the archives.
vB Version: 3.0.3 Rating: (0 vote - 0 average) Installs: 34
Released: 17 Dec 2004 Last Update: Never Downloads: 2
Not Supported  

This hack is part of Lesson #6 of my Using the PHPINCLUDE_START template" tutorial thread. It is presented here individually. While techinically a user feature, it is put here with mini-mods since it requires no code edits. Instead you have 2 template edits: navbar and phpinclude_start. You must also add a user profile field.

For a more complete explaination of the code please visit the tutorial thread.

AND NOW THE HACK...

To begin create a user profile field that is multiple text lines and has a character limit of at least 2000. Note the user profile field # the system assigns to the new field - you'll need it below.

Once you do that crack into your navbar and look for this code:

HTML Code:
			<!-- nav buttons bar -->
				<div align="center">
					<table class="thead" cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
						<tr align="center">
							<if condition="$show['popups']">
Immediately after add.

HTML Code:
								<if condition="!empty($mylinks)">
									<td id="mylinks" class="vbmenu_control"><a href="#mylinks">My Links</a> <script type="text/javascript"> vbmenu_register("mylinks"); </script></td>		
								</if>
Next look for this code in the navbar

HTML Code:
	<!-- / NAVBAR POPUP MENUS -->
Immediately above it insert the following code

HTML Code:
<if condition="!empty($mylinks)">
<!-- My Links Menu -->
	<div class="vbmenu_popup" id="mylinks_menu" style="display:none"> 
 		<table cellpadding="4" cellspacing="1" border="0"> 
			$mylinks
		</table> 
	</div>
<!-- /My Links -->
</if>
Now insert the following into PHPINCLUDE_START at either the very start or the very end.

PHP Code:
if (!empty($bbuserinfo['fieldX']))
    {
    require_once(
'./includes/functions_bbcodeparse.php');
    
$mylinks parse_bbcode2($bbuserinfo['fieldX'], 0001);
    
$mylinks str_replace('<br />'''$mylinks);
    
$mylinks str_replace('</a>''</a></td></tr>'$mylinks);
    
$mylinks str_replace('<a''<tr><td class="vbmenu_option"><a'$mylinks);    
    } 
You will need to plug the correct user profile field # into the spot occupied by "fieldX" above. So if your new profile field created above was field #9 you'd refer to $bbuserinfo['field9']

And with that you're done. Enjoy.

Compatibility Note
If you are running a version of vbulletin prior to version 3.0.3 you'll need to run a database query in order to have field lengths longer than 250 characters. This query is:

ALTER TABLE userfield MODIFY COLUMN fieldX TEXT

You'll need to change fieldX to the field# appropriate to your forums.

Download

No files for download.

Supporters / CoAuthors

  • Michael Morris

Screenshots

   


vblts.ru supports vBulletin®, 2022-2024