From cfdbd07628ce4da2b23cb0068fbff520e1c5a1f7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Nov 2017 05:23:28 +0000 Subject: [PATCH] The friend contact block wasn't displayed in the profile --- include/event.php | 5 +---- include/text.php | 26 ++++++++++---------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/event.php b/include/event.php index 8d47b5fba..9a74551bc 100644 --- a/include/event.php +++ b/include/event.php @@ -437,10 +437,7 @@ function event_store($arr) { function get_event_strings() { // First day of the week (0 = Sunday). - $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week'); - if ($firstDay === false) { - $firstDay = 0; - } + $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0); $i18n = array( "firstDay" => $firstDay, diff --git a/include/text.php b/include/text.php index 9dc3c871f..0422cc647 100644 --- a/include/text.php +++ b/include/text.php @@ -937,10 +937,7 @@ function contact_block() { $o = ''; $a = get_app(); - $shown = PConfig::get($a->profile['uid'],'system','display_friend_count'); - if ($shown === false) { - $shown = 24; - } + $shown = PConfig::get($a->profile['uid'],'system','display_friend_count', 24); if ($shown == 0) { return; } @@ -1976,11 +1973,12 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') { // $file_old - categories previously associated with an item // $file_new - new list of categories for an item - if (! intval($uid)) + if (!intval($uid)) { return false; - - if ($file_old == $file_new) + } + if ($file_old == $file_new) { return true; + } $saved = PConfig::get($uid,'system','filetags'); if (strlen($saved)) { @@ -1988,8 +1986,7 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') { $lbracket = '['; $rbracket = ']'; $termtype = TERM_FILE; - } - else { + } else { $lbracket = '<'; $rbracket = '>'; $termtype = TERM_CATEGORY; @@ -2026,8 +2023,7 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') { if (DBM::is_result($r)) { unset($deleted_tags[$key]); - } - else { + } else { $filetags_updated = str_replace($lbracket . file_tag_encode($tag) . $rbracket,'',$filetags_updated); } } @@ -2036,12 +2032,10 @@ function file_tag_update_pconfig($uid, $file_old, $file_new, $type = 'file') { PConfig::set($uid, 'system', 'filetags', $filetags_updated); } return true; + } elseif (strlen($file_new)) { + PConfig::set($uid, 'system', 'filetags', $file_new); } - else - if (strlen($file_new)) { - PConfig::set($uid, 'system', 'filetags', $file_new); - } - return true; + return true; } function file_tag_save_file($uid, $item, $file) {