Ejemplo n.º 1
0
        } else {
            if ($_POST['submit_forum']) {
                redirect('viewforum.php?id=' . $forum_id, $lang_post['Post redirect']);
            } else {
                redirect('viewtopic.php?pid=' . $new_pid . '#p' . $new_pid, $lang_post['Post redirect']);
            }
        }
    }
}
// If a topic id was specified in the url (it's a reply).
if ($tid) {
    if (!$pun_user['is_guest'] && !isset($_POST['form_sent'])) {
        $last_read = get_topic_last_read($tid);
        if ($cur_posting['last_post'] > $last_read) {
            $errors[] = $lang_post['New posts error'];
            mark_topic_read($tid, $cur_posting['id'], $cur_posting['last_post']);
        }
        if ($is_comment) {
            $last_read = $cur_posting['last_post'];
            $errors = array();
        }
        $show_new = true;
    }
    $action = $lang_post['Post a reply'];
    $form = '<form id="post" method="post" action="post.php?action=post&amp;tid=' . $tid . '#postpreview" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">';
    // If a quote-id was specified in the url.
    if (isset($_GET['qid'])) {
        $qid = intval($_GET['qid']);
        if ($qid < 1) {
            message($lang_common['Bad request']);
        }
Ejemplo n.º 2
0
while ($cur_post = $db->fetch_assoc($result)) {
    $posts_list[] = $cur_post;
    $posters_ids[] = $cur_post['poster_id'];
}
if (count($posters_ids) > 0) {
    $posters_ids = array_unique($posters_ids);
    $result = $db->query('SELECT u.id, u.email, u.title, u.use_avatar, u.signature, u.email_setting, u.num_posts, g.g_id, g.g_user_title FROM ' . $db->prefix . 'users AS u INNER JOIN ' . $db->prefix . 'groups AS g ON g.g_id=u.group_id WHERE u.id IN (' . implode(',', $posters_ids) . ')', true) or error('Unable to fetch posters info', __FILE__, __LINE__, $db->error());
    while ($cur_poster = $db->fetch_assoc($result)) {
        $posters_data[$cur_poster['id']] = $cur_poster;
    }
}
// Mark as read only post showed on the page and preceding pages
if (!$pun_user['is_guest']) {
    $last_read = get_topic_last_read($id);
    $last_read_post = end($posts_list);
    mark_topic_read($id, $cur_topic['forum_id'], $last_read_post['posted']);
} else {
    $last_read = 0;
}
foreach ($posts_list as $cur_post) {
    $post_id_list[] = $cur_post['id'];
}
foreach ($posts_list as $cur_post) {
    $post_count++;
    $is_first_post = $post_count + $start_from == 1;
    $user_avatar = '';
    $user_nb_posts = '';
    $user_info = array();
    $user_contacts = array();
    $post_actions = array();
    $signature = '';