Exemplo n.º 1
0
            // Предупреждение
            $mc_class = 'warning';
            break;
        case 4:
            // Нарушение
            $mc_class = 'danger';
            break;
        default:
            $mc_class = '';
            break;
    }
    $mc_select_type = array();
    foreach ($lang['MC_COMMENT'] as $key => $value) {
        $mc_select_type[$key] = $value['type'];
    }
    $template->assign_block_vars('postrow', array('ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'POST_ID' => $post_id, 'IS_NEWEST' => $post_id == $newest, 'POSTER_NAME' => profile_url(array('username' => $poster, 'user_rank' => $user_rank)), 'POSTER_NAME_JS' => addslashes($poster), 'POSTER_RANK' => $poster_rank, 'RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => $bb_cfg['show_poster_joined'] ? $poster_longevity : '', 'POSTER_JOINED_DATE' => $poster_joined, 'POSTER_POSTS' => $bb_cfg['show_poster_posts'] ? $poster_posts : '', 'POSTER_FROM' => $bb_cfg['show_poster_from'] ? wbr($poster_from) : '', 'POSTER_BOT' => $poster_id == BOT_UID, 'POSTER_ID' => $poster_id, 'POSTER_AUTHOR' => $poster_id == $t_data['topic_poster'], 'POSTER_GENDER' => $bb_cfg['gender'] ? gender_image($postrow[$i]['user_gender']) : '', 'POSTED_AFTER' => $prev_post_time ? delta_time($postrow[$i]['post_time'], $prev_post_time) : '', 'IS_UNREAD' => is_unread($postrow[$i]['post_time'], $topic_id, $forum_id), 'IS_FIRST_POST' => !$start && $post_id == $t_data['topic_first_post_id'], 'MOD_CHECKBOX' => $moderation && ($start || defined('SPLIT_FORM_START')), 'POSTER_AVATAR' => $poster_avatar, 'POST_NUMBER' => $i + $start + 1, 'POST_DATE' => $post_date, 'MESSAGE' => $message, 'SIGNATURE' => $user_sig, 'EDITED_MESSAGE' => $l_edited_by, 'PM' => $pm_btn, 'PROFILE' => $profile_btn, 'QUOTE' => $quote_btn, 'EDIT' => $edit_btn, 'DELETE' => $delpost_btn, 'IP' => $ip_btn, 'POSTER_BIRTHDAY' => $bb_cfg['birthday_enabled'] && $this_date == $poster_birthday ? '<img src="' . $images['icon_birthday'] . '" alt="" title="' . $lang['HAPPY_BIRTHDAY'] . '" border="0" />' : '', 'MC_COMMENT' => $mc_type ? bbcode2html($mc_comment) : '', 'MC_BBCODE' => $mc_type ? $mc_comment : '', 'MC_CLASS' => $mc_class, 'MC_TITLE' => sprintf($lang['MC_COMMENT'][$mc_type]['title'], $mc_user_id), 'MC_SELECT_TYPE' => build_select("mc_type_{$post_id}", array_flip($mc_select_type), $mc_type), 'RG_AVATAR' => $rg_avatar, 'RG_NAME' => $rg_name, 'RG_URL' => GROUP_URL . $rg_id, 'RG_FIND_URL' => 'tracker.php?srg=' . $rg_id, 'RG_SIG' => $rg_signature, 'RG_SIG_ATTACH' => $postrow[$i]['attach_rg_sig']));
    if ($postrow[$i]['post_attachment'] && $is_auth['auth_download'] && function_exists('display_post_attachments')) {
        display_post_attachments($post_id, $postrow[$i]['post_attachment']);
    }
    if ($moderation && !defined('SPLIT_FORM_START') && ($start || $post_id == $t_data['topic_first_post_id'])) {
        define('SPLIT_FORM_START', TRUE);
    }
    if ($poster_id != BOT_UID) {
        $prev_post_time = $postrow[$i]['post_time'];
    }
}
set_tracks(COOKIE_TOPIC, $tracking_topics, $topic_id, $max_post_time);
if (defined('SPLIT_FORM_START')) {
    $template->assign_vars(array('SPLIT_FORM' => true, 'START' => $start, 'S_SPLIT_ACTION' => "modcp.php", 'POST_FORUM_URL' => POST_FORUM_URL, 'POST_TOPIC_URL' => POST_TOPIC_URL));
}
// Quick Reply
Exemplo n.º 2
0
$u_auth[] = $is_auth['auth_vote'] ? $lang['RULES_VOTE_CAN'] : $lang['RULES_VOTE_CANNOT'];
$u_auth[] = $is_auth['auth_attachments'] ? $lang['RULES_ATTACH_CAN'] : $lang['RULES_ATTACH_CANNOT'];
$u_auth[] = $is_auth['auth_download'] ? $lang['RULES_DOWNLOAD_CAN'] : $lang['RULES_DOWNLOAD_CANNOT'];
$u_auth[] = $is_auth['auth_mod'] ? $lang['RULES_MODERATE'] : '';
$u_auth = join("<br />\n", $u_auth);
$template->assign_vars(array('SHOW_JUMPBOX' => true, 'PAGE_TITLE' => htmlCHR($forum_data['forum_name']), 'FORUM_ID' => $forum_id, 'FORUM_NAME' => htmlCHR($forum_data['forum_name']), 'TORRENTS' => $forum_data['allow_reg_tracker'], 'POST_IMG' => $forum_data['forum_status'] == FORUM_LOCKED ? $images['post_locked'] : $post_img, 'FOLDER_IMG' => $images['folder'], 'FOLDER_NEW_IMG' => $images['folder_new'], 'FOLDER_LOCKED_IMG' => $images['folder_locked'], 'FOLDER_STICKY_IMG' => $images['folder_sticky'], 'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'], 'FOLDER_DOWNLOAD_IMG' => $images['folder_dl'], 'SHOW_ONLY_NEW_MENU' => true, 'ONLY_NEW_POSTS_ON' => $only_new == ONLY_NEW_POSTS, 'ONLY_NEW_TOPICS_ON' => $only_new == ONLY_NEW_TOPICS, 'TITLE_MATCH' => htmlCHR($title_match), 'SELECT_TPP' => $select_tpp ? build_select('tpp', $select_tpp, $topics_per_page, null, null, 'onchange="$(\'#tpp\').submit();"') : '', 'T_POST_NEW_TOPIC' => $forum_data['forum_status'] == FORUM_LOCKED ? $lang['FORUM_LOCKED'] : $post_new_topic, 'S_AUTH_LIST' => $u_auth, 'U_VIEW_FORUM' => FORUM_URL . $forum_id, 'U_MARK_READ' => FORUM_URL . $forum_id . "&amp;mark=topics", 'U_SEARCH_SELF' => "search.php?uid={$userdata['user_id']}&f={$forum_id}"));
// Okay, lets dump out the page ...
$found_topics = 0;
foreach ($topic_rowset as $topic) {
    $topic_id = $topic['topic_id'];
    $moved = $topic['topic_status'] == TOPIC_MOVED;
    $replies = $topic['topic_replies'];
    $t_hot = $replies >= $bb_cfg['hot_threshold'];
    $t_type = $topic['topic_type'];
    $separator = '';
    $is_unread = is_unread($topic['topic_last_post_time'], $topic_id, $forum_id);
    if ($t_type == POST_ANNOUNCE && !defined('ANNOUNCE_SEP')) {
        define('ANNOUNCE_SEP', true);
        $separator = $lang['TOPICS_ANNOUNCEMENT'];
    } elseif ($t_type == POST_STICKY && !defined('STICKY_SEP')) {
        define('STICKY_SEP', true);
        $separator = $lang['TOPICS_STICKY'];
    } elseif ($t_type == POST_NORMAL && !defined('NORMAL_SEP')) {
        if (defined('ANNOUNCE_SEP') || defined('STICKY_SEP')) {
            define('NORMAL_SEP', true);
            $separator = $lang['TOPICS_NORMAL'];
        }
    }
    $template->assign_block_vars('t', array('FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'HREF_TOPIC_ID' => $moved ? $topic['topic_moved_id'] : $topic['topic_id'], 'TOPIC_TITLE' => wbr($topic['topic_title']), 'TOPICS_SEPARATOR' => $separator, 'IS_UNREAD' => $is_unread, 'TOPIC_ICON' => get_topic_icon($topic, $is_unread), 'PAGINATION' => $moved ? '' : build_topic_pagination(TOPIC_URL . $topic_id, $replies, $bb_cfg['posts_per_page']), 'REPLIES' => $replies, 'VIEWS' => $topic['topic_views'], 'TOR_STALED' => $forum_data['allow_reg_tracker'] && !($t_type == POST_ANNOUNCE || $t_type == POST_STICKY || $topic['tor_size']), 'TOR_FROZEN' => isset($topic['tor_status']) ? !IS_AM ? isset($bb_cfg['tor_frozen'][$topic['tor_status']]) : '' : '', 'TOR_TYPE' => isset($topic['tor_type']) ? is_gold($topic['tor_type']) : '', 'TOR_STATUS_ICON' => isset($topic['tor_status']) ? $bb_cfg['tor_icons'][$topic['tor_status']] : '', 'TOR_STATUS_TEXT' => isset($topic['tor_status']) ? $lang['TOR_STATUS_NAME'][$topic['tor_status']] : '', 'ATTACH' => $topic['topic_attachment'], 'STATUS' => $topic['topic_status'], 'TYPE' => $topic['topic_type'], 'DL' => $topic['topic_dl_type'] == TOPIC_DL_TYPE_DL && !$forum_data['allow_reg_tracker'], 'POLL' => $topic['topic_vote'], 'DL_CLASS' => isset($topic['dl_status']) ? $dl_link_css[$topic['dl_status']] : '', 'TOPIC_AUTHOR' => profile_url(array('username' => str_short($topic['first_username'], 15), 'user_id' => $topic['first_user_id'], 'user_rank' => $topic['first_user_rank'])), 'LAST_POSTER' => profile_url(array('username' => str_short($topic['last_username'], 15), 'user_id' => $topic['last_user_id'], 'user_rank' => $topic['last_user_rank'])), 'LAST_POST_TIME' => bb_date($topic['topic_last_post_time']), 'LAST_POST_ID' => $topic['topic_last_post_id']));
    if (isset($topic['tor_size'])) {
        $tor_magnet = create_magnet($topic['info_hash'], $topic['auth_key'], $userdata['session_logged_in']);
Exemplo n.º 3
0
    if (!($result = DB()->sql_query($sql))) {
        bb_die('Could not delete topic watch information #1');
    }
}
$template->assign_vars(array('PAGE_TITLE' => $lang['WATCHED_TOPICS'], 'S_FORM_ACTION' => BB_ROOT . 'profile.php?mode=watch'));
$sql = "SELECT COUNT(topic_id) as watch_count FROM " . BB_TOPICS_WATCH . " WHERE user_id = {$user_id}";
if (!($result = DB()->sql_query($sql))) {
    bb_die('Could not obtain watch topic information #2');
}
$row = DB()->sql_fetchrow($result);
$watch_count = $row['watch_count'] ? $row['watch_count'] : 0;
DB()->sql_freeresult($result);
if ($watch_count > 0) {
    $sql = "SELECT w.*, t.*, f.*, u.*, u2.username as last_username, u2.user_id as last_user_id,\n\t\tu2.user_level as last_user_level, u2.user_rank as last_user_rank\n\tFROM " . BB_TOPICS_WATCH . " w, " . BB_TOPICS . " t, " . BB_USERS . " u, " . BB_FORUMS . " f, " . BB_POSTS . " p, " . BB_USERS . " u2\n\tWHERE w.topic_id = t.topic_id\n\t\tAND t.forum_id = f.forum_id\n\t\tAND p.post_id = t.topic_last_post_id\n\t\tAND p.poster_id = u2.user_id\n\t\tAND t.topic_poster = u.user_id\n\t\tAND w.user_id = {$user_id}\n\tGROUP BY t.topic_last_post_time DESC\n\tLIMIT {$start}, {$per_page}";
    if (!($result = DB()->sql_query($sql))) {
        bb_die('Could not obtain watch topic information #3');
    }
    $watch = DB()->sql_fetchrowset($result);
    if ($watch) {
        for ($i = 0; $i < count($watch); $i++) {
            $is_unread = is_unread($watch[$i]['topic_last_post_time'], $watch[$i]['topic_id'], $watch[$i]['forum_id']);
            $template->assign_block_vars('watch', array('ROW_CLASS' => !($i % 2) ? 'row1' : 'row2', 'POST_ID' => $watch[$i]['topic_first_post_id'], 'TOPIC_ID' => $watch[$i]['topic_id'], 'TOPIC_TITLE' => wbr(str_short($watch[$i]['topic_title'], 70)), 'FULL_TOPIC_TITLE' => wbr($watch[$i]['topic_title']), 'U_TOPIC' => TOPIC_URL . $watch[$i]['topic_id'], 'FORUM_TITLE' => wbr($watch[$i]['forum_name']), 'U_FORUM' => FORUM_URL . $watch[$i]['forum_id'], 'REPLIES' => $watch[$i]['topic_replies'], 'AUTHOR' => profile_url($watch[$i]), 'LAST_POST' => bb_date($watch[$i]['topic_last_post_time']) . '<br />' . profile_url(array('user_id' => $watch[$i]['last_user_id'], 'username' => $watch[$i]['last_username'], 'user_rank' => $watch[$i]['last_user_rank'])), 'LAST_POST_ID' => $watch[$i]['topic_last_post_id'], 'IS_UNREAD' => $is_unread, 'TOPIC_ICON' => get_topic_icon($watch[$i], $is_unread), 'PAGINATION' => $watch[$i]['topic_status'] == TOPIC_MOVED ? '' : build_topic_pagination(TOPIC_URL . $watch[$i]['topic_id'], $watch[$i]['topic_replies'], $bb_cfg['posts_per_page'])));
        }
        $template->assign_vars(array('MATCHES' => count($watch) == 1 ? sprintf($lang['FOUND_SEARCH_MATCH'], count($watch)) : sprintf($lang['FOUND_SEARCH_MATCHES'], count($watch)), 'PAGINATION' => generate_pagination(BB_ROOT . 'profile.php?mode=watch', $watch_count, $per_page, $start), 'PAGE_NUMBER' => sprintf($lang['PAGE_OF'], floor($start / $per_page) + 1, ceil($watch_count / $per_page)), 'U_PER_PAGE' => BB_ROOT . 'profile.php?mode=watch', 'PER_PAGE' => $per_page));
    }
    DB()->sql_freeresult($result);
} else {
    meta_refresh('index.php', 3);
    bb_die($lang['NO_WATCHED_TOPICS']);
}
print_page('usercp_topic_watch.tpl');
Exemplo n.º 4
0
function get_topic_icon($topic, $is_unread = null)
{
    global $bb_cfg, $images;
    $t_hot = $topic['topic_replies'] >= $bb_cfg['hot_threshold'];
    $is_unread = is_null($is_unread) ? is_unread($topic['topic_last_post_time'], $topic['topic_id'], $topic['forum_id']) : $is_unread;
    if ($topic['topic_status'] == TOPIC_MOVED) {
        $folder_image = $images['folder'];
    } else {
        $folder = $t_hot ? $images['folder_hot'] : $images['folder'];
        $folder_new = $t_hot ? $images['folder_hot_new'] : $images['folder_new'];
        if ($topic['topic_type'] == POST_ANNOUNCE) {
            $folder = $images['folder_announce'];
            $folder_new = $images['folder_announce_new'];
        } else {
            if ($topic['topic_type'] == POST_STICKY) {
                $folder = $images['folder_sticky'];
                $folder_new = $images['folder_sticky_new'];
            } else {
                if ($topic['topic_status'] == TOPIC_LOCKED) {
                    $folder = $images['folder_locked'];
                    $folder_new = $images['folder_locked_new'];
                } else {
                    if ($topic['topic_dl_type'] == TOPIC_DL_TYPE_DL) {
                        $folder = $t_hot ? $images['folder_dl_hot'] : $images['folder_dl'];
                        $folder_new = $t_hot ? $images['folder_dl_hot_new'] : $images['folder_dl_new'];
                    }
                }
            }
        }
        $folder_image = $is_unread ? $folder_new : $folder;
    }
    return $folder_image;
}
Exemplo n.º 5
0
        $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'))) {
        $datastore->update('network_news');
        $network_news = $datastore->get('network_news');
    }
    $template->assign_vars(array('SHOW_NETWORK_NEWS' => true));
    foreach ($network_news as $net) {
        $template->assign_block_vars('net', array('NEWS_TOPIC_ID' => $net['topic_id'], 'NEWS_TITLE' => str_short($net['topic_title'], $bb_cfg['max_net_title']), 'NEWS_TIME' => bb_date($net['topic_time'], 'd-M', false), 'NEWS_IS_NEW' => is_unread($net['topic_time'], $net['topic_id'], $net['forum_id'])));
    }
}
if ($bb_cfg['birthday_check_day'] && $bb_cfg['birthday_enabled']) {
    $week_list = $today_list = array();
    $week_all = $today_all = false;
    if ($stats['birthday_week_list']) {
        shuffle($stats['birthday_week_list']);
        foreach ($stats['birthday_week_list'] as $i => $week) {
            if ($i >= 5) {
                $week_all = true;
                continue;
            }
            $week_list[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday'] - 1) . ')</span>';
        }
        $week_all = $week_all ? '&nbsp;<a class="txtb" href="#" onclick="ajax.exec({action: \'index_data\', mode: \'birthday_week\'}); return false;" title="' . $lang['ALL'] . '">...</a>' : '';