Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Disable rating for all albums except one  (Read 3593 times)

0 Members and 1 Guest are viewing this topic.

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Disable rating for all albums except one
« 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?

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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Disable rating for all albums except one
« Reply #1 on: October 25, 2006, 08:17:28 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.

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:
Code: [Select]
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
Code: [Select]
                    $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
Code: [Select]
                    $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".
Logged

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: Disable rating for all albums except one
« Reply #2 on: October 25, 2006, 01:52:09 pm »

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?

Quote
If 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.
Logged

Nibbler

  • Guest
Re: Disable rating for all albums except one
« Reply #3 on: October 25, 2006, 02:25:29 pm »

Code: [Select]
UPDATE cpg_albums SET votes = 'NO'
Logged

Iced Coffee

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 128
Re: Disable rating for all albums except one
« Reply #4 on: October 26, 2006, 03:22:09 pm »

Ooops, my MySQL said this:

Quote
Error

SQL query:

UPDATE cpg_albums SET votes = 'NO'

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

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Disable rating for all albums except one
« Reply #5 on: October 26, 2006, 04:32:44 pm »

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

Page created in 0.03 seconds with 16 queries.