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
  #62  
Old 01-25-2006, 07:39 PM
DrewM DrewM is offline
 
Join Date: Oct 2005
Posts: 564
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Morris does this work with 3.5?
Reply With Quote
  #63  
Old 01-27-2006, 07:13 PM
WAR WAR is offline
 
Join Date: Jan 2004
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It does not work with 3.5. Primarily because there is no longer a PHP_Include template

Code syntax for parsing bbcode has also changed in 3.5
https://vborg.vbsupport.ru/showthread.php?t=82693 <--- thread on how to parse bbcode in 3.5

I tried for awhile to get this to work, but was unsuccessful. I'd love it if someone would port this to 3.5. If they could fix the problem with parsing dynamic url's as well, then that would be even more swell.
Reply With Quote
  #64  
Old 04-16-2006, 05:22 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 sorry for the lateness in my reply, I've been tied up as of late. I'm currently working on a boards conversion for a major client but as soon as that is done I'll start doing some hack ports, probably starting with this one.
Reply With Quote
  #65  
Old 07-26-2006, 07:53 PM
sybakaos sybakaos is offline
 
Join Date: Mar 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I like this hack, thumbs up!

The problem:
When inserting links with the & character (post link for example) and then visit that page from within the quick links menu it brings you there. If you visit that link again, that particular post shows your "my links" links in the post area instead of the original post content (edit, save post fixes this until you visit the my links link again). I think it could be omitted by parsing the & character differently perhaps?

The request:
Could you add a javascript to each post (thread) so users can click it to add that link to their my links menu?
Reply With Quote
  #66  
Old 07-28-2006, 07:15 AM
sybakaos sybakaos is offline
 
Join Date: Mar 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Let me rephrase the problem,

The content of a post is replaced by the mylinks url's if that post appears in your mylinks due to the bbcodeparse.
Reply With Quote
  #67  
Old 07-30-2006, 05:23 PM
beano33 beano33 is offline
 
Join Date: Feb 2003
Posts: 124
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sybakaos
Let me rephrase the problem,

The content of a post is replaced by the mylinks url's if that post appears in your mylinks due to the bbcodeparse.
I ran into that problem too when we updated from 3.0.3 to 3.0.11 and had to remove mylinks. I'd reinstall it if it were ported it to 3.6.
Reply With Quote
  #68  
Old 09-11-2006, 05:52 PM
sybakaos sybakaos is offline
 
Join Date: Mar 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sybakaos
Let me rephrase the problem,

The content of a post is replaced by the mylinks url's if that post appears in your mylinks due to the bbcodeparse. It's due the & character which get's parsed weirdly?
Please, any help?

I partially prevented that from happening by replacing & with %26 (ascii), but that's not the best solution......
Reply With Quote
  #69  
Old 02-12-2007, 04:31 PM
WAR WAR is offline
 
Join Date: Jan 2004
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did anyone ever get this working on 3.6.x ?
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:14 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.04430 seconds
  • Memory Usage 2,302KB
  • 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
  • (2)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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