Esempio n. 1
0
        }
        $group_membership = join(', ', $group_membership);
    }
    $template->assign_vars(array('GROUP_MEMBERSHIP' => (bool) $group_membership, 'GROUP_MEMBERSHIP_TXT' => $group_membership));
} else {
    if (IS_MOD) {
        $template->assign_vars(array('SHOW_GROUP_MEMBERSHIP' => $profiledata['user_level'] != USER));
    }
}
// Show users torrent-profile
if (IS_AM || $profile_user_id || !bf($profiledata['user_opt'], 'user_opt', 'user_dls')) {
    require UCP_DIR . 'viewtorrent.php';
}
// Ajax bt_userdata
if (IS_AM || $profile_user_id) {
    show_bt_userdata($profiledata['user_id']);
} else {
    $template->assign_vars(array('DOWN_TOTAL_BYTES' => false, 'MIN_DL_BYTES' => false));
}
if (IS_ADMIN) {
    $ajax_user_opt = Zend\Json\Json::encode(array('dis_avatar' => bf($profiledata['user_opt'], 'user_opt', 'dis_avatar'), 'dis_sig' => bf($profiledata['user_opt'], 'user_opt', 'dis_sig'), 'dis_passkey' => bf($profiledata['user_opt'], 'user_opt', 'dis_passkey'), 'dis_pm' => bf($profiledata['user_opt'], 'user_opt', 'dis_pm'), 'dis_post' => bf($profiledata['user_opt'], 'user_opt', 'dis_post'), 'dis_post_edit' => bf($profiledata['user_opt'], 'user_opt', 'dis_post_edit'), 'dis_topic' => bf($profiledata['user_opt'], 'user_opt', 'dis_topic')));
    $template->assign_vars(array('EDITABLE_TPLS' => true, 'AJAX_USER_OPT' => $ajax_user_opt, 'U_MANAGE' => "profile.php?mode=editprofile&u={$profiledata['user_id']}", 'U_PERMISSIONS' => "admin/admin_ug_auth.php?mode=user&u={$profiledata['user_id']}"));
}
$user_restrictions = array();
if (bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')) {
    $user_restrictions[] = $lang['HIDE_AVATARS'];
}
if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
    $user_restrictions[] = $lang['SHOW_CAPTION'];
}
if (bf($profiledata['user_opt'], 'user_opt', 'dis_passkey')) {
Esempio n. 2
0
            $folder_image = $is_sf ? $images['icon_minipost'] : $images['forum_locked'];
        }
        if ($is_sf) {
            $template->assign_block_vars('c.f.sf', array('SF_ID' => $fid, 'SF_NAME' => $fname_html, 'SF_NEW' => $new ? ' new' : ''));
            continue;
        }
        $template->assign_block_vars('c.f', array('FORUM_FOLDER_IMG' => $folder_image, 'FORUM_ID' => $fid, 'FORUM_NAME' => $fname_html, 'FORUM_DESC' => $f['forum_desc'], 'POSTS' => commify($f['forum_posts']), 'TOPICS' => commify($f['forum_topics']), 'LAST_SF_ID' => isset($f['last_sf_id']) ? $f['last_sf_id'] : null, 'MODERATORS' => isset($moderators[$fid]) ? join(', ', $moderators[$fid]) : '', 'FORUM_FOLDER_ALT' => $new ? $lang['NEW'] : $lang['OLD']));
        if ($f['last_post_id']) {
            $template->assign_block_vars('c.f.last', array('LAST_TOPIC_ID' => $f['last_topic_id'], 'LAST_TOPIC_TIP' => $f['last_topic_title'], 'LAST_TOPIC_TITLE' => wbr(str_short($f['last_topic_title'], $last_topic_max_len)), 'LAST_POST_TIME' => bb_date($f['last_post_time'], $bb_cfg['last_post_date_format']), 'LAST_POST_USER' => profile_url(array('username' => str_short($f['last_post_username'], 15), 'user_id' => $f['last_post_user_id'], 'user_rank' => $f['last_post_user_rank']))));
        }
    }
}
$template->assign_vars(array('SHOW_FORUMS' => $forums_count, 'SHOW_MAP' => isset($_GET['map']) && !IS_GUEST, 'PAGE_TITLE' => $viewcat ? $cat_title_html[$viewcat] : $lang['HOME'], 'NO_FORUMS_MSG' => $only_new ? $lang['NO_NEW_POSTS'] : $lang['NO_FORUMS'], 'TOTAL_TOPICS' => sprintf($lang['POSTED_TOPICS_TOTAL'], $stats['topiccount']), 'TOTAL_POSTS' => sprintf($lang['POSTED_ARTICLES_TOTAL'], $stats['postcount']), 'TOTAL_USERS' => sprintf($lang['REGISTERED_USERS_TOTAL'], $stats['usercount']), 'TOTAL_GENDER' => $bb_cfg['gender'] ? sprintf($lang['USERS_TOTAL_GENDER'], $stats['male'], $stats['female'], $stats['unselect']) : '', 'NEWEST_USER' => sprintf($lang['NEWEST_USER'], profile_url($stats['newestuser'])), 'TORRENTS_STAT' => $bb_cfg['tor_stats'] ? sprintf($lang['TORRENTS_STAT'], $stats['torrentcount'], humn_size($stats['size'])) : '', 'PEERS_STAT' => $bb_cfg['tor_stats'] ? sprintf($lang['PEERS_STAT'], $stats['peers'], $stats['seeders'], $stats['leechers']) : '', 'SPEED_STAT' => $bb_cfg['tor_stats'] ? sprintf($lang['SPEED_STAT'], humn_size($stats['speed']) . '/s') : '', 'SHOW_MOD_INDEX' => $bb_cfg['show_mod_index'], 'FORUM_IMG' => $images['forum'], 'FORUM_NEW_IMG' => $images['forum_new'], 'FORUM_LOCKED_IMG' => $images['forum_locked'], 'SHOW_ONLY_NEW_MENU' => true, 'ONLY_NEW_POSTS_ON' => $only_new == ONLY_NEW_POSTS, 'ONLY_NEW_TOPICS_ON' => $only_new == ONLY_NEW_TOPICS, 'U_SEARCH_NEW' => "search.php?new=1", 'U_SEARCH_SELF_BY_MY' => "search.php?uid={$userdata['user_id']}&o=1", 'U_SEARCH_LATEST' => "search.php?search_id=latest", 'U_SEARCH_UNANSWERED' => "search.php?search_id=unanswered", 'SHOW_LAST_TOPIC' => $show_last_topic));
// Set tpl vars for bt_userdata
if ($bb_cfg['bt_show_dl_stat_on_index'] && !IS_GUEST) {
    show_bt_userdata($userdata['user_id']);
}
// Latest news
if ($bb_cfg['show_latest_news']) {
    if (!($latest_news = $datastore->get('latest_news'))) {
        $datastore->update('latest_news');
        $latest_news = $datastore->get('latest_news');
    }
    $template->assign_vars(array('SHOW_LATEST_NEWS' => true));
    foreach ($latest_news as $news) {
        $template->assign_block_vars('news', array('NEWS_TOPIC_ID' => $news['topic_id'], 'NEWS_TITLE' => str_short($news['topic_title'], $bb_cfg['max_news_title']), 'NEWS_TIME' => bb_date($news['topic_time'], 'd-M', false), 'NEWS_IS_NEW' => is_unread($news['topic_time'], $news['topic_id'], $news['forum_id'])));
    }
}
// Network news
if ($bb_cfg['show_network_news']) {
    if (!($network_news = $datastore->get('network_news'))) {