rdf help [message #17443] |
Tue, 30 March 2004 19:54 |
mocara
Messages: 157 Registered: January 2004
Karma: 0
|
Senior Member |
|
|
Hello.
I'm using rdf to populate my home page with the last 5 posts. One problem, I'm using
Quote: | rdf.php?mode=m&l=1&n=6&cat=2,3,4,5,6,7&a%20m
|
This returns the last 5 posts but it can return multiple posts for the same thread. Is there an option to say last 5 posts from separate thread?
Pais.
P.S. My users are loving the new forum system.
|
|
|
|
Re: rdf help [message #17790 is a reply to message #17444] |
Mon, 19 April 2004 00:50 |
mocara
Messages: 157 Registered: January 2004
Karma: 0
|
Senior Member |
|
|
Quote: | SELECT
distinct m.thread_id, m.id, m.poster_id, m.reply_to, m.ip_addr, m.host_name, m.post_stamp, m.update_stamp, m.updated_by, m.icon, m.subject, m.attach_cnt, m.poll_id, m.foff, m.length,m.file_id, m.offset_preview, m.length_preview, m.file_id_preview, m.attach_cache, m.poll_cache, m.mlist_msg_id, m.msg_opt, m.apr,
u.alias,
t.forum_id,
p.name AS poll_name, p.total_votes,
m2.subject AS th_subject,
m3.subject AS reply_subject,
f.name AS frm_name,
c.name AS cat_name
FROM
fud26_msg m
INNER JOIN fud26_thread t ON m.thread_id=t.id
INNER JOIN fud26_forum f ON t.forum_id=f.id
INNER JOIN fud26_cat c ON c.id=f.cat_id
INNER JOIN fud26_msg m2 ON t.root_msg_id=m2.id
LEFT JOIN fud26_msg m3 ON m3.id=m.reply_to
LEFT JOIN fud26_users u ON m.poster_id=u.id
LEFT JOIN fud26_poll p ON m.poll_id=p.id
INNER JOIN fud26_group_cache g1 ON g1.user_id=0 AND g1.resource_id=f.id
WHERE
t.moved_to=0 AND m.apr=1 AND (g1.group_cache_opt & 2) > 0 GROUP BY m.thread_id ORDER BY m.post_stamp DESC LIMIT 20;
|
Just looking for ideas. I can see one flaw here. This will give me distinct thread but the first post in each thread and not the latest. distinct m.thread_id and group by m.thread_id being the basic changes.
|
|
|
Re: rdf help [message #17803 is a reply to message #17790] |
Mon, 19 April 2004 18:00 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
it will give you give you latest messages in the thread. Since the results are sorted by the timestamp in descending order, meaning that newest messages go first.
|
|
|