I added a bit more to the first post including the part about going to the Plugin Manager. However, this article really isn't for the total novice. You need to understand what a condition is and be able to write one.
|
I looked but did not find the answer. How do you add a phrase in this code for Sublink 1?
<li><a href="sublink1.php">SubLink 1</a></li> I tried ' . $vbphrase['my_phrase'] .' I tried {vb:rawphrase my_phrase} never mind ... I needed to globalize it |
What ever level we understand coding Lynne should not matter, I accept my understanding of coding needs improvement, but that's not the point. We are trying to get our heads around vB4, which is no walk in the park and we look to people like yourself for help. You do a fantastic amount of good here and I personally truly appreciate that, but clear and straight forward guides help more than being told we lack understanding.
To cellarius, I apologise, I find myself enduring a great deal of keyboard warriors here and there and I mistook your post as yet another jibe from another coward hiding behind a keyboard. Didn't mean to be offensive and I am sorry for offending you. |
Neither did I want to mock you or anything, sorry for perhaps coming off like that - so, we're good here :)
Anyway, I really see where you are coming from, I learned a lot from tutorials like this very one. I understand what you mean, but it is always about finding a middle way in texts like this. There's some basics you need to build upon if you want to do some in-depth explaining, or the tutorials would get overly complex. There's other articles about the plugin system, and even a section in the manual. If one had to explain that every time again, the articles would be cluttered. Finding this middle way is not always easy, tho, and you won't be able to need everyones needs :o |
How can we change the display order of the navbar. Meaning put new items(per this tutorial), so that they show between "blogs" and "whats new"
|
Quote:
|
Lynne,
Thanks for this awesome guide. So I'm trying to hide the tab from people not logged in. Also I only want some user groups to see it. This is what I have so far. PHP Code:
--------------- Added [DATE]1258564039[/DATE] at [TIME]1258564039[/TIME] --------------- Woot I just fixed it. I put the if statement above the global and it works. Doesn't matter about the member part now. Because if they are not part of the right group it won't even show up. :-) So here is my answer: PHP Code:
|
You really should have { and } around the whole thing after your if is_member_of statement. Right now, you are basically just saying if is_member_of then make the $template_hook global, which is needed right now for this plugin to work. If they fix the issue of the $template_hook not being global, then suddenly your plugin isn't going to work because it will be made global elsewhere and therefore work.
|
Ok so something like this?
PHP Code:
|
Yes, that looks correct - you have the content of the whole plugin in the condition now.
Hello Kallell! Now I recognize you. :) |
Quote:
What about if I want to add two tabs? with one unblocked and the other one set to usergroups. Would it be like this: PHP Code:
|
Quote:
|
Quote:
-edit- i've just removed #navtabs li.selected a.navtab from vbulletin-chrome.css, the navigation structure doesn't make sense. when vbull combined with CMS, features such as calendar, FAQ, photo gallery, friends, group should be global and not under the forum section. they should have it's own link at the parent navigation bar. now i will just manually add navigation links from the template, hope vbull developer will fix this in the future. |
Hello all! I am puzzled. I tried to adopt this with the following code to link to our store on our site.
PHP Code:
Any help? (I'm not the best in PHP coding...so I appreciate a layman's explaination if possible.) |
Is "https://www.scsimulations.com/store/" this a page your wrote yourself? Does it have a line at the top that defines THIS_SCRIPT as STORE like this?
PHP Code:
|
It sure is....and it wasn't activated...:eek:
Its always the simplest solution. Appreciate it! |
First off, great article it's really helped me in getting my test site going. Is there a way that anyone knows of to have a specific navtab show as selected if a certain article is showing. Basically I guess what i'd need to do is set what the script id is for a specific article. Any ideas?
|
I am not familiar enough with the new cms to know the answer to that question. You would, however, have to actually do some modifying to some code somewhere since the condition is already set that if you are in the cms, then the Home tab is selected. So, you'd have to change that code to say "if in cms except this article, then the Home tab is selected".
|
Lynne, I have thehack working but would love to have a sub link on the sub link as you have tab saying Tech with a link saying Carburetors then you have Cleaning Carbs and Jetting. so you would have
Tech>Carbs>cleaning Carbs and Tech>Carbs>Jeting Menu would look like Carbs Cleaning Jetting What would code be? |
Quote:
|
1 Attachment(s)
Thanks for the quick reply... Great article. In the attachment you can see that I have it working. What I am looking to do is add a sub menu to the sub menu. I have the Tech Area tab then the sub menu that has Carbs trying to add a sub menu to carbs so it will have Cleaning link and Jetting link. So basically making when you click on carbs it does not take you to Carbs.php but opens a sub menu that would have links to jetting.php and Cleaning.php
Thanks Eric PHP Code:
|
I don't know how to add a submenu to a submenu as I haven't tried to do that. You'll have to play with the css to do that.
|
Is there any way to use vb if statements with this mod?
I tried wrapping certain links under the custom tab in the Code:
<vb:if condition="$show['modcplink']"> but it completely breaks this plugin, you get a Quote:
Does perhaps some other function have to be called in either this or the .php page in question? (I'm using the custom php page Lynne posted an article on in conjunction with this plugin) the same vb if statement works if I put it elsewhere within a template that apears on the page, but I would like the link in question to be in the navbar and not in the body. |
This post shows how to use conditions to add the links - https://vborg.vbsupport.ru/showpost....6&postcount=28 See if that helps.
|
I actualy tried that way of doing it too, what happens if with is, the if conditional just gets put in the navbar as plain text, as if vb is not seeing it as a conditional. I notice the syntax highlighting on the plug code input page also doesn't color the extra if statement in green like the if statement at the top for the 'this_script ==' one.
Here's my complete code for the navtab plugin: Code:
$tabselected = ''; Only difference I can see in the example you gave and my version, is I'm trying to hide an entire popup control to non admins, your example just tries to hide a link. |
I'd suggest you start over with the plugin because you've totally messed up the structure of the submenu.
The reason why you are ending up with the condition showing up in the code is because you are putting it there. Look again at the code I wrote. You need to *end* your writing to the variable $tablinks, then do the condition and add to $tablinks if the condition is true, and then continue writing to it later on. But, you need to break out of writing to it in order to do the condition - you just put the condition right in the middle of it! Basically: PHP Code:
|
Quote:
Quote:
Thanks again. |
Quote:
|
I did everything you said in the first post, and it works perfectly. There is only one thing I can't figure out.
If I click the links below the button, link1.php for example, it doesn't keep that button selected. It highlights the forum button again. Is there anyway I can put multiple "yourpage" names in that code so it keeps the button highlighted even when going to a page by clicking a link below the button? if (THIS_SCRIPT == 'yourpage') --------------- Added [DATE]1259795597[/DATE] at [TIME]1259795597[/TIME] --------------- NVM fixed it |
1 Attachment(s)
I fixed the first issue I had, but I have another question. In my images you can see what I mean.
I want the second image, the affiliate one, to show home in front of it as well. Just like in the first image. How can I change that? Like it says: Home > Frontpage And the other one only says: Affiliates |
Quote:
|
I made a new thread about this. If you can help me please go here:
https://vborg.vbsupport.ru/showthrea...54#post1924354 |
Okay, so I was able to add a link to the navbar with this tutorial. But when I click on the link I just got white page and not the result you have in the screenshot. I tried to add link.php from your other tutorial, but it didn't change anything. What am I doing wrong? Sorry for the noob question (:
Edit: Aah, nevermind. In the link.php I was using caps for the template name like in the test.php. Didn't realize it was the template name I created until now that I rechecked the code. |
This sounds like a problem from your custom page, not this tutorial. You should ask questions about the custom page in the other article, not here (it gets confusing if you mix up articles and problems).
|
Do you have to create your own vBulletin page to use this? I created a section and am trying to use this tutorial to go to that section, yet I can't get the navbar to highlight. Here is the code as I have it now (I removed the submenu link code):
Code:
$tabselected = ''; |
No, you do not need to create your own vB page to use it. Right now, your code shows that your tab should be selected when you are on a page where THIS_SCRIPT is defined as podcast. Perhaps you meant to use something like this instead?
PHP Code:
|
Quote:
Code:
if (THIS_SCRIPT == 'podcast') Code:
if ($_REQUEST['do'] == 'podcast' Maybe that's where I'm getting confused. How do you define a page as something like 'podcast'? |
If you replaced it with exactly what you wrote, then yes, you will get a parse error because you are missing the end parenthesis.
At the top of each vb page is something like this: PHP Code:
|
Quote:
|
Quote:
17 in the online.php page. And line 17 of the forum.php page defines THIS_SCRIPT for that page to be 'index'. And for content.php, THIS_SCRIPT is defined at 'vbcms'. I believe any page in vb that you can land on has got THIS_SCRIPT defined at the top. And you don't want to replace those lines, I'm not sure why you would think you would want to do that. Those lines are there so you can write conditions like the one I use for when you are on that page. If you wrote your own page, you would give it your own definition for THIS_SCRIPT. |
All times are GMT. The time now is 04:28 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 | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|