function discussion_forum_post_list($posts, $parent_post = array())
{
    foreach ($posts as $post) {
        $return .= discussion_forum_post_render($post, $parent_post);
        $seen_posts[] = $post['id'];
    }
    if (login_checklogin()) {
        $query = 'DELETE FROM forum_notices WHERE post_id IN("' . implode($seen_posts, '", "') . '") AND user = "******"';
        mysql_query($query);
    }
    return $return;
}
Exemple #2
0
    echo $admincontrol_out;
    $output .= rounded_corners_tabs_bottom();
}
if (is_privilegied('user_management_admin')) {
    //$out = '<h2 style="margin: 0px;">Varningar</h2>';
    //$query = 'SELECT
    $out .= '<h2 style="margin-top: 0px; margin-bottom: 0px;">Abuse log</h2>';
    $query = 'SELECT * FROM user_abuse WHERE user = "******" ORDER BY id DESC';
    $result = mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
    $out .= '<ul style="margin: 0px;">' . "\n";
    while ($data = mysql_fetch_assoc($result)) {
        $out .= '<li>' . "\n";
        $out .= date('Y-m-d H:i', $data['timestamp']) . ' <strong>' . $data['admin'] . '</strong> ' . $data['freetext'];
        $out .= '</li>' . "\n";
    }
    $out .= '</ul>' . "\n";
    echo rounded_corners($out, $void, true);
    echo '<h2>De senaste inläggen i forumet och gästboken</h2>' . "\n";
    echo '<p>Inga knappar funkar, men det ska ändå inte visas publikt.</p>' . "\n";
    $forum_posts = discussion_forum_post_fetch(array('disable_forum_lookup' => true, 'author' => $params['user_id'], 'limit' => 7, 'order-direction' => 'DESC'));
    foreach ($forum_posts as $post) {
        echo '<a href="' . forum_get_url_by_post($post['id']) . '"><h2>Goto goto! Jalla Jalla! Jihad! Jihad! Go fetch it!</h2></a>' . "\n";
        echo discussion_forum_post_render($post, array(), array('show_post_controls' => false));
    }
}
if (is_privilegied('use_ghosting_tools')) {
    $guestbook_posts = guestbook_fetch(array('sender' => $params['user_id'], 'is_private' => 0, 'limit' => 5));
    echo guestbook_list($guestbook_posts);
}
echo $output;
ui_bottom();
Exemple #3
0
$out .= '<h1>Här kan du söka i Hamsterpajs forum</h1>' . "\n";
$out .= '<div class="discussionforum_searchbox">' . "\n";
$out .= '<form action="" method="get">' . "\n";
$out .= '<input type="text" id="discussionforum_search" class="discussionforum_search" name="discussionforum_search" value="' . $_GET['discussionforum_search'] . '" />' . "\n";
$out .= '<input type="submit" value="Sök" class="search_button" />' . "\n";
$out .= '</form>' . "\n";
$out .= '</div><br style="clear: both;" />' . "\n";
if (isset($_GET['discussionforum_search'])) {
    $page = isset($_GET['page']) && is_numeric($_GET['page']) && intval($_GET['page']) > 0 ? intval($page) : 1;
    $post_options['page_offset'] = $page - 1;
    $post_options['min_quality_level'] = 2;
    $post_options['limit'] = 15;
    $post_options['order-direction'] = 'DESC';
    $post_options['threads_only'] = true;
    $post_options['match'] = array('against' => $_GET['discussionforum_search'], 'in_columns' => 'p.content');
    $posts = discussion_forum_post_fetch($post_options);
    $search_keywords = explode(' ', $_GET['discussionforum_search']);
    //$out .= '<h1>Using ' . count($search_keywords) . ' keyword(s), query executed in ' . $query_execution_time . ' secounds</h1>';
    if (empty($posts)) {
        $out .= '<h2>Tyvärr, inga trådar med den beskrivningen kunde hittas. Kanske skulle ett annat sökord kunna fungera</h2>' . "\n";
    } else {
        $out .= '<h2>Din sökning genererade ' . count($posts) . ' träffar</h2>' . "\n";
        foreach ($posts as $post) {
            $out .= discussion_forum_post_render($post, array(), array('show_post_controls' => false, 'search_highlight' => $search_keywords));
            $out .= '<a style="margin-left: 20px;" href="' . forum_get_url_by_post($post['id']) . '">Gå till inlägget »</a>' . "\n";
        }
    }
}
ui_top($ui_options);
echo $out;
ui_bottom();