vBulletin Mods

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

the define('THIS_SCRIPT', 'vbcms);
by Kyle55155
13 Aug 2010 06:20

Its getting late and I'm tired. I must be doing something really dumb here.

I have a custom page that when selected I was the CMS button to show as active. I've set the define('THIS_SCRIPT', 'vbcms);

But when I choose that it ignores my setting and instead makes the forums button active. I can get one of my added home button to show as active but can't seem to get the cms button to show as active.

Anybody know what I'm doing wrong here?

Lynne 13 Aug 2010 15:20

You want the Home button to show as active when you click on your custom script? Take a look at the actual condition that makes the Home button active - you'll find it in the plugin "Navbar: Insert CMS Navbar Entry". Nowhere in there does it have anything regarding THIS_SCRIPT being equal to "vbcms", so that isn't going to work.

Kyle55155 13 Aug 2010 19:29

Quote:

Originally Posted by Lynne (Post 2083240)
You want the Home button to show as active when you click on your custom script? Take a look at the actual condition that makes the Home button active - you'll find it in the plugin "Navbar: Insert CMS Navbar Entry". Nowhere in there does it have anything regarding THIS_SCRIPT being equal to "vbcms", so that isn't going to work.

Thanks Lynn,

Boy I must have been tired. I just read what I posted and it doesn't even make sense! Ok I'm awake now.

on the CMS part of my site http://roadbikefever.com/content/

I have a link (Publish my article) to a custom page. When you go to http://roadbikefever.com/publish.php I want the CMS button (articles and reports) to remain selected.

I know how to do this when I want one of my custom buttons to be selected when you choose one of my custom pages but its not working for the CMS button. I thought I could just populate the "this_script=" value on the publish.php page to vbcms.

I have temporarily set the this_script value to my added home button.
Is that the wrong value? Is there another way to do this?

Thanks

Lynne 13 Aug 2010 20:52

Did you look at the plugin code I told you to look at? Nowhere in there does it use THIS_SCRIPT to decide if the home tab should be highlighted or not. So, you either need to change your code to use what is in the plugin, or change the plugin condition to work with your code.

Kyle55155 13 Aug 2010 21:05

Lynn,

I misspoke in my first post in this thread.

I have created lots of additional tabs before. This is the plugin code for my home tab:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'home' or THIS_SCRIPT == 'home2')
{
$vbulletin->options['selectednavtab']='home1';
$tabselected = ' class="selected"';
$tablinks = ' <ul class="floatcontainer">
<li><a href="shoplist.php">Bike Shop Reviews</a></li>
<li></li>

</ul> ';

}
$template_hook['navtab_start'] .= '<li'.$tabselected.'><a class="navtab" href="http://roadbikefever.com">Home</a>'.$tablinks.'</li>' ;

On my custom pages if I set the this_script = value to home or home2 when I select those pages the home button will show as selected.

In this instance I am not using one of my custom tabs instead I am trying to get the default CMS tab (which I have renamed "articles and reports' via phrase manager") to show as selected when I launch another one of my custom pages (publish.php).

Ok I see that the required conditions appear to be:

if (defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar'))

I see that
define('CMS_SCRIPT', true);

is in content.php.


Not sure what other line I need to add to publish.php in order to satisfy the second part of the if statement in Navbar: Insert CMS Navbar Entry

class_exists('vBCms_Navbar'))

Lynne 13 Aug 2010 22:33

As you posted - these are the conditions that need to be true in order for the CMS tab to be highlighted:

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

Most likely, unless you include the correct files in your custom page, you will not be able to meet the second part of the condition. So, it may be easiest if you modify that condition to add your own... add an OR in there:

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



All times are GMT. The time now is 11:33.

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.