aboutsummaryrefslogtreecommitdiffstats
path: root/mod/item.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-08-04 20:03:38 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-08-04 20:03:38 -0700
commitd090033a0aab7197af9dc7f3e2cf21ebdf042b21 (patch)
treedb177b9ce7292b8972a29efcb85f83a3b2dc6470 /mod/item.php
parent3540ada84ff9c64a0c4f8354cbc69032281907f2 (diff)
downloadvolse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.tar.gz
volse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.tar.bz2
volse-hubzilla-d090033a0aab7197af9dc7f3e2cf21ebdf042b21.zip
more photo progress
Diffstat (limited to 'mod/item.php')
-rw-r--r--mod/item.php18
1 files changed, 16 insertions, 2 deletions
diff --git a/mod/item.php b/mod/item.php
index 49067d940..5f53eccf3 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -23,7 +23,7 @@ function item_post(&$a) {
intval($parent)
);
if(! count($r)) {
- notice("Unable to locate original post." . EOL);
+ notice( t('Unable to locate original post.') . EOL);
goaway($a->get_baseurl() . "/" . $_POST['return'] );
}
$parent_item = $r[0];
@@ -68,7 +68,7 @@ function item_post(&$a) {
$body = escape_tags(trim($_POST['body']));
if(! strlen($body)) {
- notice("Empty post discarded." . EOL );
+ notice( t('Empty post discarded.') . EOL );
goaway($a->get_baseurl() . "/" . $_POST['return'] );
}
@@ -221,6 +221,19 @@ function item_content(&$a) {
intval($item['id'])
);
+ // If item is a link to a photo resource, nuke all the associated photos
+ // (visitors will not have photo resources)
+ // This only applies to photos uploaded from the photos page. Photos inserted into a post do not
+ // generate a resource-id and therefore aren't intimately linked to the item.
+
+ if(strlen($item['resource-id'])) {
+ $q("DELETE FROM `photo` WHERE `resource-id` = '%s' AND `uid` = %d ",
+ dbesc($item['resource-id']),
+ intval($item['uid'])
+ );
+ // ignore the result
+ }
+
// If it's the parent of a comment thread, kill all the kids
if($item['uri'] == $item['parent-uri']) {
@@ -230,6 +243,7 @@ function item_content(&$a) {
dbesc($item['parent-uri']),
intval($item['uid'])
);
+ // ignore the result
}
$url = $a->get_baseurl();