From 466267fbb5b5cc466196e40b6a8fe96f25c57e2f Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Tue, 20 Jul 2010 05:21:19 -0700 Subject: [PATCH] lotsoflittlestuff --- .gitignore | 2 ++ include/items.php | 2 +- include/nav.php | 19 ++++++++++++------- mod/contacts.php | 24 +++++++++++++----------- mod/dfrn_notify.php | 2 +- mod/network.php | 5 +++++ mod/profile.php | 11 ++++++++++- mod/profile_photo.php | 16 ++++++++-------- view/atom_feed.tpl | 9 +++++++-- view/contact_edit.tpl | 2 +- view/directory_item.tpl | 2 +- view/head.tpl | 16 +++++++++++++--- view/style.css | 24 ++++++++++++++++++++++++ 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 @@ page['nav'] .= "Logout\r\n"; +} + $a->page['nav'] .= "\r\n"; if(($a->module != 'home') && (! (x($_SESSION['uid'])))) $a->page['nav'] .= "Home\r\n"; - $a->page['nav'] .= "Site Directory\r\n"; + $a->page['nav'] .= "Site Directory\r\n"; if(x($_SESSION,'uid')) { - $a->page['nav'] .= "Notifications\r\n"; + $a->page['nav'] .= "Network\r\n"; - $a->page['nav'] .= "Messages\r\n"; + $a->page['nav'] .= "user['nickname']}\">Home\r\n"; + + $a->page['nav'] .= "Notifications\r\n"; + + $a->page['nav'] .= "Messages\r\n"; - $a->page['nav'] .= "
\r\n"; - $a->page['nav'] .= "Logout\r\n"; $a->page['nav'] .= "Settings\r\n"; @@ -23,9 +30,7 @@ $a->page['nav'] .= "Contacts\r\n"; - $a->page['nav'] .= "user['nickname']}\">Home\r\n"; - $a->page['nav'] .= "Network\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 @@ $feed_id $feed_title + $photo + 0000-00-00T00:00:00Z $feed_updated $name + 0000-00-00T00:00:00Z $profile_page - $photo - + 0000-00-00T00:00:00Z + $thumb + 0000-00-00T00:00:00Z + 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

Profile Visibility

-

Please choose the profile you would like to display to $name - when he/she connects securely to your profile page. +

Please choose the profile you would like to display to $name when viewing your profile securely.

$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 @@
-
$alt-text +
$alt-text
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 @@ 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, diff --git a/wip/todo b/wip/todo index be2a38159..9bee34488 100644 --- 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