vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=226914

Lynne 08 Dec 2009 01:59

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?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


thunderclap82 08 Dec 2009 02:13

Quote:

Originally Posted by Lynne (Post 1927055)
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?

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

So I should replace


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I tried this but get a PARSE error.

Maybe that's where I'm getting confused. How do you define a page as something like 'podcast'?

Lynne 08 Dec 2009 03:17

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That defines the page name. So, if you are going to have the tab highlight because you are on a specific page, that is the best method to use. But, you can use other valid conditions also as long as they don't interfere with the conditions to have another tab highlighted.

thunderclap82 08 Dec 2009 04:28

Quote:

Originally Posted by Lynne (Post 1927082)
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That defines the page name. So, if you are going to have the tab highlight because you are on a specific page, that is the best method to use. But, you can use other valid conditions also as long as they don't interfere with the conditions to have another tab highlighted.

Maybe I wasn't clear. Where do I find the pages where I need to replace the 'define'? I know you said at the top of every vB page, but where do I find those? Sorry if this is a novice question.

Lynne 08 Dec 2009 05:03

Quote:

Originally Posted by thunderclap82 (Post 1927098)
Maybe I wasn't clear. Where do I find the pages where I need to replace the 'define'? I know you said at the top of every vB page, but where do I find those? Sorry if this is a novice question.

Did you look at any of the pages? The line I quoted in my last post is line
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.

thunderclap82 08 Dec 2009 05:15

I'm sorry if I'm making this out to be more complicated than it needs to be, but I must be missing something. Here is your code from the first page:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I replaced 'yourpage' with 'podcast', and 'unique_name' with 'podcast'. I also changed the 'Nav Link' href and name at the bottom of the script to look like:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

It appears to me that these are the only changes required. What I don't understand is where I'm suppose to find the define('THIS_SCRIPT', '<name>');. You said it's at the top of the page, so I went to the actual podcast CMS page I created and looked at the Page Source in my browser but this code doesn't exist. So where is it located?

Lynne 08 Dec 2009 06:07

THIS_SCRIPT is defined at the top of the php page, not some browser page, but in the actual code. Open up the file called forum.php that you downloaded from vbulletin.com to install on your server and you will see the line I am talking about.

I don't think (or rather, I don't know of the condition) you can do this for a CMS page. All those pages are using the content.php page and right now, if you are on a content.php page, the Home link is highlighted. I don't know what the condition is for a particular Article, which is what it sounds like you want to do. You'd have to look in through the code to figure that out and I haven't got that far into the CMS yet.

thunderclap82 08 Dec 2009 15:59

So you're saying I do need to create a custom vBulletin page, and this NavBar technique can't work with a CMS created page, right?

Lynne 08 Dec 2009 16:04

Quote:

Originally Posted by thunderclap82 (Post 1927271)
So you're saying I do need to create a custom vBulletin page, and this NavBar technique can't work with a CMS created page, right?

No, you don't need to create a custom page. That condition I posted is an EXAMPLE of a condition to use. Most people will use THIS_SCRIPT as the condition. But, you could use forumids or threadids or who-knows-what-else - as long as the condition is UNIQUE. And, I don't know that it won't work on a CMS created page. It probably could if you find the correct unique condition. I simply don't know what that condition would be since I haven't looked that closely into the CMS pages and the attributes that are passed to them.

Vaupell 15 Dec 2009 11:03

1 Attachment(s)
Lovely it works like a charm, lynne to the rescue ;)

:D

I.am 16 Dec 2009 10:37

It work in RC2?? because the selected function and the drop down menu doesn't appear for me.

Lynne 16 Dec 2009 17:33

Quote:

Originally Posted by I.am (Post 1931568)
It work in RC2?? because the selected function and the drop down menu doesn't appear for me.

Worked fine for me in RC2 and in the current version, RC4.

I.am 16 Dec 2009 20:09

on my RC2 the function selected doesn't work....

Lynne 17 Dec 2009 00:08

Quote:

Originally Posted by I.am (Post 1931800)
on my RC2 the function selected doesn't work....

Then you probably don't have your condition written correctly, but from the (non-existant) information you've posted, it's hard to say.

I.am 17 Dec 2009 09:14

This is what i use


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

But when the page is selected the button doesn't work properly.


All times are GMT. The time now is 22:50.

Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.