Bemvindo ao ElitePortugas. Clica para te registares, se for possível...

ANÚNCIO


PARA ACEDERES À TOTALIDADE DO CONTEÚDO DESTE FÓRUM, TENS DE TE REGISTAR....!!
Olá sejam bem-vindos!!       Um bem haja aos mais recentes membros, e participem....

MOD - Sub-Forums in Two Columns

Todas as MOD´s que estão aplicadas aqui neste fórum, com algumas das particularidades que as compõem...

Moderadores: Master Portugas, Dianoka

                             

MOD - Sub-Forums in Two Columns

Postagempor Master Portugas » 07 Ago 2012, 09:30


##############################################################
## MOD Title: Sub-Forums in Two Columns
## MOD Author: JackV http://vtn.niitss.com
## MOD Description: Showing sub-forums in two columns
## MOD Version: 1.1
## Installation Level: Very Easy
## Installation Time: ~1 minutes
## Files To Edit: (1)
## - includes/functions_display.php
## Included Files: n/a
##############################################################
## MOD History:
## 2008-06-1 edited & initial release.
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#--- [ OPEN ] ----------------------------

includes/functions_display.php

#--- [ FIND ] ----------------------------
Código: Seleccionar todos
   $s_subforums_list = array();
   foreach ($subforums_list as $subforum)
   {
      $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
   }
   $s_subforums_list = (string) implode(', ', $s_subforums_list);
   $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false;


#--- [ REPLACE ] ----------------------------

Código: Seleccionar todos
   //$s_subforums_list = array();
          $count = 0;
          $s_subforums_list = '<div><table border="0" width="100%"><tr>';
          foreach ($subforums_list as $subforum)
          {
             $count++;
             if($count % 2 != 0)
             {
                $s_subforums_list .= '</tr><tr><td width="2%">&nbsp;</td>';
             }

          $s_subforums_list .= '<td width="49%"  valign="top"><a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] .'</a> &nbsp;</td>';
          }
          $s_subforums_list .='</tr></table></div>';


#--- [ SAVE AND CLOSE ALL FILES ] ----------------------------


OU ( MELHOR AINDA ) / OR BETTER


# Allow multiple columns for Sub-Forum display on index
#
#-----[ OPEN ]------------------------------------------
#

include/functions_display.php

#
#-----[ FIND ]------------------------------------------
#
Código: Seleccionar todos
      $s_subforums_list = array();
      foreach ($subforums_list as $subforum)
      {
         $s_subforums_list[] = '<a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '" title="' . (($subforum['unread']) ? $user->lang['NEW_POSTS'] : $user->lang['NO_NEW_POSTS']) . '">' . $subforum['name'] . '</a>';
      }
      $s_subforums_list = (string) implode(', ', $s_subforums_list);


#
#-----[ REPLACE WITH ]------------------------------------------
#
Código: Seleccionar todos
              //$s_subforums_list = array();
              $columns = 2; // how much columns
              $result = 0;
              $s_subforums_list = '<table><tr>';
              foreach ($subforums_list as $subforum)
              {
                 $s_subforums_list .= '<td><a href="' . $subforum['link'] . '" class="subforum ' . (($subforum['unread']) ? 'unread' : 'read') . '">' . $subforum['name'] . '</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
             
                 $result++;
                 if($result % $columns == 0)
                 {
                    $s_subforums_list .= '</tr><tr>';
                 }
              }
              $s_subforums_list .='</tr></table>';


#--- [ SAVE AND CLOSE ALL FILES ] ----------------------------

Refresh your Styles, clear your cache.
End of MOD.
Imagem
Imagem

Avatar do utilizador
Master Portugas
Administrador
Administrador
 
Mensagens: 3851
Registado: 10 Dez 2006, 12:31
Localização: Porto, Braga, Guimarães, Póvoa.....
Recordes: 67
Sexo:
Blog: Ver o Blog (1)
Sexo: Masculino


Fórum Estatísticas

Quem está ligado

Utilizadores a navegar neste fórum: Nenhum utilizador ligado e 1 visitante

Opções

Voltar para MOD's para phpBB3