Phpnuke: Fejl i sidste linie i en sql-forespørgsel.
Her er noget kode, der har irriteret mig det meste af dagen.Udklippet stammer fra PHPnuke /modules/Forum/viewforum.php omkring linie 370-380.
*********Klip fra php-fil***************
$sql = "
SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
AND t.topic_type <> " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
LIMIT $start, ".$board_config['topics_per_page'];
*************Klip slut*****************************
Problemet er, at der opstår en fejl pga. den sidste linie.
LIMIT $start, ".$board_config['topics_per_page'];
Af mærkværdige grunde kan jeg ikke selv se, hvad der er galt, så jeg håber andre har bedre øjne end jeg.