Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

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
  #32  
Old 12-28-2004, 12:56 PM
MikaK's Avatar
MikaK MikaK is offline
 
Join Date: Nov 2004
Location: Helsinki, Finland
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

*click*
Reply With Quote
  #33  
Old 12-28-2004, 01:59 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wirewolf
................................... Any clue where to start looking?
Thanks, John
After looking again at the code again (after getting a nights sleep) I think I found the answer. In the code for includes/functions_links.php around line 398:
Quote:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox;
I added $mylinks to the one line:
Quote:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox, $mylinks;
The "My Links" now shows in the navbar when going to my "Links Directory" Pages. The only thing I'm not sure of is in the rest of the code in the Construct Navbar section:
Quote:
if (!empty($navbits))
{
$navbits = construct_navbits($navbits);
}
eval('$navbar = "' . fetch_template('navbar') . '";');

$navbar = str_replace(
array(
'"memberlist.php',
'"usercp.php',
'"register.php',
'"faq.php',
'"calendar.php',
'"search.php',
'"login.php',
'"forumdisplay.php',
'"profile.php',
'"private.php',
'"subscription.php',
'"member.php',
'"online.php',
'"clientscript',
'\'misc.php',
$vboptions['bbtitle'],
'"' . $vboptions['forumhome'] . '.php'
),
array(
'"' . $vboptions['bburl'] . '/memberlist.php',
'"' . $vboptions['bburl'] . '/usercp.php',
'"' . $vboptions['bburl'] . '/register.php',
'"' . $vboptions['bburl'] . '/faq.php',
'"' . $vboptions['bburl'] . '/calendar.php',
'"' . $vboptions['bburl'] . '/search.php',
'"' . $vboptions['bburl'] . '/login.php',
'"' . $vboptions['bburl'] . '/forumdisplay.php',
'"' . $vboptions['bburl'] . '/profile.php',
'"' . $vboptions['bburl'] . '/private.php',
'"' . $vboptions['bburl'] . '/subscription.php',
'"' . $vboptions['bburl'] . '/member.php',
'"' . $vboptions['bburl'] . '/online.php',
'"' . $vboptions['bburl'] . '/clientscript',
'\'' . $vboptions['bburl'] . '/misc.php',
iif($vba_options['links_navbarhomelink'], $vboptions['hometitle'], $vba_options['links_title']),
'"' . iif($vba_options['links_navbarhomelink'], $vboptions['homeurl'], $vba_options['links_homeurl'])
), $navbar);
return $navbar;
}
}
Would any changes have to be made in this section too? I know this coding comes from vbadvanced, but I'm just asking as a general coding question.
John
Reply With Quote
  #34  
Old 12-28-2004, 04:40 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 don't think so - but I'm soon to find out. I have to install vbadvanced links directory to ENWorld next month I'll let you know if I hit any snags.
Reply With Quote
  #35  
Old 12-28-2004, 06:01 PM
wirewolf's Avatar
wirewolf wirewolf is offline
 
