lotsoflittlestuff

This commit is contained in:
Mike Macgirvin 2010-07-20 05:21:19 -07:00
parent ba8da761e6
commit 466267fbb5
14 changed files with 99 additions and 45 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
.htconfig.php .htconfig.php
\#* \#*
wip
include/jquery-1.4.2.min.js

View file

@ -207,7 +207,7 @@ function post_remote($a,$arr) {
$parent_id = 0; $parent_id = 0;
dbesc_array($arr); dbesc_array($arr);
dbg(3); //dbg(3);
$r = q("INSERT INTO `item` (`" $r = q("INSERT INTO `item` (`"
. implode("`, `", array_keys($arr)) . implode("`, `", array_keys($arr))
. "`) VALUES ('" . "`) VALUES ('"

View file

@ -1,21 +1,28 @@
<?php <?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"; $a->page['nav'] .= "<span id=\"nav-link-wrapper\" >\r\n";
if(($a->module != 'home') && (! (x($_SESSION['uid'])))) 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-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')) { 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"; $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-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";
} }

View file

@ -88,11 +88,11 @@ function contacts_content(&$a) {
} }
$photo = str_replace('-4.jpg', '' , $r[0]['photo']); // $photo = str_replace('-4.jpg', '' , $r[0]['photo']);
$photos = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d", // $photos = q("SELECT `id` FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d",
dbesc($photo), // dbesc($photo),
intval($_SESSION['uid']) // intval($_SESSION['uid'])
); // );
if($cmd == 'block') { if($cmd == 'block') {
$blocked = (($orig_record[0]['blocked']) ? 0 : 1); $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", $r = q("DELETE FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($contact_id), intval($contact_id),
intval($_SESSION['uid'])); intval($_SESSION['uid']));
if(count($photos)) {
foreach($photos as $p) { // if(count($photos)) {
q("DELETE FROM `photos` WHERE `id` = %d LIMIT 1", // foreach($photos as $p) {
$p['id']); // q("DELETE FROM `photos` WHERE `id` = %d LIMIT 1",
} // $p['id']);
} // }
// }
if(intval($contact_id)) if(intval($contact_id))
q("DELETE FROM `item` WHERE `contact-id` = %d LIMIT 1", q("DELETE FROM `item` WHERE `contact-id` = %d LIMIT 1",
intval($contact_id) intval($contact_id)

View file

@ -5,7 +5,7 @@ require_once('include/items.php');
function dfrn_notify_post(&$a) { function dfrn_notify_post(&$a) {
dbg(3);
$dfrn_id = notags(trim($_POST['dfrn_id'])); $dfrn_id = notags(trim($_POST['dfrn_id']));
$challenge = notags(trim($_POST['challenge'])); $challenge = notags(trim($_POST['challenge']));
$data = $_POST['data']; $data = $_POST['data'];

View file

@ -15,6 +15,11 @@ function network_content(&$a) {
$contact_id = $a->cid; $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'); $tpl = file_get_contents('view/jot-header.tpl');

View file

@ -126,9 +126,18 @@ function profile_content(&$a) {
// Profile owner - everything is visible // 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 = ''; $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 // authenticated visitor - here lie dragons
elseif(remote_user()) { elseif(remote_user()) {
$gs = '<<>>'; // should be impossible to match $gs = '<<>>'; // should be impossible to match

View file

@ -4,17 +4,17 @@ require_once("Photo.php");
function profile_photo_init(&$a) { function profile_photo_init(&$a) {
if((! local_user()) { if(! local_user()) {
return; return;
} }
require_once("mod/profile.php"); require_once("mod/profile.php");
profile_load($a,$_SESSION['uid']); profile_load($a,$a->user['nickname']);
} }
function profile_photo_post(&$a) { function profile_photo_post(&$a) {
if((! local_user()) { if(! local_user()) {
notice ( "Permission denied." . EOL ); notice ( "Permission denied." . EOL );
return; return;
} }
@ -63,7 +63,7 @@ function profile_photo_post(&$a) {
dbesc($base_image['filename']), dbesc($base_image['filename']),
intval($im->getHeight()), intval($im->getHeight()),
intval($im->getWidth()), intval($im->getWidth()),
dbesc($im->imageString() dbesc($im->imageString())
); );
if($r === false) if($r === false)
@ -81,7 +81,7 @@ function profile_photo_post(&$a) {
dbesc($base_image['filename']), dbesc($base_image['filename']),
intval($im->getHeight()), intval($im->getHeight()),
intval($im->getWidth()), intval($im->getWidth()),
dbesc($im->imageString() dbesc($im->imageString())
); );
if($r === false) if($r === false)
@ -89,10 +89,10 @@ function profile_photo_post(&$a) {
// Unset the profile photo flag from any other photos I own // 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']), dbesc($base_image['resource-id']),
intval($_SESSION['uid']) intval($_SESSION['uid'])
) );
} }
goaway($a->get_baseurl() . '/profiles'); goaway($a->get_baseurl() . '/profiles');
@ -160,7 +160,7 @@ function profile_photo_post(&$a) {
dbesc(basename($filename)), dbesc(basename($filename)),
intval($ph->getHeight()), intval($ph->getHeight()),
intval($ph->getWidth()), intval($ph->getWidth()),
dbesc($ph->imageString() dbesc($ph->imageString())
); );
if($r === false) if($r === false)
notice("Image size reduction (640) failed." . EOL ); notice("Image size reduction (640) failed." . EOL );

View file

@ -6,10 +6,15 @@
<id>$feed_id</id> <id>$feed_id</id>
<title>$feed_title</title> <title>$feed_title</title>
<icon>$photo</icon>
<dfrn:icon-updated>0000-00-00T00:00:00Z</dfrn:icon-updated>
<updated>$feed_updated</updated> <updated>$feed_updated</updated>
<author> <author>
<name>$name</name> <name>$name</name>
<dfrn:name-updated>0000-00-00T00:00:00Z</dfrn:name-updated>
<uri>$profile_page</uri> <uri>$profile_page</uri>
<dfrn:avatar>$photo</dfrn:avatar> <dfrn:uri-updated>0000-00-00T00:00:00Z</dfrn:uri-updated>
</author> <dfrn:avatar>$thumb</dfrn:avatar>
<dfrn:avatar-updated>0000-00-00T00:00:00Z</dfrn:avatar-updated>
</author>

View file

@ -30,7 +30,7 @@ $blocked
<div id="contact-edit-profile-select-text"> <div id="contact-edit-profile-select-text">
<h4>Profile Visibility</h4> <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> </p>
</div> </div>
$profile_select $profile_select

View file

@ -1,7 +1,7 @@
<div class="directory-item" id="directory-item-$id" > <div class="directory-item" id="directory-item-$id" >
<div class="directory-photo-wrapper" id="directory-photo-wrapper-$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> </div>
<div class="directory-photo-end"></div> <div class="directory-photo-end"></div>

View file

@ -9,7 +9,7 @@
<script type="text/javascript" src="$baseurl/include/main.js" ></script> <script type="text/javascript" src="$baseurl/include/main.js" ></script>
<script type="text/javascript"> <script type="text/javascript">
// $(document).ready(function() { setTimeout(NavUpdate,10 * 1000); }); $(document).ready(function() { NavUpdate(); });
function NavUpdate() function NavUpdate()
{ {
@ -17,10 +17,20 @@ function NavUpdate()
{ {
$(data).find('result').each(function() { $(data).find('result').each(function() {
var net = $(this).find('net').text(); 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> </script>

View 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 { .nav-commlink {
float: left; float: left;
margin-left: 10px; margin-left: 10px;
@ -597,6 +613,11 @@ input#dfrn-url {
#directory-search-end { #directory-search-end {
} }
.directory-photo-img {
border: none;
}
.pager { .pager {
padding: 10px; padding: 10px;
text-align: center; text-align: center;
@ -835,6 +856,9 @@ input#dfrn-url {
overflow: auto; overflow: auto;
} }
#group-new-submit-wrapper {
margin-top: 30px;
}
#acl-allow-group-label, #acl-allow-group-label,
#acl-allow-contact-label, #acl-allow-contact-label,

View file

@ -1,12 +1,5 @@
profile photo to self contact page? - resolve profile photo inconsistency finish one world photo resolution (update timestamps in atom feeds)
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?
>>>>>>>>contact editor >>>>>>>>contact editor
>>>>>>>> block photo >>>>>>>> block photo
@ -40,7 +33,6 @@ admin approved registration (requires admin)
atom elements atom elements
thread
tombstone tombstone
activity activity