ALEXIS
20.01.2007, 01:51
FORUMS_TABLE de değişiklik yazsaydı tek satır ile halledecektik, bu soruya daha önce de bakmıştım, modu kurmak uzun iş gelmişti.
şu SQL dene, approve tablolarındaki id ler ile topic tablosundaki id leri karşılaştırdım. yanlış anlamadıysam approve trablolarına sadece onaylı id ler ekleniyor.
[syntax="sql"]$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, at.topic_id, ap.topic_id, ap.post_id
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u, " . APPROVE_TOPICS_TABLE . " AS at, " . APPROVE_POSTS_TABLE . " AS ap
WHERE t.forum_id NOT IN (" . $except_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
AND p.post_id = ap.post_id
AND at.topic_id = t.topic_id
AND ap.topic_id = t.topic_id
ORDER BY p.post_id DESC
LIMIT " . $CFG['number_recent_topics'];[/syntax]