Beispiel #1
0
}
if (isset($t_fid) && !session::check_perm(USER_PERM_SIGNATURE, $t_fid)) {
    $allow_sig = false;
}
if ($allow_html == false) {
    $t_content = htmlentities_array($t_content);
    $t_sig = htmlentities_array($t_sig);
}
if (!$new_thread) {
    if (!($reply_message = messages_get($reply_to_tid, $reply_to_pid))) {
        html_draw_error(gettext("That post does not exist in this thread!"));
    }
    if (!($thread_data = thread_get($reply_to_tid))) {
        html_draw_error(gettext("The requested thread could not be found or access was denied."));
    }
    $reply_message['CONTENT'] = message_get_content($reply_to_tid, $reply_to_pid);
    if (perm_get_user_permissions($reply_message['FROM_UID']) & USER_PERM_WORMED && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid) || (!isset($reply_message['CONTENT']) || $reply_message['CONTENT'] == "") && $thread_data['POLL_FLAG'] != 'Y' && $reply_to_pid != 0) {
        html_draw_error(gettext("Message not found. Check that it hasn't been deleted."));
    }
}
if ($valid && isset($_POST['post'])) {
    if (post_check_frequency()) {
        if (post_check_ddkey($t_dedupe)) {
            if ($new_thread) {
                if (session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
                    $t_closed = isset($_POST['t_closed']) && $_POST['t_closed'] == 'Y' ? true : false;
                    $t_sticky = isset($_POST['t_sticky']) && $_POST['t_sticky'] == 'Y' ? 'Y' : 'N';
                } else {
                    $t_closed = false;
                    $t_sticky = "N";
                }
Beispiel #2
0
if (!($edit_message = messages_get($tid, 1, 1))) {
    html_draw_top(sprintf("title=%s", gettext("Error")));
    html_display_error_msg(gettext("That post does not exist in this thread!"));
    html_draw_bottom();
    exit;
}
$post_edit_time = forum_get_setting('post_edit_time', null, 0);
$uid = session::get_value('UID');
if ((forum_get_setting('allow_post_editing', 'N') || $uid != $edit_message['FROM_UID'] && !(perm_get_user_permissions($edit_message['FROM_UID']) & USER_PERM_PILLORIED) || session::check_perm(USER_PERM_PILLORIED, 0) || $post_edit_time > 0 && time() - $edit_message['CREATED'] >= $post_edit_time * HOUR_IN_SECONDS) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
    html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $edit_message));
}
if (forum_get_setting('require_post_approval', 'Y') && isset($edit_message['APPROVED']) && $edit_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
    html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $edit_message));
}
if ($preview_message = messages_get($tid, $pid, 1)) {
    $preview_message['CONTENT'] = message_get_content($tid, $pid);
    if (strlen(trim($preview_message['CONTENT'])) < 1 && !thread_is_poll($tid)) {
        html_draw_top(sprintf("title=%s", gettext("Error")));
        post_edit_refuse($tid, $pid);
        html_draw_bottom();
        exit;
    }
    if ((session::get_value('UID') != $preview_message['FROM_UID'] || session::check_perm(USER_PERM_PILLORIED, 0)) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
        html_draw_top(sprintf("title=%s", gettext("Error")));
        post_edit_refuse($tid, $pid);
        html_draw_bottom();
        exit;
    }
    if (forum_get_setting('require_post_approval', 'Y') && isset($preview_message['APPROVED']) && $preview_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
        html_draw_top(sprintf("title=%s", gettext("Error")));
        post_edit_refuse($tid, $pid);
function message_get_meta_content($msg, &$meta_keywords, &$meta_description)
{
    if (!validate_msg($msg)) {
        return;
    }
    list($tid, $pid) = explode('.', $msg);
    if (($thread_data = thread_get($tid)) && ($message_content = message_get_content($tid, $pid))) {
        $meta_keywords_array = search_extract_keywords(strip_tags(htmlentities_decode_array($message_content)));
        $meta_description = $thread_data['TITLE'];
        $meta_keywords = htmlentities_array(implode(',', $meta_keywords_array['keywords_array']));
    }
}
Beispiel #4
0
function light_draw_messages($tid, $pid, array $thread_data, array $messages)
{
    $webtag = get_webtag();
    forum_check_webtag_available($webtag);
    $msg_count = count($messages);
    $last_pid = null;
    light_messages_top($tid, $pid, $thread_data['TITLE'], $thread_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y');
    if (isset($_GET['post_success']) && validate_msg($_GET['post_success'])) {
        list($return_tid, $return_pid) = explode(".", $_GET['post_success']);
        if ($return_tid != $tid || $return_pid > $pid + 10) {
            light_html_display_success_msg(sprintf(gettext("Successfully created post %s"), $_GET['post_success']));
        }
    } else {
        if (isset($_GET['edit_success']) && validate_msg($_GET['edit_success'])) {
            light_html_display_success_msg(sprintf(gettext("Successfully edited post %s"), $_GET['edit_success']));
        } else {
            if (isset($_GET['delete_success']) && validate_msg($_GET['delete_success'])) {
                light_html_display_success_msg(sprintf(gettext("Successfully deleted post %s"), $_GET['delete_success']));
            } else {
                if (isset($_GET['delete_success']) && validate_msg($_GET['delete_success'])) {
                    light_html_display_success_msg(sprintf(gettext("Successfully deleted post %s"), $_GET['delete_success']));
                } else {
                    if (isset($_GET['post_approve_success']) && validate_msg($_GET['post_approve_success'])) {
                        light_html_display_success_msg(sprintf(gettext("Successfully approved post %s"), $_GET['post_approve_success']));
                    }
                }
            }
        }
    }
    if (($tracking_data_array = thread_get_tracking_data($tid)) !== false) {
        foreach ($tracking_data_array as $tracking_data) {
            if ($tracking_data['TRACK_TYPE'] == THREAD_TYPE_MERGE) {
                // Thread merged
                if ($tracking_data['TID'] == $tid) {
                    $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                    $thread_link = sprintf($thread_link, $tracking_data['NEW_TID'], gettext("here"));
                    light_html_display_warning_msg(sprintf(gettext("<b>Threads Merged:</b> This thread has moved %s"), $thread_link));
                }
                if ($tracking_data['NEW_TID'] == $tid) {
                    $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                    $thread_link = sprintf($thread_link, $tracking_data['TID'], gettext("here"));
                    light_html_display_warning_msg(sprintf(gettext("<b>Threads Merged:</b> This thread was merged from %s"), $thread_link));
                }
            } else {
                if ($tracking_data['TRACK_TYPE'] == THREAD_TYPE_SPLIT) {
                    // Thread Split
                    if ($tracking_data['TID'] == $tid) {
                        $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                        $thread_link = sprintf($thread_link, $tracking_data['NEW_TID'], gettext("here"));
                        light_html_display_warning_msg(sprintf(gettext("<b>Thread Split:</b> Some posts in this thread have been moved %s"), $thread_link));
                    }
                    if ($tracking_data['NEW_TID'] == $tid) {
                        $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                        $thread_link = sprintf($thread_link, $tracking_data['TID'], gettext("here"));
                        light_html_display_warning_msg(sprintf(gettext("<b>Thread Split:</b> Some posts in this thread were moved from %s"), $thread_link));
                    }
                }
            }
        }
    }
    echo "<div id=\"messages\" data-navigation=\"{$tid}_{$pid}_{$thread_data['LENGTH']}_10\">\n";
    if ($msg_count > 0) {
        foreach ($messages as $message_number => $message) {
            if (isset($message['RELATIONSHIP']) && ($message['RELATIONSHIP'] & USER_IGNORED || $message['RELATIONSHIP'] & USER_IGNORED_COMPLETELY)) {
                $message['CONTENT'] = gettext("Ignored");
            } else {
                $message['CONTENT'] = message_get_content($tid, $message['PID']);
            }
            if ($thread_data['POLL_FLAG'] == 'Y') {
                if ($message['PID'] == 1) {
                    light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], true, $thread_data['CLOSED'], false, false);
                    $last_pid = $message['PID'];
                } else {
                    light_message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], true, true, false);
                    $last_pid = $message['PID'];
                }
            } else {
                light_message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], true, false, false);
                $last_pid = $message['PID'];
            }
            if (adsense_check_user() && adsense_check_page($message_number, 10, $thread_data['LENGTH'])) {
                adsense_output_html();
            }
        }
    }
    unset($messages, $message);
    echo "</div>\n";
    if ($last_pid < $thread_data['LENGTH']) {
        echo "<div class=\"message_page_footer\">\n";
        echo "<ul>\n";
        echo "<li class=\"right_col\">", light_form_quick_button("lmessages.php", gettext("Keep reading&hellip;"), array('msg' => $tid . '.' . ($last_pid + 1)), '_self', 'keep_reading'), "</li>\n";
        echo "</ul>\n";
        echo "</div>\n";
    }
    if ($msg_count > 0 && session::logged_in()) {
        messages_update_read($tid, $last_pid, $thread_data['LAST_READ'], $thread_data['LENGTH'], $thread_data['MODIFIED']);
    }
}
Beispiel #5
0
        thread_set_sticky($tid, false);
        $thread_data['STICKY'] = "N";
    }
}
$show_sigs = session::get_value('VIEW_SIGS') == 'N' ? false : true;
echo "<div align=\"center\">\n";
echo "<table width=\"96%\" border=\"0\">\n";
echo "  <tr>\n";
echo "    <td align=\"left\">", messages_top($tid, $pid, $thread_data['FID'], $folder_data['TITLE'], $thread_data['TITLE'], $thread_data['INTEREST'], $folder_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y', true), "</td>\n";
echo "    <td align=\"right\">", messages_social_links($tid), "</td>\n";
echo "  </tr>\n";
echo "</table>\n";
echo "</div>\n";
if ($message) {
    $first_msg = $message['PID'];
    $message['CONTENT'] = message_get_content($tid, $message['PID']);
    echo "<table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n";
    echo "  <tr>\n";
    echo "    <td align=\"left\" width=\"2%\" valign=\"top\">&nbsp;</td>\n";
    echo "    <td align=\"center\">\n";
    if ($thread_data['POLL_FLAG'] == 'Y') {
        if ($message['PID'] == 1) {
            poll_display($tid, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], true, $thread_data['CLOSED'], false, $show_sigs, true);
        } else {
            message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], true, $thread_data['CLOSED'], false, true, $show_sigs, true);
        }
    } else {
        message_display($tid, $message, $thread_data['LENGTH'], $first_msg, $thread_data['FID'], true, $thread_data['CLOSED'], false, false, $show_sigs, true);
    }
    echo "    </td>\n";
    echo "    <td width=\"2%\">&nbsp;</td>\n";
