On youtube, only connected users can vote, and when a user is not connected he gets the java script message "Log in to rate".
Is it possible to have this behavior with five star ?
Thanks
On youtube, only connected users can vote, and when a user is not connected he gets the java script message "Log in to rate".
Is it possible to have this behavior with five star ?
Thanks
Comments
Comment #1
julma commentedYoutube is still a good example of this feature.
Comment #2
julma commentedComment #3
julma commentedComment #4
quicksketchThis behavior is possible, but can't really be implemented by default. The reason being it's possible to have multiple roles, and even if the user was logged in they still couldn't vote. So we can't make that message part of the default Fivestar install because it'd be inaccurate in a lot of cases.
Instead, what you can do is over ride the theme_fivestar_static_element() function in your template.php, to make it include this message for your particular site.
Comment #5
kakarot-1 commentedIs this possible in D6?
Comment #6
CinemaSaville commented+1 for D6 implementation.
Comment #7
drupov commentedsubscribe
Comment #8
thekayra commentedThe solution provided in #4 works in D6.
Comment #9
dunklea commentedHow would I modify the above code to make the text a link to my registration page?
Thanks!
Comment #10
TapSkill commentedJust override the display of the fivestar 'block' or widget to add an if statement checking whether or not the user is logged in. This would require custom theming but not much else.
#4 covers some of this, but it doesn't mention any check of user login status. In the example, all widgets display the same message, whether you're logged in or not. You can easily fix this in your template files by adding something like this:
If I'm missing the point, tell me, but otherwise, I consider this issue resolved. Keep in mind, however, that I use D6 and may not understand some limitation of D5. If the above code has anything wrong with it, let me know.