Page 1 of 1

NV Recent Topics mod in center block

Posted: 27. July 2008 00:28
by Fliggerty
Hello all,

It was suggested that I share what I did to get nickvergessen's NV Recent Topics mod to work in a center block. Fortunately that mod includes instructions to display the recent topics on any page, so I didn't have to do much to adapt it to work on a portal. This is what I did though:

First, in portal.php find:

Code: Select all

$template->assign_vars(array(
	'PORTAL_LEFT_COLLUMN' 	=> $portal_config['portal_left_collumn_width'],
	'PORTAL_RIGHT_COLLUMN' 	=> $portal_config['portal_right_collumn_width'],
));
Add before:

Code: Select all

if($config['rt_portal'])
{
	include($phpbb_root_path . 'includes/functions_recenttopics.' . $phpEx);
}
Now in adm/style/acp_recenttopics.html find:

Code: Select all

		<!-- IF RT_MUSTER and not RT_MUSTER -->
		<dl>
			<dt><label for="rt_muster">{L_RT_MUSTER}</label></dt>
			<dd><input type="radio" class="radio" name="rt_muster" value="1" <!-- IF RT_MUSTER -->checked="checked"<!-- ENDIF -->/> {L_YES} &nbsp; 
				<input type="radio" class="radio" name="rt_muster" value="0" <!-- IF not RT_MUSTER -->checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
		</dl>
		<!-- ENDIF -->
Add before:

Code: Select all

         <dl>
			<dt><label for="rt_portal">{L_RT_PORTAL}</label></dt>
			<dd><input type="radio" class="radio" name="rt_portal" value="1" <!-- IF RT_PORTAL -->checked="checked"<!-- ENDIF -->/> {L_YES} &nbsp; 
				<input type="radio" class="radio" name="rt_portal" value="0" <!-- IF not RT_PORTAL -->checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
		</dl>
Next, in includes/acp/acp_recenttopics.php find:

Code: Select all

#$rt_muster			= request_var('rt_muster', 0);
Add before:

Code: Select all

				$rt_portal			= request_var('rt_portal', 0);
Find:

Code: Select all

				#if($rt_muster != $config['rt_muster'])
				#{
				#	set_config('rt_muster', $rt_muster);
				#}
Add before:

Code: Select all

				if($rt_portal != $config['rt_portal'])
				{
					set_config('rt_portal', $rt_portal);
				}
Find:

Code: Select all

#'RT_MUSTER'				=> $config['rt_muster'],
Add before:

Code: Select all

				'RT_PORTAL'				=> $config['rt_portal'],
In language/en/mods/info_acp_recenttopics.php find:

Code: Select all

	'RT_INDEX'			=> 'Index',
Add after:

Code: Select all

	'RT_PORTAL'			=> 'Portal',
Finally, open styles/prosilver/template/portal/portal_body.html and decide where you want it to display. I did this:

Code: Select all

		<!-- IF S_DISPLAY_RECENT -->
			<!-- INCLUDE portal/block/recent.html -->
		<!-- ENDIF -->
Add after:

Code: Select all

<!-- IF RT_DISPLAY --><!-- INCLUDE recent_topics_body.html --><!-- ENDIF -->
And that's it. In the ACP, .mods tab under "recent topics configuration" there will now be an option to enable/disable display on the portal.

I am considering trying to actually just include this in overall_footer.html. I'll report back here how that works when/if I do try it.

Enjoy!

--Fligg

Re: NV Recent Topics mod in center block

Posted: 27. August 2008 13:42
by Pete
Hello, can someone help me work on the HTML to make it looks something like this?

Image


I'd appreicate it. :)

Re: NV Recent Topics mod in center block

Posted: 7. November 2008 22:40
by HOLOGRAPHICpizza
For some reason on my site, I got the recent topics to show up fine on the front page, but it shows double the amount of posts that are shown in the index! If I put in 4 posts, 4 will show up in the index and 8 will show up on the front page. Does anyone have any idea what might be causing this?

Edit: I just took a close look at it and it is actually listing every topic twice.I have it set to display 2 topics and it is displaying them like "Topic 1, Topic 2, Topic 1, Topic 2". This is very strange.

Edit: DOH! I just looked and I had put

Code: Select all

if ($config['rt_portal'])
{
	include($phpbb_root_path . 'includes/functions_recenttopics.'.$phpEx);
}
in portal.php twice. Man I feel stupid. :lol:

Re: NV Recent Topics mod in center block

Posted: 5. April 2009 22:54
by CitLemBiK
Its this 1.0.3 compatible?

Re: NV Recent Topics mod in center block

Posted: 3. November 2009 20:17
by JesusADS
Hi! for those who whant to make this work on the newest version of phpbb [3.0.5] and Board3 Portal [1.0.4], you have to do this:

Edit: portal.php

Find:

