]> git.mxchange.org Git - friendica.git/commitdiff
notifications to zeros, bug in notify link
authorfriendica <info@friendica.com>
Sat, 25 Feb 2012 07:44:55 +0000 (23:44 -0800)
committerfriendica <info@friendica.com>
Sat, 25 Feb 2012 07:44:55 +0000 (23:44 -0800)
mod/ping.php
view/theme/duepuntozero/nav.tpl
view/theme/duepuntozero/style.css

index 35812534735c4961e058b79b3d3f4c64994e9270..4260bbfb96419cf6b9ce7e870914215e9b69c4fb 100644 (file)
@@ -14,8 +14,8 @@ function ping_init(&$a) {
 
                $firehose = intval(get_pconfig(local_user(),'system','notify_full'));
 
-               $z = q("select * from notify where seen = 0 and uid = %d
-                       order by date desc",
+               $z = q("select * from notify where uid = %d
+                       order by seen asc, date desc limit 0, 50",
                        intval(local_user())
                );
 
@@ -135,7 +135,7 @@ function ping_init(&$a) {
                        echo '  <notif count="'. count($z) .'">';
                        if(count($z)) {
                                foreach($z as $zz) {
-                                       echo xmlize($a->get_baseurl() . '/notify/view' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), strip_tags(bbcode($zz['msg'])));
+                                       echo xmlize($a->get_baseurl() . '/notify/view/' . $zz['id'], $zz['name'],$zz['url'],$zz['photo'],relative_date($zz['date']), ($zz['seen'] ? '' : '! ') .strip_tags(bbcode($zz['msg'])));
                                }
                        }
                }
index afa9180651df4f00d05e2c7f04b199c55bdeb216..cd524ebec781ddcb5931b031d6c880d3dcf095e5 100755 (executable)
        <span id="mail-update" class="nav-ajax-left"></span>
        {{ endif }}
 
+
+
        {{ if $nav.manage }}<a id="nav-manage-link" class="nav-commlink $nav.manage.2 $sel.manage" href="$nav.manage.0" title="$nav.manage.3">$nav.manage.1</a>{{ endif }}
 
+
+               {{ if $nav.notifications }}
+                       <li  id="nav-notifications-linkmenu" class="nav-commlink"><a href="$nav.notifications.0" rel="#nav-notifications-menu" title="$nav.notifications.1">$nav.notifications.1</a>
+                               <span id="notify-update" class="nav-notify"></span>
+                               <ul id="nav-notifications-menu" class="menu-popup">
+                                       <li id="nav-notifications-mark-all"><a href="#" onclick="notifyMarkAll(); return false;">$nav.notifications.mark.1</a></li>
+                                       <li id="nav-notifications-see-all"><a href="$nav.notifications.all.0">$nav.notifications.all.1</a></li>
+                                       <li class="empty">$emptynotifications</li>
+                               </ul>
+                       </li>           
+               {{ endif }}             
+
        {{ if $nav.settings }}<a id="nav-settings-link" class="nav-link $nav.settings.2" href="$nav.settings.0" title="$nav.settings.3">$nav.settings.1</a>{{ endif }}
        {{ if $nav.profiles }}<a id="nav-profiles-link" class="nav-link $nav.profiles.2" href="$nav.profiles.0" title="$nav.profiles.3" >$nav.profiles.1</a>{{ endif }}
 
@@ -49,3 +63,7 @@
        <span id="nav-end"></span>
        <span id="banner">$banner</span>
 </nav>
+
+<ul id="nav-notifications-template" style="display:none;" rel="template">
+       <li><a href="{0}">{2} <span class="notif-when">{3}</span></a></li>
+</ul>
index cf7505ad0f6fe26b4420e4f567d2a29f9077ac6d..4604bedf08ad150bade0b9e278d579b24c9a1b13 100755 (executable)
@@ -2967,3 +2967,70 @@ div.jGrowl div.info {
        opacity: 1.0;
        filter:alpha(opacity=100);
 }
+
+/* notifications popup menu */
+.nav-notify {
+       display: none;
+       position: absolute;
+       font-size: 10px;
+       padding: 1px 3px;
+       top: 0px;
+       right: -10px;
+       min-width: 15px;
+       text-align: right;
+}
+.nav-notify.show {
+       display: block;
+}
+ul.menu-popup {
+       position: absolute;
+       display: none;
+       width: 10em;
+       margin: 0px;
+       padding: 0px;
+       list-style: none;
+       z-index: 100000;
+       top: 90px;
+}
+#nav-notifications-menu {
+       width: 320px;
+       max-height: 400px;
+       overflow-y: scroll;overflow-style:scrollbar;
+       background-color:#FFFFFF;
+       -moz-border-radius:0px 0px 5px 5px;
+       -webkit-border-radius:0px 0px 5px 5px;
+       border-radius:0px 0px 5px 5px;
+       border: 1px solid #888;
+       border-top: none;
+
+}
+#nav-notifications-menu .contactname { font-weight: bold; font-size: 0.9em; }
+#nav-notifications-menu img { float: left; margin-right: 5px; }
+#nav-notifications-menu .notif-when { font-size: 0.8em; display: block; }
+#nav-notifications-menu li {
+       padding: 7px 0px 7px 10px;
+       word-wrap:normal;
+       border-bottom: 1px solid #000;
+}
+
+#nav-notifications-menu li:hover {
+
+}
+
+#nav-notifications-menu a:hover {
+       text-decoration: underline;
+}
+
+.notif-item a {
+       color: #000000;
+}
+
+.notif-item a:hover {
+       text-decoration: underline;
+}
+
+.notif-image {
+       width: 32px;
+       height: 32px;
+       padding: 7px 7px 0px 0px;
+}