<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Active Topics]]></title>
		<link>https://punbb.informer.com/forums/topic/4160/active-topics/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/4160/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Active Topics.]]></description>
		<lastBuildDate>Tue, 25 Mar 2008 00:41:06 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/112165/#p112165</link>
			<description><![CDATA[<p>anyone wanna update this to work with 1.3?</p>]]></description>
			<author><![CDATA[null@example.com (raptrex)]]></author>
			<pubDate>Tue, 25 Mar 2008 00:41:06 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/112165/#p112165</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/103746/#p103746</link>
			<description><![CDATA[<div class="codebox"><pre><code>AND f.id != 1</code></pre></div><p>And if I want 1,2 and 3?</p><div class="codebox"><pre><code>AND f.id != 1
AND f.id != 2
AND f.id != 3</code></pre></div><p>Or is there and other better way?</p>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Fri, 16 Nov 2007 08:40:34 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103746/#p103746</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/103710/#p103710</link>
			<description><![CDATA[<p>You&#039;d probably just change</p><div class="codebox"><pre><code>$result = $db-&gt;query(&#039;
    SELECT t.* 
    FROM &#039;.$db-&gt;prefix.&#039;topics AS t 
    INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;
    ) 
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) 
    ORDER BY t.last_post DESC
    LIMIT &#039;.$ak_limit
) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());</code></pre></div><p>to</p><div class="codebox"><pre><code>$result = $db-&gt;query(&#039;
    SELECT t.* 
    FROM &#039;.$db-&gt;prefix.&#039;topics AS t 
    INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f 
    ON f.id=t.forum_id 
    LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp 
    ON (
        fp.forum_id=f.id 
        AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;
    ) 
    WHERE (
        fp.read_forum IS NULL 
        OR fp.read_forum=1
    ) AND f.id != 1
    ORDER BY t.last_post DESC
    LIMIT &#039;.$ak_limit
) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (pogenwurst)]]></author>
			<pubDate>Thu, 15 Nov 2007 20:31:57 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103710/#p103710</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/103691/#p103691</link>
			<description><![CDATA[<p>Is it possible to remove some forums in mod_active_topics_1.2?&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;I dont want forum id=1 to be displayed for example. </p><div class="codebox"><pre><code>&lt;?php
/*

PunBB Active Topics

Copyright 2004-2005 Alex King, http://www.alexking.org/

This is a mod for PunBB, http://www.punbb.org/
PunBB is Copyright (C) 2002, 2003, 2004  Rickard Andersson (rickard@punbb.org)

This file is based on the viewtopic.php file in PunBB.

-------------------------------

You can see this in action at the Use Tasks forums:

  http://www.usetasks.com/forums/


To install, include this file below the forums list in your index.php file:

  include(&#039;mod_active_topics_1.2.php&#039;);

*/

$ak_limit = 25; // change this to the number of active topics you want to display.

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

require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/forum.php&#039;;

?&gt;
&lt;div id=&quot;vf&quot; class=&quot;blocktable&quot;&gt;
    &lt;h2&gt;&lt;span&gt;Active Topics&lt;/span&gt;&lt;/h2&gt;
    &lt;div class=&quot;box&quot;&gt;
        &lt;div class=&quot;inbox&quot;&gt;
            &lt;table cellspacing=&quot;0&quot;&gt;
            &lt;thead&gt;
                &lt;tr&gt;
                    &lt;th class=&quot;tcl&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Topic&#039;] ?&gt;&lt;/th&gt;
                    &lt;th class=&quot;tc2&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Replies&#039;] ?&gt;&lt;/th&gt;
                    &lt;th class=&quot;tc3&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_forum[&#039;Views&#039;] ?&gt;&lt;/th&gt;
                    &lt;th class=&quot;tcr&quot; scope=&quot;col&quot;&gt;&lt;?php echo $lang_common[&#039;Last post&#039;] ?&gt;&lt;/th&gt;
                &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody&gt;
&lt;?php
// If there are topics in this forum.
if ($db-&gt;num_rows($result))
{
    while ($cur_topic = $db-&gt;fetch_assoc($result))
    {
        $icon_text = $lang_common[&#039;Normal icon&#039;];
        $item_status = &#039;&#039;;
        $icon_type = &#039;icon&#039;;

        if ($cur_topic[&#039;moved_to&#039;] == null)
            $last_post = &#039;&lt;a href=&quot;viewtopic.php?pid=&#039;.$cur_topic[&#039;last_post_id&#039;].&#039;#p&#039;.$cur_topic[&#039;last_post_id&#039;].&#039;&quot;&gt;&#039;.format_time($cur_topic[&#039;last_post&#039;]).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($cur_topic[&#039;last_poster&#039;]).&#039;&lt;/span&gt;&#039;;
        else
            $last_post = &#039; &#039;;

        if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
            $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);

        if ($cur_topic[&#039;moved_to&#039;] != 0)
            $subject = $lang_forum[&#039;Moved&#039;].&#039;: &lt;a href=&quot;viewtopic.php?id=&#039;.$cur_topic[&#039;moved_to&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($cur_topic[&#039;poster&#039;]).&#039;&lt;/span&gt;&#039;;
        else if ($cur_topic[&#039;closed&#039;] == &#039;0&#039;)
            $subject = &#039;&lt;a href=&quot;viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($cur_topic[&#039;poster&#039;]).&#039;&lt;/span&gt;&#039;;
        else
        {
            $subject = &#039;&lt;a href=&quot;viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/a&gt; &lt;span class=&quot;byuser&quot;&gt;&#039;.$lang_common[&#039;by&#039;].&#039; &#039;.pun_htmlspecialchars($cur_topic[&#039;poster&#039;]).&#039;&lt;/span&gt;&#039;;
            $icon_text = $lang_common[&#039;Closed icon&#039;];
            $item_status = &#039;iclosed&#039;;
        }

        if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $cur_topic[&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;] &amp;&amp; $cur_topic[&#039;moved_to&#039;] == null)
        {
            $icon_text .= &#039; &#039;.$lang_common[&#039;New icon&#039;];
            $item_status .= &#039; inew&#039;;
            $icon_type = &#039;icon inew&#039;;
            $subject = &#039;&lt;strong&gt;&#039;.$subject.&#039;&lt;/strong&gt;&#039;;
            $subject_new_posts = &#039;&lt;span class=&quot;newtext&quot;&gt;[ &lt;a href=&quot;viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&amp;action=new&quot; title=&quot;&#039;.$lang_common[&#039;New posts info&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;New posts&#039;].&#039;&lt;/a&gt; ]&lt;/span&gt;&#039;;
        }
        else
            $subject_new_posts = null;

        // Should we display the dot or not? :)
        if (1 == 0 &amp;&amp; !$pun_user[&#039;is_guest&#039;] &amp;&amp; $pun_config[&#039;o_show_dot&#039;] == &#039;1&#039;)
        {
            if ($cur_topic[&#039;has_posted&#039;] == $pun_user[&#039;id&#039;])
                $subject = &#039;&lt;strong&gt;·&lt;/strong&gt; &#039;.$subject;
            else
                $subject = &#039;  &#039;.$subject;
        }

        if ($cur_topic[&#039;sticky&#039;] == &#039;1&#039;)
        {
            $subject = &#039;&lt;span class=&quot;stickytext&quot;&gt;&#039;.$lang_forum[&#039;Sticky&#039;].&#039;: &lt;/span&gt;&#039;.$subject;
            $item_status .= &#039; isticky&#039;;
            $icon_text .= &#039; &#039;.$lang_forum[&#039;Sticky&#039;];
        }

        $num_pages_topic = ceil(($cur_topic[&#039;num_replies&#039;] + 1) / $pun_user[&#039;disp_posts&#039;]);

        if ($num_pages_topic &gt; 1)
            $subject_multipage = &#039;[ &#039;.paginate($num_pages_topic, -1, &#039;viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;]).&#039; ]&#039;;
        else
            $subject_multipage = null;

        // Should we show the &quot;New posts&quot; and/or the multipage links?
        if (!empty($subject_new_posts) || !empty($subject_multipage))
        {
            $subject .= &#039;  &#039;.(!empty($subject_new_posts) ? $subject_new_posts : &#039;&#039;);
            $subject .= !empty($subject_multipage) ? &#039; &#039;.$subject_multipage : &#039;&#039;;
        }

?&gt;
                &lt;tr&lt;?php if ($item_status != &#039;&#039;) echo &#039; class=&quot;&#039;.trim($item_status).&#039;&quot;&#039;; ?&gt;&gt;
                    &lt;td class=&quot;tcl&quot;&gt;
                        &lt;div class=&quot;intd&quot;&gt;
                            &lt;div class=&quot;&lt;?php echo $icon_type ?&gt;&quot;&gt;&lt;div class=&quot;nosize&quot;&gt;&lt;?php echo trim($icon_text) ?&gt;&lt;/div&gt;&lt;/div&gt;
                            &lt;div class=&quot;tclcon&quot;&gt;
                                &lt;?php echo $subject.&quot;\n&quot; ?&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/td&gt;
                    &lt;td class=&quot;tc2&quot;&gt;&lt;?php echo ($cur_topic[&#039;moved_to&#039;] == null) ? $cur_topic[&#039;num_replies&#039;] : &#039; &#039; ?&gt;&lt;/td&gt;
                    &lt;td class=&quot;tc3&quot;&gt;&lt;?php echo ($cur_topic[&#039;moved_to&#039;] == null) ? $cur_topic[&#039;num_views&#039;] : &#039; &#039; ?&gt;&lt;/td&gt;
                    &lt;td class=&quot;tcr&quot;&gt;&lt;?php echo $last_post ?&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php

    }
}
else
{

?&gt;
                &lt;tr&gt;
                    &lt;td class=&quot;tcl&quot; colspan=&quot;4&quot;&gt;&lt;?php echo $lang_forum[&#039;Empty forum&#039;] ?&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php

}

?&gt;
            &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (staffanl)]]></author>
			<pubDate>Thu, 15 Nov 2007 13:36:08 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/103691/#p103691</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/98124/#p98124</link>
			<description><![CDATA[<p>hmm i want this in a portal block style...</p>]]></description>
			<author><![CDATA[null@example.com (thesaint)]]></author>
			<pubDate>Sat, 14 Jul 2007 07:17:42 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/98124/#p98124</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/98119/#p98119</link>
			<description><![CDATA[<p>Sorry to dig up an old thread, but I&#039;m a huge fan of the &quot;Active Topics&quot; mod (used it on my very first install of punBB years ago).&nbsp; I just installed &quot;Mark as read&quot; and I too can&#039;t get the Active Topics to be marked as read.&nbsp; &nbsp;Any suggestions?</p><p>Thanks!</p>]]></description>
			<author><![CDATA[null@example.com (reviewum.com)]]></author>
			<pubDate>Sat, 14 Jul 2007 02:57:19 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/98119/#p98119</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/66630/#p66630</link>
			<description><![CDATA[<p>I&#039;d like to integrate the &#039;Mark topic as read&#039; Mod into the Active Topics 1.2</p><p>My question is how to translate this:<br /></p><div class="codebox"><pre><code>if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $cur_topic[&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;] &amp;&amp; $cur_topic[&#039;moved_to&#039;] == null)
        {
            $icon_text .= &#039; &#039;.$lang_common[&#039;New icon&#039;];
            $item_status .= &#039; inew&#039;;
            $icon_type = &#039;icon inew&#039;;
            $subject = &#039;&lt;strong&gt;&#039;.$subject.&#039;&lt;/strong&gt;&#039;;
            $subject_new_posts = &#039;&lt;span class=&quot;newtext&quot;&gt;[ &lt;a href=&quot;viewtopic.php?id=&#039;.$cur_topic[&#039;id&#039;].&#039;&amp;action=new&quot; title=&quot;&#039;.$lang_common[&#039;New posts info&#039;].&#039;&quot;&gt;&#039;.$lang_common[&#039;New posts&#039;].&#039;&lt;/a&gt; ]&lt;/span&gt;&#039;;
        }
        else
            $subject_new_posts = null;</code></pre></div><p>To relate to this modification from the viewtopic.php changes in the Mark topic as read mod</p><div class="codebox"><pre><code>#
#---------[ 43. OPEN ]--------------------------------------------------------
#

viewtopic.php


#
#---------[ 44. FIND (line: 71) ]---------------------------------------------
#

    $result = $db-&gt;query(&#039;SELECT MIN(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; AND posted&gt;&#039;.$pun_user[&#039;last_visit&#039;]) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());


#
#---------[ 45. REPLACE WITH ]------------------------------------------------
#

    // MOD: MARK TOPICS AS READ - 5 LINES NEW CODE FOLLOW
    if(!empty($pun_user[&#039;read_topic&#039;][&#039;t&#039;][$id])) {
        $last_read = $pun_user[&#039;read_topic&#039;][&#039;t&#039;][$id];
    } else { // if the user hasn&#039;t read the topic
        $last_read = $pun_user[&#039;last_visit&#039;];
    }
    // MOD: MARK TOPICS AS READ - 1 LINE MODIFIED CODE FOLLOWS
    $result = $db-&gt;query(&#039;SELECT MIN(id) FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$id.&#039; AND posted&gt;&#039;.$last_read) or error(&#039;Unable to fetch post info&#039;, __FILE__, __LINE__, $db-&gt;error());


#
#---------[ 46. FIND (line: 105) ]--------------------------------------------
#

    $result = $db-&gt;query(&#039;SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;subscriptions AS s ON (t.id=s.topic_id AND s.user_id=&#039;.$pun_user[&#039;id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());


#
#---------[ 47. REPLACE WITH ]------------------------------------------------
#

    // MOD: MARK TOPICS AS READ - 1 LINE MODIFIED CODE FOLLOWS
    $result = $db-&gt;query(&#039;SELECT t.subject, t.closed, t.num_replies, t.sticky, t.last_post, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;subscriptions AS s ON (t.id=s.topic_id AND s.user_id=&#039;.$pun_user[&#039;id&#039;].&#039;) LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=&#039;.$id.&#039; AND t.moved_to IS NULL&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());


#
#---------[ 48. FIND (line: 115) ]--------------------------------------------
#

// Sort out who the moderators are and if we are currently a moderator (or an admin)


#
#---------[ 49. BEFORE, ADD ]-------------------------------------------------
#

// MOD: MARK TOPICS AS READ - 1 LINE NEW CODE FOLLOWS
if (!$pun_user[&#039;is_guest&#039;]) mark_topic_read($id, $cur_topic[&#039;forum_id&#039;], $cur_topic[&#039;last_post&#039;]);


#
#---------[ 50. SAVE/UPLOAD ]-------------------------------------------------
#</code></pre></div><p>Seems like it&#039;s possible, but the language is so different I&#039;ve only been able to destroy it, not actually get it to work.</p>]]></description>
			<author><![CDATA[null@example.com (dss)]]></author>
			<pubDate>Wed, 19 Apr 2006 09:34:12 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/66630/#p66630</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/60787/#p60787</link>
			<description><![CDATA[<p>Awesome! I spent hours last night trying to make a Mod to my forum like this and failed spectacularly.</p><p><a href="http://www.jasoco.net/geekpub/">http://www.jasoco.net/geekpub/</a><br /><img src="https://punbb.informer.com/forums/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[null@example.com (Jasoco)]]></author>
			<pubDate>Sat, 21 Jan 2006 23:46:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/60787/#p60787</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/58536/#p58536</link>
			<description><![CDATA[<p>Very nice version this mod !</p>]]></description>
			<author><![CDATA[null@example.com (Zevs)]]></author>
			<pubDate>Thu, 08 Dec 2005 16:26:24 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/58536/#p58536</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/58458/#p58458</link>
			<description><![CDATA[<p><img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /> like vbulletin:<br /><a href="http://eposys.e2u.cc/forum/">My forum</a></p><div class="codebox"><pre><code>&lt;?php
/*
PunBB Active Topics Lite by aFeLiOn
Based on &quot;Mod Active Topics&quot; of Alex King, http://www.alexking.org/
This is a mod for PunBB, http://punbb.org/
PunBB is Copyright (C) 2005  Rickard Andersson (rickard@punbb.org)
-------------------------------
To install, include this file below the forums list in your index.php file:
  include(&#039;mod_active_topics.php&#039;);
  (Before line: &#039;$result = $db-&gt;query(&#039;SELECT c.id AS cid...&#039; or anywhere you want)
*/

$active_topic_limit = 7; // change this to the number of active topics you want to display.
$result = $db-&gt;query(&#039;SELECT t.* FROM &#039;.$db-&gt;prefix.&#039;topics AS t INNER JOIN &#039;.$db-&gt;prefix.&#039;forums AS f ON f.id=t.forum_id LEFT JOIN &#039;.$db-&gt;prefix.&#039;forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=&#039;.$pun_user[&#039;g_id&#039;].&#039;) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC    LIMIT &#039;.$active_topic_limit) or error(&#039;Unable to fetch topic list&#039;, __FILE__, __LINE__, $db-&gt;error());

require PUN_ROOT.&#039;lang/&#039;.$pun_user[&#039;language&#039;].&#039;/forum.php&#039;;

?&gt;
&lt;div id=&quot;vf&quot; class=&quot;blocktable&quot;&gt;
    &lt;h2&gt;&lt;span&gt;Active Topics&lt;/span&gt;&lt;/h2&gt;
    &lt;div class=&quot;box&quot;&gt;
        &lt;div class=&quot;inbox&quot;&gt;
            &lt;table cellspacing=&quot;0&quot;&gt;
            &lt;tbody&gt;
&lt;?php
// If there are topics in this forum.
if ($db-&gt;num_rows($result))
{
    echo &#039;&lt;tr&gt;&lt;td class=&quot;tcl&quot;&gt;&#039;;
    while ($cur_topic = $db-&gt;fetch_assoc($result))
    {
        $item_status = &#039;&#039;;

        if ($pun_config[&#039;o_censoring&#039;] == &#039;1&#039;)
            $cur_topic[&#039;subject&#039;] = censor_words($cur_topic[&#039;subject&#039;]);

        $last_post = &#039;&lt;a href=&quot;viewtopic.php?pid=&#039;.$cur_topic[&#039;last_post_id&#039;].&#039;#p&#039;.$cur_topic[&#039;last_post_id&#039;].&#039;&quot;&gt;&#039;.pun_htmlspecialchars($cur_topic[&#039;subject&#039;]).&#039;&lt;/a&gt;&#039;;

        if (!$pun_user[&#039;is_guest&#039;] &amp;&amp; $cur_topic[&#039;last_post&#039;] &gt; $pun_user[&#039;last_visit&#039;])
        {
            $item_status .= &#039; inew&#039;;
            $last_post = &#039;&lt;strong&gt;&#039;.$last_post.&#039;&lt;/strong&gt;&#039;;
        }

        if ($cur_topic[&#039;sticky&#039;] == &#039;1&#039;)
        {
            $last_post = &#039;&lt;span class=&quot;stickytext&quot;&gt;&#039;.$lang_forum[&#039;Sticky&#039;].&#039;: &lt;/span&gt;&#039;.$last_post;
            $item_status .= &#039; isticky&#039;;
        }
?&gt;
            &lt;div&lt;?php if ($item_status != &#039;&#039;) echo &#039; class=&quot;&#039;.trim($item_status).&#039;&quot;&#039;; ?&gt;&gt;
                    &lt;div class=&quot;intd&quot;&gt;
                            &lt;div class=&quot;tclcon&quot;&gt;
                                &lt;?php
                                 echo &#039;&lt;font color=&quot;#FF9900&quot;&gt;&lt;strong&gt;›&lt;/strong&gt;&lt;/font&gt; &#039;.$last_post.&#039; &lt;span class=&quot;byuser&quot;&gt;» &#039;.pun_htmlspecialchars($cur_topic[&#039;last_poster&#039;]).&#039; » &#039;.$lang_common[&#039;Replies&#039;].&#039;: &#039;.$cur_topic[&#039;num_replies&#039;].&#039; » &#039;.$lang_forum[&#039;Views&#039;].&#039;: &#039;.$cur_topic[&#039;num_views&#039;].&#039; » &#039;.format_time($cur_topic[&#039;last_post&#039;]).&#039;&lt;/span&gt;&#039;;
                                ?&gt;
                            &lt;/div&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
&lt;?php
    }
    echo &#039;&lt;/td&gt;&lt;/tr&gt;&#039;;
}
else
{
?&gt;
                &lt;tr&gt;
                    &lt;td class=&quot;tcl&quot; colspan=&quot;4&quot;&gt;&lt;?php echo &#039;*EMPTY*&#039; ?&gt;&lt;/td&gt;
                &lt;/tr&gt;
&lt;?php

}
?&gt;
            &lt;/tbody&gt;
            &lt;/table&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Replika)]]></author>
			<pubDate>Wed, 07 Dec 2005 11:41:10 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/58458/#p58458</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/58273/#p58273</link>
			<description><![CDATA[<p>Works perfect with 1.2.10<br />a great mods !</p>]]></description>
			<author><![CDATA[null@example.com (lebel)]]></author>
			<pubDate>Sat, 03 Dec 2005 16:28:22 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/58273/#p58273</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/36695/#p36695</link>
			<description><![CDATA[<p>Works fine.</p>]]></description>
			<author><![CDATA[null@example.com (alexkingorg)]]></author>
			<pubDate>Mon, 07 Mar 2005 19:06:15 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/36695/#p36695</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/36694/#p36694</link>
			<description><![CDATA[<p>as anybody tried it on 1.2.2</p>]]></description>
			<author><![CDATA[null@example.com (Ataxy)]]></author>
			<pubDate>Mon, 07 Mar 2005 19:05:49 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/36694/#p36694</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/36618/#p36618</link>
			<description><![CDATA[<p>Dang... I wish I was a programmer!&nbsp; &nbsp;Looking more closely there are aspects of both I like.&nbsp; For example the &quot;new post&quot; is really nice on the old version, but the layout and the number of views on the new one is great too.&nbsp; &nbsp;Decisions... decisions....</p><p>Thanks again for this ever important mod!</p>]]></description>
			<author><![CDATA[null@example.com (reviewum.com)]]></author>
			<pubDate>Sun, 06 Mar 2005 19:46:08 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/36618/#p36618</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active Topics]]></title>
			<link>https://punbb.informer.com/forums/post/36611/#p36611</link>
			<description><![CDATA[<p>Not to look a gift horse in the mouth (thanks alexkingorg for the update) but is there anybody with skillz that can make this included file / mod show like the old mod?&nbsp; &nbsp;I don&#039;t want to confuse my users and really like the old layout.</p><p>See the old version running here:<br /><a href="http://www.nifty-stuff.com/img/getimg/active_mod.gif">http://www.nifty-stuff.com/img/getimg/active_mod.gif</a></p><p>Thanks in advance!</p>]]></description>
			<author><![CDATA[null@example.com (reviewum.com)]]></author>
			<pubDate>Sun, 06 Mar 2005 17:42:11 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/36611/#p36611</guid>
		</item>
	</channel>
</rss>
