That's not completely what I meant.

I want to display the number of posts in the different topics like this:
Topic number 3160 has ... posts
Topic number 3170 has ... posts
and so on...

Is there a way of getting the $topic_id into

<?php echo('Topic has '.$num_posts.' posts.'); ?>

this line of code, so I only have to run

<?php $pun_root = './forums/';
require $pun_root.'include/common.php';

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

this code once at the top of the page and it will read the different topics?

Thanx in advance!

This works perfectly! smile

Is there any way of getting the number of posts of several different topics on the same page?

Thanx in advance!

It works, but I get this error:


Warning: Cannot modify header information - headers already sent by (output started at ROOT/index.php:10) in ROOT/forum/include/functions.php on line 82
Topic has # posts.

Any idea on what this could be?

Could someone please tell me how I can show the number of posts for a specified topic on my frontpage?
The frontpage is in the root directory and the forum is in a seperate directory '/forum/'...

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: (Topic has 4 Posts)

What code do I need to use? I tried using the extern.php file, but I'm not too experienced with php so I don't know exactly how to get this information...

Thanx in advance!
Supercharged.