diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | include/items.php | 2 | ||||
-rw-r--r-- | include/nav.php | 19 | ||||
-rw-r--r-- | mod/contacts.php | 24 | ||||
-rw-r--r-- | mod/dfrn_notify.php | 2 | ||||
-rw-r--r-- | mod/network.php | 5 | ||||
-rw-r--r-- | mod/profile.php | 11 | ||||
-rw-r--r-- | mod/profile_photo.php | 16 | ||||
-rw-r--r-- | view/atom_feed.tpl | 9 | ||||
-rw-r--r-- | view/contact_edit.tpl | 2 | ||||
-rw-r--r-- | view/directory_item.tpl | 2 | ||||
-rw-r--r-- | view/head.tpl | 16 | ||||
-rw-r--r-- | view/style.css | 24 | ||||
-rw-r--r-- | wip/todo | 10 |
14 files changed, 99 insertions, 45 deletions
diff --git a/.gitignore b/.gitignore index e85d82896..a69789254 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .htconfig.php \#* +wip +include/jquery-1.4.2.min.js
\ No newline at end of file diff --git a/include/items.php b/include/items.php index 937fc39fd..bcfa70763 100644 --- a/include/items.php +++ b/include/items.php @@ -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 ('" diff --git a/include/nav.php b/include/nav.php index b788ed48a..0dc0f6029 100644 --- a/include/nav.php +++ b/include/nav.php @@ -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"; } diff --git a/mod/contacts.php b/mod/contacts.php index 4f48c1c3d..dcbadd2ba 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -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) diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index ead49982b..169ae7bb7 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -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']; diff --git a/mod/network.php b/mod/network.php index 51b528832..845a6bb77 100644 --- a/mod/network.php +++ b/mod/network.php @@ -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'); diff --git a/mod/profile.php b/mod/profile.php index db538750d..bb7357e5b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -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()) { diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 36657ba14..9a694971d 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -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 ); diff --git a/view/atom_feed.tpl b/view/atom_feed.tpl index 00ac6c406..a620a2578 100644 --- a/view/atom_feed.tpl +++ b/view/atom_feed.tpl @@ -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> diff --git a/view/contact_edit.tpl b/view/contact_edit.tpl index 4a94f7083..26ee2ef5c 100644 --- a/view/contact_edit.tpl +++ b/view/contact_edit.tpl @@ -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 diff --git a/view/directory_item.tpl b/view/directory_item.tpl index 295a66451..2494bc4b7 100644 --- a/view/directory_item.tpl +++ b/view/directory_item.tpl @@ -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> diff --git a/view/head.tpl b/view/head.tpl index b384d6fc0..6be3f7940 100644 --- a/view/head.tpl +++ b/view/head.tpl @@ -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> diff --git a/view/style.css b/view/style.css index 58579ae48..bde06ec5c 100644 --- a/view/style.css +++ b/view/style.css @@ -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, @@ -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 |