Page 1 of 1

block categories

Posted: 5. January 2012 18:22
by matius
Your Portal Version: 1.0.6
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner
Boardlink: http://centrumrc.pl

PHP Version: 3.0.9
MySQL Version: 5.1.58

What have you done before the problem was there?


What have you already tryed to solve the problem?
I tried to solve the problem but without success. Everything that I managed to do is this, but does not work :/

Description and Message
hi,

I want to create a block on the right side, which will show the topic and then the amount of topics. Everything that I managed to do is this, but does not work.

index.php

Code: Select all

$forum_id = 4;
    $sql = 'SELECT COUNT(topic_id) AS topic_count
        FROM ' . TOPICS_TABLE . '
        WHERE forum_id = 4';
 $result = $db->sql_query($sql);
$topic_count= (int) $db->sql_fetchfield('topic_count');
$db->sql_freeresult($result); 

Code: Select all

$template->assign_vars(array(
    'TOPIC_COUNT'    => $topic_count,
)); 
block on the right side

Code: Select all

{TOPIC_COUNT}
Can somebody help me?[/i]

Re: block categories

Posted: 6. January 2012 15:58
by matius
Somebody help me?

Re: block categories

Posted: 6. January 2012 20:49
by Marc
Where did you add the code you posted?

Re: block categories

Posted: 7. January 2012 14:02
by matius
what do you mean?

first two in index.php

and last, in block. As I said i'm not very good in programing so I could make a mistake.

Re: block categories

Posted: 10. January 2012 00:29
by matius
Is it good or not?