From b875191237756534a0b3cd076ccedac7911e10fa Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 10 Nov 2012 23:19:32 +0100 Subject: [PATCH] Diaspora: Avatars of repeated items weren't found Vier: Complete redesign of the navigation header --- include/dba.php | 2 +- include/diaspora.php | 11 +-- view/theme/vier/nav.tpl | 84 ++++++++++++---------- view/theme/vier/style.css | 142 +++++++++++++++++++++++++++++++++----- 4 files changed, 182 insertions(+), 57 deletions(-) diff --git a/include/dba.php b/include/dba.php index 9f2dab5191..ad33705bf1 100644 --- a/include/dba.php +++ b/include/dba.php @@ -231,7 +231,7 @@ function q($sql) { unset($args[0]); if($db && $db->connected) { - $stmt = vsprintf($sql,$args); + $stmt = @vsprintf($sql,$args); // Disabled warnings //logger("dba: q: $stmt", LOGGER_ALL); if($stmt === false) logger('dba: vsprintf error: ' . print_r(debug_backtrace(),true), LOGGER_DEBUG); diff --git a/include/diaspora.php b/include/diaspora.php index 275b29a90a..6a8d4a3581 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -859,7 +859,8 @@ function diaspora_post($importer,$xml,$msg) { $datarray['parent'] = 0; $datarray['owner-name'] = $contact['name']; $datarray['owner-link'] = $contact['url']; - $datarray['owner-avatar'] = $contact['thumb']; + //$datarray['owner-avatar'] = $contact['thumb']; + $datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']); $datarray['author-name'] = $contact['name']; $datarray['author-link'] = $contact['url']; $datarray['author-avatar'] = $contact['thumb']; @@ -1021,7 +1022,7 @@ function diaspora_reshare($importer,$xml,$msg) { $datarray['parent'] = 0; $datarray['owner-name'] = $contact['name']; $datarray['owner-link'] = $contact['url']; - $datarray['owner-avatar'] = $contact['thumb']; + $datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']); $datarray['author-name'] = $person['name']; // Let reshared messages look like wall-to-wall posts $datarray['author-link'] = $person['url']; // we have to set an additional value in the item in the future // $datarray['author-avatar'] = $person['thumb']; // to distinct the wall-to-wall-posts from reshared/repeated messages @@ -1118,7 +1119,8 @@ function diaspora_asphoto($importer,$xml,$msg) { $datarray['parent'] = 0; $datarray['owner-name'] = $contact['name']; $datarray['owner-link'] = $contact['url']; - $datarray['owner-avatar'] = $contact['thumb']; + //$datarray['owner-avatar'] = $contact['thumb']; + $datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']); $datarray['author-name'] = $contact['name']; $datarray['author-link'] = $contact['url']; $datarray['author-avatar'] = $contact['thumb']; @@ -1866,7 +1868,8 @@ EOT; $arr['owner-name'] = $parent_item['name']; $arr['owner-link'] = $parent_item['url']; - $arr['owner-avatar'] = $parent_item['thumb']; + //$arr['owner-avatar'] = $parent_item['thumb']; + $arr['owner-avatar'] = ((x($parent_item,'thumb')) ? $parent_item['thumb'] : $parent_item['photo']); $arr['author-name'] = $person['name']; $arr['author-link'] = $person['url']; diff --git a/view/theme/vier/nav.tpl b/view/theme/vier/nav.tpl index bb3ce2016c..b2b6cc7855 100644 --- a/view/theme/vier/nav.tpl +++ b/view/theme/vier/nav.tpl @@ -6,20 +6,6 @@