![]() |
Users Can create their own drop down list in navbar
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 --> HTML Code:
<if condition="!empty($mylinks)"> HTML Code:
<!-- / NAVBAR POPUP MENUS --> HTML Code:
<if condition="!empty($mylinks)"> 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. |
Sounds cool. A screenshot would be nice.
|
Thank you Michael Morris, I may use this ;)
|
Quote:
Note, minor glitch found for RC4 - you can't have user input fields beyond 500 characters or so (odd). I presume this is fixed in later versions. |
Could this be domain specific (ie it can only be your domain they link to?
|
Not without major recoding. This simply takes advantage of an existing vbulletin mechanic (the url tag) and uses it to create the links for a new feature.
|
Quote:
|
nice hack
|
works nicely. Only thing I've found is that if you don't put bb codes in that box correctly, it can make your browser hang up. Otherwise, nice addition.
|
Nice Hack!!!!!!!!
(cool, you're from Enworld? We have our banner on your webring. That's awesome.) |
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? |
Quote:
Would be nice if this can be fixed :D |
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. |
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: |
Quote:
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. |
looks fantastic.
no queries aye? |
No queries required. The data is stored in a custom user profile field.
|
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..
|
i did this, but nothing changed lol I will keep looking but.. havnt had this happen before..
|
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.. :(
|
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']) 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? |
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. :( |
Quote:
|
And that query would be?
|
Testing it now - Such things can royally mess up a board if done incorrectly :)
BTW, 3.0.3 allows you to set any length. |
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. |
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.
|
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. :p |
BRAVO!!!! Worked perfectly!!! Much appreciated!!!!
SVTOA clicks *INSTALL* |
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 |
*click*:)
|
Quote:
Quote:
Quote:
Quote:
John |
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.
|
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:
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 |
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??
|
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. |
I can't get it to show on my navbar. I'm not running Vbadvanced. What's the deal?
|
If i use this link:
PHP Code:
PHP Code:
|
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? |
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. |
All times are GMT. The time now is 05:40 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|