vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Hiding Existing Tabs from Unregistered Users (https://vborg.vbsupport.ru/showthread.php?t=287461)

John Lester 09-12-2012 05:51 PM

Well the "what's new" tab should already be hidden from unregistered / logged out members. Did you look in your navbar template for the code I posted?

In regards to the other tabs, were those added using sstab advanced? If so it has an option built in to hide the tabs. You will have to read up on the documentation for a how to do it.

rodeojones 09-12-2012 07:18 PM

No, the code I posted was added via the creation of a new plugin. While I installed sstab advanced, I haven't yet used it. I suppose I can always get rid of the plugin tabs I created and recreate them in sstabs with the restrictions. I will try that.

As far as the "What's New" tab, I did search in the navbar template and found that. Now I need to find the "Forums" tab and insert the code there. That is proving trickier to find. Any idea where that one is?

Thanks again for your help John, I very much appreciate your time

John Lester 09-13-2012 03:02 AM

Yea you should pick one or the other before going forward. I'm not that experience writing plug-ins or mods, I'm a frakencoder :D I find something close to what I'm looking for and then butcher it until I get it to do what I want XD

rodeojones 09-13-2012 01:11 PM

LOL! Yeah, that has pretty much been my method as well. I know enough code to be dangerous :D

If anyone out there knows where to find the "Forums" tab in the templates that would be great.

I also deleted those plugins and used the sstab advanced to remake them and it works perfectly. Thanks for the help!

Macsee 09-13-2012 02:11 PM

Quote:

Originally Posted by rodeojones (Post 2365106)
If anyone out there knows where to find the "Forums" tab in the templates that would be great.

I'm no programmer, but here's a wild guess

Code:

<a class="navtab" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}">{vb:rawphrase forum}</a>

vbresults 09-13-2012 03:38 PM

The easy way is to just upgrade to 4.2 and update the add-ons. But, if you must stay on 4.1.11 AND you can code...

Disable the plugins that create the tabs for the add-ons and re-create the tabs using this, then wrap the tab declarations in a $show['member'] condition, e.g. on the parse_templates plugin hook:

PHP Code:

if ($show['member']) {
    
ExtendedNavigations::update(array(
        
'name' => $vbphrase['tab_1'],
        
'url' => 'tab_1.php'
    
));

    
# etc...



rodeojones 10-01-2012 05:51 PM

Ok, so I upgraded to 4.2. And now I have some new problems.

1. There were sub-nav that I added via plugin that aren't working. They appended themselves to the sub-nav under what is now considered "articles", but they now do not show up. Here is a what the plugin script looks like:

Code:

if (is_member_of($vbulletin->userinfo, 6, 9, 18)) {
$template_hook['vbcms_navbar_end'] .= '<li><a href="http://www.mysite.com/mypage">My special page</a></li>';
}

2. I tried to make new tabs that can only be seen by custom usergroups, but after several tries I do not know what to put in the $show to designate a custom usergroup. Do I use the usergroup id? The name? I am confused. Any help would be greatly appreciated.

--------------- Added [DATE]1349203510[/DATE] at [TIME]1349203510[/TIME] ---------------

So I figured out the solution to the first one. The subnav information is now found on each article. So if you want to set your page/article as subnav under the CMS tab, you have to indicate that on the article itself through the editor... interesting...

Still have no answer for the second question I asked... anyone? :)

MG Zebra 10-03-2012 08:24 AM

For your existing tabs click on Edit in the navigation manager and in the "Show Permission Name" put member and it will only appear for members. For the sstab plugin you can use the selection to choose which membergroups can see your custom tabs. I just fixed this on mine so I figured I'd post here to help out.

This is for 4.2.0 PL2. Not sure if it will work on other versions.

PM me if you need further assistance with your tabs. I'm using this method without any problems.


All times are GMT. The time now is 01:59 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.00983 seconds
  • Memory Usage 1,739KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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