TopStats on external page

Download and support for PhpBB3 Top Stats Mod
Locked
GROMOVNIK
BBCoder II
BBCoder II
Posts: 5
Joined: 16 Oct 2012, 15:19
BBCodes: 5

TopStats on external page

Post by GROMOVNIK »

Hi,

I implement TopStats in my forum poljoforum.rs/statistika.php, i want to use it in separate page out of forum.

Code for file Statistika.php

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id: page.php ~ Stilithius $
* @copyright (c) 2005 phpBB Group

*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('Statistika foruma');

$template->set_filenames(array(
        'body' => 'statistika_body.html')
);

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));

page_footer();

?>
and code for statistika_body.html

Code: Select all

    <!-- INCLUDE overall_header.html -->
    <h2>Statistika foruma</h2>
    <!-- IF S_TSRAT_ENABLE -->
<!-- INCLUDE recent_active_body.html -->
<!-- ENDIF -->
 
<!-- IF S_TSMVT_ENABLE or S_TSMRT_ENABLE or S_TSMAU_ENABLE or S_TSMAF_ENABLE or S_TSLVB_ENABLE or S_TSLRU_ENABLE -->
<!-- INCLUDE top_stats_body.html -->
<!-- ENDIF -->
    <!-- INCLUDE jumpbox.html -->
    <!-- INCLUDE overall_footer.html -->
I can see 5 most recent active, but cant's see other boxes. They are turned on in ACP.
Also tried to copy (can't post URL) from other topic sugested by martin123456 in statistika.php before page footer, only change is i get 10 recenet posts and again no other boxes.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3525
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

TopStats on external page

Post by Stoker »

Undo what martin told you.
Open the top stats and follow the instructions.
Do the index.php edits to your custom php file and the index_body edits to your custom html file.
Thats it.
Board rules! No PM support
GROMOVNIK
BBCoder II
BBCoder II
Posts: 5
Joined: 16 Oct 2012, 15:19
BBCodes: 5

TopStats on external page

Post by GROMOVNIK »

Done, i can see other boxes, but i got error 204 and 244 in /includes/functions_top_stats.php.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3525
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

TopStats on external page

Post by Stoker »

You have to tell more about the error. I know the lines, but need to know the error.
Also, is your board without posts?
Board rules! No PM support
GROMOVNIK
BBCoder II
BBCoder II
Posts: 5
Joined: 16 Oct 2012, 15:19
BBCodes: 5

TopStats on external page

Post by GROMOVNIK »

Errors:
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_top_stats.php on line 204: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_top_stats.php on line 244: Division by zero

No, my board have about 35000 post's.
poljoforum.rs/statistika.php
User avatar
Stoker
Site Admin
Site Admin
Posts: 3525
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

TopStats on external page

Post by Stoker »

We need some code from index.php
Open your custom page and find: $user->setup();
Add after $total_posts = $config['num_posts'];
Board rules! No PM support
GROMOVNIK
BBCoder II
BBCoder II
Posts: 5
Joined: 16 Oct 2012, 15:19
BBCodes: 5

TopStats on external page

Post by GROMOVNIK »

Done, working fine. Thank you very much. Just one more question, in table 5 most active forums, i got list, but number of posts is not matching with posts in forum, is there any error in counting or there is some other error? Thank's again.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3525
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

TopStats on external page

Post by Stoker »

No, forum posts are fine. But doesnt count subforums. Only the actual forum.
Board rules! No PM support
Locked