Ik heb op http://www.diablo2forum.nl/portal.php met succes een portal weten te installeren, maar i.p.v. de mededelingen (onder het welkomstbericht in de middenste kolom) zou ik de 5 nieuwste topics willen hebben, voor de rest met de zelfde opmaak en indeling als nu te zien is.
Hoe verander ik dat?
Portal met 5 nieuwste topics
Forumregels
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.

Dat kan je in je portal.php aanpassen
zoek en ipv 1 zet je daar de topics neer die je op het portal wil hebben. bv 3,9,12
Hoe kan je de nummers zien van de fora's door met je muis op de link te gaan staan, dan zie je in je browser welk id het is.
zoek
Code: Selecteer alles
// Nieuws bron forum ID: scheid met comma voor meerdere forums, bijv. '1,2,5'
$CFG['news_forum'] = '1';
Hoe kan je de nummers zien van de fora's door met je muis op de link te gaan staan, dan zie je in je browser welk id het is.
Dat systeem had ik al door, maar de bedoeling is dat er niet gekeken wordt naar de topiclijsten (nu is dat gebaseerd op http://www.diablo2forum.nl/viewforum.php?f=1). Volgens phpMyAdmin zou ik verwachten:
1. Realm Europe -> User hanskamp -> Char AssassHansLad (forum_id = 26)
2. Charter Might and Magic (forum_id = 27)
3. Realm Europe -> User hanskamp -> Char SorcHansLad (forum_id = 28 )
4. Passive barb maken (forum_id = 5)
5. Heel wat items te geef (forum_id = 26)
Deze topics zijn in verschillende topiclijsten gemaakt.
1. Realm Europe -> User hanskamp -> Char AssassHansLad (forum_id = 26)
2. Charter Might and Magic (forum_id = 27)
3. Realm Europe -> User hanskamp -> Char SorcHansLad (forum_id = 28 )
4. Passive barb maken (forum_id = 5)
5. Heel wat items te geef (forum_id = 26)
Deze topics zijn in verschillende topiclijsten gemaakt.
Het heeft met netjes programmeren niet zo veel te maken, maar ik heb in fetchposts.php:
veranderd in:
en
veranderd in:
Dit kan natuurlijk netter, maar dit werkt voorlopig. 
Code: Selecteer alles
$sql = 'SELECT
t.topic_id,
t.topic_time,
t.topic_title,
pt.post_text,
u.username,
u.user_id,
t.topic_replies,
pt.bbcode_uid,
t.forum_id,
t.topic_poster,
t.topic_first_post_id,
t.topic_status,
pt.post_id,
p.post_id,
p.enable_smilies
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt,
' . POSTS_TABLE . ' AS p
WHERE
t.forum_id IN (' . $forum_sql . ') AND
t.topic_time <= ' . time() . ' AND
t.topic_poster = u.user_id AND
t.topic_first_post_id = pt.post_id AND
t.topic_first_post_id = p.post_id AND
t.topic_status <> 2
ORDER BY
t.topic_time DESC';
Code: Selecteer alles
$sql = 'SELECT
t.topic_id,
t.topic_time,
t.topic_title,
pt.post_text,
u.username,
u.user_id,
t.topic_replies,
pt.bbcode_uid,
t.forum_id,
t.topic_poster,
t.topic_first_post_id,
t.topic_status,
pt.post_id,
p.post_id,
p.enable_smilies
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt,
' . POSTS_TABLE . ' AS p
WHERE
/* t.forum_id IN (' . $forum_sql . ') AND */
t.topic_time <= ' . time() . ' AND
t.topic_poster = u.user_id AND
t.topic_first_post_id = pt.post_id AND
t.topic_first_post_id = p.post_id AND
t.topic_status <> 2
ORDER BY
t.topic_time DESC';
Code: Selecteer alles
$sql = 'SELECT
t.*,
vd.*
FROM
' . TOPICS_TABLE . ' AS t,
' . VOTE_DESC_TABLE . ' AS vd
WHERE
t.forum_id IN (' . $forum_sql . ') AND
t.topic_status <> 1 AND
t.topic_status <> 2 AND
t.topic_vote = 1 AND
t.topic_id = vd.topic_id
ORDER BY
t.topic_time DESC
LIMIT
0,1';
Code: Selecteer alles
$sql = 'SELECT
t.*,
vd.*
FROM
' . TOPICS_TABLE . ' AS t,
' . VOTE_DESC_TABLE . ' AS vd
WHERE
/* t.forum_id IN (' . $forum_sql . ') AND */
t.topic_status <> 1 AND
t.topic_status <> 2 AND
t.topic_vote = 1 AND
t.topic_id = vd.topic_id
ORDER BY
t.topic_time DESC
LIMIT
0,1';
