Seite 4 von 5

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.01.2012 00:45
von Miriam
Das ist ja nett. :grin:

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 30.11.2013 02:01
von redbull254
Hallo Miriam,

würdest Du dieses Snippet bitte an die aktuelle Version phpBB 3.0.12 anpassen? :)

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 30.11.2013 23:44
von Miriam
Was genau macht denn eine Codeanpassung notwendig? :o

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 02:16
von redbull254
Ich finde nicht die passenden Stellen in der 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. :-?

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 02:41
von Miriam
finde in der includes/functions_display.php

Code: Alles auswählen

        $last_catless = $catless;
    } 
danach füge ein: https://www.phpbb.de/support/pastebin.p ... iew&s=1359
oder hier -> viewtopic.php?f=89&t=219728&start=20#p1255165

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 02:57
von redbull254
Miriam hat geschrieben:finde in der includes/functions_display.php

Code: Alles auswählen

        $last_catless = $catless;
    }
danach füge ein: https://www.phpbb.de/support/pastebin.p ... iew&s=1359
oder hier -> viewtopic.php?f=89&t=219728&start=20#p1255165
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. :-?

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 10:20
von Miriam
redbull254 hat geschrieben:...Demzufolge müsste ich erst Code entfernen und dafür dann Deinen modifizierten Code einsetzen. :-?
Genau so ist es.

Der ganze Noxwizard-PHP-Code muß aus der includes/functions_display.php raus.

Der Code sollte eingesetzt werden nach: beginnt so:
  • Code: Alles auswählen

        //
        // Start category based loops
        // Credits to Noxwizard of phpBB.com for this code
        //           
und endet folgendermaßen:
  • Code: Alles auswählen

        //
        // End category based loops
        //           
Dafür sollte dann der angepaßte MOD Code eingesetzt werden. Kein Grund, die Augen zu rollen.
Vergiß nicht, auch die Variable ON_INDEX in der index.php zu definieren.
Du mußt natürlich auch die Template Umbauten machen.

Angenehmen 1. Advent wünsche ich Dir.

// Gern kannst Du die Umbauten hier nachlesen.

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 16:19
von redbull254
Miriam hat geschrieben:
// Gern kannst Du die Umbauten hier nachlesen.
Nein danke. :) Je mehr wir hier darüber schreiben, umso weniger verstehe ich, was eigentlich gemacht weden muss. Dann noch in englischer Sprache, dann lasse ich es doch lieber gleich sein. Vielleicht packt das ja irgendwann jemand als Mod-Anweisung zusammen. Vielen Dank für Deinen Mühen, bei mir sind sie leider vergebens. :oops:

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 16:46
von Miriam
Vielen Dank für Deinen Mühen, bei mir sind sie leider vergebens.
Das macht ja richtig Lust auf Hilfestellung. :cry:
FIND & AFTER ADD verstehst Du doch aber?
Mach wie Du willst.

Re: Forenkategorien - Anordnung nebeneinander

Verfasst: 01.12.2013 17:08
von Kirk
Hallo
Hab es mir mal zum testen eingebaut, hier nochmal alles zusammen gefasst:
Öffne: root/index.php
Finde:

Code: Alles auswählen

define('IN_PHPBB', true); 
Danach einfügen:

Code: Alles auswählen

define('ON_INDEX', true); 
Öffne: root/includes/functions_display.php
Finde:

Code: Alles auswählen

            $last_catless = $catless;
        } 
Danach einfügen:

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
            //


 
Öffne: root/styles/prosilver/template/forumlist_body.html

Ersetze den darin enthaltenen Code damit:

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} &nbsp;
                  <!-- 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} &nbsp;
                  <!-- 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 -->
Hinweis:
Ändere die Definition von $FORUMS = 1 in diesem Teil, um die maximale Anzahl von Foren einzugeben.

[OT]
Sorry für die schlechte Übersetzung :oops:
[/OT]