mijn portal moet nu 2x recente topics weergeven, maar dan van 2 verschillende fora.
nu heb ik bij de code gewoon overal een "2" toegevoegd:
Code: Selecteer alles
//
// Recent Topics2
//
$sql = "SELECT * FROM ". phpbb_forums . " ORDER BY forum_id";
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
$forum_data[] = $row;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
if( $CFG['exceptional_forums2'] == '' )
{
$except_forum_id2 = '\'start\'';
}
else
{
$except_forum_id2 = $CFG['exceptional_forums2'];
}
for ($i = 0; $i < count($forum_data); $i++)
{
if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
{
if ($except_forum_id2 == '\'start\'')
{
$except_forum_id2 = $forum_data[$i]['forum_id'];
}
else
{
$except_forum_id2 .= ',' . $forum_data[$i]['forum_id'];
}
}
}
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM phpbb_topics AS t, phpbb_posts AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forum_id2 . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $CFG['number_recent_topics2'];
if (!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics2 = $db->sql_numrows($result);
$recent_topic_row2 = array();
while ($row = $db->sql_fetchrow($result))
{
$recent_topic_row2[] = $row;
}
for ($i = 0; $i < $number_recent_topics2; $i++)
{
$template->assign_block_vars('recent_topic_row2', array(
'U_TITLE2' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row2[$i]['post_id']) . '#' .$recent_topic_row2[$i]['post_id'],
'L_TITLE2' => $recent_topic_row2[$i]['topic_title'],
'U_POSTER2' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $recent_topic_row2[$i]['user_id']),
'S_POSTER2' => $recent_topic_row2[$i]['username'],
'S_POSTTIME2' => create_date($board_config['default_dateformat'], $recent_topic_row2[$i]['post_time'], $board_config['board_timezone'])
)
);
}
//
// END - Recent Topics2
//
terwijl een aantal dingen goed staan ingevuld bovenaan de portal.php en in portal_body.tpl
dus de fout zit hierboven ergens.
wie ziet hem?
de 2tjes zijn allemaal door mij toegevoegd als ik me niet vergis.