Announcement

#1 2008-10-05 19:02:30

rherzog
Guest

getting rid of rates display

Hi,
I would like to hide the status of the current rate of all pictures in one of my categories, while I require the visitor to be able to rate and even modify his/her rating for any of the pictures.
Can somebody lead me to the place where I should interviene ? Or is there a plugin that would allow this kind of customisation ?
I use 1.7.2 on Ubuntu Linux.
Thanks in advance
Robert

 

#2 2008-10-05 20:50:31

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: getting rid of rates display

Good, I never thought on that way.
Brilliant idea!!!

We will come back on that point later.
Thanks.
8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#3 2008-10-06 01:14:13

rvelices
Former Piwigo Team
2005-12-29
1960

Re: getting rid of rates display

Admin / general configuration... Uncheck "Rating" and "Rating by guests" ...

Offline

 

#4 2008-10-06 08:56:14

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: getting rid of rates display

rvelices I didn't understand like this.

I understood to hide current rank of the picture till the visitor has ranked it.
Previous rankings don't have to influence any new ranking.

8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#5 2008-10-06 11:23:33

rherzog
Member
Eppegem
2008-10-06
10

Re: getting rid of rates display

VDigital wrote:

rvelices I didn't understand like this.

I understood to hide current rank of the picture till the visitor has ranked it.
Previous rankings don't have to influence any new ranking.

8-)

Exactly, VDigital. This is what I mean. The gallery serves to present a photo contest and the visitors (both registered and simpel "guest" ones) should not be able to see the current ranking of the pictures from one of my collections. But I, as manager, must be able to look at th current ranking, preferably as admin of the phpwebgallery, not only in the DB...

Obviously, it is a nice feature for the registered use to actually see his ranking and remain able to change it. This should preferably not be a possibility for the guest.

Thanks for your interest in this issue.
Robert

Offline

 

#6 2008-10-06 15:57:31

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: getting rid of rates display

I didn't try it, take care.
In ./include/picture_rate.inc.php

Find:

$template->assign_block_vars('info_rate', array('CONTENT' => $value));

replace by:

if (!is_null($user_rate))
$template->assign_block_vars('info_rate', array('CONTENT' => $value));

It will reply to your request, not for a specific category but for all.
Tell us and enjoy!


Note to rvelices: if we could assign another field with user_rate and test it to display in tpl, that could be better than a trigger. Anyway, I didn't see how we can do currently in Piwigo.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#7 2008-10-06 22:52:22

rherzog
Member
Eppegem
2008-10-06
10

Re: getting rid of rates display

VDigital wrote:

I didn't try it, take care.
In ./include/picture_rate.inc.php

Find:

$template->assign_block_vars('info_rate', array('CONTENT' => $value));

replace by:

if (!is_null($user_rate))
$template->assign_block_vars('info_rate', array('CONTENT' => $value));

It will reply to your request, not for a specific category but for all.
Tell us and enjoy!


Note to rvelices: if we could assign another field with user_rate and test it to display in tpl, that could be better than a trigger. Anyway, I didn't see how we can do currently in Piwigo.

Hi VDigital,
No. It does not help. What it does is to hide the current rating as long as a user never voted for a certain pic. When he votes, he sees the current rate, deviation, etc., taking into account the vote he just gave. By the way, this is what I expected to see when stating (!is_null($user_rate)). I would be closer to the goal by readily hiding the "average_rate" line. I would still have the info about the number of visits and hopefully the row of stars allowing the vote. This could be an overall property of my site, as I can access the rates from the db or the admin rating page.

In fact, I thought that removing the $template->assign_block_vars... line could not lead me to the goal. I tried by commenting out the line and indeed the rate line disappeared... But maybe other areas of the site might suffer from this surgery... ?
What do you think ?
You can look at aamodels.dyndns.org:7180/pwg for the current status...
Thanks in any case for the kind reaction.
Robert

Offline

 

#8 2008-10-06 23:05:05

rherzog
Member
Eppegem
2008-10-06
10

Re: getting rid of rates display

rherzog wrote:

VDigital wrote:

I didn't try it, take care.
In ./include/picture_rate.inc.php

Find:

$template->assign_block_vars('info_rate', array('CONTENT' => $value));

replace by:

if (!is_null($user_rate))
$template->assign_block_vars('info_rate', array('CONTENT' => $value));

It will reply to your request, not for a specific category but for all.
Tell us and enjoy!


Note to rvelices: if we could assign another field with user_rate and test it to display in tpl, that could be better than a trigger. Anyway, I didn't see how we can do currently in Piwigo.

Hi VDigital,
No. It does not help. What it does is to hide the current rating as long as a user never voted for a certain pic. When he votes, he sees the current rate, deviation, etc., taking into account the vote he just gave. By the way, this is what I expected to see when stating (!is_null($user_rate)). I would be closer to the goal by readily hiding the "average_rate" line. I would still have the info about the number of visits and hopefully the row of stars allowing the vote. This could be an overall property of my site, as I can access the rates from the db or the admin rating page.

In fact, I thought that removing the $template->assign_block_vars... line could not lead me to the goal. I tried by commenting out the line and indeed the rate line disappeared... But maybe other areas of the site might suffer from this surgery... ?
What do you think ?
You can look at aamodels.dyndns.org:7180/pwg for the current status...
Thanks in any case for the kind reaction.
Robert

Hi again,
I tested this situation and it pretty well fits my requirement. I could not detect any side effect (yet?).
Now it would be nice that admin does not suffer from this hiding. You can probably tell me what to put on the "if (..." line for the rating line to appear only when the current user is admin... I am rather naive in php, sorry. I was only trained in FORTRAN many years ago...;-)
Something like if(Is_user(admin) ?
Robert

Offline

 

#9 2008-10-06 23:14:57

rherzog
Member
Eppegem
2008-10-06
10

Re: getting rid of rates display

Hi again...
Well, I lloked for and found other code lines where the admin status is tested. I put the following if line in from of the $template->assign_block line and I get what I am looking for.

if (is_admin())
$template->assign_block_vars('info_rate', array('CONTENT' => $value));

The change obviously affects all local galleries.... but this is better than the default situation.

and... I wrote my first PHP code line ! ;-)

Thanks again for the inspiration,

Robert

Offline

 

#10 2008-10-06 23:56:17

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: getting rid of rates display

I add your idea to anoter [Bugtracker] ticket 863 because we are focusing on rating.
I am convinced you will find all you were looking for in next release.

Current rate display will be removed without editing a php module.
Current rate display will be removed only in the current quarter category.
Current rate display will be available for webmaster.

We will come back on this subject when Piwigo stable will be available.
8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

Board footer

Powered by FluxBB

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