Remove Rating But Keep Voting Remove Rating But Keep Voting
 

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

Remove Rating But Keep Voting

Started by drweb, January 25, 2007, 05:50:14 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

drweb

Hiya, this was sorted in V1.3 but having got V1.4 it doesn't seem to apply anymore as the code doesn't exist in V1.5 the fix is listed in this topic
http://forum.coppermine-gallery.net/index.php?topic=20068.0

Does anyone know how to just display the number of votes instead of the rating and the number of votes.  I've taken off all my ratings and substituted the 5 rating with a vote button.  This allows the view just to vote for the pic, but when the results are displayed I get a 5/5  5 Votes.  All I want to see is the number of votes.

Can anyone help with this?

Dave

Nibbler

Code moved into the theme system. Add this code into your theme's theme.php near the end, before the closing ?>


function theme_html_rating_box()
{
    global $CONFIG, $CURRENT_PIC_DATA, $CURRENT_ALBUM_DATA, $THEME_DIR;
    global $template_image_rating, $lang_rate_pic;

    if (!(USER_CAN_RATE_PICTURES && $CURRENT_ALBUM_DATA['votes'] == 'YES')) return '';

    $votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];
    $pid = $CURRENT_PIC_DATA['pid'];

    if (defined('THEME_HAS_RATING_GRAPHICS')) {
        $location= $THEME_DIR;
    } else {
        $location= '';
    }

    $params = array('{TITLE}' => $lang_rate_pic['rate_this_pic'],
        '{VOTES}' => $votes,
        '{RATE0}' => "ratepic.php?pic=$pid&rate=0",
        '{RATE1}' => "ratepic.php?pic=$pid&rate=1",
        '{RATE2}' => "ratepic.php?pic=$pid&rate=2",
        '{RATE3}' => "ratepic.php?pic=$pid&rate=3",
        '{RATE4}' => "ratepic.php?pic=$pid&rate=4",
        '{RATE5}' => "ratepic.php?pic=$pid&rate=5",
        '{RUBBISH}' => $lang_rate_pic['rubbish'],
        '{POOR}' => $lang_rate_pic['poor'],
        '{FAIR}' => $lang_rate_pic['fair'],
        '{GOOD}' => $lang_rate_pic['good'],
        '{EXCELLENT}' => $lang_rate_pic['excellent'],
        '{GREAT}' => $lang_rate_pic['great'],
        '{WIDTH}' => $CONFIG['picture_table_width'],
        '{LOCATION}' => $location,        //theme dir or default images directory
        );

    return template_eval($template_image_rating, $params);
}


The change to the language file should be the same as before.