Browse Source

lotsoflittlestuff

pull/1/head
Mike Macgirvin 11 years ago
parent
commit
466267fbb5
  1. 2
      .gitignore
  2. 2
      include/items.php
  3. 19
      include/nav.php
  4. 24
      mod/contacts.php
  5. 2
      mod/dfrn_notify.php
  6. 5
      mod/network.php
  7. 11
      mod/profile.php
  8. 16
      mod/profile_photo.php
  9. 9
      view/atom_feed.tpl
  10. 2
      view/contact_edit.tpl
  11. 2
      view/directory_item.tpl
  12. 16
      view/head.tpl
  13. 24
      view/style.css
  14. 10
      wip/todo

2
.gitignore

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

2
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 ('"

19
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";
}

24
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)

2
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'];

5
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');

11
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()) {

16
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 );

9
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>

2
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

2
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>

16
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>

24
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,

10
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

Loading…
Cancel
Save