• 0
  • 3 RepliesReplies
  • 5727 ReadTimes Read
  • 10 PointsPoints

Topic: Índice Board Formato de tabla

Usuario: Toro
Rango: Nuevo Usuario
Mensajes: 242
Points: 18
Mi web: http://cfgamers.com
Perfil: View Profile
Índice Board Formato de tabla
December 07, 2013 - 08:44 08:44
Un buen día, mirando algunos TIPS gringos me tope con este gran tutorial para darle un toque diferente a tu foro SMF:


Vamos a editar el BoardIndex.Template.php:

Encontrar:
Code: [Select]
<td class="lastpost">
Reemplazar:
<td class="lastpost" colspan="2">

Encontrar:
Code: [Select]
// Show some basic information about the number of posts, etc.
echo '
               </td>
               <td class="stats windowbg">
                  <p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
                  ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
                  </p>
               </td>

Reemplazar:
Code: [Select]
// Show some basic information about the number of posts, etc.
               echo '
               </td>

Encontrar:
Code: [Select]
            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children']))
            {
               // Sort the links into an array with new boards bold so it can be imploded.
               $children = array();
               /* Each child in each board's children has:
                     id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
               foreach ($board['children'] as $child)
               {
                  if (!$child['is_redirect'])
                     $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                  else
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';


                  // Has it posts awaiting approval?
                  if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
                     $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';


                  $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
               }
               echo '
               <tr id="board_', $board['id'], '_children">
                  <td colspan="3" class="children windowbg">
                     <strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '
                  </td>
               </tr>';

Reemplazar:
Code: [Select]
            echo '
               </td>
            </tr>
            <tr class="boardstats">
               <td class="windowbg" ', empty($board['children']) ? 'colspan="1"':'','>';

            // Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
            if (!empty($board['children']))
            {
               // Sort the links into an array with new boards bold so it can be imploded.
               $children = array();
               /* Each child in each board's children has:
                     id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
               foreach ($board['children'] as $child)
               {
                  if (!$child['is_redirect'])
                     $child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
                  else
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';


                  // Has it posts awaiting approval?
                  if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))
                     $child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';


                  $children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
               }
               echo '
                  <strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children);
            }


         echo '
               </td>
               <td class="windowbg" style="text-align: center"><p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], '</p></td>
               <td class="windowbg" style="text-align: center"><p>', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '</p></td>
            </tr>';


Encontrar:
Code: [Select]
               <td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
Reemplazar:
Code: [Select]
               <td class="icon windowbg" rowspan="2">
Y por ultimo el index.csc añaden esto al final:
Code: [Select]

.boardstats {
   height: 20px;
   padding: 4px;
   margin: 0;
}

Un saludo espero que les guste.
Iniciando con Simple Machines Forum
Visitame: http://devrelease.net
You do not have permission to give points
point 10 Points

Users who gave points in this topic » 4kstore (3 Pts) » nodensdorian (2 Pts) » EduardO (2 Pts) » Papá distante (3 Pts) 

Usuario: 4kstore
Rango: Moderador Global
Mensajes: 4916
Points: 8111
Mi web: http://www.smfsimple.com
Perfil: View Profile
Pais:
ar
Re:[TIP] Índice Board Formato de tabla
Reply #1 December 07, 2013 - 11:48 11:48
Esta bastante bueno el resultado, muchas gracias!

Usuario: EduardO
Rango: Nuevo Usuario
Mensajes: 875
Points: 15
Mi web: http://www.gamerzperu.com/
Perfil: View Profile
Pais:
pe
Re:[TIP] Índice Board Formato de tabla
Reply #2 December 07, 2013 - 02:25 14:25
Se ve bueno man. Gracias!

Lo que pasa es que tengo problemas, se me desconfigura todo. De todas formas aqui te dejo mi archivo par que tú lo modifiques.

Saludos

no avatar
Usuario: nodensdorian
Rango: Nuevo Usuario
Mensajes: 207
Points: 27
Mi web: http://www.ardiforos.com.ar/
Perfil: View Profile
Re:[TIP] Índice Board Formato de tabla
Reply #3 December 15, 2013 - 03:19 03:19
Abrí un nuevo tema Eduardo.

 

TAGS



top

Smfsimple.com es un sitio destinado a brindar un servicio de soporte y herramientas para foros realizados con el sistema de foros gratuito simplemachines.org. Contamos con un selecto equipo de desarrolladores y conocedores del sistema, sus foros estaran en buenas manos.
This site is not affiliated with or endorsed by Simple Machines