Code: Select all

    $template->assign_vars(array(
       'PORTAL_LEFT_COLLUMN'    => $portal_config['portal_left_collumn_width'],
       'PORTAL_RIGHT_COLLUMN'    => $portal_config['portal_right_collumn_width'],
    ));
Add after:

Code: Select all

if ($config['rt_portal'])
{
	if (!function_exists('display_recent_topics'))
	{
		include($phpbb_root_path . 'includes/functions_recenttopics.' . $phpEx);
	}
	display_recent_topics($config['rt_number'], $config['rt_page_number'], $config['rt_anti_topics'], 'recent_topics', request_var('f', 0), true);
}
***********************************************************************************************************************************************************

Edit: adm/style/acp_recenttopics.html

Find:

Code: Select all

<legend>{L_RT_VIEW_ON}</legend>

		<dl>

			<dt><label for="rt_index">{L_RT_INDEX}</label></dt>

			<dd><input type="radio" class="radio" name="rt_index" value="1" <!-- IF RT_INDEX -->checked="checked"<!-- ENDIF -->/> {L_YES} &nbsp; 

				<input type="radio" class="radio" name="rt_index" value="0" <!-- IF not RT_INDEX -->checked="checked"<!-- ENDIF --> /> {L_NO}</dd>

		</dl>

Add after:

Code: Select all

		<dl>
			<dt><label for="rt_portal">{L_RT_PORTAL}</label></dt>
			<dd><input type="radio" class="radio" name="rt_portal" value="1" <!-- IF RT_PORTAL -->checked="checked"<!-- ENDIF -->/> {L_YES} &nbsp;
			<input type="radio" class="radio" name="rt_portal" value="0" <!-- IF not RT_PORTAL -->checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
		</dl>
***********************************************************************************************************************************************************

Edit: includes/acp/acp_recenttopics.php

Find:

Code: Select all

			set_config('rt_index', request_var('rt_index', 0));
Add after:

Code: Select all

			set_config('rt_portal', request_var('rt_portal', 0));
-----------------------------------------------------------------------------------------------------------------------------------------------------------

Find:

Code: Select all

			'RT_INDEX'				=> $config['rt_index'],
Add after:

Code: Select all

			'RT_PORTAL'				=> $config['rt_portal'],
***********************************************************************************************************************************************************

Edit: language/es/mods/info_acp_recenttopics.php

Find:

Code: Select all

	'RT_INDEX'			=> 'Index',
Add after:

Code: Select all

	'RT_PORTAL'			=> 'Portal',
***********************************************************************************************************************************************************

Edit: styles/prosilver/template/portal/portal_body.html

Find:

Code: Select all

<!-- [+] center block area -->
	   <td valign="top">
	   <br style="clear:both" />
decide where you want to display it, and add:

Code: Select all

    		  <!-- IF RECENT_TOPICS_DISPLAY --><!-- INCLUDE recent_topics_body.html --><!-- ENDIF -->
***********************************************************************************************************************************************************

Done :D

Enjoy ;)

Re: NV Recent Topics mod in center block

Posted: 6. November 2009 20:39
by JesusADS
updated in my previous post for the newest version of phpbb [3.0.5] and Board3 Portal [1.0.4].

The newest version of the MOD NV Recent Topics you can find it here

enjoy ;)

Re: NV Recent Topics mod in center block

Posted: 3. July 2010 15:37
by hooplah
Hi using the latest phpbb and latest portal I am getting the following error on portal page

Code: Select all

[phpBB Debug] PHP Notice: in file /portal.php on line 257: Undefined index: rt_portal
[phpBB Debug] PHP Notice: in file /portal.php on line 266: Undefined index: rt_portal
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4303: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
in acp when I click on "Recent topics" MOD configuration

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/acp/acp_recenttopics.php on line 60: Undefined index: rt_portal
[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)

EDIT: if I take this edit out it nearly works

Image

but on my portal but still error in acp
Edit: portal.php

Find:
Code: Select all
$template->assign_vars(array(
'PORTAL_LEFT_COLLUMN' => $portal_config['portal_left_collumn_width'],
'PORTAL_RIGHT_COLLUMN' => $portal_config['portal_right_collumn_width'],
));


Add after:
Code: Select all
if ($config['rt_portal'])
{
if (!function_exists('display_recent_topics'))
{
include($phpbb_root_path . 'includes/functions_recenttopics.' . $phpEx);
}
display_recent_topics($config['rt_number'], $config['rt_page_number'], $config['rt_anti_topics'], 'recent_topics', request_var('f', 0), true);
}

Re: NV Recent Topics mod in center block

Posted: 3. July 2010 21:14
by Marc
Did you maybe forget to run the Recen Topics MOD installer?

Re: NV Recent Topics mod in center block

Posted: 3. July 2010 23:08
by hooplah
No m8 ran the installer and nv part works fine on board ;) thanks anyway :)