Exemplo n.º 1
0
// fetch five users by total posts
$top_poster = phpbb_fetch_top_poster();
// fetch a random user
$random_user = phpbb_fetch_random_user();
// fetch forum structure
$forums = phpbb_fetch_forums();
// fetch user of a specific group
// this function is disabled because fetching without a specific
// user group can produces a lot of results (all registered users)
// and this may result in an internal server error. If you want to
// use this feature please specify the group id.
# $member      = phpbb_fetch_users();
// fetch a poll
$poll = phpbb_fetch_poll();
// fetch a single topic by topic id
$download = phpbb_fetch_topics(1);
// fetch latest postings
$CFG['posts_trim_topic_number'] = 15;
$recent = phpbb_fetch_posts(null, POSTS_FETCH_LAST);
// fetch postings
$CFG['posts_trim_topic_number'] = 0;
$CFG['posts_span_pages'] = true;
$news = phpbb_fetch_posts();
//
// these settings are for the clanunity site - ignore them
//
// $forums      = phpbb_fetch_forums(5);
// $member      = phpbb_fetch_users(83);
// $poll        = phpbb_fetch_poll(12);
// $download    = phpbb_fetch_topics(623);
// $CFG['posts_trim_topic_number'] = 25;
Exemplo n.º 2
0
function phpbb_fetch_newposts()
{
    global $CFG, $userdata;
    if (!$userdata['session_logged_in']) {
        return;
    }
    $sql = 'SELECT post_id
				FROM ' . POSTS_TABLE . '
				WHERE post_time >= ' . $userdata['user_lastvisit'];
    $result = phpbb_fetch_rows($sql);
    if (!$result) {
        return;
    }
    $search_ids = array();
    for ($i = 0; $i < count($result); $i++) {
        $search_ids[] = $result[$i]['post_id'];
    }
    $sql = 'SELECT topic_id
				FROM ' . POSTS_TABLE . '
				WHERE post_id IN (' . implode(', ', $search_ids) . ')
				GROUP BY topic_id
				ORDER BY post_time DESC';
    $result = phpbb_fetch_rows($sql);
    if (!$result) {
        return;
    }
    $topic_ids = array();
    for ($i = 0; $i < count($result); $i++) {
        $topic_ids[] = $result[$i]['topic_id'];
    }
    $result = phpbb_fetch_topics($topic_ids, POSTS_FETCH_LAST);
    return $result;
}