<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — forum.linux.pl - Polish Linux Site]]></title>
		<link>https://punbb.informer.com/forums/topic/16896/forumlinuxpl-polish-linux-site/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/16896/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in forum.linux.pl - Polish Linux Site.]]></description>
		<lastBuildDate>Sat, 25 Aug 2007 17:56:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: forum.linux.pl - Polish Linux Site]]></title>
			<link>https://punbb.informer.com/forums/post/99749/#p99749</link>
			<description><![CDATA[<div class="quotebox"><cite>sirena wrote:</cite><blockquote><p>Very well put together. Wow, lots of members too.</p></blockquote></div><p>Thx ;-)</p><div class="quotebox"><cite>sirena wrote:</cite><blockquote><p>The&nbsp; &quot;/dev/null&quot; forum - how did you set that up to auto-remove posts?</p></blockquote></div><p>There is function which do this :-) (putted in functions.php, invoked from header.php)<br /></p><div class="codebox"><pre><code>// Delete topics from &#039;/dev/null&#039;
function forum_clean_devnull()
{
    global $db, $db_type, $pun_config, $pun_user;
    
    if($pun_user[&#039;g_id&#039;] &gt; PUN_MOD)
        return;
        
    require_once PUN_ROOT.&#039;include/search_idx.php&#039;;
    
    //For each forum, which name is &#039;/dev/null&#039;
    $fresult = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;forums WHERE forum_name=\&#039;/dev/null\&#039;&#039;) or error(&#039;Unable to get forum list&#039;, __FILE__, __LINE__, $db-&gt;error());
    while(list($fid) = $db-&gt;fetch_row($fresult)){
        
        // Find topics, where last_post is time() - 1 day
        $long_ago = time() - 60 * 60 * 24;
        $topics_were_deleted = 0;
        
        $tresult = $db-&gt;query(&#039;SELECT id FROM &#039;.$db-&gt;prefix.&#039;topics WHERE last_post&lt;&#039;.$long_ago.&#039; AND forum_id=&#039;.$fid) or error(&#039;Unable to get topic list&#039;, __FILE__, __LINE__, $db-&gt;error());
        while(list($topic) = $db-&gt;fetch_row($tresult)){

            // Delete the topics and any redirect topics
            $db-&gt;query(&#039;DELETE FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id=&#039;.$topic.&#039; OR moved_to=&#039;.$topic) or error(&#039;Unable to delete topic&#039;, __FILE__, __LINE__, $db-&gt;error());
            $topics_were_deleted = 1;

            // Delete any subscriptions
            $db-&gt;query(&#039;DELETE FROM &#039;.$db-&gt;prefix.&#039;subscriptions WHERE topic_id=&#039;.$topic) or error(&#039;Unable to delete subscriptions&#039;, __FILE__, __LINE__, $db-&gt;error());

            // Create a list of the post ID&#039;s in this topic and then strip the search index
            $result = $db-&gt;query(&#039;SELECT id, poster_id FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$topic) or error(&#039;Unable to fetch posts&#039;, __FILE__, __LINE__, $db-&gt;error());

            $post_ids = &#039;&#039;;
            while (list($post_id, $user_id) = $db-&gt;fetch_row($result)){
                $post_ids .= ($post_ids != &#039;&#039;) ? &#039;,&#039;.$post_id : $post_id;
                $db-&gt;query(&#039;UPDATE user SET forum_posty=forum_posty-1 WHERE id=&#039;.$user_id) or error(&#039;Unable to update user data&#039;, __FILE__, __LINE__, $db-&gt;error());
            }

            // We have to check that we actually have a list of post ID&#039;s since we could be deleting just a redirect topic
            if ($post_ids != &#039;&#039;)
                strip_search_index($post_ids);

            // Delete posts
            $db-&gt;query(&#039;DELETE FROM &#039;.$db-&gt;prefix.&#039;posts WHERE topic_id=&#039;.$topic) or error(&#039;Unable to delete posts&#039;, __FILE__, __LINE__, $db-&gt;error());
        }

        if($topics_were_deleted == 1){
            update_forum($fid);
    
            @include PUN_ROOT.&#039;include/cache.php&#039;;
            generate_latest_topics_cache();
        }
    }
}</code></pre></div><p>Some code was cp&#039;ed from delete.php (AFAIR). There is reference to table user in the database - this table is a part of linux.pl, not PunBB. At the end there is reference to generate_latest_topics_cache() - this function generates file in cache with list of the newest posted topics.</p>]]></description>
			<author><![CDATA[null@example.com (zipoking)]]></author>
			<pubDate>Sat, 25 Aug 2007 17:56:18 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/99749/#p99749</guid>
		</item>
		<item>
			<title><![CDATA[Re: forum.linux.pl - Polish Linux Site]]></title>
			<link>https://punbb.informer.com/forums/post/99732/#p99732</link>
			<description><![CDATA[<p>Very well put together. Wow, lots of members too.</p><p>The&nbsp; &quot;/dev/null&quot; forum - how did you set that up to auto-remove posts?</p>]]></description>
			<author><![CDATA[null@example.com (sirena)]]></author>
			<pubDate>Fri, 24 Aug 2007 22:57:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/99732/#p99732</guid>
		</item>
		<item>
			<title><![CDATA[forum.linux.pl - Polish Linux Site]]></title>
			<link>https://punbb.informer.com/forums/post/99729/#p99729</link>
			<description><![CDATA[<p><a href="http://forum.linux.pl">http://forum.linux.pl</a><br />Features added in our version of PunBB:<br />- category groups - this forum is available from many addresses (newbie.linux.pl/forum - subsite for new Linux-users, gry.linux.pl/forum - games in Linux, biznes.linux.pl/forum - Linux in bussiness) and every subsite has it&#039;s own forum; on forum.linux.pl all these forums are available together;<br />- category view - it is possible to see only one category; in our forum 2 categories have special meaning - we maintain 2 big projects: &quot;<a href="http://www.linux.pl/rozdajemy">We&#039;re giving Linux</a>&quot; (everybody, who wants share Linux-disks with the others, can announce it here) and &quot;<a href="http://www.linux.pl/hardware">Hardware compability with Linux</a>&quot; (people can share their experiencies about this subject) - in this category topics are sorted alphabetically;<br />- extended RSS output<br />- &quot;/dev/null&quot; - forum with automated removing capability;<br />- latest topics list, which is based on the cached files;<br />- fully integrated with the rest of linux.pl code.</p><p><em>(P.S.: Sorry for my English ;-))</em></p>]]></description>
			<author><![CDATA[null@example.com (zipoking)]]></author>
			<pubDate>Fri, 24 Aug 2007 21:10:41 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/99729/#p99729</guid>
		</item>
	</channel>
</rss>
