"log in to rate it" message for non connected user

julma - March 23, 2008 - 16:27
Project:Fivestar
Version:5.x-1.11
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

julma - March 24, 2008 - 23:00
Title:"Youtube like" behavior for non connected user» I should have named this issue "log in to rate it" message for non connected user

Youtube is still a good example of this feature.

#2

julma - March 24, 2008 - 23:02
Title:I should have named this issue "log in to rate it" message for non connected user» "log in to rate it" message for non connected user

#3

julma - March 24, 2008 - 23:04
Category:support request» feature request

#4

quicksketch - March 26, 2008 - 22:46

This 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.

<?php
/**
* Display a static fivestar value as stars with a title and description.
*/
function [nameofyourtheme]_fivestar_static_element($value, $title = NULL, $description = NULL) {
 
$output .= '<div class="fivestar-static-form-item">';
 
$element = array(
   
'#type' => 'item',
   
'#title' => $title,
  );

 
$output .= theme('form_element', $element, $value);
 
$output .= '<div class="description">'. t('Login or register to vote.') .'</div>';
 
$output .= '</div>';
  return
$output;
}
?>

#5

kakarot - August 4, 2009 - 11:15

Is this possible in D6?

#6

CinemaSaville - October 20, 2009 - 00:54

+1 for D6 implementation.

#7

mitkoru - October 22, 2009 - 07:52

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.