Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Solved]: Visualización de categorías en modo columnas en vez de filas  (Read 4503 times)

0 Members and 1 Guest are viewing this topic.

jManuel

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
    • Comunidad de fotografos aficionados

Hola de nuevo a todos.

Solo necesitaria saber como hacer para que las categorías se visualizaran en modo columnas y no en filas ya que quiero añadir algunas más y queda muy feo estar bajando para abajo y ala vez desperdiciar mucho espacio a la derecha.

Pongo un ejemplo:

Las categorías desearia visionarlas asi:  ( + + + + ) y no así: (mirar abajo),

+
+
+
+

Estoy usando los templates "Igames" y "Peace of mind" seleccionable por el usuario.

Mi galería: http://www.efotolia.com/galerias/

Muchas gracias por tu ayuda y hasta la proxima.
« Last Edit: October 15, 2008, 05:18:56 pm by fabri »
Logged
jManuel - Comunidad de fotografos aficionados

Fabricio Ferrero

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: Visualización de categorías en modo columnas en vez de filas
« Reply #1 on: October 14, 2008, 11:24:02 pm »

Hola,

Copia y pega lo siguiente en tu theme.php:

Code: [Select]
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" align="left"><b>{CATEGORY}</b></td>
      </tr>
      <tr>
      <td>
        <div class="categories">
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <div class="catcell">
                {CAT_THUMB}<br /><span class="catlink">{CAT_TITLE}</span><br />{CAT_DESC}<br />{PIC_COUNT} photos in {ALB_COUNT} albums
        </div>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <div class="catcell">
                <div style="float: left; width: 24%; text-align: center;">
            {CAT_THUMB}
            </div>
            <div style="float: right; width: 74%;">
            <span class="catlink">{CAT_TITLE}</span><br /><span class="thumb_caption">{CAT_DESC}<br />{PIC_COUNT} wallpapers in {ALB_COUNT} albums</span></div>
            <div style="clear: both;"></div>
        </div>
<!-- END catrow -->
<!-- BEGIN footer -->
      </div>
      </td>
      </tr>
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;

function theme_display_film_strip(&$thumb_list, $nbThumb, $album_name, $aid, $cat, $pos, $sort_options, $mode = 'thumb')
{
    global $CONFIG, $THEME_DIR;
    global $template_film_strip, $lang_film_strip;

    static $template = '';
    static $thumb_cell = '';
    static $empty_cell = '';
    static $spacer = '';

    if ((!$template)) {
        $template = $template_film_strip;
        $thumb_cell = template_extract_block($template, 'thumb_cell');
        $empty_cell = template_extract_block($template, 'empty_cell');
    }

    $cat_link = is_numeric($aid) ? '' : '&amp;cat=' . $cat;

    $thumbcols = $CONFIG['thumbcols'];
    $cell_width = ceil(100 / $CONFIG['max_film_strip_items']) . '%';

    $i = 0;
    $thumb_strip = '';
    foreach($thumb_list as $thumb) {

        $new_size = 65;
        preg_match('/(?<=width=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        $srcWidth=$matches[0][0];
        preg_match('/(?<=height=")[0-9]*/',$thumb['image'],$matches,PREG_OFFSET_CAPTURE);
        $srcHeight=$matches[0][0];
        $ratio = max($srcWidth, $srcHeight) / $new_size;
        $ratio = max($ratio, 1.0);
        $destWidth = (int)($srcWidth / $ratio);
        $destHeight = (int)($srcHeight / $ratio);
        $thumb['image']=preg_replace('/width="[^"]*"/','width="'.$destWidth.'"',$thumb['image']);
        $thumb['image']=preg_replace('/height="[^"]*"/','height="'.$destHeight.'"',$thumb['image']);
        $i++;
        if ($mode == 'thumb') {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => $thumb['caption'],
                '{ADMIN_MENU}' => ''
                );
        } else {
            $params = array('{CELL_WIDTH}' => $cell_width,
                '{LINK_TGT}' => "index.php?cat={$thumb['cat']}",
                '{THUMB}' => $thumb['image'],
                '{CAPTION}' => '',
                '{ADMIN_MENU}' => ''
                );
        }
        $thumb_strip .= template_eval($thumb_cell, $params);
    }

    if (defined('THEME_HAS_FILM_STRIP_GRAPHICS')) {
        $tile1 = $THEME_DIR . 'images/tile1.gif';
        $tile2 = $THEME_DIR . 'images/tile2.gif';
    } elseif (defined('THEME_HAS_FILM_STRIP_GRAPHIC')) {
        $tile1=$tile2=$THEME_DIR . 'images/tile.gif';
    } else {
        $tile1=$tile2= 'images/tile.gif';
    }

    $params = array('{THUMB_STRIP}' => $thumb_strip,
        '{COLS}' => $i,
        '{TILE1}' => $tile1,
        '{TILE2}' => $tile2,
        );

    ob_start();
    starttable($CONFIG['picture_table_width']);
    echo template_eval($template, $params);
    endtable();
    $film_strip = ob_get_contents();
    ob_end_clean();

    return $film_strip;
}
?>

Recorda volver a realizar las modificaciones si ya habias modificado esa porcion de codigo. En este momento, además, has agregado algunas nuevas llamadas al style.css, entonces agregale lo siguiente:

Code: [Select]
.catcell {
   float: left;
   width: 32%;
   text-align: left;
   margin: 5px auto;
   padding-left: 5px;
}

Además, vas anotar que si colocas esto y tenes una categoria vacia, te va a arrojar un error. Asi que, no tengas categorias vacias  ;)

Saludos,
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)

jManuel

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 46
    • Comunidad de fotografos aficionados
Re: Visualización de categorías en modo columnas en vez de filas
« Reply #2 on: October 15, 2008, 12:40:39 am »

Perfecto,

Aunque solo se ve haciendo login,osea "para usuarios registrados" me vale.

Muchas gracias de nuevo.
Logged
jManuel - Comunidad de fotografos aficionados

Fabricio Ferrero

  • Moderator
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 1996
  • From San Juan, Argentina, to the World!
    • http://fabricioferrero.com/
Re: Visualización de categorías en modo columnas en vez de filas
« Reply #3 on: October 15, 2008, 05:18:42 pm »

De nada.  ;)
Logged
Read Docs and Search the Forum before posting. - Soporte en español
--*--
Fabricio Ferrero's Website

Catching up! :)
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 22 queries.