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)

rodeojones 09-04-2012 06:00 PM

Hiding Existing Tabs from Unregistered Users
 
Greetings all. I am currently using vB 4.1.11 (haven't upgraded because things are running smoothly and I am afraid to mess with that :) )

I would like to know if there is a simple plug-in script that I can execute in order to hide all but the home and blog tabs from unregistered users. I made the forum visible in order to let unregistered users see the articles and blogs I am posting, but they don't need to see a bunch of links for sections they can't access anyway. I appreciate the help! Thanks!

John Lester 09-04-2012 08:16 PM

Do you have any of the "tabs" mods installed?

rodeojones 09-04-2012 08:33 PM

I have the sstab advanced 2.0.5 installed, but it appears that I can only set those permissions for newly created tabs, not existing tabs.

rodeojones 09-11-2012 03:49 PM

Just checking in. Any help would be appreciated. Thanks!

Lynne 09-11-2012 04:02 PM

You will need to ask that question in the modification thread since we know nothing about that modification and how to add permissions to the tabs.

rodeojones 09-11-2012 04:16 PM

Lynne,

Thanks for the response :)

My mention of the mod was in response to the question ask about the mods I have installed. From what I can see, this cannot be done with that mod so I am looking for any code I can add as a plug-in or a mod that currently exists to make this happen. Thanks!

ForceHSS 09-11-2012 04:23 PM

The one in my sig can do what u ask if you have any problems with it pm me

Lynne 09-11-2012 04:35 PM

Or write a plugin - https://vborg.vbsupport.ru/showthread.php?t=226914

John Lester 09-11-2012 04:39 PM

Sorry forgot about this thread :( You will need to edit the navbar template and add a conditional around the tabs you want to hide.

<vb:if condition="$show['member']"> is the tag you put in front of the stuff you want to hide from guests.

</vb:if> is the tag you put at the end of the stuff you want to hide from guests.

This example is the default code for the "what's new" tab, it hides the tab from guests. As I don't have that tab mod installed I can't show you an example using the code from one of the tabs you created.

Code:

<vb:if condition="$show['member']">
                        <li><a href="search.php?{vb:raw session.sessionurl}do=getnew&amp;contenttype=vBForum_Post">{vb:rawphrase new_posts_nav}</a></li>
                        <vb:else />
                        <li><a href="search.php?{vb:raw session.sessionurl}do=getdaily&amp;contenttype=vBForum_Post">{vb:rawphrase todays_posts}</a></li>
                        </vb:if>


rodeojones 09-12-2012 12:17 PM

John,

Thanks for your code. I am trying to hide 4 tabs, two of which are built in to vB, two are plugins.

The two tabs built in are the Forum and What's New. I looked in the navbar template and can't find the code that specifically points to the "Forum" tab itself. Any guidance would be appreciated.

The two plugins use the following code:

Code:

$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'calendar')
{
$vbulletin->options['selectednavtab']='events';
    $tabselected = ' class="selected"';

$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="http://www.projecttheophilus.com/comcenter/calendar.php?calendarid=1">EVENTS</a>'.$tablinks.'</li>' ;

I'm not sure where to add the code you provided into these plugins. Any help there would be appreciated. Thank you so much for all the help!

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 05:49 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.01107 seconds
  • Memory Usage 1,760KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete