More "LIMIT 1" removed - and some other SQL improvements.
This commit is contained in:
parent
9f4ef7c105
commit
6e7bd68ebb
34 changed files with 271 additions and 258 deletions
10
mod/like.php
10
mod/like.php
|
|
@ -109,7 +109,7 @@ function like_content(&$a) {
|
|||
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
|
||||
|
||||
|
||||
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
|
||||
$r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0
|
||||
AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
|
||||
dbesc($activity),
|
||||
intval($contact['id']),
|
||||
|
|
@ -121,7 +121,7 @@ function like_content(&$a) {
|
|||
$like_item = $r[0];
|
||||
|
||||
// Already voted, undo it
|
||||
$r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
|
||||
$r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d",
|
||||
dbesc(datetime_convert()),
|
||||
intval($like_item['id'])
|
||||
);
|
||||
|
|
@ -207,14 +207,14 @@ EOT;
|
|||
$arr['unseen'] = 1;
|
||||
$arr['last-child'] = 0;
|
||||
|
||||
$post_id = item_store($arr);
|
||||
$post_id = item_store($arr);
|
||||
|
||||
if(! $item['visible']) {
|
||||
$r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
$r = q("UPDATE `item` SET `visible` = 1 WHERE `id` = %d AND `uid` = %d",
|
||||
intval($item['id']),
|
||||
intval($owner_uid)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Save the author information for the like in case we need to relay to Diaspora
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue