Author Topic: Para que las imagenes nuevas vayan rotando en la pagina principal  (Read 18626 times)

0 Members and 1 Guest are viewing this topic.

mendozak

  • Guest
Hola me gustaria saber si alguien sabe como hacer ke las imagenes nuevas vayan rotando en la pagina principal.. para que asi se puedan ir viendo todas aunke meta muchas de un tiron.. He estado buscando y no encuentro el mod, me acuerdo que lo hice una vez pero ya no se como volver a hacerlo..

Ayuda porfavor. dios se lo pagara. :)

Offline ascanio

  • Hero Member
  • *****
  • Posts: 569
    • View Profile
    • http://www.surfourspace.net
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #1 on: April 15, 2005, 01:37:06 AM »
Hola

En index.php:

Busca:

Code: [Select]
$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 IN (".get_auth_cat_sql("auth_viewcat").")
       ORDER BY i.image_date DESC
       LIMIT $num_new_images";

Remplaza por:

Code: [Select]
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$num_new_images = $config['image_cells'];
$sql = "SELECT IF(i.image_date >= $new_cutoff,RAND()+1,1) as random_no, 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 IN (".get_auth_cat_sql("auth_viewcat").")
       ORDER BY random_no DESC, i.image_date DESC
       LIMIT $num_new_images";

Si quieres que hay mas de una fila como en mi pagina:

Busca:

Code: [Select]
$num_new_images = $config['image_cells'];
Remplaza por:

Code: [Select]
$num_new_images = $config['image_cells']*2;

mendozak

  • Guest
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #2 on: April 15, 2005, 04:34:54 AM »
Perfecto.. muchas gracias... ke rapidez asi da gusto.. ole por ti.

Offline theolbap

  • Full Member
  • ***
  • Posts: 118
  • Search Google "AH"
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #3 on: September 07, 2006, 02:30:54 AM »
No funciona en la version 1.7.3

Quote
An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/docs/ahmira.com.ar/public_html/includes/db_mysql.php on line 116

Como podemos arreglarlo??

Saludos..

Offline noguero

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #4 on: September 11, 2006, 11:51:26 PM »
con la 1.7.2 va perfecto, excelente :D

Offline excitex2

  • Addicted member
  • ******
  • Posts: 1.590
  • He desactivado la galería y el buscador
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #5 on: September 17, 2006, 12:19:22 AM »
Saludos,,,

Para la versión 1.7.3 intenta hacer la siguiente modificación :

Localiza en index.php :

Quote
$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";

Cambia a :

[qcode]$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$num_new_images = $config['image_cells'];
$sql = "SELECT IF(i.image_date >= $new_cutoff,RAND()+1,1) as random_no, 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 random_no DESC, i.image_date DESC
        LIMIT $num_new_images";
[/qcode]

excitex2
Lo importante no es saber,,, lo importante es tener el E-Mail de quien sabe

Offline theolbap

  • Full Member
  • ***
  • Posts: 118
  • Search Google "AH"
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #6 on: September 25, 2006, 07:54:15 PM »
gracias !!! funciona de 10

le cambie

Quote
$num_new_images = $config['image_cells'];

por

Quote
$num_new_images = $config['image_cells']*3;

para que se vean la cantidad de imagenes que ya tenia...

Offline paburmester

  • Full Member
  • ***
  • Posts: 244
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #7 on: September 25, 2006, 09:30:14 PM »
una simple pregunta, este MOD funciona tambien para mostrar imagenes aleatorias que no sean nuevas?

Offline KaKo_83

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #8 on: September 26, 2006, 06:27:22 AM »
Gracias excitex va de 10 , yo tb tengo la version 1.7.3

Ahhh y tu galeria esta genial, jeje


==================
http://www.solotattoos.net

Offline tripiyon

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Para que las imagenes nuevas vayan rotando en la pagina principal
« Reply #9 on: May 03, 2008, 09:19:30 PM »
Gracias,

Funcionando en la versión 1.7.6 perfectamente  :D