[Aporte] SubForos

Started by MarioH, July 16, 2008, 09:47:20 PM

Previous topic - Next topic

MarioH

No se si ya estaba, pero lo posteo porsilasdudas =)

Esta es una modificación para que los Subforos, no se vean tan monotonos. y se puedan organizar de mejor forma (Por lo menos a quienes tienen demaciados).

Aqui una imagen para que vean a lo que me refiero.



la idea la obtuve del tema dilbermc, donde vienen así los Hijos por defecto y la modifique un poco, para centrarla y aliniar los SubForos.



la modificación es la siguiente:

en BoardIndex.Template de su theme o default

Buscar:
Quote
            // 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)
               {
                  $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                  $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
               }

               echo '
         <div style="padding-top: 1px;" class="smalltext"><i>', $txt['parent_boards'], ': ', implode(', ', $children), '</i></div>';
            }


Y Remplazar por esto:
Quote//Nuevos subforos

            if (!empty($board['children']))
            {
                              $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)
               {
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                     $children[] = $child['new'] ? '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/onk.gif" alt="' . $txt[333] . '"/><b>' . $child['link'] . '</b>' : '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/offk.gif" alt="' . $txt[334] . '"/>' . $child['link'];                     
               }

               echo '
               <table style="float:right; margin-top: 15px;" width="100%" cellspacing="0" cellpadding="3" border="0">
                  <tr>
                     <td class="middletext" valign="middle" align="center" width="26%">
                        <b>', $txt['parent_boards'], ':</b>
                     ';

               $child_counter = 0;
               
               if(empty($settings['child_boards_rows']))
               {
                  echo '   
                     </td>
                     <td class="middletext" valign="top" width="37%">';
                        
                        for(; $child_counter < ceil(count($children)/2); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               }
               
               echo '
                     </td>
                     <td class="middletext" valign="top" width="37%">';   
                        for(; $child_counter < count($children); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               echo '
                     </td>
                  </tr>
               </table>';
            }
            //Fin nuevos subforos




Updrage:

PARA THEME DEFAULT




Buscar esto:
Quote// 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)
               {
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                     $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
               }

               echo '
         <tr>
            <td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
               <span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
            </td>
         </tr>';
            }


remplazar por esto:

Quote//Nuevos subforos

            if (!empty($board['children']))
            {
                              $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)
               {
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                     $children[] = $child['new'] ? '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/onk.gif" alt="' . $txt[333] . '"/><b>' . $child['link'] . '</b>' : '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/offk.gif" alt="' . $txt[334] . '"/>' . $child['link'];                     
               }

               echo '
                 <tr>
                     <td class="middletext" valign="middle" align="center" width="26%">
                        <b>', $txt['parent_boards'], ':</b>
                     ';

               $child_counter = 0;
               
               if(empty($settings['child_boards_rows']))
               {
                  echo '   
                     </td>
                     <td class="middletext" valign="top" width="37%">';
                       
                        for(; $child_counter < ceil(count($children)/2); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               }
               
               echo '
                     </td>
                     <td class="middletext" valign="top" width="37%">';   
                        for(; $child_counter < count($children); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               echo '
                     </td>
                  </tr>';
            }
            //Fin nuevos subforos


no olviden colocar las imagenes




Pueden verlo funcionando en mi WEB " AimBox " http://www.aimbox.cl

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD

Pues chico...

:S lastima que no me funciono...me sale un PARSE ERROR...

:S

te adjunto mi BoarIndex.Template.php

a ver si ves lo que me falla, pork vamos...no se que puede ver....
Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

ElDon

Hey hermano muy bueno, andaba buscando algo parecido pero creo que lo podre conseguir por ahi ademas que esta muy lindo y organizado, Gracias man
***NUEVO*** 2,500 Vistas Youtube!!! [PREGUNTAS?]
Posicionamiento SEO
Necesitas Comprar Trafico?
Descarga Nuestro Reporte SEO Gratis!!!

MarioH

Quote from: ~BeneKiD on July 16, 2008, 10:12:20 PM
Pues chico...

:S lastima que no me funciono...me sale un PARSE ERROR...

:S

te adjunto mi BoarIndex.Template.php

a ver si ves lo que me falla, pork vamos...no se que puede ver....

Tu theme tiene un forech (bucle) que mi theme no tiene, por eso debes agregarle un cierre mas al final de la modificación "}" para cerrar ese bucle, así se te deberia solucionar. (o al menos eso logre apreciar)

prueba y Éxito.


AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD

#4
mil gracias... a ver como queda..sino te edito este mensaje....

;)

Saludos y gracias

EDITO: Bueno... aqui mi fallo... xD


(ya he puesto imagenes... y isgue igual...
:S

Saludos
Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

MarioH

Se me olvidaba, tienen que crear 3 imagenes

onk.gif
offk.gif
on2k.gif

tamaño a su elección, pueden usar las que vienen por defecto en su foro.

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD

Si ya te lo he dicho...imagenes ya he puesto... y sigo con el problema...

:s

(ahora mismo he puesto la copia que tenia...pero si quieres verlo online me lo dices y lo pongo de nuevo)
Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

MarioH

#7
MODIFICADO

Sorry espera:


estoy revisando tu boardIndex.


Modifico cuando termine-.

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD

fin original theme*/
         echo 
'
      </table>'
;
      }
      echo 
'
   </div>'
;
       }
	
	
	
	
//Fin nuevos subforos


vamos asi? ^^

pues me tira un parse error


:s
Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

MarioH

que complicado tu theme.

pero, creo que ya está.


Prueba y me cuentas te lo adjunto

Mi explicación corta.

