Announcement

#1 2010-12-22 15:04:14

kiddy-admin
Translation Team
Moscow
2009-05-16
116

best rated in one of categories

Good day,
how can i display number of votes on category page (list of thumbnails) near each thumbnails as it is realized on page best_rated?

Offline

 

#2 2010-12-23 14:11:55

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: best rated in one of categories

This isn't the best solution (lost in the next update) but for now I have no other

in the file category_default.inc.php

search ->       

case 'most_visited' :
      {
        if ( !$user['show_nb_hits']) {
          $name = '('.$row['hit'].') '.$name;
        }
        break;
      }

and add after

case 'categories' :
      {
        $name = '('.$row['average_rate'].') '.$name;
        break;
      }


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2010-12-23 14:49:45

kiddy-admin
Translation Team
Moscow
2009-05-16
116

Re: best rated in one of categories

Thanks, it works!)
How can I display a rating only for one concrete category?

Offline

 

#4 2011-01-18 13:31:56

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: best rated in one of categories

kiddy-admin wrote:

Thanks, it works!)
How can I display a rating only for one concrete category?

sorry, i don't look your repply

you can test

add

global $page;

$exceptions = array(1, 5, 10);

  if (isset($page['category']['id']) and in_array($page['category']['id'], $exceptions))
  {
case 'categories' :
      {
        $name = '('.$row['average_rate'].') '.$name;
        break;
      }
  }


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#5 2011-01-18 14:50:45

kiddy-admin
Translation Team
Moscow
2009-05-16
116

Re: best rated in one of categories

Excellently! It works! Thanks a lot! Now I can easily hold competitions!)

Offline

 

#6 2011-01-18 15:02:03

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: best rated in one of categories


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#7 2011-01-18 15:29:11

kiddy-admin
Translation Team
Moscow
2009-05-16
116

Re: best rated in one of categories

I tried to set it, but, it is incorrectly displayed in my theme and I hasn't understood how to add photos on competition  and I refused it

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact