Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Changing rating function  (Read 4511 times)

0 Members and 1 Guest are viewing this topic.

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Changing rating function
« on: January 30, 2006, 08:40:30 pm »

Sorry if this has been asked before (or atleast something similar) but here goes.

I'm working at a modelagency, and I just installed coppermine at our server for internal usage.
We are goin to use it in a bunch of different ways, and it seems that it's going to make our job a whole lot easier, so for that I thank you all.

The first thing i need to change if possible is this: We have alot of people that are sending in application to us to be models.
And the way it works is this, each and everyone of us has to check the application and say, yes, no or dont know/dont care.
The ratingsystem that you guys have are great for this. But is it possible to change it form a numeric scale (0-5) to instead have text that says "Yes, No, Dont know" ?
If so, where do I change it?
(and also, cant seem to find where to modifie so we get the ratebox over the image instead of under it?)

Anyone has the time to help me out?

Thanks in advance
« Last Edit: January 31, 2006, 10:05:46 pm by Nibbler »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Changing rating function
« Reply #1 on: January 30, 2006, 09:19:20 pm »

depends a bit on the theme you're using - post, which one you have chosen. Generally speaking, edit themes/yourtheme/theme.php and paste
Code: [Select]
// 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="3" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="33%" align="center"><a href="{RATE0}" title="no" rel="nofollow">no<br /></a></td>
                <td class="tableb_compact" width="33%" align="center"><a href="{RATE2}" title="Dont know" rel="nofollow">Dont know<br /></a></td>
                <td class="tableb_compact" width="34%" align="center"><a href="{RATE4}" title="Yes" rel="nofollow">yes<br /></a></td>
        </tr>
</table>
EOT;
into a new line right before
Code: [Select]
?>
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #2 on: January 30, 2006, 09:21:58 pm »

damn thats a fast reply..
im using the macos theme..
goin to try your tip now.. I'll post here if i get it to work.
Thanks a bunch for the quick reply

/Elias
« Last Edit: January 31, 2006, 01:22:59 pm by anomali »
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #3 on: January 31, 2006, 01:24:28 pm »

Well editing my own message wasnt the smartest thing to do, so I edited it.

your tip worked as a charm.. the next problem is: if i place the code you gave me in another position.. will it move the rating boxes there to?

(dont know if I'm allowed to ask multiple questions in one thread, if not, Sorry)

Logged

Nibbler

  • Guest
Re: Changing rating function
« Reply #4 on: January 31, 2006, 02:25:45 pm »

You can copy the function theme_display_image() from include/themes.inc.php into your theme's theme.php and change the ordering of the sections there.
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #5 on: January 31, 2006, 04:22:49 pm »

Sweet.. will do that as soon as i get home.

thanks a bunch for you quick help ;)
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #6 on: January 31, 2006, 08:44:42 pm »

So.. I tried to copying the theme_display_image() block from the theme.inc.php as adviced, but when I change the order and put it in this order(or any other than the default) $nav_menu, $votes, $picture, $pic_info, $comments, $film_strip everyting works except the picture now has lost it's position in the center and is now to the far left.

Am I missing something here? Well I propably are since I really dont know that much about anything :)
Btw, I'm using the Macos theme.

Thanks
Logged

Nibbler

  • Guest
Re: Changing rating function
« Reply #7 on: January 31, 2006, 08:46:49 pm »

Post your code.
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #8 on: January 31, 2006, 09:29:43 pm »

guess you dont need it all, so here it is from the theme bit and down:
//{THEMES}

if (!function_exists('theme_display_image')) {  //{THEMES}
function theme_display_image($nav_menu, $votes, $picture, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}
}  //{THEMES}
// 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="3" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="33%" align="center"><a href="{RATE0}" title="Nej" rel="nofollow">Nej<br /></a></td>
                <td class="tableb_compact" width="33%" align="center"><a href="{RATE2}" title="Vet inte" rel="nofollow">Vet inte<br /></a></td>
                <td class="tableb_compact" width="34%" align="center"><a href="{RATE4}" title="Ja" rel="nofollow">Ja<br /></a></td>
        </tr>
</table>
EOT;
?>
Logged

anomali

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Changing rating function
« Reply #9 on: January 31, 2006, 09:56:38 pm »

oh.. erhm.. i just saw what I did..
never mind.. I fixed it.
Thanks for your quick help, but you can tag this thread as solved.

;)
Logged
Pages: [1]   Go Up
 

Page created in 0.032 seconds with 20 queries.