<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[PunBB Forums — Number of posts on frontpage?]]></title>
		<link>https://punbb.informer.com/forums/topic/3160/number-of-posts-on-frontpage/</link>
		<atom:link href="https://punbb.informer.com/forums/feed/rss/topic/3160/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Number of posts on frontpage?.]]></description>
		<lastBuildDate>Mon, 02 Feb 2004 06:27:01 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/9426/#p9426</link>
			<description><![CDATA[<p>Maybe he is making a news script or a portal thing?</p>]]></description>
			<author><![CDATA[null@example.com (Dale)]]></author>
			<pubDate>Mon, 02 Feb 2004 06:27:01 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/9426/#p9426</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8968/#p8968</link>
			<description><![CDATA[<p>Might I ask why you want to display the topic ID and the number of posts in that topic on the front page?</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sun, 18 Jan 2004 14:34:53 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8968/#p8968</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8965/#p8965</link>
			<description><![CDATA[<p>Yes, just add the variable into the line like this:<br /></p><div class="codebox"><pre><code>&lt;?php echo(&#039;Topic: &#039;.$topic_id.&#039; has &#039;.$num_posts.&#039; posts.&#039;); ?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Chacmool)]]></author>
			<pubDate>Sun, 18 Jan 2004 14:23:50 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8965/#p8965</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8964/#p8964</link>
			<description><![CDATA[<p>That&#039;s not completely what I meant.</p><p>I want to display the number of posts in the different topics like this:<br /><em>Topic number 3160 has ... posts<br />Topic number 3170 has ... posts<br />and so on...</em></p><p>Is there a way of getting the $topic_id into <br /></p><div class="codebox"><pre><code>&lt;?php echo(&#039;Topic has &#039;.$num_posts.&#039; posts.&#039;); ?&gt;</code></pre></div><p>this line of code, so I only have to run </p><div class="codebox"><pre><code>&lt;?php $pun_root = &#039;./forums/&#039;;
require $pun_root.&#039;include/common.php&#039;;

$result = $db-&gt;query(&#039;SELECT num_replies+1 FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id=&#039;.$topic_id) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());
$num_posts = intval($db-&gt;result($result, 0));?&gt;</code></pre></div><p>this code once at the top of the page and it will read the different topics?</p><p>Thanx in advance!</p>]]></description>
			<author><![CDATA[null@example.com (Supercharged)]]></author>
			<pubDate>Sun, 18 Jan 2004 14:16:35 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8964/#p8964</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8951/#p8951</link>
			<description><![CDATA[<p>Yes. Change</p><p>$topic_id = 3160;</p><p>to</p><p>$topic_id = &#039;3160, 1222, 1446&#039;;</p><p>and</p><p>$result = $db-&gt;query(&#039;SELECT num_replies+1 FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id=&#039;.$topic_id) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>to</p><p>$result = $db-&gt;query(&#039;SELECT num_replies+1 FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id IN(&#039;.$topic_id.&#039;)&#039;) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());</p><p>Then just edit $topic_id. It&#039;s a comma-separeted list of topic IDs.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sat, 17 Jan 2004 22:42:33 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8951/#p8951</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8950/#p8950</link>
			<description><![CDATA[<p>This works perfectly! <img src="https://punbb.informer.com/forums/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Is there any way of getting the number of posts of several different topics on the same page?</p><p>Thanx in advance!</p>]]></description>
			<author><![CDATA[null@example.com (Supercharged)]]></author>
			<pubDate>Sat, 17 Jan 2004 22:37:23 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8950/#p8950</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8948/#p8948</link>
			<description><![CDATA[<p>Do this. Include the following piece of code at the very top of your page (before &lt;html&gt; and all that).<br /></p><div class="codebox"><pre><code>&lt;?php

$topic_id = 3160;

$pun_root = &#039;./forums/&#039;;
require $pun_root.&#039;include/common.php&#039;;

$result = $db-&gt;query(&#039;SELECT num_replies+1 FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id=&#039;.$topic_id) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());
$num_posts = intval($db-&gt;result($result, 0));

?&gt;</code></pre></div><p>Then, when you want to display the text, just include this code:<br /></p><div class="codebox"><pre><code>&lt;?php echo(&#039;Topic has &#039;.$num_posts.&#039; posts.&#039;); ?&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sat, 17 Jan 2004 22:12:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8948/#p8948</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8945/#p8945</link>
			<description><![CDATA[<p>It works, but I get this error:</p><p><em><br />Warning: Cannot modify header information - headers already sent by (output started at <strong>ROOT</strong>/index.php:10) in <strong>ROOT</strong>/forum/include/functions.php on line 82<br />Topic has # posts.<br /></em></p><p>Any idea on what this could be?</p>]]></description>
			<author><![CDATA[null@example.com (Supercharged)]]></author>
			<pubDate>Sat, 17 Jan 2004 19:03:48 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8945/#p8945</guid>
		</item>
		<item>
			<title><![CDATA[Re: Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8943/#p8943</link>
			<description><![CDATA[<p>Here&#039;s an example of how you could do it:<br /></p><div class="codebox"><pre><code>&lt;?php

$topic_id = 3160;

$pun_root = &#039;./forums/&#039;;
require $pun_root.&#039;include/common.php&#039;;

$result = $db-&gt;query(&#039;SELECT num_replies+1 FROM &#039;.$db-&gt;prefix.&#039;topics WHERE id=&#039;.$topic_id) or error(&#039;Unable to fetch topic info&#039;, __FILE__, __LINE__, $db-&gt;error());
$num_posts = intval($db-&gt;result($result, 0));

exit(&#039;Topic has &#039;.$num_posts.&#039; posts.&#039;);

?&gt;</code></pre></div><p>Just replace the value 3160 with the ID for the topic.</p>]]></description>
			<author><![CDATA[null@example.com (Rickard)]]></author>
			<pubDate>Sat, 17 Jan 2004 17:59:26 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8943/#p8943</guid>
		</item>
		<item>
			<title><![CDATA[Number of posts on frontpage?]]></title>
			<link>https://punbb.informer.com/forums/post/8938/#p8938</link>
			<description><![CDATA[<p>Could someone please tell me how I can show the number of posts for a specified topic on my frontpage?<br />The frontpage is in the root directory and the forum is in a seperate directory &#039;/forum/&#039;...</p><p>Example: Lets say this topic has 4 posts total. I want my frontpage to show me automatically how many posts this topic has, like this: <em>(Topic has <strong>4</strong> Posts)</em></p><p>What code do I need to use? I tried using the extern.php file, but I&#039;m not too experienced with php so I don&#039;t know exactly how to get this information...</p><p>Thanx in advance!<br /> Supercharged.</p>]]></description>
			<author><![CDATA[null@example.com (Supercharged)]]></author>
			<pubDate>Sat, 17 Jan 2004 14:38:16 +0000</pubDate>
			<guid>https://punbb.informer.com/forums/post/8938/#p8938</guid>
		</item>
	</channel>
</rss>
