lotsoflittlestuff
This commit is contained in:
parent
ba8da761e6
commit
466267fbb5
14 changed files with 99 additions and 45 deletions
|
@ -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)
|
||||
|
|
|
@ -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'];
|
||||
|
|
|
@ -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');
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue