forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: alexandre596 on May 15, 2012, 10:53:28 pm

Title: there's a way to the album thumb always random?
Post by: alexandre596 on May 15, 2012, 10:53:28 pm
I don't know how to say that...  ???

well, everytime you create an album, and add pictures, the album thumbnail is always the last image that was uploaded, right?

but, I want it to be a random image not the last uploaded... (there's an option when you click in the album properties, that's the random I'm talking about)
there's a way for it happen?

I tried searching for something at albmgr.php file, but I couldn't find it anywhere there..

[I hope everyone could understand :P)
Title: Re: there's a way to the album thumb always random?
Post by: Αndré on May 16, 2012, 10:15:00 am
What's the actual question? Set the album thumbnail to random and it will always be random for that album, unless you change it.
Title: Re: Re: there's a way to the album thumb always random?
Post by: alexandre596 on May 16, 2012, 11:24:37 pm
What's the actual question? Set the album thumbnail to random and it will always be random for that album, unless you change it.

that's the question, the default is the last uploaded image, but I want to always be the "random image" option
Title: Re: there's a way to the album thumb always random?
Post by: lurkalot on May 16, 2012, 11:45:52 pm
Go to album properties, use the dropdown arrow just below that thumbnail, and select random image.  Then click the Update album button at the bottom.
Title: Re: Re: there's a way to the album thumb always random?
Post by: alexandre596 on May 17, 2012, 12:37:17 am
Go to album properties, use the dropdown arrow just below that thumbnail, and select random image.  Then click the Update album button at the bottom.

yeah, but there's a way to that happen automatically?
Title: Re: there's a way to the album thumb always random?
Post by: Αndré on May 21, 2012, 01:47:03 pm
First option: set the default value of the thumb field to -1 in the database's albums table.

Second option: open delete.php, find
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id')";and replace with
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner, thumb) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id', '-1')";
Title: Re: Re: there's a way to the album thumb always random?
Post by: alexandre596 on May 21, 2012, 02:28:02 pm
First option: set the default value of the thumb field to -1 in the database's albums table.

Second option: open delete.php, find
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id')";and replace with
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, description, owner, thumb) VALUES ('$category', '$get_album_name', 'NO', '{$position}', '', '$user_id', '-1')";

tried the second option, and it's working!!

thank you very much!!!!