From 3067663909e7a5553d55d0dc385d02998c1961a0 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 28 Nov 2015 22:56:48 +0100 Subject: [PATCH 1/3] The manage page now shows the unread notifications --- mod/manage.php | 14 ++++++++++++++ view/templates/manage.tpl | 2 +- view/theme/vier/plus.css | 6 ++++++ view/theme/vier/style.css | 19 +++++++++++++++++++ 4 files changed, 40 insertions(+), 1 deletion(-) diff --git a/mod/manage.php b/mod/manage.php index c0eedc2ba0..3f2023b7e3 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -114,6 +114,20 @@ function manage_content(&$a) { $identities[$key][thumb] = $thumb[0][thumb]; $identities[$key]['selected'] = (($id['nickname'] === $a->user['nickname']) ? true : false); + + $notifications = 0; + + $r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))", + intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL)); + if ($r) + $notifications = sizeof($r); + + $r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`", + intval($id['uid'])); + if ($r) + $notifications = $notifications + sizeof($r); + + $identities[$key]['notifications'] = $notifications; } $o = replace_macros(get_markup_template('manage.tpl'), array( diff --git a/view/templates/manage.tpl b/view/templates/manage.tpl index e23c402754..dd27092e9b 100644 --- a/view/templates/manage.tpl +++ b/view/templates/manage.tpl @@ -11,6 +11,7 @@
@@ -22,7 +23,6 @@
({{$id.nickname}})
-
{{/foreach}} diff --git a/view/theme/vier/plus.css b/view/theme/vier/plus.css index 5faf069c22..8e1865a869 100644 --- a/view/theme/vier/plus.css +++ b/view/theme/vier/plus.css @@ -17,6 +17,12 @@ nav a:hover, color: #000; } +.manage-notify { + background-color: #CB4437; + border-radius: 10px; + font: bold 11px/16px Arial; +} + nav .nav-notify { /* background-color: #427FED; */ background-color: #CB4437; diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 5bd475759f..a9c5e7ec8e 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -667,6 +667,7 @@ nav .nav-menu img { margin-top: -3px; margin-right: 4px; } + nav .nav-menu-icon .nav-notify { top: 3px; } @@ -701,6 +702,23 @@ nav .nav-menu:hover { /* background: #4c619c; */ text-decoration: none; } + +.manage-notify { + background-color: #F80; + -moz-border-radius: 5px 5px 5px 5px; + -webkit-border-radius: 5px 5px 5px 5px; + border-radius: 5px 5px 5px 5px; + font-size: 10px; + padding: 1px 3px; + top: 0px; + min-width: 15px; + text-align: center; + color: white; + float: right; + margin-top: -14px; + margin-right: -20px; +} + nav .nav-notify { display: none; position: absolute; @@ -720,6 +738,7 @@ nav .nav-notify { text-align: center; color: white; } + nav .nav-notify.show { display: block; } From 58a261a29a3445afad1fe47ee7175fbce669a976 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 28 Nov 2015 23:18:01 +0100 Subject: [PATCH 2/3] Other themes are now supported as well --- view/theme/duepuntozero/style.css | 11 +++++++++++ view/theme/frost/style.css | 16 ++++++++++++++++ view/theme/smoothly/style.css | 11 +++++++++++ 3 files changed, 38 insertions(+) diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 255a1d089a..2729e01278 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -3312,6 +3312,17 @@ div.jGrowl div.info { } /* notifications popup menu */ +.manage-notify { + font-size: 10px; + padding: 1px 3px; + top: 0px; + min-width: 15px; + text-align: center; + float: right; + margin-top: -14px; + margin-right: -20px; +} + .nav-notify { display: none; position: absolute; diff --git a/view/theme/frost/style.css b/view/theme/frost/style.css index 24fe47559a..0e51128e29 100644 --- a/view/theme/frost/style.css +++ b/view/theme/frost/style.css @@ -4040,6 +4040,22 @@ div.jGrowl-notification { } /* notifications popup menu */ +.manage-notify { + padding: 1px 3px; + top: 0px; + min-width: 15px; + text-align: center; + float: right; + margin-top: -14px; + margin-right: -20px; + + font-size: 0.8em; + border-radius: 4px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + background-color: gold !important; +} + .nav-notify { display: none; position: absolute; diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 3b6b73dc6e..f441ea5412 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -4216,6 +4216,17 @@ a.active { } /* notifications popup menu */ +.manage-notify { + font-size: 10px; + padding: 1px 3px; + top: 0px; + min-width: 15px; + text-align: center; + float: right; + margin-top: -14px; + margin-right: -20px; +} + .nav-notify { display: none; position: absolute; From 68916689de86eabde434aaf1349aab0ca32a3b00 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sat, 28 Nov 2015 23:35:02 +0100 Subject: [PATCH 3/3] Introductions are now added as well --- mod/manage.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/manage.php b/mod/manage.php index 3f2023b7e3..adcc3d787a 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -127,6 +127,11 @@ function manage_content(&$a) { if ($r) $notifications = $notifications + sizeof($r); + $r = q("SELECT COUNT(*) AS `introductions` FROM `intro` WHERE NOT `blocked` AND NOT `ignore` AND `uid` = %d", + intval($id['uid'])); + if ($r) + $notifications = $notifications + $r[0]["introductions"]; + $identities[$key]['notifications'] = $notifications; }