allow live updates for unlikes and undislikes

This commit is contained in:
Zach Prezkuta 2012-07-13 09:09:01 -06:00
parent 15cae001d9
commit 88711deceb
4 changed files with 8 additions and 5 deletions

View File

@ -357,9 +357,9 @@
function dolike(ident,verb) { function dolike(ident,verb) {
unpause(); unpause();
$('#like-rotator-' + ident.toString()).show(); $('#like-rotator-' + ident.toString()).show();
$.get('like/' + ident.toString() + '?verb=' + verb ); $.get('like/' + ident.toString() + '?verb=' + verb, NavUpdate );
if(timer) clearTimeout(timer); // if(timer) clearTimeout(timer);
timer = setTimeout(NavUpdate,3000); // timer = setTimeout(NavUpdate,3000);
liking = 1; liking = 1;
} }

View File

@ -117,7 +117,7 @@ function like_content(&$a) {
$like_item = $r[0]; $like_item = $r[0];
// Already voted, undo it // Already voted, undo it
$r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1", $r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
dbesc(datetime_convert()), dbesc(datetime_convert()),
intval($like_item['id']) intval($like_item['id'])
); );

View File

@ -616,7 +616,8 @@ function network_content(&$a, $update = 0) {
if($update) { if($update) {
$r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid` $r = q("SELECT `parent` AS `item_id`, `contact`.`uid` AS `contact_uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
and `item`.`moderated` = 0 and `item`.`unseen` = 1 and `item`.`moderated` = 0 and `item`.`unseen` = 1
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
$sql_extra3 $sql_extra $sql_nets ", $sql_extra3 $sql_extra $sql_nets ",

View File

@ -204,6 +204,8 @@ function profile_content(&$a, $update = 0) {
$r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid` $r = q("SELECT distinct(parent) AS `item_id`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE ."' OR item.verb = '" . ACTIVITY_DISLIKE . "')
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0 and `item`.`unseen` = 1 and `item`.`moderated` = 0 and `item`.`unseen` = 1
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0