Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2008, 12:15 PM
Varsh's Avatar
Varsh Varsh is offline
 
Join Date: Aug 2006
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Hiding Elements

Currently I've been trying to create a completely new style however despite being able to create and display templates fine, hiding elements from users and other usergroups just doesn't seem to work for some reason. If I put all of the elements in a new template it won't work, however putting them in the navbar element works.

Is there something I need to put into the plugin to get the elements to hide? Putting the code in the navbar will not work for this style so putting code in the navbar isn't really an option.

Any help is appreciated.

I have tried:
Code:
<if condition="$show['member']">
and:
Code:
<if condition="$show['admincplink']">
without any success so...
Reply With Quote
  #2  
Old 12-09-2008, 12:17 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What are you trying to hide exactly, and from whom? I'm not sure I understand what your trying to do.
Reply With Quote
  #3  
Old 12-09-2008, 12:28 PM
Varsh's Avatar
Varsh Varsh is offline
 
Join Date: Aug 2006
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

At the moment I'm trying to create a new navbar, however there's certain options (like the current navbar) that I want hidden from guests and only show up if you're registered. Think of it like copying the current navbar to a different template.

This is what I'm trying to do at the moment:


I pasted the code from the custom template and put it into the navbar template and it worked fine, I'm trying to figure out why it doesn't work in the custom template. Also the bottom part of the new navbar is supposed to be hidden from guests, which also works in the navbar template but not the custom template. You can test what I mean on my site using test/pass.
Reply With Quote
  #4  
Old 12-09-2008, 01:07 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<if condition="$show['member']">

^^ this should have worked as I have tried this long time back and it worked.

Can you post the code from your custom template?

.
Reply With Quote
  #5  
Old 12-09-2008, 01:23 PM
Varsh's Avatar
Varsh Varsh is offline
 
Join Date: Aug 2006
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's exactly what I did funnily enough, the custom template looks like this:
Code:
<ul id="topMenu">
	<li><a href="http://www.nexusrealms.co.uk">Home</a></li>
	<li><a href="http://media.nexusrealms.co.uk">Media Projects</a></li>
	<li><a href="http://forums.nexusrealms.co.uk/project.php">Projects Tools</a></li>
	<li><a href="http://forums.nexusrealms.co.uk">Forums</a></li>
	<li><a href="http://forums.nexusrealms.co.uk/faq.php">FAQs</a></li>
	<li><a href="http://wiki.nexusrealms.co.uk">Wiki</a></li>
</ul>
<if condition="$show['member']">
<ul class="topMenu2 blue">
	<li><a href="http://forums.nexusrealms.co.uk/usercp.php">Control Panel</a></li>
	<li><a href="http://forums.nexusrealms.co.uk/search.php?$session[sessionurl]do=finduser&amp;u=$bbuserinfo[userid]">My Posts</a></li>
	<li><a href="http://forums.nexusrealms.co.uk/search.php?do=getnew">New Posts</a></li>
	<if condition="$vboptions['enablememberlist']">
		<li><a href="http://forums.nexusrealms.co.uk/memberlist.php$session[sessionurl_q]">$vbphrase[members_list]</a></li>
	</if>
	<if condition="$show['member']">
		<li><a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')">$vbphrase[log_out]</a></li>
	</if>
	<if condition="$show['admincplink']"><li><a href="$admincpdir/index.php$session[sessionurl_q]">$vbphrase[admin]</a></li></if>
</ul>
</if>
And the plugins look like this:
global_start
Code:
eval('$nxr_topMenu = "' . fetch_template('nxr_topMenu') . '";');
cache_templates
Code:
$globaltemplates = array_merge($globaltemplates, array('nxr_topMenu'));
I would've used
Code:
globaltemplates[] = 'nxr_topMenu';
if I didn't get an error.
Reply With Quote
  #6  
Old 12-09-2008, 02:03 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm

Try this:

<if condition="is_member_of($bbuserinfo, 5, 6, 7)">

Change the user groups as needed.

.
Reply With Quote
  #7  
Old 12-09-2008, 02:40 PM
Varsh's Avatar
Varsh Varsh is offline
 
Join Date: Aug 2006
Location: UK
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok that worked well, could be a big problem down the road though as I'll be making constant changes to usergroups. Also in the same code I'm finding that Logout and Admin CP links are not showing up either, there's got to be something that I'm doing wrong or have missed. In the bottom setup (for the navbar) the Admin CP just links to the index page rather than the admin CP so that isn't working for the navbar (moving form the footer). I've really got to figure all of this skinn molarchy out. o_O
Reply With Quote
  #8  
Old 12-09-2008, 05:59 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What you can do is use <if condition="!is_member_of($bbuserinfo, 5, 6, 7)"> to exclude usergroups

For adminCP link you can use

Code:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">  

instead of 

<if condition="$show['admincplink']">
Edit the usergroups accordingly.
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 12:56 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.09517 seconds
  • Memory Usage 2,238KB
  • 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
  • (7)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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