コード例 #1
0
ファイル: light.inc.php プロジェクト: richstokoe/BeehiveForum
function light_threads_draw_discussions_dropdown($mode)
{
    $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 "To: Me""), 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"), 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 light_form_dropdown_array("mode", $available_views, $mode);
}
コード例 #2
0
ファイル: light.inc.php プロジェクト: DeannaG65/BeehiveForum
function light_folder_search_dropdown($selected_folder)
{
    if (!($db = db::get())) {
        return false;
    }
    if (!is_numeric($selected_folder)) {
        return false;
    }
    if (!($table_prefix = get_table_prefix())) {
        return false;
    }
    $available_folders = array();
    $access_allowed = USER_PERM_POST_READ;
    $sql = "SELECT FID, TITLE FROM `{$table_prefix}FOLDER` ";
    $sql .= "ORDER BY FID ";
    if (!($result = $db->query($sql))) {
        return false;
    }
    if ($result->num_rows == 0) {
        return false;
    }
    while (($folder_data = $result->fetch_assoc()) !== null) {
        if (!session::logged_in()) {
            if (session::check_perm(USER_PERM_GUEST_ACCESS, $folder_data['FID'])) {
                $available_folders[$folder_data['FID']] = htmlentities_array($folder_data['TITLE']);
            }
        } else {
            if (session::check_perm($access_allowed, $folder_data['FID'])) {
                $available_folders[$folder_data['FID']] = htmlentities_array($folder_data['TITLE']);
            }
        }
    }
    if (sizeof($available_folders) == 0) {
        return false;
    }
    $available_folders = array(gettext("ALL")) + $available_folders;
    return light_form_dropdown_array("fid", $available_folders, $selected_folder);
}
コード例 #3
0
ファイル: lsearch.php プロジェクト: DeannaG65/BeehiveForum
            echo "", html_style_image('search'), "&nbsp;", gettext("Found"), ": 0 ", gettext("matches"), "<br /><br />\n";
        }
        light_html_draw_bottom();
        exit;
    }
}
light_html_draw_top();
light_navigation_bar();
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
    light_html_display_error_array($error_msg_array);
} else {
    if (isset($search_no_matches) && $search_no_matches == true) {
        light_html_display_error_msg(gettext("Search Returned No Results"));
    }
}
echo "<form accept-charset=\"utf-8\" id=\"search_form\" method=\"post\" action=\"lsearch.php\" target=\"_self\">\n";
echo "  ", form_csrf_token_field(), "\n";
echo form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
echo "<div class=\"search\">\n";
echo "<h3>", gettext("Search discussions"), "</h3>\n";
echo "<div class=\"search_inner\">\n";
echo "<div class=\"search_keywords\">", gettext("Keywords"), ":", light_form_input_text("search_string", isset($search_arguments['search_string']) ? htmlentities_array($search_arguments['search_string']) : '', 30), "</div>\n";
echo "<div class=\"search_user\">", gettext("Username (optional)"), ":", light_form_input_text("username", isset($search_arguments['username']) ? htmlentities_array($search_arguments['username']) : '', 30), "</div>\n";
echo "<div class=\"search_folder\">", gettext("Folder(s)"), ":", $folder_dropdown, "</div>\n";
echo "<div class=\"search_date\">", gettext("Posted From"), ":", light_form_dropdown_array("date_from", $search_date_from_array, isset($search_arguments['date_from']) && in_array($search_arguments['date_from'], array_keys($search_date_from_array)) ? $search_arguments['date_from'] : SEARCH_FROM_ONE_MONTH_AGO), "</div>\n";
echo "<div class=\"search_date\">", gettext("Posted to"), ":", light_form_dropdown_array("date_to", $search_date_to_array, isset($search_arguments['date_to']) && in_array($search_arguments['date_to'], array_keys($search_date_from_array)) ? $search_arguments['date_to'] : SEARCH_TO_TODAY), "</div>\n";
echo "<div class=\"search_buttons\">", light_form_submit("search_submit", gettext("Find")), "</div>";
echo "</div>";
echo "</div>";
echo "</form>";
light_html_draw_bottom();