We needed to be able to click up for a vote and then click again to undo the vote. I've created a theme that achieves this. It's not on a public site, so I can't provide an example.

To make it work it needs a modification to vud.theme.inc to add a variable in the vud_widget_proxy function:

$token_reset = drupal_get_token("vote/$type/$cid/0/$tag");
$variables['link_reset'] = url("vote/$type/$cid/0/$tag/$token_reset");

I've attached the theme. We called it campfire because it's our project name. If someone comes up with a better name, feel free.

Jack Sparrow: You know, for all that pirates are clever-called, we are an unimaginative lot when it comes to naming things.
Gibbs: Like?
Jack Sparrow: I once sailed with a geezer lost both his arms and part of his eye.
Gibbs: What did you call him?
Jack Sparrow (after a pause): Larry

Comments

bassam’s picture

How can I have this change for 6.2?

thanks

jgreep’s picture

StatusFileSize
new3.61 KB
new1.18 KB

I've attached the new theme and patch. Let me know how it works for you.

bassam’s picture

Hi,

Thanks for the files. There is one change thought

campfire/campfire.inc:
change function name from
UDCampfire_campfire_vud_widgets
to
vud_campfire_vud_widgets

jgreep’s picture

StatusFileSize
new2.39 KB

Thanks. Forgot about that. Here's the update.

marvil07’s picture

Version: » 6.x-3.x-dev

I'm not sure if we want this feature, but subscribing me to avoid reviewing ti in detail.

btw: please provide patches instead of tarballs to make it easy to review.

moving to 3.x since 2.x is in the process of stabilization.

marvil07’s picture

Status: Needs review » Closed (works as designed)

Apart from the last patch at #2, from the tarball, I think the only relevant part is at:

      if ($voted_up) {
        $link_up = $link_reset;
        $vote_up_text = $vote_reset_text;
      }
      if ($voted_down) {
        $link_down = $link_reset;
        $vote_down_text = $vote_reset_text;
      }

Since I'm not too convinced at this request, I'm wondering if we could have a way to modify template values before sending them to the tpl.. actually it can be done on the tpl itself, and the creation of the new widget fits on the idea to customize the behaviour.