Good idea! You could probably do this with a global.
is_watched =>
sub {
my $id = shift;
return $DB->table('ThreadWatch')->count( { user_id_fk => $USER->{user_id}, thread_id_fk => $id });
}
and then do:
<%if is_watched($post_root_id)%>
.. display stop watch
<%else%>
.. display watch
<%endif%>
Cheers,
Alex
--
Gossamer Threads Inc.
is_watched =>
sub {
my $id = shift;
return $DB->table('ThreadWatch')->count( { user_id_fk => $USER->{user_id}, thread_id_fk => $id });
}
and then do:
<%if is_watched($post_root_id)%>
.. display stop watch
<%else%>
.. display watch
<%endif%>
Cheers,
Alex
--
Gossamer Threads Inc.