Very often question Very often question
 

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

Very often question

Started by bladecris, August 30, 2007, 11:30:43 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bladecris

Hy, as the subject says I'm wondering how can I rate my pictures from 1 to 10  ?
I found some answers and the closest to the result was http://forum.coppermine-gallery.net/index.php?topic=22298.0 but in my theme.php I can't find
<td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}"><img src="images/rating0.gif" alt="{RUBBISH}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}"><img src="images/rating1.gif" alt="{POOR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}"><img src="images/rating2.gif" alt="{FAIR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}"><img src="images/rating3.gif" alt="{GOOD}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}"><img src="images/rating4.gif" alt="{EXCELLENT}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}"><img src="images/rating5.gif" alt="{GREAT}" border="0" /><br /></a></td>
        </tr>

Please answer me. Can I edit other files as well? As the thread from above says I can't find the codes there presented.

Thanks

Hein Traag

The thread you refer to has the answer.

Now open ratepic.php, and find;

$rate = min($rate,5);
$rate = max($rate, 0);

should become
$rate = min($rate,10);
$rate = max($rate, 0);
;

Now open displayimage.php, and find;
Change these to match above...goes from 1 to 10.
'{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",
must become'{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",
        '{RATE6}' => "ratepic.php?pic=$pid&rate=6",
        '{RATE7}' => "ratepic.php?pic=$pid&rate=7",
        '{RATE8}' => "ratepic.php?pic=$pid&rate=8",
        '{RATE9}' => "ratepic.php?pic=$pid&rate=9",
etc. - you get the idea....

Open your language file and find this:
Change the 5 to a 10.

'rating' => '(current rating : %s / 5 with %s votes)',

bladecris

Ok, thanks for your confimation.
I'm using coppermine 1.4.12 and in the file displayimage.php I can't find
'{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",
I searched the code 10 times, it isn't there.
Can I put it in the file, and if so where? (at the start or at the end?)

Please answer,
Thanks a lot

Sami

Copy function theme_html_rating_box() from themes/sample/theme.php to your theme.php and change it as suggested
‍I don't answer to PM with support question
Please post your issue to related board

bladecris

Thanks a lot, the problems with theme.php and the ratepic.php are solved.
Now the problem with displayimage.php where do I get the code
'{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",

and how about the pictures that are used for ratings how can i change them? by making ne ones from 5 to 10 (rating6, rating7 .... rating10) ?

Sami

You are talking about outdated mod , the code you are looking for is under function theme_html_rating_box() so you should do as I suggested
‍I don't answer to PM with support question
Please post your issue to related board

bladecris

got it, but how about the
  <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}"><img src="images/rating0.gif" alt="{RUBBISH}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}"><img src="images/rating1.gif" alt="{POOR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}"><img src="images/rating2.gif" alt="{FAIR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}"><img src="images/rating3.gif" alt="{GOOD}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}"><img src="images/rating4.gif" alt="{EXCELLENT}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}"><img src="images/rating5.gif" alt="{GREAT}" border="0" /><br /></a></td>
        </tr>
that should be in theme.php, where is it?

Joachim Müller

As suggested above: if a section you want to see modified doesn't exist in your custom theme, copy the corresponding section from themes/sample/theme.php into a new line before?>of themes/yourtheme/theme.php
In your case, copy// HTML template for the image rating box
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}" rel="nofollow"><img src="{LOCATION}images/rating0.gif" border="0" alt="{RUBBISH}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}" rel="nofollow"><img src="{LOCATION}images/rating1.gif" border="0" alt="{POOR}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}" rel="nofollow"><img src="{LOCATION}images/rating2.gif" border="0" alt="{FAIR}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}" rel="nofollow"><img src="{LOCATION}images/rating3.gif" border="0" alt="{GOOD}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}" rel="nofollow"><img src="{LOCATION}images/rating4.gif" border="0" alt="{EXCELLENT}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}" rel="nofollow"><img src="{LOCATION}images/rating5.gif" border="0" alt="{GREAT}" /><br /></a></td>
        </tr>
</table>
EOT;
from themes/sample/theme.php

Quote from: bladecris on August 30, 2007, 11:30:43 AM
Hy, as the subject says I'm wondering how can I rate my pictures from 1 to 10  ?
Your subject doesn't say that you're asking to change the rating. In fact it is a stupid subject line and doesn't help others who are looking for help on similar issues. In the future, use a subject that actually describes your issues. In your case, a good subject would have been "Change rating from 0-5 to 1-10". Leave it to our judgement if a question has been asked frequently or not.

jerx

This topic should be renamed, at least the word rating should apear in the title. I have only found it after running into the same problem.

I changed my ratings to 1-5 instead of 0-5. Now I wonder if you need to recalculate the existing ratings in the database. I assume you would have to do it, but it cannot be recalculated, because there are too little information in the database. I think the only thing you can do is setting pictures with 1 vote of rating 0 to voting with rating of 1. Or is this totally wrong?

Joachim Müller

Quote from: jerx on October 25, 2008, 10:12:59 PM
This topic should be renamed, at least the word rating should apear in the title. I have only found it after running into the same problem.
I agree that the thread subject is totally silly and irrelevant. In fact, the thread starter broke a board rule (Board rules / Forum policies: Use a meaningfull subject line) by starting his/her thread with this silly subject. However, we can not rename all threads with bad subjects, as this would
a) cause too much moderation effort
and
b) result in thread starters no longer finding the threads they started