aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-08 21:08:50 -0700
committerfriendica <info@friendica.com>2014-09-08 21:08:50 -0700
commitb7c1ad8cb2d50da98d38166500c83e17c611e163 (patch)
tree7eaa0058f4fa275023aea0df12cc384b067f1e91 /include/diaspora.php
parent21290bffce4420ab78167531bd9c4163ed61f740 (diff)
downloadvolse-hubzilla-b7c1ad8cb2d50da98d38166500c83e17c611e163.tar.gz
volse-hubzilla-b7c1ad8cb2d50da98d38166500c83e17c611e163.tar.bz2
volse-hubzilla-b7c1ad8cb2d50da98d38166500c83e17c611e163.zip
diaspora_like - sql error
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php37
1 files changed, 15 insertions, 22 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 0d797d915..9a85a0587 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1684,36 +1684,29 @@ function diaspora_photo($importer,$xml,$msg,$attempt=1) {
return 202;
}
- $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `mid` = '%s' LIMIT 1",
intval($importer['channel_id']),
dbesc($status_message_guid)
);
- if(! count($r)) {
- if($attempt <= 3) {
- q("INSERT INTO dsprphotoq (uid, msg, attempt) VALUES (%d, '%s', %d)",
- intval($importer['channel_id']),
- dbesc(serialize($msg)),
- intval($attempt + 1)
- );
- }
+ if(! $r) {
logger('diaspora_photo: attempt = ' . $attempt . '; status message not found: ' . $status_message_guid . ' for photo: ' . $guid);
return;
}
- $parent_item = $r[0];
+// $parent_item = $r[0];
- $link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
+// $link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
- $link_text = scale_external_images($link_text, true,
- array($remote_photo_name, 'scaled_full_' . $remote_photo_name));
+// $link_text = scale_external_images($link_text, true,
+// array($remote_photo_name, 'scaled_full_' . $remote_photo_name));
- if(strpos($parent_item['body'],$link_text) === false) {
- $r = q("update item set `body` = '%s', `visible` = 1 where `id` = %d and `uid` = %d",
- dbesc($link_text . $parent_item['body']),
- intval($parent_item['id']),
- intval($parent_item['uid'])
- );
- }
+// if(strpos($parent_item['body'],$link_text) === false) {
+// $r = q("update item set `body` = '%s', `visible` = 1 where `id` = %d and `uid` = %d",
+// dbesc($link_text . $parent_item['body']),
+// intval($parent_item['id']),
+// intval($parent_item['uid'])
+// );
+// }
return;
}
@@ -1750,7 +1743,7 @@ function diaspora_like($importer,$xml,$msg) {
return 202;
}
- $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `mid` = '%s' LIMIT 1",
intval($importer['channel_id']),
dbesc($parent_guid)
);
@@ -1761,7 +1754,7 @@ function diaspora_like($importer,$xml,$msg) {
$parent_item = $r[0];
- $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `guid` = '%s' LIMIT 1",
+ $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `mid` = '%s' LIMIT 1",
intval($importer['channel_id']),
dbesc($guid)
);