Ejemplo n.º 1
0
function guestbook_page()
{
    //Get pagenumber
    $page = 1;
    if (isset($_GET['page']) && is_numeric($_GET['page'])) {
        $page = intval($_GET['page']);
        if ($page < 1 || $page > 999) {
            $page = 1;
        }
    }
    $fetch['offset'] = ($page - 1) * 30;
    $fetch['limit'] = 30;
    $entries = guestbook_fetch($fetch);
    $out .= guestbook_list($entries);
    //Create Pagination links
    if (isset($_GET['page']) && is_numeric($_GET['page'])) {
        $page = intval($_GET['page']);
        if ($page > 1) {
            $out .= ' <a href="' . $_SERVER['PHP_SELF'];
            $out .= isset($_GET['view']) ? '?view=' . $_GET['view'] . '&page' : '?page';
            $out .= '=' . ($page - 1) . '">&laquo; Föregående</a> |';
        }
        if ($page > 0) {
            $out .= ' ' . $page . ' | <a href="' . $_SERVER['PHP_SELF'];
            $out .= isset($_GET['view']) ? '?view=' . $_GET['view'] . '&page' : '?page';
            $out .= '=' . ($page + 1) . '">Nästa &raquo;</a>';
        }
    } else {
        $out .= ' <a href="' . $_SERVER['PHP_SELF'];
        $out .= isset($_GET['view']) ? '?view=' . $_GET['view'] . '&page' : '?page';
        $out .= '=2">Nästa &raquo;</a>';
    }
    return $out;
}
Ejemplo n.º 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();
Ejemplo n.º 3
0
        //Important!
    }
    $ui_options['stylesheets'][] = 'profile_themes/' . $profile['profile_theme'] . '.css';
    $out .= '<div class="profile_' . $profile['profile_theme'] . '">' . "\n";
    $out .= profile_head($profile);
    $out .= '</div>' . "\n";
    $ui_options['stylesheets'][] = 'user_profile.css';
    $ui_options['javascripts'][] = 'user_profile.js';
    if (isset($_GET['history'])) {
        $fetch['recipient'] = array($fetch['recipient'], $_GET['history']);
        $fetch['sender'] = $fetch['recipient'];
    }
    if (!isset($_GET['history']) && login_checklogin() && $fetch['recipient'] != $_SESSION['login']['id'] && !is_array($fetch['recipient'])) {
        $out .= guestbook_form(array('recipient' => $fetch['recipient']));
    }
    $entries = guestbook_fetch($fetch);
    $out .= guestbook_list($entries);
    if (login_checklogin()) {
        foreach ($entries as $entry) {
            if ($entry['recipient'] == $_SESSION['login']['id'] && $entry['read'] == 0) {
                $update_read[] = $entry['id'];
            }
        }
        if (count($update_read) > 0) {
            $query = 'UPDATE traffa_guestbooks SET `read` = 1 WHERE id IN("' . implode('", "', $update_read) . '")';
            mysql_query($query) or report_sql_error($query, __FILE__, __LINE__);
            $_SESSION['notices']['unread_gb_entries'] -= count($update_read);
        }
        $_SESSION['notices']['unread_gb_entries'] = 0;
    }
} else {