]> git.mxchange.org Git - friendica.git/commitdiff
lotsoflittlestuff
authorMike Macgirvin <mike@macgirvin.com>
Tue, 20 Jul 2010 12:21:19 +0000 (05:21 -0700)
committerMike Macgirvin <mike@macgirvin.com>
Tue, 20 Jul 2010 12:21:19 +0000 (05:21 -0700)
14 files changed:
.gitignore
include/items.php
include/nav.php
mod/contacts.php
mod/dfrn_notify.php
mod/network.php
mod/profile.php
mod/profile_photo.php
view/atom_feed.tpl
view/contact_edit.tpl
view/directory_item.tpl
view/head.tpl
view/style.css
wip/todo

index e85d8289655c538ebaaf20ec31ea5027020335f5..a69789254f70bb08d960d2733616e6476470d2fe 100644 (file)
@@ -1,2 +1,4 @@
 .htconfig.php
 \#*
+wip
+include/jquery-1.4.2.min.js
\ No newline at end of file
index 937fc39fd988c63cb17832ad5ad74e96d70bda8a..bcfa7076322afeb1e8fc7307147c9ec31dc34474 100644 (file)
@@ -207,7 +207,7 @@ function post_remote($a,$arr) {
        $parent_id = 0;
 
        dbesc_array($arr);
-dbg(3);
+//dbg(3);
        $r = q("INSERT INTO `item` (`" 
                        . implode("`, `", array_keys($arr)) 
                        . "`) VALUES ('" 
index b788ed48a3a92c6b6ed65811587c75a2d3302a9b..0dc0f6029e42164a8aa38680171a2389a562cf52 100644 (file)
@@ -1,21 +1,28 @@
 
 <?php
+
+if(x($_SESSION['uid'])) {
+               $a->page['nav'] .= "<a id=\"nav-logout-link\" class=\"nav-link\" href=\"logout\">Logout</a>\r\n";
+}
+
        $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
 
        if(($a->module != 'home') && (! (x($_SESSION['uid']))))
                $a->page['nav'] .= "<a id=\"nav-home-link\" class=\"nav-commlink\" href=\"\">Home</a>\r\n";
        
-       $a->page['nav'] .= "<a id=\"nav-directory-link\" class=\"nav-commlink\" href=\"directory\">Site Directory</a>\r\n";
+       $a->page['nav'] .= "<a id=\"nav-directory-link\" class=\"nav-link\" href=\"directory\">Site Directory</a>\r\n";
 
        if(x($_SESSION,'uid')) {
 
-               $a->page['nav'] .= "<a id=\"nav-notify-link\" class=\"nav-commlink\" href=\"notifications\">Notifications</a>\r\n";
+               $a->page['nav'] .= "<a id=\"nav-network-link\" class=\"nav-commlink\" href=\"network\">Network</a><span id=\"net-update\" class=\"nav-ajax-left\"></span>\r\n";
 
-               $a->page['nav'] .= "<a id=\"nav-messages-link\" class=\"nav-commlink\" href=\"Messages\">Messages</a>\r\n";
+               $a->page['nav'] .= "<a id=\"nav-home-link\" class=\"nav-commlink\" href=\"profile/{$a->user['nickname']}\">Home</a><span id=\"home-update\" class=\"nav-ajax-left\"></span>\r\n";
+
+               $a->page['nav'] .= "<a id=\"nav-notify-link\" class=\"nav-commlink\" href=\"notifications\">Notifications</a><span id=\"notify-update\" class=\"nav-ajax-left\"></span>\r\n";
+
+               $a->page['nav'] .= "<a id=\"nav-messages-link\" class=\"nav-commlink\" href=\"Messages\">Messages</a><span id=\"mail-update\" class=\"nav-ajax-left\"></span>\r\n";
                
-               $a->page['nav'] .= "<div id=\"nav-notify\" class=\"nav-notify\"></div>\r\n";
 
-               $a->page['nav'] .= "<a id=\"nav-logout-link\" class=\"nav-link\" href=\"logout\">Logout</a>\r\n";
 
                $a->page['nav'] .= "<a id=\"nav-settings-link\" class=\"nav-link\" href=\"settings\">Settings</a>\r\n";
 
@@ -23,9 +30,7 @@
 
                $a->page['nav'] .= "<a id=\"nav-contacts-link\" class=\"nav-link\" href=\"contacts\">Contacts</a>\r\n";
 
-               $a->page['nav'] .= "<a id=\"nav-home-link\" class=\"nav-link\" href=\"profile/{$a->user['nickname']}\">Home</a>\r\n";
 
-               $a->page['nav'] .= "<a id=\"nav-network-link\" class=\"nav-link\" href=\"network\">Network</a>\r\n";
                
        }
 
index 4f48c1c3d5f4f205589d40eb80f443101ce2fac6..dcbadd2bac5def3ddc6f80616ff10da2c5092333 100644 (file)
@@ -88,11 +88,11 @@ function contacts_content(&$a) {
                }
 
 
-               $photo = str_replace('-4.jpg', '' , $r[0]['photo']);
-               $photos = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d",
-                               dbesc($photo),
-                               intval($_SESSION['uid'])
-               );
+//             $photo = str_replace('-4.jpg', '' , $r[0]['photo']);
+//             $photos = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d",
+//                             dbesc($photo),
+//                             intval($_SESSION['uid'])
+//             );
        
                if($cmd == 'block') {
                        $blocked = (($orig_record[0]['blocked']) ? 0 : 1);
@@ -113,12 +113,14 @@ function contacts_content(&$a) {
                        $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                                intval($contact_id),
                                intval($_SESSION['uid']));
-                       if(count($photos)) {
-                               foreach($photos as $p) {
-                                       q("DELETE FROM `photos` WHERE `id` = %d LIMIT 1",
-                                               $p['id']);
-                               }
-                       }
+
+//                     if(count($photos)) {
+//                             foreach($photos as $p) {
+//                                     q("DELETE FROM `photos` WHERE `id` = %d LIMIT 1",
+//                                             $p['id']);
+//                             }
+//                     }
+
                        if(intval($contact_id))
                                q("DELETE FROM `item` WHERE `contact-id` = %d LIMIT 1",
                                        intval($contact_id)
index ead49982bec5519434b9eddce697d98b442bf679..169ae7bb7ca56da8716dd1f4be04020b62998f3e 100644 (file)
@@ -5,7 +5,7 @@ require_once('include/items.php');
 
 
 function dfrn_notify_post(&$a) {
-dbg(3);
+
        $dfrn_id = notags(trim($_POST['dfrn_id']));
        $challenge = notags(trim($_POST['challenge']));
        $data = $_POST['data'];
index 51b528832a88a55747003f2a6649573904d5e614..845a6bb77f55bff4fc5331a57c8dfc8250449696 100644 (file)
@@ -15,6 +15,11 @@ function network_content(&$a) {
 
        $contact_id = $a->cid;
 
+       $r = q("UPDATE `item` SET `unseen` = 0 
+               WHERE `unseen` = 1 AND `uid` = %d",
+               intval($_SESSION['uid'])
+       );
+
 
        $tpl = file_get_contents('view/jot-header.tpl');
        
index db538750de6c742af906aafa689715d59be3ccdc..bb7357e5b7e70e1aefd9bb94cee15160c24cf2d5 100644 (file)
@@ -126,8 +126,17 @@ function profile_content(&$a) {
 
        // Profile owner - everything is visible
 
-       if(local_user() && ($_SESSION['uid'] == $a->profile['profile_uid']))
+       if(local_user() && ($_SESSION['uid'] == $a->profile['profile_uid'])) {
                $sql_extra = ''; 
+               
+               // Oh - while we're here... reset the Unseen messages
+
+               $r = q("UPDATE `item` SET `unseen` = 0 
+                       WHERE `type` != 'remote' AND `unseen` = 1 AND `uid` = %d",
+                       intval($_SESSION['uid'])
+               );
+
+       }
 
        // authenticated visitor - here lie dragons
        elseif(remote_user()) {
index 36657ba14e799f9d120217e5dd2005854b2df2c8..9a694971dbebd5824d8b1cb4771cc695ff3f4102 100644 (file)
@@ -4,17 +4,17 @@ require_once("Photo.php");
 
 function profile_photo_init(&$a) {
 
-       if((! local_user()) {
+       if(! local_user()) {
                return;
        }
        require_once("mod/profile.php");
-       profile_load($a,$_SESSION['uid']);
+       profile_load($a,$a->user['nickname']);
 }
 
 
 function profile_photo_post(&$a) {
 
-        if((! local_user()) {
+        if(! local_user()) {
                 notice ( "Permission denied." . EOL );
                 return;
         }
@@ -63,7 +63,7 @@ function profile_photo_post(&$a) {
                                dbesc($base_image['filename']),
                                intval($im->getHeight()),
                                intval($im->getWidth()),
-                               dbesc($im->imageString()
+                               dbesc($im->imageString())
                        );
 
                        if($r === false)
@@ -81,7 +81,7 @@ function profile_photo_post(&$a) {
                                dbesc($base_image['filename']),
                                intval($im->getHeight()),
                                intval($im->getWidth()),
-                               dbesc($im->imageString()
+                               dbesc($im->imageString())
                        );
                        
                        if($r === false)
@@ -89,10 +89,10 @@ function profile_photo_post(&$a) {
 
                        // Unset the profile photo flag from any other photos I own
 
-                       $r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d"
+                       $r = q("UPDATE `photo` SET `profile` = 0 WHERE `profile` = 1 AND `resource-id` != '%s' AND `uid` = %d",
                                dbesc($base_image['resource-id']),
                                intval($_SESSION['uid'])
-                       )
+                       );
 
                }
                goaway($a->get_baseurl() . '/profiles');
@@ -160,7 +160,7 @@ function profile_photo_post(&$a) {
                        dbesc(basename($filename)),
                        intval($ph->getHeight()),
                        intval($ph->getWidth()),
-                       dbesc($ph->imageString()
+                       dbesc($ph->imageString())
                );
                if($r === false)
                        notice("Image size reduction (640) failed." . EOL );
index 00ac6c40639893e370dac0143087595d772021bf..a620a2578199ea6c2a9889d8670a9ce5a7b8b514 100644 (file)
@@ -6,10 +6,15 @@
 
   <id>$feed_id</id>
   <title>$feed_title</title>
+  <icon>$photo</icon>
+  <dfrn:icon-updated>0000-00-00T00:00:00Z</dfrn:icon-updated>
   <updated>$feed_updated</updated>
 
   <author>
     <name>$name</name>
+    <dfrn:name-updated>0000-00-00T00:00:00Z</dfrn:name-updated>
     <uri>$profile_page</uri>
-    <dfrn:avatar>$photo</dfrn:avatar>
-  </author>
+    <dfrn:uri-updated>0000-00-00T00:00:00Z</dfrn:uri-updated>
+    <dfrn:avatar>$thumb</dfrn:avatar>
+    <dfrn:avatar-updated>0000-00-00T00:00:00Z</dfrn:avatar-updated>
+ </author>
index 4a94f708376fe12c8f1bd8d6aa15fc5107f878f4..26ee2ef5c5d28761d975954926dc18892a42a522 100644 (file)
@@ -30,7 +30,7 @@ $blocked
 
 <div id="contact-edit-profile-select-text">
 <h4>Profile Visibility</h4>
-<p>Please choose the profile you would like to display to $name - when he/she connects securely to your profile page.
+<p>Please choose the profile you would like to display to $name when viewing your profile securely.
 </p> 
 </div>
 $profile_select
index 295a66451a2918568502a4c0b53caa4032e3c83b..2494bc4b78c79e7927141a8cde9ead1e8b78831e 100644 (file)
@@ -1,7 +1,7 @@
 
 <div class="directory-item" id="directory-item-$id" >
 <div class="directory-photo-wrapper" id="directory-photo-wrapper-$id" > 
-<div class="directory-photo" id="directory-photo-$id" ><a href="$profile-link" class="directory-profile-link" id="directory-profile-link-$id" ><img src="$photo" alt="$alt-text" title="$alt-text" /></a>
+<div class="directory-photo" id="directory-photo-$id" ><a href="$profile-link" class="directory-profile-link" id="directory-profile-link-$id" ><img class="directory-photo-img" src="$photo" alt="$alt-text" title="$alt-text" /></a>
 </div>
 </div>
 <div class="directory-photo-end"></div>
index b384d6fc05082cabd7cef8e809cf8eb0dfc974ad..6be3f7940aa9c7aae9373d2f44a8ff168e2bd703 100644 (file)
@@ -9,7 +9,7 @@
 <script type="text/javascript" src="$baseurl/include/main.js" ></script>
 
 <script type="text/javascript">
-//     $(document).ready(function() { setTimeout(NavUpdate,10 * 1000); });
+       $(document).ready(function() { NavUpdate(); });
 
 function NavUpdate()
        {
@@ -17,10 +17,20 @@ function NavUpdate()
                        {
                        $(data).find('result').each(function() {
                                var net = $(this).find('net').text();
-                       alert(net);
+                               if(net == 0) { net = ''; }
+                               $('#net-update').html(net);
+                               var home = $(this).find('home').text();
+                               if(home == 0) { home = ''; }
+                               $('#home-update').html(home);
+                               var mail = $(this).find('mail').text();
+                               if(mail == 0) { mail = ''; }
+                               $('#mail-update').html(mail);
+                               var intro = $(this).find('intro').text();
+                               if(intro == 0) { intro = ''; }
+                               $('#notify-update').html(intro);
                        });
                }) ;
-               setTimeout(NavUpdate,10 * 1000);
+               setTimeout(NavUpdate,30000);
        }
 </script>
 
index 58579ae480fde42c73608c5b78eec5c018f92874..bde06ec5cd6eb42d5560eb50b010d5021b9f538b 100644 (file)
@@ -77,6 +77,22 @@ footer {
        
 }
 
+.nav-ajax-left {
+       margin-left: 1px;
+       float: left;
+       font-size: 0.6em;
+       font-weight: bold;
+       color: #FF0000;
+}
+
+.nav-ajax-right {
+       margin-left: 1px;
+       float: right;
+       font-size: 0.6em;
+       font-weight: bold;
+       color: #FF0000;
+}
+
 .nav-commlink {
        float: left;
        margin-left: 10px;
@@ -597,6 +613,11 @@ input#dfrn-url {
 #directory-search-end {
 }
 
+.directory-photo-img {
+       border: none;
+}
+
+
 .pager {
   padding: 10px;
   text-align: center;
@@ -835,6 +856,9 @@ input#dfrn-url {
        overflow: auto;
 }
 
+#group-new-submit-wrapper {
+       margin-top: 30px;
+}
 
 #acl-allow-group-label, 
 #acl-allow-contact-label,
index be2a38159b6f68c6b66c6d09836380a75f99a195..9bee344886f27fbdad6c9d02001dba8c12be6118 100644 (file)
--- a/wip/todo
+++ b/wip/todo
@@ -1,12 +1,5 @@
 
-profile photo to self contact page? - resolve profile photo inconsistency
-       pre-load profile photos and use in conversations instead of contact photos
-       (done for profile owner)
-
-       ensure correct photo is pushed with notify/poll and used in wall/wall comments/posts
-       use photo hash to notify of changes?
-
-
+finish one world photo resolution (update timestamps in atom feeds)
 >>>>>>>>contact editor
 >>>>>>>>       block photo
 
@@ -40,7 +33,6 @@ admin approved registration (requires admin)
 
 atom elements
 
-       thread
        tombstone
        activity