1 up | 2 up |
^^^ Additional posts ^^^
zorg.ch
#53699 by @ 20.10.2004 19:04 - nach oben -
jo i hanen au nirgends gseh ussert bi de unread... schräg schräg
zorg.ch
#53702 by @ 20.10.2004 19:09 - nach oben -
I de Forumübersicht? Ich glaub die het zzt. en Knall...
zorg.ch
#53704 by @ 20.10.2004 19:13, edited @ 20.10.2004 19:15 - nach oben -
ja, i dä forumübersicht. isch kommisch. hät evtl. SQL-Abfrog ä where-condition drin, dass es child-posts muess drin ha?
zorg.ch
#53730 by @ 20.10.2004 20:33, edited @ 21.10.2004 11:18 - nach oben -
Die isch so:

(wennd verbesserige gsehsch bitte meldä)

SELECT

c.board, c.id, c.parent_id, c.text last_post_text,
UNIX_TIMESTAMP(c.date) last_post_date,
lu.id lu_id, lu.clan_tag lu_clan_tag, lu.username lu_username,

t.thread_id,
tu.id tu_id, tu.clan_tag tu_clan_tag, tu.username tu_username,
UNIX_TIMESTAMP(t.date) thread_date

, IF(ISNULL(tfav.thread_id ), 0, 1) AS isfavorite

, count(DISTINCT cnum.id) numposts

FROM comments_threads ct

LEFT JOIN comments c ON ( c.id = (
SELECT MAX( id )
FROM comments
WHERE thread_id = ct.thread_id AND board = ct.board) )
LEFT JOIN comments t ON (t.id = ct.comment_id)
LEFT JOIN comments cnum ON (ct.board = cnum.board AND ct.thread_id = cnum.thread_id)
LEFT JOIN templates s ON s.id = c.thread_id
LEFT JOIN bugtracker_bugs b ON b.id=c.thread_id
LEFT JOIN `events` e ON e.id=c.thread_id

LEFT JOIN user lu ON lu.id=c.user_id
LEFT JOIN user tu ON tu.id=t.user_id
LEFT JOIN comments_threads_rights ctr
ON (ctr.thread_id=ct.thread_id AND ctr.board=ct.board AND ctr.user_id='3')
LEFT JOIN comments_threads_favorites tfav
ON (tfav.board = ct.board AND tfav.thread_id = ct.thread_id AND tfav.user_id = '3')

WHERE
c.board IN ('b','f','h,'i','g')
AND (2 >= ct.rights OR ct.rights=3 AND ctr.user_id IS NOT NULL)
AND ct.comment_id IS NOT NULL

GROUP BY ct.thread_id

ORDER BY last_post_date DESC

LIMIT 0,23
zorg.ch
#53710 by @ 20.10.2004 19:53 - nach oben -
jo die isch eh FUBAR
zorg.ch
#53799 by @ 20.10.2004 21:45 - nach oben -
also a am mangelnde speicherplatz liegts das mol ganz sicher nid.