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: Hide vote counting..  (Read 6512 times)

0 Members and 1 Guest are viewing this topic.

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Hide vote counting..
« on: April 08, 2012, 02:04:00 am »

Hi, I want to hide the counted votes display inside the bracket just after Rate this file..which is like (No vote yet), (5/5 with 100 votes) etc. I do not want my visitors or users see the no. of votes. Is this possible to remove only for one album having album_id=30?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hide vote counting..
« Reply #1 on: April 12, 2012, 09:59:19 am »

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]
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round(($CURRENT_PIC_DATA['pic_rating'] / 2000) / (5/$rating_stars_amount), 1), $rating_stars_amount, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];and replace with
Code: [Select]
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf(($CURRENT_PIC_DATA['aid'] == 30 ? '(Current rating : %s / %s)' : $lang_rate_pic['rating']), round(($CURRENT_PIC_DATA['pic_rating'] / 2000) / (5/$rating_stars_amount), 1), $rating_stars_amount, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];if you just want to hide the number of votes, or remove that line completely if you want to remove the whole text.
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #2 on: April 12, 2012, 02:25:12 pm »

Thank you, Andre. It is solved now..
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #3 on: April 17, 2012, 03:36:55 am »

I may be a little annoying, Andre. I think adjusting the mod we have discussed here would be better again. If that mod could be adjusted to show the Rating only for admin & the picture uploader, it seems better because the uploader will not have to click a link. The show details link we have discussed here would function the same anyway with the request adjustment.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hide vote counting..
« Reply #4 on: April 17, 2012, 11:27:24 am »

Your links both points to this thread (after removing the pointless stuff from the URL)?

Am I right that you want to hide the actual voting for album ID 30, if the current user isn't the uploader or the admin?
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #5 on: April 18, 2012, 12:33:09 am »

You are right, Andre. I want to hide the actual voting for album ID 30, if the current user isn't the uploader or the admin with this mod.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hide vote counting..
« Reply #6 on: April 18, 2012, 10:01:40 am »

This code should work, but I haven't tested that:
Code: [Select]
$votes = $CURRENT_PIC_DATA['votes'] ? sprintf((($CURRENT_PIC_DATA['aid'] == 30 && !GALLERY_ADMIN_MODE && $CURRENT_PIC_DATA['owner_id'] != USER_ID) ? '(Current rating : %s / %s)' : $lang_rate_pic['rating']), round(($CURRENT_PIC_DATA['pic_rating'] / 2000) / (5/$rating_stars_amount), 1), $rating_stars_amount, $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #7 on: April 18, 2012, 05:15:16 pm »

Unfortunately, it does not work. Apart from the file uploader and the admin, all other users still can see the ratings..
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hide vote counting..
« Reply #8 on: April 18, 2012, 07:00:56 pm »

So it currently does exactly the opposite?
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #9 on: April 18, 2012, 07:31:43 pm »

I am sorry.. the mod is working, Andre. I removed '(Current rating : %s / %s)' and replace with '.'

However, since I use 1 star rating for album ID=30, it is not good to show 'Current rating : 1/1 with 5 votes" etc.. That is what it is currently showing.. I prefer to change this as 'Current rating: 5 votes" leaving the 1/1 part. Again, is it possible to show only the total of a unique votes meaning the total of the votes given only by the registered users excluding the votes given by Guests?

When the Admin or the uploader of the picture see "Current rating : 5 votes" that would mean the votes given only by the registered users. Thank you so much for the precious help.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #11 on: April 21, 2012, 01:12:20 am »

I am sorry for breaking the rule, the mod is working great, Andre. The vote could not be seen other than the admin or the file uploader, however, it is still seen when they click the vote. It says "Your vote was accepted (Current rating : 1/1 with 6 votes)"

Could you please help me to display only "Your vote was accepted" ?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Hide vote counting..
« Reply #12 on: April 23, 2012, 10:59:29 am »

Open ratepic.php, find
Code: [Select]
$new_rating_text = $lang_rate_pic_php['rate_ok'] . ' ' . sprintf($lang_rate_pic['rating'], $new_rating, $rating_stars_amount, $row['votes'] + 1);and replace with
Code: [Select]
$new_rating_text = "Your vote was accepted";
Logged

mr.bena

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 117
Re: Hide vote counting..
« Reply #13 on: April 23, 2012, 03:31:55 pm »

Solved. Thank you, Andre.
Logged
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.