From b53ae0d42af7cc4c2a682bec7229669dba114ca6 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 17 Nov 2015 08:39:09 +0100 Subject: [PATCH 1/3] Bugfix: The own avatar was (sometimes?) changed back when it was changed. --- include/items.php | 8 ++++---- mod/dfrn_poll.php | 10 ++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/items.php b/include/items.php index 65c49bf26..c4310c24e 100644 --- a/include/items.php +++ b/include/items.php @@ -2384,7 +2384,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $photos = import_profile_photo($photo_url,$contact['uid'],$contact['id']); q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' - WHERE `uid` = %d AND `id` = %d", + WHERE `uid` = %d AND `id` = %d AND NOT `self`", dbesc(datetime_convert()), dbesc($photos[0]), dbesc($photos[1]), @@ -2403,7 +2403,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) intval($contact['id']) ); - $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s'", + $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s' AND NOT `self`", dbesc(notags(trim($new_name))), dbesc(datetime_convert()), intval($contact['uid']), @@ -3083,7 +3083,7 @@ function local_delivery($importer,$data) { $photos = import_profile_photo($photo_url,$importer['importer_uid'],$importer['id']); q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s' - WHERE `uid` = %d AND `id` = %d", + WHERE `uid` = %d AND `id` = %d AND NOT `self`", dbesc(datetime_convert()), dbesc($photos[0]), dbesc($photos[1]), @@ -3102,7 +3102,7 @@ function local_delivery($importer,$data) { intval($importer['id']) ); - $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s'", + $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s' AND NOT `self`", dbesc(notags(trim($new_name))), dbesc(datetime_convert()), intval($importer['importer_uid']), diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index b5f60a039..d6a07186a 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -476,8 +476,8 @@ function dfrn_poll_content(&$a) { // URL reply if($dfrn_version < 2.2) { - $s = fetch_url($r[0]['poll'] - . '?dfrn_id=' . $encrypted_id + $s = fetch_url($r[0]['poll'] + . '?dfrn_id=' . $encrypted_id . '&type=profile-check' . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&challenge=' . $challenge @@ -493,7 +493,7 @@ function dfrn_poll_content(&$a) { 'sec' => $sec )); } - + $profile = ((count($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname); switch($destination_url) { @@ -506,7 +506,7 @@ function dfrn_poll_content(&$a) { case 'status': case '': $dest = $a->get_baseurl() . '/profile/' . $profile; - break; + break; default: $dest = $destination_url . '?f=&redir=1'; break; @@ -564,5 +564,3 @@ function dfrn_poll_content(&$a) { } } } - - From a07a0fd1d7a47b1945a31635c4a3fad73d5a1929 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Tue, 17 Nov 2015 20:57:12 +0100 Subject: [PATCH 2/3] forumlist: fix id conflict and js show-more --- include/forums.php | 2 +- view/templates/widget_forumlist.tpl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/forums.php b/include/forums.php index e604a3156..00b7bd6ce 100644 --- a/include/forums.php +++ b/include/forums.php @@ -74,7 +74,7 @@ function widget_forumlist($a) { $contacts = get_forumlist($a->user['uid'],true,$lastitem, true); $total = count($contacts); - $visible_forums = 10; + $visible_forums = 1; if(count($contacts)) { diff --git a/view/templates/widget_forumlist.tpl b/view/templates/widget_forumlist.tpl index 4d155fd0a..cfc3f8cbc 100644 --- a/view/templates/widget_forumlist.tpl +++ b/view/templates/widget_forumlist.tpl @@ -1,13 +1,13 @@