Пример #1
0
page_head(tra("Forum search"));
start_table();
echo "<form action=\"forum_search_action.php\" method=\"post\">";
row1(tra("Search query"));
row2(tra("Search for keywords:") . "<br />\n    <span class=\"smalltext\">" . tra("Posts that contain all the specified words will be displayed") . "</span>", "<input type=\"text\" style=\"width: 290px\" name=\"search_keywords\" size=\"30\" /><br />\n    <span class=\"smalltext\">" . tra("For example: \"screensaver freeze\"") . "</span>");
row2(tra("Search for author ID:") . "<br />\n    <span class=\"smalltext\">" . tra("Only posts by this author will be displayed") . "</span>", "<input type=\"text\" style=\"width: 150px\" name=\"search_author\" size=\"10\" /><br />\n    <span class=\"smalltext\">" . tra("For example: \"43214\"") . "</span>");
row1(tra("Search options"));
row2(tra("Search limits") . "<br />\n    <span class=\"smalltext\">" . tra("Search at most this many days back in time") . "</span>", "<select name=\"search_max_time\">\n    <option value=\"1\">" . tra("1 day") . "</option>\n    <option value=\"3\">" . tra("%1 days", "3") . "</option>\n    <option value=\"7\">" . tra("%1 days", "7") . "</option>\n    <option value=\"15\">" . tra("%1 days", "15") . "</option>\n    <option value=\"30\" selected>" . tra("%1 days", "30") . "</option>\n    <option value=\"90\">" . tra("%1 months", "3") . "</option>\n    <option value=\"180\">" . tra("%1 months", "6") . "</option>\n    <option value=\"365\">" . tra("1 year") . "</option>\n    <option value=\"0\">" . tra("no limit") . "</option>\n    </select>");
$forumid = null;
if (get_str("forumid", true)) {
    $forumid = get_str("forumid");
}
$forumlist = "<option value=\"-1\">" . tra("All") . "</option>";
$categories = BoincCategory::enum();
foreach ($categories as $category) {
    $forums = BoincForum::enum("parent_type=0 and category={$category->id}");
    foreach ($forums as $forum) {
        if ($forum->id == $forumid) {
            $forumlist .= "<option selected value=\"" . $forum->id . "\">" . $forum->title . "</option>";
        } else {
            $forumlist .= "<option value=\"" . $forum->id . "\">" . $forum->title . "</option>";
        }
    }
}
row2(tra("Forum") . "<br />\n    <span class=\"smalltext\">" . tra("Only display posts from this forum") . "</span>", '<select name="search_forum">' . $forumlist . '</select');
$sortlist = null;
foreach ($thread_sort_styles as $id => $style) {
    if ($id == CREATE_TIME_NEW) {
        $sortlist .= "<option selected value=\"" . $id . "\">" . $style . "</option>";
    } else {
        $sortlist .= "<option value=\"" . $id . "\">" . $style . "</option>";
Пример #2
0
    if ($first) {
        $first = false;
        echo "<p>";
        show_forum_title($category, NULL, NULL);
        echo "<p>";
        show_mark_as_read_button($user);
        start_forum_table(array(tra("Topic"), tra("Threads"), tra("Posts"), tra("Last post")));
    }
    if (strlen($category->name)) {
        echo '
            <tr class="subtitle">
            <td class="category" colspan="4">' . $category->name . '</td>
            </tr>
        ';
    }
    $forums = BoincForum::enum("parent_type=0 and category={$category->id} order by orderID");
    $i = 0;
    foreach ($forums as $forum) {
        show_forum_summary($forum, $i++);
    }
}
if ($user && $user->teamid) {
    $forum = BoincForum::lookup("parent_type=1 and category={$user->teamid}");
    if ($forum) {
        show_forum_summary($forum, $i++);
    }
}
end_table();
if ($user) {
    $subs = BoincSubscription::enum("userid={$user->id}");
    if (count($subs)) {
switch ($action) {
    case 'hide':
    case 'lock':
        echo "<input type=hidden name=action value={$action}>";
        row2("", tra("Select the reason category, or write a longer description of why you're hiding or locking the thread; then press OK."));
        row2(tra("Category"), "<select name=\"category\">\n        <option value=\"1\">" . tra("Obscene") . "</option>\n        <option value=\"2\">" . tra("Flame/Hate mail") . "</option>\n        <option value=\"3\">" . tra("Commercial spam") . "</option>\n        <option value=\"4\">" . tra("Other") . "</option>\n        </select>");
        break;
    case 'move':
        if ($forum->parent_type != 0) {
            error_page("Nope");
        }
        echo "<input type=hidden name=action value=move>";
        $selectbox = '<select name="forumid">';
        $categories = BoincCategory::enum();
        foreach ($categories as $category) {
            $forums = BoincForum::enum("category={$category->id}");
            foreach ($forums as $f) {
                $selectbox .= '<option value="' . $f->id . '">' . $f->title . '</option>';
            }
        }
        $selectbox .= '</option>';
        row2(tra("Current forum"), $forum->title);
        row2(tra("Destination forum"), $selectbox);
        break;
    case 'title':
        echo "<input type=hidden name=action value=title>";
        row2(tra("New title:"), "<input size=80 name=\"newtitle\" value=\"" . htmlspecialchars($thread->title) . "\">");
        break;
    case 'delete':
        echo "<input type=hidden name=action value=delete>";
        echo "Are you sure you want to delete this thread and all its posts?\n        This action cannot be undone.\n        <input type=submit value=Yes>\n    ";