forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: mr.bena on April 14, 2012, 01:43:50 am

Title: One star for the album..
Post by: mr.bena on April 14, 2012, 01:43:50 am
Hi, currently I am using 5 stars rating system. But, I want to imply exception and make only 1 star for the album album_id=30. Is there a way to make this happen? Please, help..
Title: Re: One star for the album..
Post by: Αndré on April 16, 2012, 02:57:15 pm
Copy the function theme_html_rating_box from the sample theme to your theme's theme.php file if it doesn't exist. Then, find
Code: [Select]
$rating_stars_amount = ($CONFIG['old_style_rating']) ? 5 : $CONFIG['rating_stars_amount'];and above, add
Code: [Select]
        if ($CURRENT_PIC_DATA['aid'] == 30) {
            $CONFIG['rating_stars_amount'] = 1;
        }

Additionally, open ratepic.php, find
Code: [Select]
$rating_stars_amount = ($CONFIG['old_style_rating']) ? 5 : $CONFIG['rating_stars_amount'];and above, add
Code: [Select]
$aid = mysql_result(cpg_db_query("SELECT aid FROM {$CONFIG['TABLE_PICTURES']} WHERE pid = ".$superCage->get->getInt('pic')), 0);
if ($aid == 30) {
    $CONFIG['rating_stars_amount'] = 1;
}
Title: Re: One star for the album..
Post by: mr.bena on April 16, 2012, 07:13:36 pm
Yes! ;D

This one works..