vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Create a New Tab in the navbar (https://vborg.vbsupport.ru/showthread.php?t=226914)

Lynne 12-02-2009 10:40 PM

Quote:

Originally Posted by oooh em geee (Post 1924343)
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

That has nothing to do with this article - you are asking about the navbits code. You should ask for help modifying that code out in the main vb4 forums. (And actually, I believe it is a problem with your affiliates page and the way your wrote the navbits code, so you should post that part of your code when you ask for help.)

oooh em geee 12-02-2009 10:42 PM

I made a new thread about this. If you can help me please go here:
https://vborg.vbsupport.ru/showthrea...54#post1924354

JarkkoL 12-04-2009 07:31 PM

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.

Lynne 12-04-2009 07:45 PM

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).

thunderclap82 12-07-2009 11:10 PM

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 = '';
$tablinks = '';
if (THIS_SCRIPT == 'podcast')
{
    $vbulletin->options['selectednavtab']='podcast';
    $tabselected = ' class="selected"';
    $tablinks = '
                <ul class="floatcontainer">
                       
                </ul> ';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="/forums/content/116-podcast">Podcast</a>'.$tablinks.'</li>' ;


Lynne 12-07-2009 11:59 PM

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:

if ($_REQUEST['do'] == 'podcast'


thunderclap82 12-08-2009 12:13 AM

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?
PHP Code:

if ($_REQUEST['do'] == 'podcast'


So I should replace

Code:

if (THIS_SCRIPT == 'podcast')
with

Code:

if ($_REQUEST['do'] == 'podcast'
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 12-08-2009 01:17 AM

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:

define('THIS_SCRIPT''online'); 

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 12-08-2009 02:28 AM

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:
PHP Code:

define('THIS_SCRIPT''online'); 

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 12-08-2009 03:03 AM

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.


All times are GMT. The time now is 04:35 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01715 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete