assign('lang_manageboards', _gettext('Manage boards'));
$tpl_links = '';
if (!$manage_class->ValidateSession(true)) {
$tpl_links .= '
Log in';
} else {
$manage_postpassword = md5_encrypt($_SESSION['manageusername'], KU_RANDOMSEED);
$tpl_links .= 'Logout
'._gettext('Show Posting Password').'';
/* Home */
$tpl_links .= section_html(_gettext('Home'), 'home') .
'';
/* Administration */
if ($manage_class->CurrentUserIsAdministrator()) {
$tpl_links .= section_html(_gettext('Administration'), 'administration') .
'';
/*$tpl_links .= section_html(_gettext('Modules'), 'modules') .
'';*/
}
/* Boards */
$tpl_links .= section_html(_gettext('Boards'), 'boards') .
'';
/* Moderation */
if ($manage_class->CurrentUserIsAdministrator() || $manage_class->CurrentUserIsModerator()) {
$open_reports = $tc_db->GetAll("SELECT HIGH_PRIORITY COUNT(*) FROM `" . KU_DBPREFIX . "reports` WHERE `cleared` = '0'");
$tpl_links .= section_html(_gettext('Moderation') . '[' . $open_reports[0][0] . ']', 'moderation') .
'';
}
$tpl_links .= '
' . _gettext('Welcome') . ', ' . $_SESSION['manageusername'] . '';
if ($_SESSION['manageusername'] == 'admin' && $_SESSION['managepassword'] == md5('admin')) {
$tpl_links .= '' . _gettext('NOTICE: You are using the default administrator account. Anyone can log in to this account, so a second administrator account needs to be created. Create another, log in to it, and delete this one.') . '
';
}
$tpl_links .= '
' . _gettext('Staff rights') . ': ';
if ($manage_class->CurrentUserIsAdministrator()) {
$tpl_links .= _gettext('Administrator');
} elseif ($manage_class->CurrentUserIsModerator()) {
$tpl_links .= _gettext('Moderator');
} else {
$tpl_links .= _gettext('Janitor');
}
$tpl_links .= '
';
if (!$manage_class->CurrentUserIsAdministrator()) {
$tpl_links .= _gettext('Moderating boards') . ': ';
$i = 0;
$resultsboard = $tc_db->GetAll("SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "boards`");
foreach ($resultsboard as $lineboard) {
if ($manage_class->CurrentUserIsModeratorOfBoard($lineboard['name'], $_SESSION['manageusername'])) {
$i++;
$tpl_links .= '/' . $lineboard['name'] . '/, ';
}
}
if ($i == 0) {
$tpl_links .= _gettext('No boards');
} else {
$tpl_links .= $i . ' ' . _gettext('Boards');
}
}
}
function section_html($section, $abbreviation) {
return '
−
' . $section . '
';
}
$smarty->assign('links', $tpl_links);
$smarty->display('manage_menu.tpl');
?>