Beispiel #6
0
     if (isset($_POST['emots_toggle'])) {
         $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY;
     } else {
         if (isset($_POST['sig_toggle'])) {
             $page_prefs = (double) $page_prefs ^ POST_SIGNATURE_DISPLAY;
         }
     }
     $user_prefs = array('POST_PAGE' => $page_prefs);
     if (!user_update_prefs($uid, $user_prefs)) {
         $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
         $valid = false;
     }
 } else {
     $post_edit_time = forum_get_setting('post_edit_time', null, 0);
     if (count($edit_message) > 0) {
         if ($edit_message['CONTENT'] = message_get_content($tid, $pid)) {
             if ((forum_get_setting('allow_post_editing', 'N') || $uid != $edit_message['FROM_UID'] && !(perm_get_user_permissions($edit_message['FROM_UID']) & USER_PERM_PILLORIED) || session::check_perm(USER_PERM_PILLORIED, 0) || $post_edit_time > 0 && time() - $edit_message['CREATED'] >= $post_edit_time * HOUR_IN_SECONDS) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
                 html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg));
             }
             if (forum_get_setting('require_post_approval', 'Y') && isset($edit_message['APPROVED']) && $edit_message['APPROVED'] == 0 && !session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
                 html_draw_error(gettext("You are not permitted to edit this message."), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg));
             }
             $parsed_message = new MessageTextParse($edit_message['CONTENT']);
             $t_content = $parsed_message->getMessage();
             $t_sig = $parsed_message->getSig();
         } else {
             html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg));
         }
     } else {
         html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'discussion.php', 'get', array('back' => gettext("Back")), array('msg' => $msg));
     }
