Disable rating for all albums except one Disable rating for all albums except one
 

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]

Main Menu

Disable rating for all albums except one

Started by Iced Coffee, October 25, 2006, 07:26:05 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Iced Coffee

Can I disable rating for all albums (including newly created one) by default and set rating permission to one or two albums later on?

I heard I can do this by modifying MySQL database, but I don't know how. Can anyone help show me how to do this.

Thank you too much.

Joachim Müller

Quote from: Iced Coffee on October 25, 2006, 07:26:05 AM
Can I disable rating for all albums (including newly created one) by default and set rating permission to one or two albums later on?
Yes.

Quote from: Iced Coffee on October 25, 2006, 07:26:05 AM
I heard I can do this by modifying MySQL database, but I don't know how.
Sort of yes - you need to run a query on the database (using phpMyAdmin or similar). Your query should look like this:ALTER TABLE `YourCoppermineTablePrefix_albums` CHANGE `votes` `votes` ENUM( 'YES', 'NO' ) NOT NULL DEFAULT 'NO'
This will set the default for rating to 'NO' for newly added albums. However, fiddling with the database can be tricky if you don't know your way around - I don't recommend doing this if you're not absolutely sure what you're doing.
Another option would be to modify the query within delete.php that creates new albums, the corresponding line in delete.php is                    $query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}')";which should be replaced with                    $query = "INSERT INTO {$CONFIG['TABLE_ALBUMS']} (category, title, uploads, pos, votes) VALUES ('$category', '" . addslashes($op['album_nm']) . "', 'NO',  '{$op['album_sort']}', 'NO')";(not tested though, please report if this works for you). Again, this applies to new albums you create from now on. Your old (existing) albums will remain as they are, either use Coppermine's user interface (album properties) to change the ability to rate one by one. If you feel adventurous, you could come up with a query (to be run in phpMyAdmin) that sets all existing albums to "no rating".

Iced Coffee

Thank you very much Gaugau. It's a great help already. I have modified the delete.php file. Could you please help with the query to set all existing album to "no rating"? I have more than 100 albums for my members now, and it would be a bit foolish if I just try to change the properties one by one. Could you please help?

QuoteIf you feel adventurous, you could come up with a query (to be run in phpMyAdmin) that sets all existing albums to "no rating".

Thank you very much.

Nibbler


Iced Coffee

Ooops, my MySQL said this:

QuoteError

SQL query:

UPDATE cpg_albums SET votes = 'NO'

MySQL said: Documentation
#1146 - Table 'november_cpg.cpg_albums' doesn't exist

Sami

change the cpg_ with your table prefix (look at the include/config.inc.php for your prefix)
‍I don't answer to PM with support question
Please post your issue to related board