Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2010, 05:20 AM
Kyle55155 Kyle55155 is offline
 
Join Date: Mar 2010
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default the define('THIS_SCRIPT', 'vbcms);

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?
Reply With Quote
  #2  
Old 08-13-2010, 02:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-13-2010, 06:29 PM
Kyle55155 Kyle55155 is offline
 
Join Date: Mar 2010
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
  #4  
Old 08-13-2010, 07:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 08-13-2010, 08:05 PM
Kyle55155 Kyle55155 is offline
 
Join Date: Mar 2010
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'))
Reply With Quote
  #6  
Old 08-13-2010, 09:33 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As you posted - these are the conditions that need to be true in order for the CMS tab to be highlighted:
Code:
if (defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar'))
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:
Code:
if ((defined('CMS_SCRIPT') AND class_exists('vBCms_Navbar')) OR (your condition))
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:22 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
  • Page Generation 0.03836 seconds
  • Memory Usage 2,213KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete