The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Users Can create their own drop down list in navbar Details »» | |||||||||||||||||||||||||||
Users Can create their own drop down list in navbar
Developer Last Online: Jun 2009
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']"> 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> HTML Code:
<!-- / NAVBAR POPUP MENUS -->
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> PHP Code:
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
|
Comments |
#22
|
|||
|
|||
I have been comparing the code between vBAdvanced homepage and VBA CMPS, and began to play with the index.php files for both. I took this bit of code from vbAdvanced homepage:
Code:
if ($vboptions['home_navbar']) { 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]</strong>" ), 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[hometitle]</strong>" ), $navbar); } Code:
require_once('./global.php'); The ratio of php-to-mysql and page load time changed very little, if any. I get no errors either. Is this an acceptable fix or have I introduced bad code into the CMPS page? |
#23
|
|||
|
|||
Quote:
"Maximum Input (Input, Textarea only) This setting is how many characters a user is allowed to enter into this field. This can be any number between 1 and 250." Nice idea but it's not working out like I had hoped. |
#24
|
||||
|
||||
Quote:
|
#25
|
|||
|
|||
And that query would be?
|
#26
|
||||
|
||||
Testing it now - Such things can royally mess up a board if done incorrectly
BTW, 3.0.3 allows you to set any length. |
#27
|
||||
|
||||
The correct query is..
ALTER TABLE userfield MODIFY COLUMN fieldX TEXT You need to change fieldX to the actual field # you're going to use. PS you can use this script to up the lengths of the other profile fields, such as biography, if you want. |
#28
|
|||
|
|||
Thank you for the followup, if this works then the hack becomes extremely useful to me and my members. Will check back in a bit.
|
#29
|
|||
|
|||
Nice Michael.
Along the same lines as the msg I sent you, just got to figure out how to get the actual links to work in the profile view if other members look at it. I know I could keep it a private field, but whats the fun in that. |
#30
|
|||
|
|||
BRAVO!!!! Worked perfectly!!! Much appreciated!!!!
SVTOA clicks *INSTALL* |
#31
|
||||
|
||||
Michael, very nice hack. Installed it today and it went smoothly. However, I have the "Links Directory v1.0.0 RC3" by vBadvanced installed on my forum. All of the "links" directory scripts call for their links_config.php file, which in turn calls for the vbulletins' global.php file, where the PHPINCLUDE_START is called. The "links" templates also call for the vbulletin $navbar. But the "My Links" drop down does not show when you go to the Links Directory Pages. I suspect it has to do with the PHPINCLUDE_START not being called apon correctly in the "links" files, but I'm not sure. I'm not getting any errors. The "Links Directory" files are in a separate directory within my main forum directory.
/home/vbforum/links See the two attachments. Any clue where to start looking? Thanks, John |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|