Page 1 of 1

2 Blöcke in der mittleren Spalte nebeneinander

Posted: 23. November 2012 12:13
by Loomster
Um mal an ein altes Thema anzuknüpfen ...

Ist es mittlerweile irgendwie möglich, 2 Blöcke in der mittleren Spalte nebeneinander darzustellen?
Auf anderen phpbb basierenden Foren habe ich so etwas schon gesehen.

Interessant wäre für mich z.B. Neueste Bekanntmachungen, Neueste beliebte Themen und Neueste Themen nebeneinander darstellen zu können.

Grüße
Loom

Re: 2 Blöcke in der mittleren Spalte nebeneinander

Posted: 23. November 2012 15:23
by Kirk
So wie es du haben willst geht es nicht.
Das hier Neueste Bekanntmachungen, Neueste beliebte Themen und Neueste Themen ist ein und das selbe Modul.
Du könntest ein seitliches Modul erstellen und zwar so:
Öffne: root/portal/modules/portal_recent.php

Suche:

Code: Select all

public $columns = 21;
Ersetze es mit:

Code: Select all

public $columns = 31;
Suche:

Code: Select all

		return 'recent_center.html';
	}
Setze danach das hier ein:

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_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';
	}
Für prosilver basierende Style:

Öffne: root/styles/[stylename]/template\portal\modules\recent_center.html

Ersetze den darin enthaltenen Code durch diesen hier:

Code: Select all

<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
	<ul class="topiclist bg1">
		<li><dl>
			<dd style="border-left:0px; padding-left:73px; width:100%">
			<table 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 -->
			</tr>
			<tr>
				<!-- IF .latest_announcements -->
				<td class="row1" style="width: 33%;" valign="top">
					<span class="gensmall">
					<!-- BEGIN latest_announcements -->
								<a href="{latest_announcements.U_VIEW_TOPIC}" title="{latest_announcements.FULL_TITLE}">{latest_announcements.TITLE}</a><br />
					<!-- END latest_announcements -->
					</span>
				</td>
				<!-- ENDIF -->
				<!-- IF .latest_hot_topics -->
				<td class="row1" style="width: 33%;" valign="top">
					<span class="gensmall">
					<!-- 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 -->
					</span>
				</td>
				<!-- ENDIF -->
			</tr>
			</table>
			</dd>
		</dl></li>
	</ul>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
Erstelle eine Datei mit den Namen recent_side.html und füge dort folgenden Code ein:

Code: Select all

<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="{$IMAGE_WIDTH}" height="{$IMAGE_HEIGHT}" alt="" />&nbsp;<!-- ENDIF -->{$TITLE}{$LR_BLOCK_H_R}
	<div class="portal-navigation">
	<ul class="topiclist bg1">
		<li><dl>
			<dd style="border-left:0px; width:100%">
			<table width="100%">
			<tr>
				<!-- IF .latest_topics --><td class="row1"><strong>{L_PORTAL_RECENT_TOPIC}</strong></td><!-- ENDIF -->
			</tr>
			<tr>
				<!-- IF .latest_topics -->
				<td class="row1" style="width: 33%;" valign="top">
					<span class="gensmall">
					<!-- BEGIN latest_topics -->
						<li><a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a></li>
					<!-- END latest_topics -->
					</span>
				</td>
				<!-- ENDIF -->
			</tr>
			</table>
			</dd>
		</dl></li>
	</ul>
	</div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
<!-- ENDIF -->
Lade diesen Block in root/styles/[stylename]/template/portal/modules hoch.


Für subsilver2 basierende Styles

Öffne root/styles/[stylename]/template/portal/modules/recent_center.html

Ersetze den darin enthaltenen Code durch diesen hier:

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 -->
	</tr>
	<tr>
		<!-- IF .latest_announcements -->
		<td class="row1" width="39%" 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 -->
	</tr>
</table>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
<!-- ENDIF -->
Erstelle eine Datei mit den Namen recent_side.html und füge dort folgenden Code ein:

Code: Select all

<!-- IF .latest_announcements or .latest_hot_topics or .latest_topics -->
{$LR_BLOCK_H_L}<!-- IF $S_BLOCK_ICON --><img src="{$IMAGE_SRC}" width="{$IMAGE_WIDTH}" height="{$IMAGE_HEIGHT}" alt="" />&nbsp;<!-- ENDIF -->{$TITLE}{$LR_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
			<tr class="row3">
				<td>
					<strong>{portalmenu.CAT_TITLE}</strong>
				</td>
			</tr>
		<!-- IF .latest_topics -->
			<tr class="row1">
				<td>
			<!-- BEGIN latest_topics -->
					<img src="{T_THEME_PATH}/images/portal/arrowbullet<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->_rtl<!-- ENDIF -->.gif" width="12" height="11" alt="" />&nbsp;{portalmenu.links.LINK_TITLE}</a><a href="{latest_topics.U_VIEW_TOPIC}" title="{latest_topics.FULL_TITLE}">{latest_topics.TITLE}</a><br />
			<!-- END latest_topics -->
				</td>
			</tr>
		<!-- ENDIF -->
	</tr>
</table>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
<!-- ENDIF -->
Lade diesen Block in root/styles/[stylename]/template/portal/modules hoch.

Aktualisiere deine Styles:
"Administrations-Bereich" (ACP) > "Styles" > "Templates" > jedes > "Aktualisieren"

Leere den Cache im "Administrations-Bereich" (ACP) > "Allgemein" > "Den Cache leeren"


Danach kannst du dieses Modul im ACP hinzufügen.