From a821682c8c165077947781bca2064922884f6e7d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 5 Sep 2018 12:17:32 +0200 Subject: instead of not displaying the cover-photo at all after first page load, load the page with the cover slided up. change pointer to n-resize if cover is not slid. --- Zotlabs/Widget/Cover_photo.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Widget/Cover_photo.php') diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php index af1ae5c7f..965566523 100644 --- a/Zotlabs/Widget/Cover_photo.php +++ b/Zotlabs/Widget/Cover_photo.php @@ -21,9 +21,9 @@ class Cover_photo { return ''; // only show cover photos once per login session - + $hide_cover = false; if(array_key_exists('channels_visited',$_SESSION) && is_array($_SESSION['channels_visited']) && in_array($channel_id,$_SESSION['channels_visited'])) { - return EMPTY_STR; + $hide_cover = true; } if(! array_key_exists('channels_visited',$_SESSION)) { $_SESSION['channels_visited'] = []; @@ -53,6 +53,7 @@ class Cover_photo { $subtitle = str_replace('@','@',$channel['xchan_addr']); $c = get_cover_photo($channel_id,'html'); + $c = str_replace('src=', 'data-src=', $c); if($c) { $photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c); @@ -62,6 +63,7 @@ class Cover_photo { '$title' => $title, '$subtitle' => $subtitle, '$hovertitle' => t('Click to show more'), + '$hide_cover' => $hide_cover )); } return $o; -- cgit v1.2.3 From ea381d918021a33a73df40de95fd0c57f0edc5c2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 5 Sep 2018 14:44:06 +0200 Subject: move str_replace inside if clause --- Zotlabs/Widget/Cover_photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Widget/Cover_photo.php') diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php index 965566523..955048992 100644 --- a/Zotlabs/Widget/Cover_photo.php +++ b/Zotlabs/Widget/Cover_photo.php @@ -53,9 +53,9 @@ class Cover_photo { $subtitle = str_replace('@','@',$channel['xchan_addr']); $c = get_cover_photo($channel_id,'html'); - $c = str_replace('src=', 'data-src=', $c); if($c) { + $c = str_replace('src=', 'data-src=', $c); $photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c); $o = replace_macros(get_markup_template('cover_photo_widget.tpl'),array( -- cgit v1.2.3