International > Español / Castellano

Imagenes por Fila

(1/1)

alvaro0022:
Hola a todos;

Queria saber si es posible que en la index solo aparezca una imagne por fila en la parte de nuevas imagenes y que en categorias aparezcan 3 imagenes por fila.

Porque si cambio en el panel de control en la parte de Configuración de imágenes en Número de celdas en la tabla de imágenes
coloco un 3 se cambia automaticamente en la index y tambien en categorias.

Saludos!!!

manurom:
Hola;
un suponer: deseas 4 imagenes en tu index, con una imagen por fila.
Edita el fichero "index.php", y busca:

--- Code: ---$num_new_images = $config['image_cells'];
--- End code ---

cambialo por:

--- Code: ---$num_new_images = 4;
$config['image_cells'] = 1;
--- End code ---

Guarda tu previa configuracion para mostrar 3 imagenes por fila en categorias.

masterred:
hola

visita est enlace, puedes hacer la modificacion a lo que necesites, tanto ponerlas en vertical, como ponerlas dentro de una marquesina

http://www.4homepages.de/forum/index.php?topic=6974.0

y tambien realizar esta pequeña modificacion.


--- Quote ---//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "has_rss"   => true,
  "rss_title" => "RSS Feed: ".format_text($config['site_name'], 2)." (".str_replace(':', '', $lang['new_images']).")",
  "rss_url"   => $script_url."/rss.php?action=images"
));

$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
  $imgtable_width .= "%";
}

$additional_sql = "";
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}

$num_new_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").")
        ORDER BY i.image_date DESC
        LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $new_images .= $lang['no_new_images'];
  $new_images .= "</td></tr></table>";
}
else  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
      $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    show_image($image_row);
    $new_images .= $site_template->parse_template("thumbnail_bit");
    $new_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
      $new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
      for ($f = 0; $f < $leftover; $f++) {
        $new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      $new_images .= "</tr>\n";
    }
  }
  $new_images .= "</table>\n";
} // end else

$site_template->register_vars("new_images", $new_images);
unset($new_images);

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
--- End quote ---

esta linea del codigo


--- Code: ---$new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
--- End code ---

por esta otra


--- Quote ---//$new_images .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
--- End quote ---

y esta otra


--- Code: ---$new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while
--- End code ---

por esto


--- Quote ---//$new_images .= "</tr>\n";
      $count = 0;
    }
  } // end while
--- End quote ---

hasta pronto

alvaro0022:
Hola,

Hace tiempo que estaba buscando esto en el foro y no lo podia encontrar. !!Muchisimas gracias por su ayuda!! :lol:

Saludos!!

pablogross:

--- Quote from: manurom on May 24, 2007, 09:54:48 AM ---Hola;
un suponer: deseas 4 imagenes en tu index, con una imagen por fila.
Edita el fichero "index.php", y busca:

--- Code: ---$num_new_images = $config['image_cells'];
--- End code ---

cambialo por:

--- Code: ---$num_new_images = 4;
$config['image_cells'] = 1;
--- End code ---

Guarda tu previa configuracion para mostrar 3 imagenes por fila en categorias.

--- End quote ---

y en categories.php es igual ?

Navigation

[0] Message Index

Go to full version