tu theme esta modificado para que los sub foros no lo muestre en tablas, y después de media hora tratando de adaptar el theme, me dije:
"Por que modificar el theme para adaptar el script" asi que modifique el script para adaptarlo a tu theme.
quitándole las tablas y dejándolo aislado como tu lo tenias. no quedara igual pero se asimila pruébalo y me cuentas que tal te fue.


como no tengo tu theme, no pude probarlo y se me hizo un poco más complejo ya que no puedo ver los cambios, espero tu respuesta para ver si eso era la solución.


Éxito!!!

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD



perfecto!

solo ese pequeño detalle, me gustaria tener lo que te señalo algo mas a la izquierda... que tendira que tocar?

(te lo pregunto porque desconozco el codigo...:S)

CAPTURA EXA CON: Internet Explorer

Salduos

PD: cogi tus imagenes prestadas^^
Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

MarioH

Quote from: ~BeneKiD on July 17, 2008, 12:29:10 AM

perfecto!

solo ese pequeño detalle, me gustaria tener lo que te señalo algo mas a la izquierda... que tendira que tocar?

(te lo pregunto porque desconozco el codigo...:S)

CAPTURA EXA CON: Internet Explorer

Salduos

PD: cogi tus imagenes prestadas^^

prueba modificando el "width" de las tablas en los <td>

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

~BeneKiD

Quote from: http://www.territoriodd.com
TERRITORIODD.com Descargas Directas de las ISOS, CSO y ROMS de PSP NDS Wii X360, PELICULAS, SERIES MUSICA y SOFTWARE... Todo lo necesario totalmente GRATIS!!

-PS3
-Playstation Portable
-Nintendo DS
-Nintendo Wii
-Xbox 360
-iOS & Android


HTTP://WWW.TERRITORIODD.COM
Quote from: Visitanos!

josan

pregunto: y esto se puede adaptar a  SMF 2.0 Beta 3.1???

porque intente buscar parte de ese codigo y en mi BoardIndex.Template  no hay,

como hago.....??

PosibleHost.Com » Proudly serving websites since 2009.
Shared Hosting » Reseller Hosting » VPS Servers. At An Affordable Price.
English and Spanish 24/7 Support Staff!

MarioH

sorry no trabajo con el beta nisiquiera lo he bajado, así que en realidad no sabria responder de como seria.

más adlante probare, luego que termine un proyecto que traigo ;)

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

josan

#15
Ya lo pude hacer funcionar en la Beta  SMF 2.0 Beta 3.1

Solo era pasar un poco mas la linea de codigo que diste ejemplo despues de....

Quote// 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'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                  else
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . $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=topics;brd=' . $child['id'] . ';sesc=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

                  $children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
               }

               echo '
         <tr>
            <td colspan="3" class="windowbg', !empty($settings['separate_sticky_lock']) ? '3' : '', '">
               <span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
            </td>
         </tr>';
            }

Reemplazar por lo que  dice MarioH :

Quote//Nuevos subforos

            if (!empty($board['children']))
            {
                              $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)
               {
                     $child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
                     $children[] = $child['new'] ? '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/onk.gif" alt="' . $txt[333] . '"/><b>' . $child['link'] . '</b>' : '<img style="margin-right:5px;" src="' . $settings['images_url'] . '/' . $settings['theme_main_color'] . '/offk.gif" alt="' . $txt[334] . '"/>' . $child['link'];                     
               }

               echo '
               <table style="float:right; margin-top: 15px;" width="100%" cellspacing="0" cellpadding="3" border="0">
                  <tr>
                     <td class="middletext" valign="middle" align="center" width="26%">
                        <b>', $txt['parent_boards'], ':</b>
                     ';

               $child_counter = 0;
               
               if(empty($settings['child_boards_rows']))
               {
                  echo '   
                     </td>
                     <td class="middletext" valign="top" width="37%">';
                       
                        for(; $child_counter < ceil(count($children)/2); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               }
               
               echo '
                     </td>
                     <td class="middletext" valign="top" width="37%">';   
                        for(; $child_counter < count($children); $child_counter++)
                              echo $children[$child_counter], '<br/>';
               echo '
                     </td>
                  </tr>
               </table>';
            }
            //Fin nuevos subforos

en mi caso edite por las lineas 200 al 227 mas o menos, por lo que pude hacerlo funcionar en la beta de smf 2..

lo pueden ver en mi foro http://www.warezgods.net/foro/index.php aunque me falta centrar la imagen primera que no se porque me sale asi:



Alguien me explica el porque me sale asi, o como lo centro

PosibleHost.Com » Proudly serving websites since 2009.
Shared Hosting » Reseller Hosting » VPS Servers. At An Affordable Price.
English and Spanish 24/7 Support Staff!

MarioH

Gracias josan!!!!! por el aport para 2.03  O:)

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

kenet

yo lo tengo distinto al que posteastes, que parte tendria que remplazar. muchas gracias

// 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)
{
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
</td>
</tr>';
}
}
echo '
</table>';
}
echo '
</div>';


Thomas Alva Edison dijo:

    "No fracasé, sólo descubrí 999 maneras de como no hacer una bombilla."


MarioH

la llave que habre el if, hasta la que termina.

en notepad++ te lo puede indicar al seleccionarla "{"

AimBox Comunidad online, Jugos, Anime, Warez.
[Aportes]: Ordenar SubForos || Smiles Tipo IPB || Agreement.txt ||

kenet

perdona MarioH, no consigo ponerlo bien, siempre  me da arror, mens una vez que me salio bien pero me deformava lo subforos


Thomas Alva Edison dijo:

    "No fracasé, sólo descubrí 999 maneras de como no hacer una bombilla."


Advertisement: