Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Users Can create their own drop down list in navbar Details »»
Users Can create their own drop down list in navbar
Version: 1.00, by Michael Morris Michael Morris is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 12-15-2004 Last Update: Never Installs: 34
 
No support by the author.

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.

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 12-17-2004, 01:39 PM
SVTOA SVTOA is offline
 
Join Date: Oct 2002
Location: In a fishbowl
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have it working in 3.0.0
I'm having trouble getting this to display on the navbar in my Vbadvanced CMPS index page though. Displays fine in the forum. Any ideas?
Reply With Quote
  #13  
Old 12-17-2004, 02:38 PM
jluerken's Avatar
jluerken jluerken is offline
 
Join Date: Aug 2003
Location: Germany
Posts: 1,016
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SVTOA
I'm having trouble getting this to display on the navbar in my Vbadvanced CMPS index page though. Displays fine in the forum. Any ideas?
Yes, thats right. Its also not displaying for me in the CMPS Portal.
Would be nice if this can be fixed
Reply With Quote
  #14  
Old 12-17-2004, 02:53 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not having this problem - but my dropdown system was moved to the header template.

I guess check to make sure your cmps page isn't using a different navbar from you're forums - and that both are executing the PHPINCLUDE_START template.

Speaking of which - I intend to write a module that displays this information in vba cmps - eventually.
Reply With Quote
  #15  
Old 12-17-2004, 03:01 PM
Lottis Lottis is offline
 
Join Date: Sep 2004
Location: Norway
Posts: 299
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, but i need some help.

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.

Im not quite shure what this means. :blush:
Reply With Quote
  #16  
Old 12-17-2004, 03:54 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lottis
Sorry, but i need some help.

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.

Im not quite shure what this means. :blush:
You can read up on creating user profile fields here.

In brief, log in to your admincp and scroll down the left menu till you see "User Profile Fields" Expand that box, then click "Create New"

In the first dialog select "Multiple line text box"

On the next screen choose "2000" as the maximum length of user input, then set the last option to display on "Edit Options - Other"

Leave everything else on their defaults. When you exit this screen you'll see a list of all the availabe user profile fields. Look at you're newly create one. You'll see an id#. Note that number and plug it into the phpinclude_start script above.
Reply With Quote
  #17  
Old 12-17-2004, 03:55 PM
Guy G Guy G is offline
 
Join Date: Nov 2004
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

looks fantastic.
no queries aye?
Reply With Quote
  #18  
Old 12-17-2004, 03:57 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No queries required. The data is stored in a custom user profile field.
Reply With Quote
  #19  
Old 12-17-2004, 06:22 PM
SVTOA SVTOA is offline
 
Join Date: Oct 2002
Location: In a fishbowl
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Michael, thanks for the reply.. I use the same navbar for CMPS as I do for the forum, other links I have added work fine in both sections. I'll look a little closer and see if I can get it to work..
Reply With Quote
  #20  
Old 12-18-2004, 04:03 AM
Sooner95 Sooner95 is offline
 
Join Date: Apr 2003
Location: I don't know
Posts: 535
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i did this, but nothing changed lol I will keep looking but.. havnt had this happen before..
Reply With Quote
  #21  
Old 12-18-2004, 02:20 PM
SVTOA SVTOA is offline
 
Join Date: Oct 2002
Location: In a fishbowl
Posts: 301
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ugh, I am pulling my hair out trying to get this to work with with CMPS. I still have my old VbAdvanced index page and when I call that page in a browser the "my links" displays fine! if I call up the vBa CMPS it's no dice. There must be a way to get this to work and I am overlooking it..
Reply With Quote
Reply


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 07:10 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.05539 seconds
  • Memory Usage 2,321KB
  • Queries Executed 26 (?)
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
  • (4)bbcode_html
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete