aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_notify.php20
-rw-r--r--mod/item.php21
-rw-r--r--mod/photos.php29
3 files changed, 44 insertions, 26 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php
index 2ac98af59..089e508ad 100644
--- a/mod/dfrn_notify.php
+++ b/mod/dfrn_notify.php
@@ -68,7 +68,7 @@ function dfrn_notify_post(&$a) {
$msg['uri'] = notags(unxmlify($base['id'][0]['data']));
$msg['parent-uri'] = notags(unxmlify($base['in-reply-to'][0]['data']));
$msg['created'] = datetime_convert(notags(unxmlify('UTC','UTC',$base['sentdate'][0]['data'])));
-
+
dbesc_array($msg);
$r = q("INSERT INTO `mail` (`" . implode("`, `", array_keys($msg))
@@ -124,16 +124,18 @@ function dfrn_notify_post(&$a) {
);
if(count($r)) {
if($r[0]['uri'] == $r[0]['parent-uri']) {
- $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
+ $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
WHERE `parent-uri` = '%s'",
dbesc($when),
+ dbesc(datetime_convert()),
dbesc($r[0]['uri'])
);
}
else {
- $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s'
+ $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s'
WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
dbesc($when),
+ dbesc(datetime_convert()),
dbesc($uri),
intval($importer['importer_uid'])
);
@@ -166,12 +168,14 @@ function dfrn_notify_post(&$a) {
intval($importer['importer_uid'])
);
if(count($r)) {
- $r1 = q("UPDATE `item` SET `last-child` = 0 WHERE `uid` = %d AND `parent` = %d",
+ $r1 = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `uid` = %d AND `parent` = %d",
+ dbesc(datetime_convert()),
intval($importer['importer_uid']),
intval($r[0]['parent'])
);
}
- $r2 = q("UPDATE `item` SET `last-child` = 1 WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ $r2 = q("UPDATE `item` SET `last-child` = 1, `changed` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
+ dbesc(datetime_convert()),
intval($importer['importer_uid']),
intval($posted_id)
);
@@ -214,8 +218,9 @@ function dfrn_notify_post(&$a) {
if(count($r)) {
$allow = $item->get_item_tags( NAMESPACE_DFRN, 'comment-allow');
if($allow && $allow[0]['data'] != $r[0]['last-child']) {
- $r = q("UPDATE `item` SET `last-child` = %d WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `last-child` = %d, `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
intval($allow[0]['data']),
+ dbesc(datetime_convert()),
dbesc($item_id),
intval($importer['importer_uid'])
);
@@ -272,8 +277,9 @@ function dfrn_notify_post(&$a) {
if(count($r)) {
$allow = $item->get_item_tags( NAMESPACE_DFRN, 'comment-allow');
if($allow && $allow[0]['data'] != $r[0]['last-child']) {
- $r = q("UPDATE `item` SET `last-child` = %d WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `last-child` = %d, `changed` = '%s' WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
intval($allow[0]['data']),
+ dbesc(datetime_convert()),
dbesc($item_id),
intval($importer['importer_uid'])
);
diff --git a/mod/item.php b/mod/item.php
index 5b81f13ee..812216426 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -143,8 +143,8 @@ function item_post(&$a) {
$r = q("INSERT INTO `item` (`uid`,`type`,`contact-id`,`owner-name`,`owner-link`,`owner-avatar`,
`author-name`, `author-link`, `author-avatar`, `created`,
- `edited`, `uri`, `title`, `body`, `location`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
- VALUES( %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
+ `edited`, `changed`, `uri`, `title`, `body`, `location`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
+ VALUES( %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
intval($profile_uid),
dbesc($post_type),
intval($contact_id),
@@ -154,8 +154,9 @@ function item_post(&$a) {
dbesc($author['name']),
dbesc($author['url']),
dbesc($author['thumb']),
- datetime_convert(),
- datetime_convert(),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbesc($uri),
dbesc($title),
dbesc($body),
@@ -173,7 +174,8 @@ function item_post(&$a) {
if($parent) {
// This item is the last leaf and gets the comment box, clear any ancestors
- $r = q("UPDATE `item` SET `last-child` = 0 WHERE `parent` = %d ",
+ $r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent` = %d ",
+ dbesc(datetime_convert()),
intval($parent)
);
@@ -227,10 +229,11 @@ function item_post(&$a) {
}
}
- $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `last-child` = 1, `visible` = 1
+ $r = q("UPDATE `item` SET `parent` = %d, `parent-uri` = '%s', `changed` = '%s', `last-child` = 1, `visible` = 1
WHERE `id` = %d LIMIT 1",
intval($parent),
dbesc(($parent == $post_id) ? $uri : $parent_item['uri']),
+ dbesc(datetime_convert()),
intval($post_id)
);
// photo comments turn the corresponding item visible to the profile wall
@@ -279,7 +282,8 @@ function item_content(&$a) {
// delete the item
- $r = q("UPDATE `item` SET `deleted` = 1, `body` = '', `edited` = '%s' WHERE `id` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `deleted` = 1, `body` = '', `edited` = '%s', `changed` = '%s' WHERE `id` = %d LIMIT 1",
+ dbesc(datetime_convert()),
dbesc(datetime_convert()),
intval($item['id'])
);
@@ -300,9 +304,10 @@ function item_content(&$a) {
// If it's the parent of a comment thread, kill all the kids
if($item['uri'] == $item['parent-uri']) {
- $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `body` = ''
+ $r = q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s', `body` = ''
WHERE `parent-uri` = '%s' AND `uid` = %d ",
dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbesc($item['parent-uri']),
intval($item['uid'])
);
diff --git a/mod/photos.php b/mod/photos.php
index bbc9c2df5..0558f746a 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -117,7 +117,8 @@ function photos_post(&$a) {
);
if(count($r)) {
foreach($r as $rr) {
- q("UPDATE `item` SET `deleted` = 1 WHERE `parent-uri` = '%s' AND `uid` = %d",
+ q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
+ dbesc(datetime_convert()),
dbesc($rr['parent-uri']),
intval($_SESSION['uid'])
);
@@ -153,7 +154,9 @@ function photos_post(&$a) {
intval($_SESSION['uid'])
);
if(count($i)) {
- q("UPDATE `item` SET `deleted` = 1 WHERE `parent-uri` = '%s' AND `uid` = %d",
+ q("UPDATE `item` SET `deleted` = 1, `edited` = '%s', `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbesc($i[0]['uri']),
intval($_SESSION['uid'])
);
@@ -219,8 +222,8 @@ function photos_post(&$a) {
$r = q("INSERT INTO `item` (`uid`, `type`, `resource-id`, `contact-id`,
`owner-name`,`owner-link`,`owner-avatar`, `created`,
- `edited`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
- VALUES( %d, '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
+ `edited`, `changed`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`)
+ VALUES( %d, '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' )",
intval($_SESSION['uid']),
dbesc('photo'),
dbesc($p[0]['resource-id']),
@@ -228,8 +231,9 @@ function photos_post(&$a) {
dbesc($contact_record['name']),
dbesc($contact_record['url']),
dbesc($contact_record['thumb']),
- datetime_convert(),
- datetime_convert(),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbesc($uri),
dbesc($uri),
dbesc($title),
@@ -254,8 +258,10 @@ function photos_post(&$a) {
}
}
- $r = q("UPDATE `item` SET `tag` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ $r = q("UPDATE `item` SET `tag` = '%s', `edited` = '%s', `changed` = '%s' WHERE `id` = %d AND `uid` = %d LIMIT 1",
dbesc($tags),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
intval($item_id),
intval($_SESSION['uid'])
);
@@ -386,8 +392,8 @@ function photos_post(&$a) {
$r = q("INSERT INTO `item` (`uid`, `type`, `resource-id`, `contact-id`,`owner-name`,`owner-link`,`owner-avatar`, `created`,
- `edited`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `visible`)
- VALUES( %d, '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
+ `edited`, `changed`, `uri`, `parent-uri`, `title`, `body`, `allow_cid`, `allow_gid`, `deny_cid`, `deny_gid`, `visible`)
+ VALUES( %d, '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d )",
intval($_SESSION['uid']),
dbesc('photo'),
dbesc($photo_hash),
@@ -395,8 +401,9 @@ function photos_post(&$a) {
dbesc($contact_record['name']),
dbesc($contact_record['url']),
dbesc($contact_record['thumb']),
- datetime_convert(),
- datetime_convert(),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
dbesc($uri),
dbesc($uri),
dbesc($title),