From: Friendika Date: Wed, 3 Nov 2010 05:21:49 +0000 (-0700) Subject: fix like/dislike refresh on photos/display items X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98a508532f0f3ea35748fa650aa3cad5e929e3de;p=friendica.git fix like/dislike refresh on photos/display items --- diff --git a/images/3ring150.jpg b/images/3ring150.jpg deleted file mode 100644 index a5bbc1bf25..0000000000 Binary files a/images/3ring150.jpg and /dev/null differ diff --git a/images/friendika.gif b/images/friendika.gif deleted file mode 100644 index d386466176..0000000000 Binary files a/images/friendika.gif and /dev/null differ diff --git a/images/friendika.ico b/images/friendika.ico deleted file mode 100644 index 8428d28dc2..0000000000 Binary files a/images/friendika.ico and /dev/null differ diff --git a/images/friendika.jpg b/images/friendika.jpg new file mode 100644 index 0000000000..a5bbc1bf25 Binary files /dev/null and b/images/friendika.jpg differ diff --git a/images/friendika48.gif b/images/friendika48.gif new file mode 100644 index 0000000000..d386466176 Binary files /dev/null and b/images/friendika48.gif differ diff --git a/images/friendika48.ico b/images/friendika48.ico new file mode 100644 index 0000000000..8428d28dc2 Binary files /dev/null and b/images/friendika48.ico differ diff --git a/include/main.js b/include/main.js index f0cb8571b9..1b5553161c 100644 --- a/include/main.js +++ b/include/main.js @@ -16,7 +16,7 @@ document.getElementById(theID).style.display = "none" } - + var src = null; var prev = null; var livetime = null; @@ -24,6 +24,7 @@ var stopped = false; var timer = null; var pr = 0; + var liking = 0; $(document).ready(function() { $.ajaxSetup({cache: false}); @@ -49,6 +50,18 @@ if($('#live-network').length) { src = 'network'; liveUpdate(); } if($('#live-profile').length) { src = 'profile'; liveUpdate(); } + if($('#live-display').length) { + if(liking) { + liking = 0; + window.location.href=window.location.href + } + } + if($('#live-photos').length) { + if(liking) { + liking = 0; + window.location.href=window.location.href + } + } if(! stopped) { $.get("ping",function(data) { @@ -135,6 +148,7 @@ $.get('like/' + ident.toString() + '?verb=' + verb ); if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,3000); + liking = 1; } function getPosition(e) { diff --git a/mod/display.php b/mod/display.php index 2e35cd6acc..b451d69300 100644 --- a/mod/display.php +++ b/mod/display.php @@ -3,6 +3,8 @@ function display_content(&$a) { + $o = '
' . "\r\n"; + require_once('mod/profile.php'); profile_init($a); @@ -100,6 +102,7 @@ function display_content(&$a) { ); + $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); $tpl = load_view_file('view/wall_item.tpl'); @@ -112,6 +115,13 @@ function display_content(&$a) { if(count($r)) { + if((local_user()) && (local_user() == $a->profile['uid'])) { + q("UPDATE `item` SET `unseen` = 0 + WHERE `parent` = %d AND `unseen` = 1", + intval($r[0]['parent']) + ); + } + foreach($r as $item) { like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); diff --git a/mod/home.php b/mod/home.php index 9239f1d173..13b6d56c4a 100644 --- a/mod/home.php +++ b/mod/home.php @@ -16,7 +16,7 @@ function home_content(&$a) { $o = ''; if(! (x($a->page,'footer'))) $a->page['footer'] = ''; - $a->page['footer'] .= "
Powered by friendika
"; + $a->page['footer'] .= "
Powered by friendika
"; $o .= '

Welcome' . ((x($a->config,'sitename')) ? " to {$a->config['sitename']}" : "" ) . '

'; if(file_exists('home.html')) $o .= file_get_contents('home.html'); diff --git a/mod/photos.php b/mod/photos.php index 63300ebee0..8d2805fdef 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -665,6 +665,7 @@ function photos_content(&$a) { require_once('security.php'); require_once('bbcode.php'); + $o = '
' . "\r\n"; // fetch image, item containing image, then comments $ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource-id` = '%s'