예제 #1
0
$cs_lang = cs_translate('board');
$user_id = $_GET['id'];
settype($user_id, 'integer');
$board_access = $account['access_board'];
$where = "users_id = '" . $user_id . "'";
$board_count = cs_sql_count(__FILE__, 'board', $where);
$cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_register, users_active, users_delete', "users_id = '" . $user_id . "'");
$userposts = getUserPosts($user_id);
$data['users']['addons'] = cs_addons('users', 'view', $user_id, 'board');
$cs_ranks = cs_sql_select(__FILE__, 'boardranks', 'boardranks_min, boardranks_name', 0, 'boardranks_min ASC', 0, 0);
$data['count']['com'] = $userposts;
$since = cs_time() - $cs_user['users_register'];
$since = $since <= 86400 ? 1 : $since / 86400;
$posts_per_day = $userposts / $since;
$data['count_com']['per_day'] = round($posts_per_day, 2) . $cs_lang['posts_per_day'];
$data['count']['rank'] = cs_secure(getRankTitle($userposts, $cs_ranks));
$data['last']['com'] = sprintf($cs_lang['last_com'], $posts);
$data['last']['thr'] = sprintf($cs_lang['last_thr'], $threads);
$from = 'comments cms INNER JOIN {pre}_threads thr ON cms.comments_fid = thr.threads_id ';
$from .= 'INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$from .= 'INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id';
$select = 'DISTINCT thr.threads_id AS threads_id, cat.categories_name AS categories_name, ';
$select .= 'cat.categories_id AS categories_id, frm.board_name AS board_name, frm.board_id AS board_id, ';
$select .= 'thr.threads_headline AS threads_headline, thr.threads_last_time AS threads_last_time, ';
$select .= 'thr.threads_last_user AS threads_last_user, cms.comments_time AS comments_time';
$where = 'cms.users_id = \'' . $user_id . '\' AND frm.board_access <= \'' . $board_access . '\' AND frm.board_pwd = \'\'';
$where .= ' AND cms.comments_mod = \'board\'';
$order = 'cms.comments_time DESC';
$cs_comments = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, $posts);
$comments_loop = count($cs_comments);
if (empty($comments_loop)) {
예제 #2
0
 }
 $user = cs_secure($data['thread']['users_nick']);
 $data['thread_desc']['country'] = $data['thread']['users_country'];
 $data['thread_desc']['users_link'] = cs_user($data['thread']['users_id'], $data['thread']['users_nick'], $data['thread']['users_active'], $data['thread']['users_delete']);
 $key = array_search($userid, $mods);
 if (!empty($key)) {
     $data['if']['moderator'] = true;
     $f_user = "******" . $userid . "'";
     $boardmod = cs_sql_select(__FILE__, 'boardmods', 'categories_id, users_id', $f_user);
     $f_cat = "categories_id = '" . $boardmod['categories_id'] . "'";
     $bm_cat = cs_sql_select(__FILE__, 'categories', 'categories_id, categories_name', $f_cat);
     $data['thread_desc']['boardmod'] = $bm_cat['categories_name'];
 } else {
     $data['if']['no_moderator'] = true;
     $data['thread_desc']['users_rank'] = getUserRank($count_com[$userid], $ranks);
     $data['thread_desc']['users_title'] = getRankTitle($count_com[$userid], $ranks);
 }
 $data['thread_desc']['avatar'] = getUserAvatar($data['thread']['users_avatar']);
 $content = cs_secure($data['thread']['users_place']);
 $hidden = explode(',', $data['thread']['users_hidden']);
 if (in_array('users_place', $hidden)) {
     $content = ($account['access_users'] > 4 or $data['thread']['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content . cs_html_italic(0) : '';
 }
 $data['thread_desc']['place'] = empty($content) ? '' : $cs_lang['place'] . ': ' . $content;
 $data['thread_desc']['posts'] = $count_com[$userid];
 $data['thread_desc']['date'] = cs_date('unix', $data['thread']['threads_time'], 1);
 $data['thread_desc']['text'] = cs_secure($data['thread']['threads_text'], 1, 1);
 //Files Start
 if (!empty($loop_files)) {
     $data['if']['thread_desc_files'] = true;
     $check_files = 0;
예제 #3
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
require_once 'mods/board/functions.php';
$start = empty($_GET['start']) ? 0 : (int) $_GET['start'];
$array_result = array();
$toplist = array();
$cs_ranks = cs_sql_select(__FILE__, 'boardranks', 'boardranks_min, boardranks_name', 0, 'boardranks_min ASC', 0, 0);
$toplist = toplist_comments($start, $account['users_limit']);
$count = cs_sql_count(__FILE__, 'comments', 'comments_mod = \'board\'', 'users_id');
$data = array();
$data['pages']['list'] = cs_pages('board', 'toplist', $count, $start);
$i = 0;
if (!empty($toplist)) {
    foreach ($toplist as $users_data) {
        if ($users_data['users_id'] != 0) {
            //dont list comments of visitors
            $data['toplist'][$i]['user'] = empty($users_data['users_nick']) ? '' : cs_user($users_data['users_id'], $users_data['users_nick'], $users_data['users_active'], $users_data['users_delete']);
            $data['toplist'][$i]['number'] = $i + $start + 1;
            $data['toplist'][$i]['rank'] = cs_secure(getRankTitle($users_data['num_comments'], $cs_ranks));
            $data['toplist'][$i]['class'] = $users_data['users_id'] != $account['users_id'] ? 'leftb' : 'leftc';
            $data['toplist'][$i]['comments'] = $users_data['num_comments'];
            $i++;
        }
    }
} else {
    $data['toplist'] = array();
}
echo cs_subtemplate(__FILE__, $data, 'board', 'toplist');