Page 1 of 1

Problem insertion block last active topics on viewforum

Posted: 15 Jun 2014, 22:56
by systemcrack
Hello guys, I'm trying to insert the block last active topics in vieforum and in viewtopic.
So I opened the viewtopic.php and I modified it like this:

Code: Select all

//-- mod: Top Stats ---------------------------------------------------------//
   include($phpbb_root_path . 'includes/functions_top_stats.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//

// Output the page
page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);

$template->set_filenames(array(
	'body' => ($view == 'print') ? 'viewtopic_print.html' : 'viewtopic_body.html')
);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"), $forum_id);

page_footer();

?>
I opened the viewforum.php and I modified it like this:

Code: Select all

//-- mod: Top Stats ---------------------------------------------------------//
   include($phpbb_root_path . 'includes/functions_top_stats.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//

page_footer();

?>
I opened the viewtopic_body.html and I modified it like this:

Code: Select all

<!-- INCLUDE overall_header.html -->

<!-- IF S_TSRAT_ENABLE -->
<!-- INCLUDE recent_active_body.html -->
<!-- ENDIF -->

<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
I opened the viewforum_body.html and I modified it like this:

Code: Select all

<!-- INCLUDE overall_header.html -->

<!-- IF S_TSRAT_ENABLE -->
<!-- INCLUDE recent_active_body.html -->
<!-- ENDIF -->

<!-- IF U_MCP --><p>[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ENDIF -->
<h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
The problem lies in the fact appear the following errors on overall_header:

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/includes/functions_top_stats.php on line 204: Undefined variable: total_posts
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions_top_stats.php on line 204: Division by zero
could you help me understand where I'm wrong please.

Problem insertion block last active topics

Posted: 19 Jun 2014, 00:28
by Stoker
You need some of the code from index.php on the other pages.

Problem insertion block last active topics

Posted: 19 Jun 2014, 09:56
by systemcrack
Stoker wrote:You need some of the code from index.php on the other pages.
Hi Stoker,
Have you looked at the code I posted before? if you talk about this code:

Code: Select all

//-- mod: Top Stats ---------------------------------------------------------//
   include($phpbb_root_path . 'includes/functions_top_stats.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//
I've already added it.. on viewtopic.php and viewforum.php, and this:

Code: Select all

<!-- IF S_TSRAT_ENABLE -->
<!-- INCLUDE recent_active_body.html -->
<!-- ENDIF -->
in vietopic_body.html and vieforum_body.html, but you already know what is my result.
You could be a little more specific please.. ;)

Image

maybe a picture might help you to understand .. the block appears in viewforum, but also the errors appear and distort the display of the menu.

I can't understand where could be the problem. :coffee:

Problem insertion block last active topics on viewforum

Posted: 19 Jun 2014, 16:54
by Stoker
Im not at home with my pc these days, sorry.

Problem insertion block last active topics on viewforum

Posted: 23 Jun 2014, 13:53
by systemcrack
No problem Stoker, we're not talking about blood transfusions .. ahahahaha! :D I am here and do not run away. ;)

Problem insertion block last active topics on viewforum

Posted: 03 Jul 2014, 14:00
by systemcrack
up

Problem insertion block last active topics on viewforum

Posted: 05 Jul 2014, 04:35
by Stoker
First you need to upload this file to the includes folder
functions_recent_taf.zip
(1.52 KiB) Downloaded 112 times
open viewforum.php
find:

Code: Select all

// Dump out the page header and load viewforum template
add before

Code: Select all

//-- mod: Top Stats ---------------------------------------------------------//
	include($phpbb_root_path . 'includes/functions_recent_taf.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//
open viewtopic.php
Find

Code: Select all

// Output the page
add before

Code: Select all

//-- mod: Top Stats ---------------------------------------------------------//
	include($phpbb_root_path . 'includes/functions_recent_taf.' . $phpEx);
//-- end: Top Stats ---------------------------------------------------------//
The html you have added should be fine

Problem insertion block last active topics on viewforum

Posted: 07 Jul 2014, 15:44
by systemcrack
You are simply great... Thanks Stoker!