I don't know if it would be easier to manage. On my site, I only want to add one or two more tabs and so it's no problem for me to do it the way everything is currently set up. I find it pretty simple the way it is, so I've never looked into an 'easier' method.
|
Now that I've gone through all of the work, I hope this helps someone on here. A while back, I created two new tabs (Home and Groups) over at http://www.drzforums.com, and just replicated the navlinks from the Forums navtab. The result was a set of broken links for visitors, since some of the navlinks require registration.
Today, I converted the navlinks conditional statements from the vB-specific HTML found in navheader, into the PHP required for a plug-in. Here is the plug-in code for my Groups tab: PHP Code:
|
how do you check permissions at that hook?
$cando = $permissions['myproduct'] & $vbulletin->bf_ugp['myproduct']['cando'] ? true : false; is not doing anything. edit ... found answer in blogs |
Thanks. Using this for one of my subforums (kind of like the tabs here at vB.org). However, instead of forumdisplay.php?{vb:raw session.sessionurl}2-Main-Forum I would like to generate 2-Main-Forum using the vBulletin link generator so it takes the current rewrite rules into consideration. Any ideas how I would do that?
|
Lynne can this be used to make a simple navtab with out the drop down and sub links in the lower navbar ?
thanks |
Quote:
|
thanks
|
I cannot seem to get the plugin to accept a userid in the menu. I'm probably overlooking something obvious, but here's my code:
Code:
$tablinks .= '<li><a href="tracker.php?'. $session['sessionurl'] . '&do=search&userid=' . Code:
require_once('./global.php'); Any ideas what I might be doing wrong or overlooking? Thanks :) |
Try
Code:
$tablinks .= '<li><a href="tracker.php?'. $session['sessionurl'] . '&do=search&userid=' .$vbulletin->userinfo[userid]. '"> |
Quote:
|
Hi Lynne,
I am wondering if there is anyway for me to use this great tutorial. I want to be able to use this even though I do not have a custom page, I have my forumhome split to keep style download forums out of my main forums. I have do this using a really old mod by amykhar. My forums for style downloads are located on forum.php?page=2, there isn't a this script defined anywhere so I cannot use one to get the tab higlighted or the pop-up menus to appear. This is how I have my plugin written: Code:
$tabselected = ''; http://www.styleorigin.com/vbstyles/forum.php The link navigates to the page well enough but obviously the tab doesn't higlight and the pop-up menus do not appear. I know this is because of the incorrect use of the THIS_SCRIPT, but I don't know what to use instead. Do you have any ideas please? |
@Alice. Have you tried if(THIS_SCRIPT == 'index' AND $_REQUEST['page'] == 2) ?
|
1 Attachment(s)
Hi, great site! I need some help.
When I unselect "Sections to Display in the Navbar Sub-Menu" I end up losing the Home tab. Is there any way to keep the Home tab present? It remains on every other screen (ie. when I'm in the forums - screenshots attached). My site is: www.wonderfulwaterloo.com if you want to check out the error. I imagine it has something to do with this, and I tried to play around with it but the forum stopped working. Edit Plugin Navbar: Insert CMS Navbar Entry Code:
if (defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar')) |
Quote:
|
Quote:
Appreciate all of your help... and I have all working bar one last thing... When a user lands on my home page (by clicking on the new 'HOME' button I created), the highlighted button remains as the 'FORUMS' button? If they are on the home page, I would like them to see the 'HOME' button (which is the one I created with your mod) to be highlighted. Are you able to help me work out this last aspect pls? Cheers Wormy |
If your custom tab is not getting highlighted, then you probably don't have your condition for it written correctly. As I specified, that condition MUST be unique or it won't work.
|
Hi Lynne
It is unique... and that's what's puzzling me 8| It ighlights when it mouse overs... no problem there... BUT when a user clicks on the 'Home' tab and is directed there... the 'Forums' tab still remains as the highlighted option? Does that make sense? Thanks in advance!! |
What is that unique condition?
|
Hi Lynne
Heres my code: Code:
$tabselected = ''; |
Has anyone posted how to get the 'quick links' drop down on every page yet?
|
Quote:
|
I'm going to sound slow here... but you've kind of lost me :(
I am using vBadvanced CMPS. I'm not exectly sure where I get the specific details for "THIS_SCRIPT" I've looked in the page sourece code and I can't identify anything that looks like how the page is defined? Sorry for my slow uptake on this... I doo aprreciate your help! --------------- Added [DATE]1278197941[/DATE] at [TIME]1278197941[/TIME] --------------- Bingo!! Got it!! Doh! I edited the main index page and found the "THIS_SCRIPT" and we are off and running :) Seriously... thanks SO much for your help!!! --------------- Added [DATE]1278199197[/DATE] at [TIME]1278199197[/TIME] --------------- Hi Lynne Just a quick query... now that i have that in place, is there any way of getting the default forum settings to appear 'under' the Nav? ie: * New Posts * Private Messages * FAQ * Calendar * Community o Groups o My Albums o Friends & Contacts o Member List * Forum Actions o Mark Forums Read o General Settings o Edit Profile * Quick Links o Subscribed Threads o Open Contacts Popup o View Forum Leaders o Who's Online Cheers --------------- Added [DATE]1278200287[/DATE] at [TIME]1278200287[/TIME] --------------- Another self answered question... I just recreate my own within your code!! Doh! All done :) |
This worked great for me. Thank you! :)
|
I was wondering? Is it possible for this tab to go in front of the forum tab. I'm going to call it "Home" and link it with my vbadvanced page.
If anyone can help please write back soon. |
Quote:
Quote:
|
Quote:
|
If someone is using this and has the problem that the Homepage is selected, i modiefied the first line of vbcms_navbar_link to
PHP Code:
Hope this works for you --------------- Added [DATE]1281531651[/DATE] at [TIME]1281531651[/TIME] --------------- Only one more question: I have new NavTabs to Content Sections (e.g. content?=60) called News. Below that i have sub-nav links to content?=61 "Sports", content?=62 "Travel",... Now all this works fine, all are displayed and you can follow the link. Only problem is: If i hit one of the subNavs, "News" loses the Highligthing (Selection) and none of the Navbar is selected. Is there a way to have News Selected when using one of its sublinks ? OK Got it myself PHP Code:
Thanks in advance |
Hi Lynne,
First of all thanks for all the help and the great article. Is there a way to create a new tab that links to the user's profile? For example the tab would be called "My Profile" and when the user clicks on it, it would take him to his profile as seen in member.php. On my forum, my user ID is "1", so the link would be www.myforum.com/member.php?1. But how do I do that through the plugin code? That is, how do I write a condition that only lets that tab show if the user is logged in, and to customize the link to be different for each user? I know that the vb command Code:
{vb:link member, {vb:raw bbuserinfo}} Code:
<a href="member.php?{vb:link member, {vb:raw bbuserinfo}}"> Thanks! |
No need for the member.php? in front of the variable - it contains the complete link, including the path and file.
Just try Code:
<a href="{vb:link member, {vb:raw bbuserinfo}}">{vb:rawphrase your_profile}</a> |
Quote:
Code:
http://myforum.com/member.php?1-username Code:
http://myforum.com/{vb:link member, {vb:raw bbuserinfo}} Thanks! |
You need to use php in a plugin. {vb:template stuff} is not php. You need to use actual $variables.
|
Quote:
|
If you look in the php code, then you will see how to call out stuff using php. If you want *your* userid, then it would be $vbulletin->userinfo['userid'].
|
Thanks, that worked!
Now to make it so that only logged in users can see the tab. I'm assuming $vbulletin->userinfo['userid'] returns either empty or '0' if the user isn't logged in, so an if statement should do the job (hopefully) =) --------------- Added [DATE]1281736840[/DATE] at [TIME]1281736840[/TIME] --------------- In case anyone is interested, here is the code to add to a new vBulletin plugin which will create a conditional navbar tab. If the user is logged in, it displays a tab linking to his profile. If not, it displays a tab linking to the registration page (register.php). Thanks Cellarius and Lynne for helping me figure it out! PHP Code:
|
Thank you, Lynne, for the well thought out article. I have been trying to figure this out for 2 days now. You made it easy, young lady. ;)
For anyone interested, here is all you need to make a W3C button that will check the markup validation for whatever page of the site you are currently on. PHP Code:
|
So I added a link to the user's private message inbox as a sublink to my new tab, but when I click on that it activates the "forum' tab instead of the new tab. Any ideas on what files I have to modify to get the new tab to be activated instead of the forum tab? I'm guessing I need to find a certain condition and change it?
|
It should stay with the new tab when it is clicked. Does the tab itself stay selected when you click it?
|
Quote:
I'm thinking I could add a condition to the plugin that says the new tab should be selected if THIS_SCRIPT is the inbox, but that would create a conflict and both the new tab and the forum tab would select themselves, causing a big mess. |
Any sub-link you add needs to be under the navbar button you want to user it with. Like you did with the My Profile code.
|
Quote:
http://cl.ly/20PD When I click the "My Profile" tab, it becomes selected and it shows the right sub-links. "Career Talk" is what I have renamed my "Forum" tab to. When I click on the sub-link "Inbox", though, it takes the user to the private messages page, but now the "Career Talk" tab becomes selected: http://cl.ly/20N6 And here is my code: PHP Code:
|
All times are GMT. The time now is 08:43 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|