Join Date: Jun 2004
Location: New York City
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got an answer from Brian over at vbadvanced. Everything in your coding is fine. The includes/functions_links.php constructs the navbar. The links scripts read the PHPINCLUDE_START template but you have to include $mylinks in the global line and then the "My Links" shows in the navbar on the links directory pages. The only changes in the array section would be if a user did not write in a full url path in the My Links text box. Such would be the case as in [ post=475]Post #475[/post]. The url would show in the "Directory" navbar with the "links directory folder in front of showthread.php - /links/showthread.php etc.. of course being wrong. One fix is to include showthread.php in the array:
Try replacing that function in includes/functions_links.php with this:
Quote:
// ##################### Construct Navbar #################################
if (!function_exists('construct_adv_navbar'))
{
function construct_adv_navbar($navbits, $index = 'false')
{
global $vboptions, $vba_options, $vbphrase, $stylevar, $bbuserinfo, $show, $pmbox, $mylinks;

if (!empty($navbits))
{
$navbits = construct_navbits($navbits);
}
eval('$navbar = "' . fetch_template('navbar') . '";');

$navbar = str_replace(
array(
'"memberlist.php',
'"usercp.php',
'"register.php',
'"faq.php',
'"calendar.php',
'"search.php',
'"login.php',
'"forumdisplay.php',
'"profile.php',
'"private.php',
'"subscription.php',
'"member.php',
'"online.php',
'"clientscript',
'\'misc.php',
'"showthread.php',
$vboptions['bbtitle'],
'"' . $vboptions['forumhome'] . '.php'
),
array(
'"' . $vboptions['bburl'] . '/memberlist.php',
'"' . $vboptions['bburl'] . '/usercp.php',
'"' . $vboptions['bburl'] . '/register.php',
'"' . $vboptions['bburl'] . '/faq.php',
'"' . $vboptions['bburl'] . '/calendar.php',
'"' . $vboptions['bburl'] . '/search.php',
'"' . $vboptions['bburl'] . '/login.php',
'"' . $vboptions['bburl'] . '/forumdisplay.php',
'"' . $vboptions['bburl'] . '/profile.php',
'"' . $vboptions['bburl'] . '/private.php',
'"' . $vboptions['bburl'] . '/subscription.php',
'"' . $vboptions['bburl'] . '/member.php',
'"' . $vboptions['bburl'] . '/online.php',
'"' . $vboptions['bburl'] . '/clientscript',
'\'' . $vboptions['bburl'] . '/misc.php',
'"' . $vboptions['bburl'] . '/showthread.php',
iif($vba_options['links_navbarhomelink'], $vboptions['hometitle'], $vba_options['links_title']),
'"' . iif($vba_options['links_navbarhomelink'], $vboptions['homeurl'], $vba_options['links_homeurl'])
), $navbar);
return $navbar;
}
}
I tried the changes above and they work. But it might be just as easy to have users enter the full url path. Most of mine aren't too good with bbcodes anyway. So I just left in the global line - $mylinks, instructed my users to put in the full url path and everything is working fine.
BTW Michael - you may find other scripting problems in the vbadvanced links program where the links directory folder is placed in front of a typical forum file path - /forum/links/member.php? for example. Look in any array section in the links php files (like browslinks.php, showlink.php, misc.php, etc) that deal with a forum function(member.php is one). Had that problem when I first installed "Links Directory". Brian has cleaned up a lot of the code, but you may hit a snag.
Thanks and have a Happy New Year!!
John
Reply With Quote
  #36  
Old 01-21-2005, 06:45 PM
nautiqeman nautiqeman is offline
 
Join Date: Jan 2003
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having a simliar problem in the vba Gallery -- I put in the steps above (but of course reflected for the gallery portion), but for some reason, it's not showing up. Any ideas??
Reply With Quote
  #37  
Old 02-02-2005, 11:24 AM
jamesyfx jamesyfx is offline
 
Join Date: Jan 2005
Location: Manchester, UK
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

I'm wondering, would it be possible for an option to click an "Add to Links" button in threads, so it would add a link to the thread to your menu?

A member of my team suggested it, I think it could be useful.. but I don't know how to do it myself.
Reply With Quote
  #38  
Old 02-11-2005, 11:14 PM
OrangeFlea OrangeFlea is offline
 
Join Date: Aug 2004
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can't get it to show on my navbar. I'm not running Vbadvanced. What's the deal?
Reply With Quote
  #39  
Old 02-12-2005, 10:06 AM
mikexxx mikexxx is offline
 
Join Date: Aug 2004
Posts: 60
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If i use this link:

PHP Code:
[url=http://www.vbulletin.com/search.php?do=getdaily&days=7]7 Dagen[/url] 
This is the link when i use it:

PHP Code:
http://www.vbulletin.com/search.php?do=getdaily&amp;days=7 
The & (replaced by: &amp is not in the link. Is there a solution for this?
Reply With Quote
  #40  
Old 02-13-2005, 03:33 PM
OrangeFlea OrangeFlea is offline
 
Join Date: Aug 2004
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use vB 3.0.3 without the vbadvanced hack. I entered the information exactly as outlined in the instructions and read every single post in this thread even remotely related to my dilemma, but the link is just not appearing on my navbar.

Can someone -- anyone -- help?
Reply With Quote
  #41  
Old 02-14-2005, 03:38 AM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check to make sure there isn't a parse error in your PHPINCLUDE_START template. To do this, put this in your footer.

$phpinclude_output

Then, if there's a parse error, it will appear in your footer.
Reply With Quote
Reply

Thread Tools

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 03:15 AM.


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.05390 seconds
  • Memory Usage 2,333KB
  • 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
  • (3)bbcode_php
  • (5)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
  • (4)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