Move Recent Topics module to left column?

Current Version: 2.0.2
Released: 2013-10-27
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
kooljp
Active Member
Posts: 34
Joined: 4. June 2011 04:08

Move Recent Topics module to left column?

Post by kooljp »

Your Portal Version: 2.0.1
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Advanced Knowledge
Boardlink: http://www.fishing-victoria.com/

What have you done before the problem was there?
n/a

What have you already tryed to solve the problem?
cannot move the Recent Topics module from the Centre Column to the left column.

Description and Message
Hi, I cannot move the Recent Topics module from the Centre Column to the left column.
There are no arrows as pictured:
Image

We need to move "Recent" to the Left column.

How do you achieve this?
User avatar

cpg
Sponsor
Posts: 119
Joined: 3. September 2010 19:42
phpBB.de User: cpg
Location: Ringsberg
Contact:

Re: Move Recent Topics module to left column?

Post by cpg »

Hallo,

the file in \styles\yourstyle\template\portal\modules
is "recent_center.html"

I think, for the sides you have to write a new "recent_side.html".

Best regards
CPG
Last edited by cpg on 28. February 2013 17:48, edited 1 time in total.
User avatar

Kirk
Dev
Posts: 1956
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Move Recent Topics module to left column?

Post by Kirk »

Hi
Open root/portal/modules/portal_recent.php

Find:

Code: Select all

	/**
	* Allowed columns: Just sum up your options (Exp: left + right = 10)
	* top		1
	* left		2
	* center	4
	* right		8
	* bottom	16
	*/
	public $columns = 21;
Replace with:

Code: Select all

	/**
	* Allowed columns: Just sum up your options (Exp: left + right = 10)
	* top		1
	* left		2
	* center	4
	* right		8
	* bottom	16
	*/
	public $columns = 31;
Find:

Code: Select all

		return 'recent_center.html';
	}
Add after:

Code: Select all

	public function get_template_side($module_id)
	{
		global $config, $template, $db, $auth, $phpbb_root_path, $phpEx;

		//
		// Exclude forums
		//
		$sql_where = '';
		if ($config['board3_recent_forum_' . $module_id] > 0)
		{
			$exclude_forums = explode(',', $config['board3_recent_forum_' . $module_id]);
			
			$sql_where = ' AND ' . $db->sql_in_set('forum_id', array_map('intval', $exclude_forums), ($config['board3_recent_exclude_forums_' . $module_id]) ? true : false);
		}

		// Get a list of forums the user cannot read
		$forum_ary = array_unique(array_keys($auth->acl_getf('!f_read', true)));

		// Determine first forum the user is able to read (must not be a category)
		$sql = 'SELECT forum_id
			FROM ' . FORUMS_TABLE . '
			WHERE forum_type = ' . FORUM_POST;

		$forum_sql = '';
		if (sizeof($forum_ary))
		{
			$sql .= ' AND ' . $db->sql_in_set('forum_id', $forum_ary, true);
			$forum_sql = ' AND ' . $db->sql_in_set('t.forum_id', $forum_ary, true);
		}

		$result = $db->sql_query_limit($sql, 1);
		$g_forum_id = (int) $db->sql_fetchfield('forum_id');
		$db->sql_freeresult($result);

		//
		// Recent announcements
		//
		$sql = 'SELECT topic_title, forum_id, topic_id
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_status <> ' . FORUM_LINK . '
				AND topic_approved = 1 
				AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ')
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_announcements', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		//
		// Recent hot topics
		//
		$sql = 'SELECT topic_title, forum_id, topic_id
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_approved = 1 
				AND topic_replies >=' . $config['hot_threshold'] . '
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_hot_topics', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id'] == 0) ? $g_forum_id : $row['forum_id']) . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		//
		// Recent topic (only show normal topic)
		//
		$sql = 'SELECT topic_title, forum_id, topic_id
			FROM ' . TOPICS_TABLE . ' t
			WHERE topic_status <> ' . ITEM_MOVED . '
				AND topic_approved = 1 
				AND topic_type = ' . POST_NORMAL . '
				AND topic_moved_id = 0
				' . $sql_where . '' .  $forum_sql . '
			ORDER BY topic_time DESC';
		$result = $db->sql_query_limit($sql, $config['board3_max_topics_' . $module_id]);

		while(($row = $db->sql_fetchrow($result)) && ($row['topic_title']))
		{
			// auto auth
			if (($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0'))
			{
				$template->assign_block_vars('latest_topics', array(
					'TITLE'			=> character_limit($row['topic_title'], $config['board3_recent_title_limit_' . $module_id]),
					'FULL_TITLE'	=> censor_text($row['topic_title']),
					'U_VIEW_TOPIC'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])
				));
			}
		}
		$db->sql_freeresult($result);

		return 'recent_side.html';
	}
Create a file named recent_side.html with the following content:

Code: Select all

<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
	<tr>
		<!-- IF .latest_announcements --><td class="row1"><strong>{L_PORTAL_RECENT_ANN}</strong></td><!-- ENDIF -->
		<!-- IF .latest_hot_topics --><td class="row1"><strong>{L_PORTAL_RECENT_HOT_TOPIC}</strong></td><!-- ENDIF -->
		<!-- IF .latest_topics --><td class="row1"><strong>{L_PORTAL_RECENT_TOPIC}</strong></td><!-- ENDIF -->
	</tr>
	<tr>
		<!-- IF .latest_announcements -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_announcements -->
						<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
			<!-- END latest_announcements -->
		</td>
		<!-- ENDIF -->
		<!-- IF .latest_hot_topics -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_hot_topics -->
				<a href="{latest_hot_topics.U_VIEW_TOPIC}" title="{latest_hot_topics.FULL_TITLE}">{latest_hot_topics.TITLE}</a><br />
			<!-- END latest_hot_topics -->
		</td>
		<!-- ENDIF -->
		<!-- IF .latest_topics -->
		<td class="row1" width="33%" valign="top">
			<!-- BEGIN latest_topics -->
				<a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
			<!-- END latest_topics -->
		</td>
		<!-- ENDIF -->
	</tr>
</table>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
Upload these file to root/styles/[stylename]/template/potal/module

Refresh your Styles:
"Administration Control Panel" (ACP) > "Styles" > "Templates" > each > "refresh"
"Administration Control Panel" (ACP) > "Styles" > "Theme" > each > "refresh"

Clear your cache in the "Administration Control Panel" (ACP) > "General" > "Purge the cache"


The adjustments you have to make yourself
Gruß Udo

Topic author
kooljp
Active Member
Posts: 34
Joined: 4. June 2011 04:08

Re: Move Recent Topics module to left column?

Post by kooljp »

now I have an error:

Fatal error: Call to undefined method portal_recent_module::get_template_side() in /home/content/12/7540112/html/portal.php on line 97
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Move Recent Topics module to left column?

Post by Marc »

You are supposed to add that method as described in the post above. Please take another look at your edits.

Topic author
kooljp
Active Member
Posts: 34
Joined: 4. June 2011 04:08

Re: Move Recent Topics module to left column?

Post by kooljp »

works perfectly now. Thanks!
Locked

Return to “Board3 Portal 2.0.x - English Support”