$new_forum_settings['attachments_max_post_space'] = 1048576;
     // 1MB in bytes
 }
 if (isset($_POST['attachments_allow_embed']) && $_POST['attachments_allow_embed'] == "Y") {
     $new_forum_settings['attachments_allow_embed'] = "Y";
 } else {
     $new_forum_settings['attachments_allow_embed'] = "N";
 }
 if (isset($_POST['attachment_allow_guests']) && $_POST['attachment_allow_guests'] == "Y") {
     $new_forum_settings['attachment_allow_guests'] = "Y";
 } else {
     $new_forum_settings['attachment_allow_guests'] = "N";
 }
 if ($valid) {
     $unread_cutoff_stamp = $new_forum_settings['messages_unread_cutoff'];
     $previous_unread_cutoff_stamp = forum_get_unread_cutoff();
     if (!isset($_POST['confirm_unread_cutoff'])) {
         if ($unread_cutoff_stamp > 0 && $previous_unread_cutoff_stamp !== false && $unread_cutoff_stamp != $previous_unread_cutoff_stamp) {
             html_draw_top(sprintf('title=%s', gettext("Admin - Global Forum Settings")), 'class=window_title');
             echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Global Forum Settings"), "</h1>\n";
             echo "<br />\n";
             echo "<div align=\"center\">\n";
             echo "<form accept-charset=\"utf-8\" name=\"prefsform\" action=\"admin_default_forum_settings.php\" method=\"post\" target=\"_self\">\n";
             echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
             echo "  ", form_input_hidden_array($_POST), "\n";
             echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
             echo "    <tr>\n";
             echo "      <td align=\"left\">\n";
             echo "        <table class=\"box\" width=\"100%\">\n";
             echo "          <tr>\n";
             echo "            <td align=\"left\" class=\"posthead\">\n";
예제 #2
0
function forum_get_unread_cutoff_datetime()
{
    if (($unread_cutoff_stamp = forum_get_unread_cutoff()) === false) {
        return false;
    }
    return date(MYSQL_DATETIME_MIDNIGHT, time() - $unread_cutoff_stamp);
}
예제 #3
0
function thread_list_available_views()
{
    $unread_cutoff_stamp = forum_get_unread_cutoff();
    if (!session::logged_in()) {
        $available_views = array(ALL_DISCUSSIONS => gettext("All Discussions"), TODAYS_DISCUSSIONS => gettext("Today's Discussions"), TWO_DAYS_BACK => gettext("2 Days Back"), SEVEN_DAYS_BACK => gettext("7 Days Back"));
    } else {
        $available_views = array(ALL_DISCUSSIONS => gettext("All Discussions"), UNREAD_DISCUSSIONS => gettext("Unread Discussions"), UNREAD_DISCUSSIONS_TO_ME => gettext("Unread &quot;To: Me&quot;"), TODAYS_DISCUSSIONS => gettext("Today's Discussions"), UNREAD_TODAY => gettext("Unread today"), TWO_DAYS_BACK => gettext("2 Days Back"), SEVEN_DAYS_BACK => gettext("7 Days Back"), HIGH_INTEREST => gettext("High Interest"), UNREAD_HIGH_INTEREST => gettext("Unread High Interest"), RECENTLY_SEEN => gettext("I've recently seen"), IGNORED_THREADS => gettext("I've ignored"), BY_IGNORED_USERS => gettext("By ignored users"), SUBSCRIBED_TO => gettext("I've subscribed to"), STARTED_BY_FRIEND => gettext("Started by friend"), UNREAD_STARTED_BY_FRIEND => gettext("Unread started by friend"), STARTED_BY_ME => gettext("Started by me"), POLL_THREADS => gettext("Polls"), STICKY_THREADS => gettext("Sticky Threads"), MOST_UNREAD_POSTS => gettext("Most unread posts"), SEARCH_RESULTS => gettext("Search Results"), DELETED_THREADS => gettext("Deleted Threads"));
        if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0)) {
            if ($unread_cutoff_stamp === false) {
                // Remove unread thread options (Unread Discussions, Unread Today,
                // Unread High Interest, Unread Started By Friend, Most Unread Posts).
                unset($available_views[UNREAD_DISCUSSIONS], $available_views[UNREAD_TODAY], $available_views[UNREAD_HIGH_INTEREST]);
                unset($available_views[UNREAD_STARTED_BY_FRIEND], $available_views[MOST_UNREAD_POSTS]);
            }
        } else {
            // Remove Admin Deleted Threads option.
            unset($available_views[DELETED_THREADS]);
            if ($unread_cutoff_stamp === false) {
                // Remove unread thread options (Unread Discussions, Unread Today,
                // Unread High Interest, Unread Started By Friend, Most Unread Posts).
                unset($available_views[UNREAD_DISCUSSIONS], $available_views[UNREAD_TODAY], $available_views[UNREAD_HIGH_INTEREST]);
                unset($available_views[UNREAD_STARTED_BY_FRIEND], $available_views[MOST_UNREAD_POSTS]);
            }
        }
    }
    return $available_views;
}