Ejemplo n.º 1
0
require_once get_config('libroot') . 'registration.php';
$upgrades = check_upgrades();
if (isset($upgrades['core']) && !empty($upgrades['core']->install)) {
    $smarty = smarty();
    $smarty->assign('installing', true);
    $smarty->assign('releaseargs', array($upgrades['core']->torelease, $upgrades['core']->to));
    $smarty->display('admin/installgpl.tpl');
    exit;
}
if (!get_config('registration_lastsent') || get_config('new_registration_policy')) {
    $register = true;
}
$closed = get_config('siteclosedbyadmin');
$closeform = pieform(array('name' => 'close_site', 'renderer' => 'oneline', 'elements' => array('close' => array('type' => 'hidden', 'value' => !$closed), 'submit' => array('type' => 'submit', 'value' => get_string($closed ? 'Open' : 'Close', 'admin'), 'class' => $closed ? 'btn-success' : 'btn-default'))));
if (get_config('installed')) {
    $sitedata = site_statistics();
}
$smarty = smarty();
$smarty->assign('PAGEHEADING', get_string('administration', 'admin'));
// normal admin page starts here
$smarty->assign('upgrades', $upgrades);
if (isset($sitedata)) {
    $smarty->assign('sitedata', $sitedata);
}
if (isset($register)) {
    $smarty->assign('register', $register);
}
$smarty->assign('closed', $closed);
$smarty->assign('closeform', $closeform);
$smarty->assign('warnings', site_warnings());
$smarty->display('admin/index.tpl');
Ejemplo n.º 2
0
// NOTE: THESE FUNCTIONS ARE MOSTLY IN include/functions_general.php
// Moved for simplicity in caching the results
// GET RECENT SIGNUPS
$signup_array = recent_signups();
$smarty->assign_by_ref('signups', $signup_array);
// GET RECENT POPULAR USERS (MOST FRIENDS)
$friend_array = popular_users();
$smarty->assign_by_ref('friends', $friend_array);
// GET RECENT LOGINS
$login_array = recent_logins();
$smarty->assign_by_ref('logins', $login_array);
// GET NEWS ITEMS
$news_array = site_news();
$smarty->assign_by_ref('news', $news_array);
// GET TOTALS
$stats_array = site_statistics();
$smarty->assign_by_ref('site_statistics', $stats_array);
// Backwards compatibility with old home.tpl template
$total_members = isset($stats_array['members']['stat']) ? $stats_array['members']['stat'] : 0;
$total_friends = isset($stats_array['friends']['stat']) ? $stats_array['friends']['stat'] : 0;
$total_comments = isset($stats_array['comments']['stat']) ? $stats_array['comments']['stat'] : 0;
$smarty->assign('total_members', $total_members);
$smarty->assign('total_friends', $total_friends);
$smarty->assign('total_comments', $total_comments);
// Get online users
$online_array = online_users();
$smarty->assign_by_ref('online_users', $online_array);
// Get actions feed - Has code in it that is preventing direct caching
$actions_array = $actions->actions_display(0, $setting['setting_actions_actionsperuser']);
$smarty->assign_by_ref('actions', $actions_array);
// ASSIGN SMARTY VARIABLES AND INCLUDE FOOTER
Ejemplo n.º 3
0
$subpages = array('users', 'groups', 'views', 'content', 'historical', 'institutions', 'logins');
$offset = param_integer('offset', 0);
$limit = param_integer('limit', 10);
if (!in_array($type, $subpages)) {
    $type = 'users';
}
if ($type == 'historical') {
    $field = param_alphanumext('field', 'count_usr');
}
if ($type == 'institutions' || $type == 'logins') {
    $sort = param_alphanumext('sort', 'displayname');
    $sortdesc = param_boolean('sortdesc');
    $start = param_alphanumext('start', null);
    $end = param_alphanumext('end', null);
}
$sitedata = site_statistics(true);
switch ($type) {
    case 'logins':
        $data = institution_logins_statistics($limit, $offset, $sort, $sortdesc, $start, $end);
        break;
    case 'institutions':
        $data = institution_comparison_statistics($limit, $offset, $sort, $sortdesc);
        break;
    case 'historical':
        $data = historical_statistics($limit, $offset, $field);
        break;
    case 'content':
        $data = content_statistics($limit, $offset);
        break;
    case 'groups':
        $data = group_statistics($limit, $offset);