Exemple #1
0
        $user = $page->users->getByUsername($altUsername);
        if ($user) {
            $altID = $user['id'];
        }
    } else {
        if ($altID !== false) {
            $userID = $altID;
            $publicView = true;
        }
    }
}
$data = $page->users->getById($userID);
if (!$data) {
    $page->show404();
}
// Check if the user selected a theme.
if (!isset($data['style']) || $data['style'] == 'None') {
    $data['style'] = 'Using the admin selected theme.';
}
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$page->smarty->assign(['apirequests' => $page->users->getApiRequests($userID), 'userinvitedby' => $data['invitedby'] != '' ? $page->users->getById($data['invitedby']) : '', 'user' => $data, 'privateprofiles' => $privateProfiles, 'publicview' => $publicView, 'privileged' => $privileged, 'pagertotalitems' => $rc->getCommentCountForUser($userID), 'pageroffset' => $offset, 'pageritemsperpage' => ITEMS_PER_PAGE, 'pagerquerybase' => "/profile?id={$userID}&offset=", 'pagerquerysuffix' => "#comments"]);
$sabApiKeyTypes = [SABnzbd::API_TYPE_NZB => 'Nzb Api Key', SABnzbd::API_TYPE_FULL => 'Full Api Key'];
$sabPriorities = [SABnzbd::PRIORITY_FORCE => 'Force', SABnzbd::PRIORITY_HIGH => 'High', SABnzbd::PRIORITY_NORMAL => 'Normal', SABnzbd::PRIORITY_LOW => 'Low'];
$sabSettings = [1 => 'Site', 2 => 'Cookie'];
// Pager must be fetched after the variables are assigned to smarty.
$page->smarty->assign(['pager' => $page->smarty->fetch("pager.tpl"), 'commentslist' => $rc->getCommentsForUserRange($userID, $offset, ITEMS_PER_PAGE), 'exccats' => implode(",", $page->users->getCategoryExclusionNames($userID)), 'saburl' => $sab->url, 'sabapikey' => $sab->apikey, 'sabapikeytype' => $sab->apikeytype != '' ? $sabApiKeyTypes[$sab->apikeytype] : '', 'sabpriority' => $sab->priority != '' ? $sabPriorities[$sab->priority] : '', 'sabsetting' => $sabSettings[$sab->checkCookie() === true ? 2 : 1]]);
$page->meta_title = "View User Profile";
$page->meta_keywords = "view,profile,user,details";
$page->meta_description = "View User Profile for " . $data["username"];
$page->content = $page->smarty->fetch('profile.tpl');
$page->render();
Exemple #2
0
        $userid = $res["ID"];
    }
} else {
    $userid = $users->currentUserId();
}
$data = $users->getById($userid);
if (!$data) {
    $page->show404();
}
$invitedby = '';
if ($data["invitedby"] != "") {
    $invitedby = $users->getById($data["invitedby"]);
}
$page->smarty->assign('userinvitedby', $invitedby);
$page->smarty->assign('user', $data);
$commentcount = $rc->getCommentCountForUser($userid);
$offset = isset($_REQUEST["offset"]) ? $_REQUEST["offset"] : 0;
$page->smarty->assign('pagertotalitems', $commentcount);
$page->smarty->assign('pageroffset', $offset);
$page->smarty->assign('pageritemsperpage', ITEMS_PER_PAGE);
$page->smarty->assign('pagerquerybase', "/profile?id=" . $userid . "&offset=");
$page->smarty->assign('pagerquerysuffix', "#comments");
$pager = $page->smarty->fetch($page->getCommonTemplate("pager.tpl"));
$page->smarty->assign('pager', $pager);
$commentslist = $rc->getCommentsForUserRange($userid, $offset, ITEMS_PER_PAGE);
$page->smarty->assign('commentslist', $commentslist);
$exccats = $users->getCategoryExclusionNames($userid);
$page->smarty->assign('exccats', implode(",", $exccats));
$page->smarty->assign('saburl', $sab->url);
$page->smarty->assign('sabapikey', $sab->apikey);
$sabapikeytypes = array(SABnzbd::API_TYPE_NZB => 'Nzb Api Key', SABnzbd::API_TYPE_FULL => 'Full Api Key');