Re: Forenkategorien - Anordnung nebeneinander
Verfasst: 01.01.2012 00:45
Das ist ja nett. 

phpBB.de - Die deutsche phpBB-Community
https://www.phpbb.de/community/
includes/functions_display.php
, wo ich Deinen Code einsetzen muss. Entweder funktioniert mein Notepad ++ nicht mehr richtig oder es gibt die //xxx Stellen in phpBB 3.0.12 nicht mehr, die Du als Anhaltspunkt angegeben hast. Ich habe mich schon dusselig danach gesucht, leider ohne Erfolg. Code: Alles auswählen
$last_catless = $catless;
}
Bist Du sicher, dass ich den ganzen Code zusätzlich einsetzen soll? Du hast einige Beiträge vorher von einem Ersetzungscode geschrieben. Demzufolge müsste ich erst Code entfernen und dafür dann Deinen modifizierten Code einsetzen.Miriam hat geschrieben:finde in der includes/functions_display.phpdanach füge ein: https://www.phpbb.de/support/pastebin.p ... iew&s=1359Code: Alles auswählen
$last_catless = $catless; }
oder hier -> viewtopic.php?f=89&t=219728&start=20#p1255165
Genau so ist es.redbull254 hat geschrieben:...Demzufolge müsste ich erst Code entfernen und dafür dann Deinen modifizierten Code einsetzen.
Code: Alles auswählen
$last_catless = $catless;
}
Code: Alles auswählen
//
// Start category based loops
// Credits to Noxwizard of phpBB.com for this code
//
Code: Alles auswählen
//
// End category based loops
//
ON_INDEX
in der index.php zu definieren.Nein danke.Miriam hat geschrieben:
// Gern kannst Du die Umbauten hier nachlesen.
Das macht ja richtig Lust auf Hilfestellung.Vielen Dank für Deinen Mühen, bei mir sind sie leider vergebens.
FIND
& AFTER ADD
verstehst Du doch aber?root/index.php
Code: Alles auswählen
define('IN_PHPBB', true);
Code: Alles auswählen
define('ON_INDEX', true);
root/includes/functions_display.php
Code: Alles auswählen
$last_catless = $catless;
}
Code: Alles auswählen
//
// Start category based loops
// Credits to Noxwizard of phpBB.com for this code
//
//Sort forums by category
$cat_array = array();
foreach($forum_rows as $forum)
{
if (defined('ON_INDEX'))
{
if (($forum['forum_type'] == FORUM_CAT) AND ($forum['parent_id'] == 0))
{
$cat_array[$forum['forum_id']] = $forum;
}
else
{
$id = $forum['parent_id'];
@$cat_array[$id]['children'][@count(@$cat_array[$id]['children'])] = $forum;
}
}
else
{
if (($forum['forum_type'] == FORUM_CAT) AND ($forum['parent_id'] > 0))
{
$cat_array[$forum['forum_id']] = $forum;
}
else
{
$id = $forum['parent_id'];
@$cat_array[$id]['children'][@count(@$cat_array[$id]['children'])] = $forum;
}
}
}
//Loop through the categories
foreach($cat_array as $cat)
{
if (isset($cat['forum_id']))
{
$template->assign_block_vars('catrow', array(
'FORUM_ID' => $cat['forum_id'],
'FORUM_NAME' => $cat['forum_name'],
'FORUM_DESC' => generate_text_for_display($cat['forum_desc'], $cat['forum_desc_uid'], $cat['forum_desc_bitfield'], $cat['forum_desc_options']),
'FORUM_FOLDER_IMG' => '',
'FORUM_FOLDER_IMG_SRC' => '',
'FORUM_IMAGE' => ($cat['forum_image']) ? '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $cat['forum_id']) . '"><img src="' . $phpbb_root_path . $cat['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" /></a>' : '',
'FORUM_IMAGE_SRC' => ($cat['forum_image']) ? $phpbb_root_path . $cat['forum_image'] : '',
'CHILDREN_COUNT' => count($cat['children']),
'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $cat['forum_id']))
);
}
else
{
$template->assign_block_vars('catrow', array(
'CHILDREN_COUNT' => count($cat['children']))
);
}
//Forums under category
foreach($cat['children'] as $row)
{
$visible_forums++;
$forum_id = $row['forum_id'];
$forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false;
$folder_image = $folder_alt = $l_subforums = '';
$subforums_list = array();
// Generate list of subforums if we need to
if (isset($subforums[$forum_id]))
{
foreach ($subforums[$forum_id] as $subforum_id => $subforum_row)
{
$subforum_unread = (isset($forum_tracking_info[$subforum_id]) && $subforum_row['orig_forum_last_post_time'] > $forum_tracking_info[$subforum_id]) ? true : false;
if ($subforum_row['display'] && $subforum_row['name'])
{
$subforums_list[] = array(
'link' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $subforum_id),
'name' => $subforum_row['name'],
'unread' => $subforum_unread,
);
}
else
{
unset($subforums[$forum_id][$subforum_id]);
}
// If one subforum is unread the forum gets unread too...
if ($subforum_unread)
{
$forum_unread = true;
}
}
$l_subforums = (sizeof($subforums[$forum_id]) == 1) ? $user->lang['SUBFORUM'] . ': ' : $user->lang['SUBFORUMS'] . ': ';
$folder_image = ($forum_unread) ? 'forum_unread_subforum' : 'forum_read_subforum';
}
else
{
switch ($row['forum_type'])
{
case FORUM_POST:
$folder_image = ($forum_unread) ? 'forum_unread' : 'forum_read';
break;
case FORUM_LINK:
$folder_image = 'forum_link';
break;
}
}
// Which folder should we display?
if ($row['forum_status'] == ITEM_LOCKED)
{
$folder_image = ($forum_unread) ? 'forum_unread_locked' : 'forum_read_locked';
$folder_alt = 'FORUM_LOCKED';
}
else
{
$folder_alt = ($forum_unread) ? 'NEW_POSTS' : 'NO_NEW_POSTS';
}
// Create last post link information, if appropriate
if ($row['forum_last_post_id'])
{
$last_post_subject = $row['forum_last_post_subject'];
$last_post_time = $user->format_date($row['forum_last_post_time']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
}
else
{
$last_post_subject = $last_post_time = $last_post_url = '';
}
// Output moderator listing ... if applicable
$l_moderator = $moderators_list = '';
if ($display_moderators && !empty($forum_moderators[$forum_id]))
{
$l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS'];
$moderators_list = implode(', ', $forum_moderators[$forum_id]);
}
$l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS';
$post_click_count = ($row['forum_type'] != FORUM_LINK || $row['forum_flags'] && FORUM_FLAG_LINK_TRACK) ? $row['forum_posts'] : '';
$s_subforums_list = array();
foreach ($subforums_list as $subforum)
{
$s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] . '</a>';
}
$s_subforums_list = (string) implode(', ', $s_subforums_list);
if ($row['forum_type'] != FORUM_LINK)
{
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
}
else
{
// If the forum is a link and we count redirects we need to visit it
// If the forum is having a password or no read access we do not expose the link, but instead handle it in viewforum
if (($row['forum_flags'] && FORUM_FLAG_LINK_TRACK) || $row['forum_password'] || !$auth->acl_get('f_read', $forum_id))
{
$u_viewforum = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']);
}
else
{
$u_viewforum = $row['forum_link'];
}
}
$template->assign_block_vars('catrow.forumrow', array(
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
'S_UNREAD_FORUM' => $forum_unread,
'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false,
'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false,
'FORUM_ID' => $row['forum_id'],
'FORUM_NAME' => $row['forum_name'],
'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']),
'TOPICS' => $row['forum_topics'],
$l_post_click_count => $post_click_count,
'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'),
'FORUM_IMAGE' => ($row['forum_image']) ? '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) . '"><img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" /></a>' : '',
'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '',
'LAST_POST_SUBJECT' => censor_text($last_post_subject),
'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'MODERATORS' => $moderators_list,
'SUBFORUMS' => $s_subforums_list,
'L_SUBFORUM_STR' => $l_subforums,
'L_FORUM_FOLDER_ALT' => $folder_alt,
'L_MODERATOR_STR' => $l_moderator,
'U_VIEWFORUM' => $u_viewforum,
'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'U_LAST_POST' => $last_post_url)
);
// Assign subforums loop for style authors
foreach ($subforums_list as $subforum)
{
$template->assign_block_vars('forumrow.subforum', array(
'U_SUBFORUM' => $subforum['link'],
'SUBFORUM_NAME' => $subforum['name'],
'S_UNREAD' => $subforum['unread'])
);
}
}
}
//
// End category based loops
//
root/styles/prosilver/template/forumlist_body.html
Code: Alles auswählen
<!-- DEFINE $FORUMS = 1 -->
<!-- BEGIN catrow -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt><!-- IF catrow.FORUM_NAME --><a href="{catrow.U_VIEWFORUM}">{catrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
</dl>
</li>
</ul>
<!-- IF catrow.CHILDREN_COUNT > $FORUMS --><div style="float: left; width: 49.95%;"><!-- ELSE --><div style="width: 100%"><!-- ENDIF -->
<ul class="topiclist forums">
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_ROW_COUNT is even or catrow.CHILDREN_COUNT <= $FORUMS -->
<li class="row">
<dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
{forumrow.FORUM_DESC}
<!-- IF forumrow.CLICKS -->
<span>{L_REDIRECTS}: {forumrow.CLICKS}</span>
<!-- ELSEIF not forumrow.S_IS_LINK -->
<br /><br />{forumrow.TOPICS} {L_TOPICS} / {forumrow.POSTS} {L_POSTS}
<!-- IF forumrow.LAST_POST_TIME --> <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_TIME}">{LAST_POST_IMG} {L_LAST_POST}</a> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}<br />
<!-- ELSE -->{L_NO_POSTS}<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF forumrow.MODERATORS -->
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
</dt>
</dl>
</li>
<!-- ENDIF -->
<!-- END forumrow -->
</ul>
</div>
</div>
<!-- IF catrow.CHILDREN_COUNT > $FORUMS -->
<div style="float: right; width: 49.95%;">
<ul class="topiclist forums">
<!-- BEGIN forumrow -->
<!-- IF forumrow.S_ROW_COUNT is odd -->
<li class="row">
<dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
{forumrow.FORUM_DESC}
<!-- IF forumrow.CLICKS -->
<span>{L_REDIRECTS}: {forumrow.CLICKS}</span>
<!-- ELSEIF not forumrow.S_IS_LINK -->
<br /><br />{forumrow.TOPICS} {L_TOPICS} / {forumrow.POSTS} {L_POSTS}
<!-- IF forumrow.LAST_POST_TIME --> <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_TIME}">{LAST_POST_IMG} {L_LAST_POST}</a> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}<br />
<!-- ELSE -->{L_NO_POSTS}<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF forumrow.MODERATORS -->
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
</dt>
</dl>
</li>
<!-- ENDIF -->
<!-- END forumrow -->
</ul>
</div>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span>
</div>
<!-- BEGINELSE -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_NO_FORUMS}</strong>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- END forumrow -->
$FORUMS = 1
in diesem Teil, um die maximale Anzahl von Foren einzugeben.