It should be $args, not $arg. I notice in my version of the plugin, I
have the same mistake. I'll upload a fix.

Cheers,
Dan

On Sat, Jan 9, 2010 at 4:57 PM, Markus <[email protected]> wrote:
> I tried to change the rating plugin to return votes or score only. I
> expected the following to work:
>
> ...
> $fmt = $arg['fmt'];
> if ($fmt == ''):
>        $fmt = "{+score} ({+count} votes)";
> elseif ($fmt == 'score'):
>        $fmt = "{+score}";
> elseif ($fmt == 'votes'):
>        $fmt = "{+count}";
> endif;
> return str_replace(Array('{+count}', '{+score}'), Array($count,
> $score), $fmt);
> ...
>
> And in my search template:
> [(rate rate.{+p} fmt="score")] [(rate rate.{+p} fmt="votes")]
>
> But in both cases the rate function returns "x (y votes)", i.e. the
> first if statement.
>
> Help!
>
> Markus
>
> --
> You received this message because you are subscribed to the Google Groups 
> "BoltWire" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/boltwire?hl=en.
>
>
>
>
-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en.


Reply via email to