How to disable sidebar in some cases?

barcley

Joined: 2005-01-16
Posts: 1
Posted: Sun, 2005-01-16 00:09

Hi,

can somebody point me to a possibility to disable the sidebar when no user is logged in, if this is possible? I want the space an album takes to be as small as possible and in my use case only the admin needs edit-Functions.

Thank You, Sebastian
----
[=9]
Gallery version:3-4 days old CVS

 
jmullan
jmullan's picture

Joined: 2002-07-28
Posts: 974
Posted: Tue, 2005-01-18 05:19

from irc:

bharat wrote:
the simplest solution is to tell him to dupe the layout and then add a check in layout.inc to figure out if the user is the anonymous user, then add an {if} around the {include sidebar.tpl} to not show it for guests

The API can be very daunting, so here's some more code:

list ($ret, $currentUser) = $gallery->getActiveUserId()
if ($ret->isError()) {
    return array($ret->wrap(__FILE__, __LINE__), null);
}
list ($ret, $everybodyGroupId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.allUserGroup');
if ($ret->isError()) {
    return array($ret->wrap(__FILE__, __LINE__), null);
}
$isLoggedIn = (GalleryCoreApi::isUserInGroup($currentUser->getId(), $everybodyGroupId);

You will have to fill in a few steps yourself, or ask again if you get stuck. Let us know!