Exemplo n.º 1
0
    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";
    echo "  </tr>\n";
    echo "</table>\n";
    if (adsense_check_user() && adsense_check_page($message['PID'], 1, $thread_data['LENGTH'])) {
        adsense_output_html();
        echo "<br />\n";
    }
}
echo "<table width=\"96%\" border=\"0\">\n";
echo "  <tr>\n";
echo "    <td align=\"center\">\n";
echo "      <a href=\"messages.php?webtag={$webtag}&amp;msg={$tid}.{$pid}\" target=\"_self\" class=\"button\"><span>", gettext("Back"), "</span></a>\n";
echo "      ", form_button("print", gettext("Print")), "\n";
echo "    </td>\n";
echo "  </tr>\n";
echo "</table>\n";
html_draw_bottom();
Exemplo n.º 2
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']);
    }
}
Exemplo n.º 3
0
        } else {
            $message['CONTENT'] = message_get_content($tid, $message['PID']);
        }
        if ($thread_data['POLL_FLAG'] == 'Y') {
            if ($message['PID'] == 1) {
                poll_display($tid, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], $show_sigs, false, $highlight_array);
                $last_pid = $message['PID'];
            } else {
                message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], true, $show_sigs, false, $highlight_array);
                $last_pid = $message['PID'];
            }
        } else {
            message_display($tid, $message, $thread_data['LENGTH'], $pid, $thread_data['FID'], true, $thread_data['CLOSED'], false, $show_sigs, false, $highlight_array);
            $last_pid = $message['PID'];
        }
        if (adsense_check_user() && adsense_check_page($message_number, $posts_per_page, $thread_data['LENGTH'])) {
            adsense_output_html();
            echo "<br />\n";
        }
    }
}
if ($msg_count > 0 && session::logged_in() && !isset($_GET['markasread'])) {
    messages_update_read($tid, $last_pid, $thread_data['LAST_READ'], $thread_data['LENGTH'], $thread_data['MODIFIED']);
}
echo "</div>\n";
echo "<div align=\"center\">\n";
echo "<table width=\"96%\" border=\"0\">\n";
echo "  <tr>\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 "    <td width=\"33%\" align=\"left\" style=\"white-space: nowrap\" class=\"postbody\">";
    echo "      ", html_style_image('reply_all', gettext("Reply to All")), " ";
Exemplo n.º 4
0
function html_draw_bottom($frame_set_html = false)
{
    if (!is_bool($frame_set_html)) {
        $frame_set_html = false;
    }
    if ($frame_set_html === false) {
        if ($page_footer = html_get_page_footer()) {
            echo fix_html($page_footer);
        }
        if (adsense_publisher_id() && adsense_check_user() && adsense_check_page_bottom()) {
            echo '<br>';
            adsense_output_html();
        }
        if ($google_analytics_code = html_get_google_analytics_code()) {
            echo "<script type=\"text/javascript\">\n\n";
            echo "  var _gaq = _gaq || [];\n";
            echo "  _gaq.push(['_setAccount', '{$google_analytics_code}']);\n";
            echo "  _gaq.push(['_trackPageview']);\n\n";
            echo "  (function() {\n";
            echo "    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n";
            echo "    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n";
            echo "    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n";
            echo "  })();\n\n";
            echo "</script>\n";
        }
        echo "</body>\n";
    }
    echo "</html>\n";
}
Exemplo n.º 5
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']);
    }
}