okay - here's my fletch, err, fetch code(www.gadgetaddict.com/index.php)
<?php
#######################################################################
## ##
## phpBB Fetch All - displays phpBB on any page ##
## ----------------------------------------------------------------- ##
## A portal example file. ##
## ##
#######################################################################
## ##
## Authors: Volker 'Ca5ey' Rattel <
[email protected]> ##
##
http://clanunity.net/portal.php ##
## ##
## This file is free software; you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published ##
## by the Free Software Foundation; either version 2, or (at your ##
## option) any later version. ##
## ##
## This file is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
#######################################################################
//
// This path points to the directory where phpBB is installed. Do
// not enter an URL here. The path must end with a trailing
// slash.
//
// Examples:
// forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ccc/
// --> $phpbb_root_path = './';
// forum in /aaa/bbb/ccc/ and script in /aaa/bbb/
// --> $phpbb_root_path = './ccc/';
// forum in /aaa/bbb/ccc/ and script in /aaa/bbb/ddd/
// --> $phpbb_root_path = '../ccc/';
//
$phpbb_root_path = './forums/';
//
// this setting is for the clanunity site - ignore it
//
#$phpbb_root_path = './forum/';
define ('IN_PHPBB', true);
if (!file_exists($phpbb_root_path . 'extension.inc'))
{
die ('<tt><b>phpBB Fetch All:</b>
$phpbb_root_path is wrong and does not point to your forum.</tt>');
}
//
// phpBB related files
//
include ($phpbb_root_path . 'extension.inc');
include ($phpbb_root_path . 'common.' . $phpEx);
include ($phpbb_root_path . 'includes/bbcode.' . $phpEx);
//
// Fetch All related files - we do need all these because the portal is a
// huge example
//
include ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx);
include ($phpbb_root_path . 'mods/phpbb_fetch_all/stats.' . $phpEx);
include ($phpbb_root_path . 'mods/phpbb_fetch_all/users.' . $phpEx);
include ($phpbb_root_path . 'mods/phpbb_fetch_all/polls.' . $phpEx);
include ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx);
include ($phpbb_root_path . 'mods/phpbb_fetch_all/forums.' . $phpEx);
//
// start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
init_userprefs($userdata);
//
// since we are demonstrating span pages we need to set the page offset
//
if (isset($HTTP_GET_VARS['start']) or isset($HTTP_POST_VARS['start'])) {
$CFG['posts_span_pages_offset'] = isset($HTTP_GET_VARS['start']) ? $HTTP_GET_VARS['start'] : $HTTP_POST_VARS['start'];
}
// fetch new posts since last visit
$new_posts = phpbb_fetch_new_posts();
// fetch user online, total posts, etc
$stats = phpbb_fetch_stats();
// 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
// $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(2);
//
// 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;
#$recent = phpbb_fetch_posts(12, POSTS_FETCH_LAST);
#$CFG['posts_trim_topic_number'] = 0;
#$CFG['posts_span_pages'] = true;
#$news = phpbb_fetch_posts(11);
//
// disconnect from the database
//
phpbb_disconnect();
?>
<html>
<head>
<title>gadget addict upgrade in progress - please bear with us</title>
<meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="forums/templates/subSilver/subSilver.css" type="text/css">
</head>
<body bgcolor="#FFFCC" text="#330000" link="#006699" vlink="#5493B4">
<table align="center" border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td class="bodyline" valign="top" width="100%">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="center" width="100%" valign="middle"><span class="maintitle">gadgetaddict site upgrade in progress - please bear with us</span><br /><span class="gen"><br /> </span>
</td>
</tr>
</table>
<br />
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td valign="top" width="25%">
<!-- USER -->
<?php if ($userdata) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">User</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<?php if ($userdata['session_logged_in']) { ?>
<table>
<tr>
<td valign="top">
<?php if ($userdata['user_avatar_type'] > 0) { ?>
<?php if ($userdata['user_avatar_type'] == 1) { ?>
<img src="<?php echo $CFG['avatar_url']; ?>/<?php echo $userdata['user_avatar']; ?>" border="0" alt="" />
<?php } elseif ($userdata['user_avatar_type'] > 1) { ?>
<img src="<?php echo $CFG['avatar_gallery_url']; ?>/<?php echo str_replace(' ', '%20', $userdata['user_avatar']); ?>" border="0" alt="" />
<?php } ?>
<?php } else { ?>
<?php } ?>
</td>
<td valign="top">
<span class="gensmall">
Welcome back <?php echo $userdata['username']; ?>.
You last visited on <?php echo date($userdata['user_dateformat'], $userdata['user_lastvisit']); ?>.<p />
</span>
</td>
</tr>
</table>
<span class="gensmall">
<a href="<?php echo $phpbb_root_path; ?>privmsg.php?folder=inbox">You have
<?php if ($userdata['user_new_privmsg']) { echo $userdata['user_new_privmsg']; } else { echo 'no'; } ?> new message<?php echo $userdata['user_new_privmsg'] == 1 ? '' : 's' ?></a><br />
<a href="<?php echo $phpbb_root_path; ?>search.php?search_id=newposts">View posts since last visit
(<?php echo $new_posts['total']; ?>)</a>
<br />
<a href="<?php echo $phpbb_root_path; ?>search.php?search_id=egosearch">View your posts</a><br />
<a href="<?php echo $phpbb_root_path; ?>search.php?search_id=unanswered">View unanswered posts</a>
<?php } else { ?>
Welcome guest.<p />
<a href="<?php echo $phpbb_root_path; ?>profile.php?mode=register">Register</a>
<?php } ?>
</span>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- USER -->
<!-- LOGIN -->
<?php if (!$userdata or !$userdata['session_logged_in']) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Login</span></td>
</tr>
<tr>
<td class="row1" align="center" width="100%">
<table align="center">
<tr>
<td>
<span class="gensmall">
<form action="<?php echo $phpbb_root_path; ?>login.php" method="post" target="_top">
Username:<br />
<input type="text" name="username" size="20" maxlength="40" value="" /><br />
Password:<br />
<input type="password" name="password" size="20" maxlength="25" /><br />
<input type="checkbox" name="autologin" /> auto login<p />
<input type="hidden" class="mainoption" name="redirect" value="<?php echo $PHP_SELF; ?>" />
<div align="center"><input type="submit" class="mainoption" name="login" value="Login" /><p />
<a href="<?php echo $phpbb_root_path; ?>profile.php?mode=sendpassword">I forgot my password</a></div>
</form>
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- LOGIN -->
<!-- SEARCH -->
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Search</span></td>
</tr>
<tr>
<td class="row1" align="center" width="100%">
<form action="<?php echo $phpbb_root_path; ?>search.php?mode=results" method="post" target="_top">
<input type="text" class="post" name="search_keywords" size="20" />
<input type="submit" class="mainoption" name="login" value="Go" /><p />
<span class="gensmall">
<a href="<?php echo $phpbb_root_path; ?>search.php">Advanced Search</a>
</span>
</form>
</td>
</tr>
</table>
<p />
<!-- SEARCH -->
<!-- STATS -->
<?php if ($stats) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Stats</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
Our users have posted a total of <b><?php echo $stats['total_posts']; ?></b> articles.
We have <b><?php echo $stats['total_users']; ?></b> registered users.
The newest registered user is <a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $stats['user_id']; ?>"><b><?php echo $stats['username']; ?></b></a>.
In total there <?php echo ($stats['user_online'] == 1) ? 'is' : 'are' ?> <b><?php echo $stats['user_online']; ?></b> user online.<br />
</span>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- STATS -->
<!-- TOP POSTER -->
<?php if ($top_poster) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Top Poster</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<table>
<?php for ($i = 0; $i < count($top_poster); $i++) { ?>
<tr>
<td><span class="gensmall">#<?php echo ($i+1); ?></span></td>
<td width="100%"><span class="gensmall"><a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $top_poster[$i]['user_id']; ?>"><?php echo $top_poster[$i]['username']; ?></a></span></td>
<td align="right"><span class="gensmall"><?php echo $top_poster[$i]['user_posts']; ?></span></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- TOP POSTER -->
<!-- RANDOM USER -->
<?php if ($random_user) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Random User</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
The user of the moment is <a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $random_user['user_id']; ?>"><b><?php echo $random_user['username']; ?></b></a><br />
</span>
<?php if ($random_user['user_avatar_type'] > 0) { ?>
<table>
<tr>
<td valign="top">
<?php if ($random_user['user_avatar_type'] == 1) { ?>
<img src="<?php echo $CFG['avatar_url']; ?>/<?php echo $random_user['user_avatar']; ?>" border="0" alt="" />
<?php } elseif ($random_user['user_avatar_type'] > 1) { ?>
<img src="<?php echo $CFG['avatar_gallery_url']; ?>/<?php echo str_replace(' ', '%20', $random_user['user_avatar']); ?>" border="0" alt="" />
<?php } ?>
</td>
<td valign="top">
<?php } ?>
<span class="gensmall">
Since: <?php
$since = intval((time() - $random_user['user_regdate']) / 86400);
if ($since == 0) {
echo 'today';
} elseif ($since == 1) {
echo '1 day';
} else {
echo $since . ' days';
} ?><br />
Posts: <?php echo $random_user['user_posts']; ?><br />
From: <?php echo $random_user['user_from']; ?><br />
</span>
<?php if ($random_user['user_avatar_type'] > 0) { ?>
</td>
</tr>
</table>
<?php } ?>
</td>
</tr>
</table>
<?php } ?>
<!-- RANDOM USER -->
</td>
<td valign="top" width="50%">
<p />
<!-- NEWS -->
<?php for ($i = 0; $i < count($news); $i++) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" height="28"><?php echo $news[$i]['topic_title']; ?><?php if ($news[$i]['topic_trimmed']) { echo '...'; } ?></th>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
Posted by
<a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $news[$i]['user_id']; ?>">
<?php echo $news[$i]['username']; ?>
</a>
on <?php echo $news[$i]['date']; ?> at <?php echo $news[$i]['time']; ?>
</span>
<span class="gen">
<hr size="1"/>
<?php echo $news[$i]['post_text']; ?><?php if ($news[$i]['trimmed']) { echo '...'; } ?>
</span>
<hr size="1"/>
<span class="gensmall">
<div align="right"><font color="#333333" face="Verdana" size="1">(<?php echo $news[$i]['topic_replies']; ?>)
<a href="<?php echo $phpbb_root_path; ?>viewtopic.php?t=<?php echo $news[$i]['topic_id']; ?>">
Comment<?php if ($news[$i]['topic_replies'] != 1) { echo 's'; } ?></a></font></div>
</span>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- NEWS -->
<!-- FORUMS -->
<?php if ($forums) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<th class="thTop" height="28">Forum</th>
<th class="thTop" height="28">Topics</th>
<th class="thTop" height="28">Posts</th>
</tr>
<?php $last_cat = -1; ?>
<?php for ($i = 0; $i < count($forums); $i++) { ?>
<?php if ($last_cat != $forums[$i]['cat_id']) { ?>
<?php $last_cat = $forums[$i]['cat_id']; ?>
<tr>
<td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="<?php echo $phpbb_root_path; ?>index.php?c=<?php echo $forums[$i]['cat_id']; ?>" class="cattitle"><?php echo $forums[$i]['cat_title']; ?></a></span></td>
</tr>
<?php } ?>
<tr>
<td class="row1" align="left" width="100%">
<span class="forumlink">
<a href="<?php echo $phpbb_root_path; ?>viewforum.php?f=<?php echo $forums[$i]['forum_id']; ?>" class="forumlink"><?php echo $forums[$i]['forum_name']; ?></a><br />
</span>
<span class="genmed">
<?php echo $forums[$i]['forum_desc']; ?>
</span>
</td>
<td class="row1" align="center" width="100%">
<span class="genmed">
<?php echo $forums[$i]['forum_topics']; ?>
</span>
</td>
<td class="row1" align="center" width="100%">
<span class="genmed">
<?php echo $forums[$i]['forum_posts']; ?>
</span>
</td>
</tr>
<?php } ?>
</table>
<p />
<?php } ?>
<!-- FORUMS -->
</td>
<td valign="top" width="25%">
<!-- DOWNLOAD -->
<?php if ($download) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Download</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
<?php echo $download[0]['post_text']; ?>
</span>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- DOWNLOAD -->
<!-- RECENT -->
<?php if ($recent) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Latest Discussion</span></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
<?php for ($i = 0; $i < count($recent); $i++) { ?>
<?php echo date($CFG['date_format'] . ' ' . $CFG['time_format'], $recent[$i]['post_time']); ?> <a href="<?php echo $phpbb_root_path; ?>profile.php?mode=viewprofile&u=<?php echo $recent[$i]['user_id']; ?>"><?php echo $recent[$i]['username']; ?></a><br /><img src="<?php echo $phpbb_root_path; ?>templates/subSilver/images/icon_latest_reply.gif" border="0" align="absmiddle" /> <a href="<?php echo $phpbb_root_path; ?>viewtopic.php?p=<?php echo $recent[$i]['post_id']; ?>#<?php echo $recent[$i]['post_id']; ?>"><b><?php echo $recent[$i]['topic_title']; ?><?php if ($recent[$i]['topic_trimmed']) { echo '...'; } ?></b></a><br />
<?php } ?>
</span>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- RECENT -->
<!-- POLL -->
<?php if ($poll) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="28"><span class="cattitle">Poll</span></td>
</tr>
<tr>
<td class="row1" align="center" width="100%">
<?php if (!$poll) { ?>
<span class="gensmall"><b>No poll at the moment.</b></span>
<?php } else { ?>
<span class="gensmall"><b><?php echo $poll['vote_text']; ?></b></span>
</font>
<form method="post" action="<?php echo $phpbb_root_path; ?>posting.php?t=<?php echo $poll['topic_id']; ?>">
<table>
<?php for ($i = 0; $i < count($poll['options']); $i++) { ?>
<tr>
<td>
<input type="radio" name="vote_id" value="<?php echo $poll['options'][$i]['vote_option_id']; ?>">
</td>
<td>
<span class="gensmall"><?php echo $poll['options'][$i]['vote_option_text']; ?></span>
</td>
<td>
<span class="gensmall">[ <?php echo $poll['options'][$i]['vote_result']; ?> ]</span>
</td>
</tr>
<?php } ?>
</table>
<?php if ($userdata['session_logged_in']) { ?>
<input type="submit" class="mainoption" name="submit" value="Vote">
<input type="hidden" name="topic_id" value="<?php echo $poll['topic_id']; ?>">
<input type="hidden" name="mode" value="vote">
<?php } else { ?>
<span class="gensmall"><b>You must login to vote.</b></span>
<?php } ?>
</form>
<?php } ?>
</td>
</tr>
</table>
<p />
<?php } ?>
<!-- POLL -->
</td>
</tr>
</table>
<div align="center"><span class="copyright"><br />
Powered by <a href="http://www.phpbb.com/" target="_phpbb" class="copyright">phpBB</a> 2.1 beta © 2001, 2002, 2003 phpBB Group<br /></span></div>
</td>
</tr>
</table>
</body>
</html>