echo "<link>{$forum_location}/</link>\n";
echo "</image>\n";
// Get the 20 most recent threads
if ($threads_array = threads_get_most_recent($limit, $fid, $sort_created == 'Y')) {
    foreach ($threads_array as $thread) {
        $t_title = $thread['TITLE'];
        // Make the date human readable and fetch the content of the last
        // post in the thread. Can easily change this if it isn't right
        // by making it fetch post 1.
        $modified_date = gmdate("D, d M Y H:i:s", $thread['MODIFIED']);
        // Get the post content and author
        if ($sort_created == 'Y') {
            $t_content = message_get_content($thread['TID'], 1);
            $t_user_array = message_get_user_array($thread['TID'], 1);
        } else {
            $t_content = message_get_content($thread['TID'], $thread['LENGTH']);
            $t_user_array = message_get_user_array($thread['TID'], $thread['LENGTH']);
        }
        // Strip signatures from the RSS feed
        $t_content = message_apply_formatting($t_content, true);
        // Strip HTML and trim the content back.
        $t_content = strip_tags(trim(xml_strip_invalid_chars($t_content)));
        // Convert HTML special chars (& -> &amp;, etc);
        $t_content = htmlspecialchars($t_content);
        $t_title = htmlspecialchars($t_title);
        // Check for double-encoded HTML chars (&amp;amp;, etc.)
        $t_content = preg_replace("/&amp;(#[0-9]+|[a-z]+);/iu", "&\\1;", $t_content);
        $t_title = preg_replace("/&amp;(#[0-9]+|[a-z]+);/iu", "&\\1;", $t_title);
        // Convert HTML entities to XML literals.
        $t_content = html_entity_to_decimal($t_content);
        $t_title = html_entity_to_decimal($t_title);
Beispiel #8
0
            if (isset($_POST['emots_toggle'])) {
                $page_prefs = (double) $page_prefs ^ POST_EMOTICONS_DISPLAY;
            } else {
                if (isset($_POST['sig_toggle'])) {
                    $page_prefs = (double) $page_prefs ^ POST_SIGNATURE_DISPLAY;
                }
            }
            $user_prefs = array('POST_PAGE' => $page_prefs);
            if (!user_update_prefs($_SESSION['UID'], $user_prefs)) {
                $error_msg_array[] = gettext("Some or all of your user account details could not be updated. Please try again later.");
                $valid = false;
            }
        } else {
            $post_edit_time = forum_get_setting('post_edit_time', 'is_numeric', 0);
            if (count($edit_message) > 0) {
                if (($edit_message['CONTENT'] = message_get_content($tid, $pid)) !== false) {
                    if ((forum_get_setting('allow_post_editing', 'N') || $_SESSION['UID'] != $edit_message['FROM_UID'] && !(perm_get_user_permissions($edit_message['FROM_UID']) & USER_PERM_PILLORIED) || session::check_perm(USER_PERM_PILLORIED, 0) || $post_edit_time > 0 && time() - $edit_message['CREATED'] >= $post_edit_time * HOUR_IN_SECONDS) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
                        light_html_draw_error(gettext("You are not permitted to edit this message."), 'lmessages.php', 'get', array('back' => gettext("Back")), array('msg' => $return_msg));
                    }
                    $parsed_message = new MessageTextParse($edit_message['CONTENT']);
                    $content = $parsed_message->getMessage();
                    $sig = $parsed_message->getSig();
                } else {
                    light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
                }
            } else {
                light_html_draw_error(sprintf(gettext("Message %s was not found"), $msg), 'lthread_list.php', 'get', array('back' => gettext("Back")));
            }
        }
    }
}
Beispiel #9
0
 if (($search_results_array = search_fetch_results($page, $sort_by, $sort_dir)) !== false) {
     html_draw_top(array('js' => array('js/search.js', 'js/search_popup.js', 'js/thread_list.js')));
     thread_list_draw_top(SEARCH_RESULTS);
     echo "<br />\n";
     echo "<h1>", gettext("Search Results"), "</h1>\n";
     echo "", html_style_image('search', gettext("Found")), "&nbsp;", gettext("Found"), ": {$search_results_array['result_count']} ", gettext("matches"), "<br />\n";
     if ($page > 1) {
         echo "", html_style_image('current_thread', gettext("Previous page")), "&nbsp;<a href=\"search.php?webtag={$webtag}&amp;page=", $page - 1, "&amp;sort_by={$sort_by}&amp;sort_dir={$sort_dir}\">", gettext("Previous page"), "</a>\n";
     }
     echo "<ol start=\"", $page * 20 - 20 + 1, "\">\n";
     foreach ($search_results_array['result_array'] as $search_result) {
         if (($message = messages_get($search_result['TID'], $search_result['PID'], 1)) !== false) {
             if (($thread_data = thread_get($search_result['TID'])) !== false) {
                 $message['TITLE'] = trim($thread_data['TITLE']);
                 // Fetch the messaage content, strip the signature and remove HTML.
                 $message['CONTENT'] = message_get_content($search_result['TID'], $search_result['PID']);
                 $message['CONTENT'] = message_apply_formatting($message['CONTENT'], true);
                 $message['CONTENT'] = trim(strip_tags($message['CONTENT']));
                 // Limit thread title to 20 characters.
                 if (mb_strlen($message['TITLE']) > 20) {
                     $message['TITLE'] = word_filter_add_ob_tags(mb_substr($message['TITLE'], 0, 20), true) . "&hellip;";
                 } else {
                     $message['TITLE'] = word_filter_add_ob_tags($message['TITLE'], true);
                 }
                 // Limit displayed post content to 35 characters
                 if (mb_strlen($message['CONTENT']) > 70) {
                     $message['CONTENT'] = word_filter_add_ob_tags(fix_html(mb_substr($message['CONTENT'], 0, 70)), true) . "&hellip;";
                 } else {
                     $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], true);
                 }
                 if (thread_is_poll($search_result['TID']) && $search_result['PID'] == 1 || strlen($message['CONTENT']) < 1) {
Beispiel #10
0
function light_draw_messages($tid, $pid)
{
    $webtag = get_webtag();
    if (!($thread_data = thread_get($tid, session::check_perm(USER_PERM_ADMIN_TOOLS, 0)))) {
        light_html_display_error_msg(gettext("The requested thread could not be found or access was denied."));
        return;
    }
    if (!folder_get($thread_data['FID'])) {
        light_html_display_error_msg(gettext("The requested folder could not be found or access was denied."));
        return;
    }
    if (!($messages = messages_get($tid, $pid, 10))) {
        light_html_display_error_msg(gettext("That post does not exist in this thread!"));
        return;
    }
    $msg_count = count($messages);
    light_messages_top($tid, $pid, $thread_data['TITLE'], $thread_data['INTEREST'], $thread_data['STICKY'], $thread_data['CLOSED'], $thread_data['ADMIN_LOCK'], $thread_data['DELETED'] == 'Y');
    if ($tracking_data_array = thread_get_tracking_data($tid)) {
        foreach ($tracking_data_array as $tracking_data) {
            if ($tracking_data['TRACK_TYPE'] == THREAD_TYPE_MERGE) {
                // Thread merged
                if ($tracking_data['TID'] == $tid) {
                    $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                    $thread_link = sprintf($thread_link, $tracking_data['NEW_TID'], gettext("here"));
                    light_html_display_warning_msg(sprintf(gettext("<b>Threads Merged:</b> This thread has moved %s"), $thread_link));
                }
                if ($tracking_data['NEW_TID'] == $tid) {
                    $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                    $thread_link = sprintf($thread_link, $tracking_data['TID'], gettext("here"));
                    light_html_display_warning_msg(sprintf(gettext("<b>Threads Merged:</b> This thread was merged from %s"), $thread_link));
                }
            } else {
                if ($tracking_data['TRACK_TYPE'] == THREAD_TYPE_SPLIT) {
                    // Thread Split
                    if ($tracking_data['TID'] == $tid) {
                        $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                        $thread_link = sprintf($thread_link, $tracking_data['NEW_TID'], gettext("here"));
                        light_html_display_warning_msg(sprintf(gettext("<b>Thread Split:</b> Some posts in this thread have been moved %s"), $thread_link));
                    }
                    if ($tracking_data['NEW_TID'] == $tid) {
                        $thread_link = "<a href=\"lmessages.php?webtag={$webtag}&amp;msg=%s.1\" target=\"_self\">%s</a>";
                        $thread_link = sprintf($thread_link, $tracking_data['TID'], gettext("here"));
                        light_html_display_warning_msg(sprintf(gettext("<b>Thread Split:</b> Some posts in this thread were moved from %s"), $thread_link));
                    }
                }
            }
        }
    }
    if ($msg_count > 0) {
        foreach ($messages as $message_number => $message) {
            if (isset($message['RELATIONSHIP'])) {
                if ($message['RELATIONSHIP'] >= 0) {
                    // if we're not ignoring this user
                    $message['CONTENT'] = message_get_content($tid, $message['PID']);
                } else {
                    $message['CONTENT'] = gettext("Ignored");
                    // must be set to something or will show as deleted
                }
            } else {
                $message['CONTENT'] = message_get_content($tid, $message['PID']);
            }
            if ($thread_data['POLL_FLAG'] == 'Y') {
                if ($message['PID'] == 1) {
                    light_poll_display($tid, $thread_data['LENGTH'], $thread_data['FID'], true, $thread_data['CLOSED'], false, false);
                    $last_pid = $message['PID'];
                } else {
                    light_message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], true, true, false);
                    $last_pid = $message['PID'];
                }
            } else {
                light_message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], true, false, false);
                $last_pid = $message['PID'];
            }
            if (adsense_check_user() && adsense_check_page($message_number, 10, $thread_data['LENGTH'])) {
                adsense_output_html();
            }
        }
    }
    unset($messages, $message);
    echo "<div class=\"message_page_footer\">\n";
    echo "<ul>\n";
    if ($thread_data['CLOSED'] == 0 && session::check_perm(USER_PERM_POST_CREATE, $thread_data['FID']) || session::check_perm(USER_PERM_FOLDER_MODERATE, $thread_data['FID'])) {
        echo "<li><a href=\"lpost.php?webtag={$webtag}&amp;replyto={$tid}.0\" class=\"reply_all\">", gettext("Reply to All"), "</a></li>\n";
    }
    if ($last_pid < $thread_data['LENGTH']) {
        $npid = $last_pid + 1;
        echo "<li class=\"right_col\">", light_form_quick_button("lmessages.php", gettext("Keep reading&hellip;"), array('msg' => "{$tid}.{$npid}")), "</li>\n";
    }
    echo "</ul>\n";
    echo "</div>\n";
    echo "<a href=\"lthread_list.php?webtag={$webtag}\" class=\"thread_list_link\">", gettext("Back to thread list"), "</a>";
    light_messages_nav_strip($tid, $pid, $thread_data['LENGTH'], 10);
    if ($msg_count > 0 && session::logged_in()) {
        messages_update_read($tid, $last_pid, $thread_data['LAST_READ'], $thread_data['LENGTH'], $thread_data['MODIFIED']);
    }
}
Beispiel #11
0
 if ($search_results_array = search_fetch_results($page, $sort_by, $sort_dir)) {
     html_draw_top('search.js', 'search_popup.js');
     thread_list_draw_top(SEARCH_RESULTS);
     echo "<br />\n";
     echo "<h1>", gettext("Search Results"), "</h1>\n";
     echo "<img src=\"", html_style_image('search.png'), "\" alt=\"", gettext("Found"), "\" title=\"", gettext("Found"), "\" />&nbsp;", gettext("Found"), ": {$search_results_array['result_count']} ", gettext("matches"), "<br />\n";
     if ($page > 1) {
         echo "<img src=\"" . html_style_image('current_thread.png') . "\" alt=\"", gettext("Previous page"), "\" title=\"", gettext("Previous page"), "\" />&nbsp;<a href=\"search.php?webtag={$webtag}&amp;page=", $page - 1, "&amp;sort_by={$sort_by}&amp;sort_dir={$sort_dir}\">", gettext("Previous page"), "</a>\n";
     }
     echo "<ol start=\"", $page * 20 - 20 + 1, "\">\n";
     foreach ($search_results_array['result_array'] as $search_result) {
         if ($message = messages_get($search_result['TID'], $search_result['PID'], 1)) {
             $message['CONTENT'] = message_get_content($search_result['TID'], $search_result['PID']);
             if ($thread_data = thread_get($search_result['TID'])) {
                 $message['TITLE'] = trim($thread_data['TITLE']);
                 $message['CONTENT'] = trim(strip_tags(message_get_content($search_result['TID'], $search_result['PID'])));
                 // Limit thread title to 20 characters.
                 if (mb_strlen($message['TITLE']) > 20) {
                     $message['TITLE'] = word_filter_add_ob_tags(mb_substr($message['TITLE'], 0, 20), true) . "&hellip;";
                 } else {
                     $message['TITLE'] = word_filter_add_ob_tags($message['TITLE'], true);
                 }
                 // Limit displayed post content to 35 characters
                 if (mb_strlen($message['CONTENT']) > 35) {
                     $message['CONTENT'] = word_filter_add_ob_tags(mb_substr($message['CONTENT'], 0, 35), true) . "&hellip;";
                 } else {
                     $message['CONTENT'] = word_filter_add_ob_tags($message['CONTENT'], true);
                 }
                 if (thread_is_poll($search_result['TID']) && $search_result['PID'] == 1 || strlen($message['CONTENT']) < 1) {
                     echo "  <li><p><a href=\"messages.php?webtag={$webtag}&amp;msg={$search_result['TID']}.{$search_result['PID']}&amp;hightlight=yes\" target=\"", html_get_frame_name('right'), "\"><b>{$message['TITLE']}</b></a><br />";
                     echo "<span class=\"smalltext\"><b>", gettext("From"), ":</b> ", word_filter_add_ob_tags(format_user_name($search_result['FROM_LOGON'], $search_result['FROM_NICKNAME']), true), ", ", format_time($search_result['CREATED']), "</span></p></li>\n";
function message_get_meta_content($msg, &$meta_keywords, &$meta_description)
{
    if (!validate_msg($msg)) {
        return;
    }
    list($tid) = explode('.', $msg);
    if (($thread_data = thread_get($tid)) && ($message_content = message_get_content($tid, 1))) {
        $meta_keywords_array = search_extract_keywords(strip_tags(htmlentities_decode_array($message_content)));
        list($meta_description) = explode("\n", wordwrap($message_content, 150));
        $meta_keywords = htmlentities_array(implode(',', array_map('message_clean_meta_keyword', $meta_keywords_array['keywords_array'])));
    }
}