sidebar visible/not visible based on user login

internetgardener

Joined: 2004-09-10
Posts: 5
Posted: Mon, 2005-04-04 04:06

Hi Everyone,

Would it be possible to make sidebar.tpl 'user dependant'?

For example: When you went to the top level gallery (or any sub gallery) the sidebar would not be present unless the user was logged in? Further to that, could you can make the options on the sidebar user dependant?

What I would like is to have sidebar not 'on' unless the user was admin.

Thoughts?

CW

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-04-05 03:23

We're going to redo the layouts a little bit to downplay the value of the sidebar, and at that time we can surely make this possible. Might not happen until after B2 though.

 
internetgardener

Joined: 2004-09-10
Posts: 5
Posted: Tue, 2005-04-05 06:30

Thanks bharat.

I am just trying to figure out a 'nice' way to hide the sidebar when it is not the admin who is logged in. Thought that it would make logical sense to be able to do a check on the user then decided to display or not display.

Any other ideas?

Regards,
Curt

 
buss

Joined: 2005-09-26
Posts: 7
Posted: Tue, 2005-10-11 19:31
Quote:
I am just trying to figure out a 'nice' way to hide the sidebar when it is not the admin who is logged in. Thought that it would make logical sense to be able to do a check on the user then decided to display or not display.

I have the exact same issue. Has any progress been made on this since the last post? I hide the sidebar by just removing the following lines from album.tpl, modules.tpl, and photo.tpl:
{if !empty($theme.params.sidebarBlocks)}
<td id="gsSidebarCol">
{g->theme include="sidebar.tpl"}
</td>
{/if}

But I would still like to display the sidebar when admin is logged in, because as it stands now, the admin can't do a thing without the sidebar.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Tue, 2005-10-11 19:40

The theme system was completely rewritten. There's no need to do any of that.

If you search the forums there is a way to display the sidbar if logged in as admin. You just need to wrap it with a bit of code see this page at the bottom: http://codex.gallery2.org/index.php/Gallery2:Tpl_Reference#User_Information

If you don't want to display it for anyone, then just remove all of the blocks in the sidebar from
Site Admin > Themes > your theme

Something like:

{if $user.isAdmin}
  {if !empty($theme.params.sidebarBlocks)}
    <td id="gsSidebarCol">
      {g->theme include="sidebar.tpl"}
    </td>
  {/if}
{/if}

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
buss

Joined: 2005-09-26
Posts: 7
Posted: Wed, 2005-10-12 16:30

Fantastic, thank you! If I had started this thread I would mark it resolved, but alas... :P