Topic: Active topics (G0dD*&#*&@ this irritating)

Okay i tried everything but nothing seems to work. The active MOD shows the topic starter and i want only responses on a topic. So if somebody can tell me how i do this...?

Not working, result is that it show all new postings.

$result = $db->query('
    SELECT t.* 
    FROM '.$db->prefix.'topics AS t 
    INNER JOIN '.$db->prefix.'forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN '.$db->prefix.'forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id='.$pun_user['g_id'].'
    ) 
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) 
    ORDER BY t.last_post DESC
    LIMIT '.$ak_limit
) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

Anybody?

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

*tralalala....*

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

I am looking for something like this too.. I am looking to use it on an external page outside of the forums and show the topic posts somewhere else on my website.  Any help?

Re: Active topics (G0dD*&#*&@ this irritating)

Indeed a external page with the comments would be great.

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

Unfortunately I'm not quite sure what you're requesting.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Active topics (G0dD*&#*&@ this irritating)

lol smile okay i try in my best English.

I want a page where i see the latest post from users. But not the topic starter/first post, i want only the posts after that. So people can follow the discussion.

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

Hmm

'SELECT p.id, p.topic_id, t.subject FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON p.topic_id = t.id INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id = f.id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (f.id = fp.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum = 1) AND p.posted > t.posted ORDER BY t.last_post DESC LIMIT 10'

That query should return the last 10 posts that are not topic starters assuming that I didn't make any typos and that my logic is correct.

A question for anyone who knows SQL better than I do (which would be many people wink ): Could p.posted > t.posted be included in the conditions for the JOIN?

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Active topics (G0dD*&#*&@ this irritating)

thanx i go trying this...

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

Works smile thanks

PunnyBunny..

11 (edited by thesaint 2007-07-21 05:00)

Re: Active topics (G0dD*&#*&@ this irritating)

okay got this

<div class="block">
<h2><span><font color="#CCCC99"><b>Topics</b></font></span></h2>

<?
$result = $db->query('SELECT p.poster, p.id, p.topic_id, t.subject FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON p.topic_id = t.id INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id = f.id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (f.id = fp.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum = 1) AND p.posted > t.posted ORDER BY t.last_post DESC LIMIT 100') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while($cur_topic = $db->fetch_assoc($result))
{
    
?>

    <div class="box">
        <div id="recenttopics" class="inbox">
<?php echo $cur_topic['posted']; ?> <a href="viewtopic.php?pid=<?php echo $cur_topic['id']; ?>#p<?php echo $cur_topic['id']; ?>" target=_blank><?php echo substr($cur_topic['subject'], 0, 50); ?></a> <i><font color="#CCCC99"><?php echo $cur_topic['poster']; ?></font></i><br>
</div>
</div>

<?
}
?>

   </div>

It bumps the new comments up, thats good. But is also show all the other comments and the ordering is strange. Try it and you see what i mean:)

PunnyBunny..

Re: Active topics (G0dD*&#*&@ this irritating)

I currently have neither an active PunBB forum nor an offline test forum (I usually do, but I'm about to reinstall my OS) so unfortunately I cannot try it out.

I'm not sure what you mean about it showing "all the other comments", but the strange ordering is a mistake on my part. The query should read "ORDER BY p.posted", not "ORDER BY t.last_post".

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Active topics (G0dD*&#*&@ this irritating)

Thanx it works now just the way i want smile

PunnyBunny..

14

Re: Active topics (G0dD*&#*&@ this irritating)

Code:
<div class="block">
<h2><span><font color="#CCCC99"><b>Topics</b></font></span></h2>

<?
$result = $db->query('SELECT p.poster, p.id, p.topic_id, t.subject FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'topics AS t ON p.topic_id = t.id INNER JOIN '.$db->prefix.'forums AS f ON t.forum_id = f.id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (f.id = fp.forum_id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum = 1) AND p.posted > t.posted ORDER BY t.last_post DESC LIMIT 100') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while($cur_topic = $db->fetch_assoc($result))
{
   
?>

    <div class="box">
        <div id="recenttopics" class="inbox">
<?php echo $cur_topic['posted']; ?> <a href="viewtopic.php?pid=<?php echo $cur_topic['id']; ?>#p<?php echo $cur_topic['id']; ?>" target=_blank><?php echo substr($cur_topic['subject'], 0, 50); ?></a> <i><font color="#CCCC99"><?php echo $cur_topic['poster']; ?></font></i><br>
</div>
</div>

<?