Código: Selecionar todos
<?php
/**
*
* @package phpBB3
* @version $Id: autoindex.php,v 1.0.0 2009/09/02 19:58:08 eunaumtenhoid $
* @copyright (c) 2009 eunaumtenhoid
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/autoindex');
// set id of forum here, separate for comma to multiple forums
$forum_list = array(39,40,41,7,8,9,10,36,17,18,2,3,4,5,12,13,14,15,60,61,62,63,37,58);
$start = request_var('start', 0);
$author_id = request_var('author_id', 0);
// How many topics do we have?
$sql = 'SELECT COUNT(topic_id) AS total_topics
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
ORDER BY topic_id';
$result = $db->sql_query($sql);
$total_topics = (int) $db->sql_fetchfield('total_topics');
$db->sql_freeresult($result);
$pagination_url = append_sid("{$phpbb_root_path}autoindex/user.$phpEx");
// Grab Topic details for display
$sql = 'SELECT t.topic_id, t.forum_id, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_desc, f.forum_id, f.forum_name, i.icons_id, t.icon_id, i.icons_url
FROM ' . TOPICS_TABLE . ' t
LEFT JOIN ' . FORUMS_TABLE . ' f ON (t.forum_id = f.forum_id)
LEFT JOIN ' . ICONS_TABLE . ' i ON (i.icons_id = t.icon_id)
WHERE t.forum_id = f.forum_id AND ' . $db->sql_in_set('t.forum_id', $forum_list) . "
ORDER BY topic_title asc";
$result = $db->sql_query_limit($sql, 500, $start);
$db->sql_freeresult($result);
$template->assign_vars(array(
'PAGINATION' => generate_pagination($pagination_url, $total_topics, 500, $start),
'PAGE_NUMBER' => on_page($total_topics, 500, $start),
'TOTAL_TOPICS' => ($total_topics == 1) ? $user->lang['TOPIC_COUNT'] : sprintf($user->lang['TOPICS_COUNT'], $total_topics),
));
// Output page
page_header($user->lang['USER_TOPICS']);
$template->set_filenames(array(
'body' => 'autoindex/user.html',
));
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
isso no momento e atualmente esta puxando todos os topicos que desejo, agora so falta puxar os topicos de um x usuario, no caos pelo id, id x para o user x id y para o user y