vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Hiding Elements (https://vborg.vbsupport.ru/showthread.php?t=198429)

Varsh 12-09-2008 12:15 PM

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

Digital Jedi 12-09-2008 12:17 PM

What are you trying to hide exactly, and from whom? I'm not sure I understand what your trying to do.

Varsh 12-09-2008 12:28 PM

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:
http://img218.imageshack.us/img218/6439/navbarre0.jpg

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.

Seven Skins 12-09-2008 01:07 PM

<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?

.

Varsh 12-09-2008 01:23 PM

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.

Seven Skins 12-09-2008 02:03 PM

Hmmm

Try this:

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

Change the user groups as needed.

.

Varsh 12-09-2008 02:40 PM

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

Seven Skins 12-09-2008 05:59 PM

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.


All times are GMT. The time now is 10:10 AM.

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.01141 seconds
  • Memory Usage 1,735KB
  • 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
  • (7)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete