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/mood.php
10
mod/mood.php
|
|
@ -12,8 +12,8 @@ function mood_init(&$a) {
|
|||
|
||||
$uid = local_user();
|
||||
$verb = notags(trim($_GET['verb']));
|
||||
|
||||
if(! $verb)
|
||||
|
||||
if(! $verb)
|
||||
return;
|
||||
|
||||
$verbs = get_mood_verbs();
|
||||
|
|
@ -30,7 +30,7 @@ function mood_init(&$a) {
|
|||
|
||||
|
||||
if($parent) {
|
||||
$r = q("select uri, private, allow_cid, allow_gid, deny_cid, deny_gid
|
||||
$r = q("select uri, private, allow_cid, allow_gid, deny_cid, deny_gid
|
||||
from item where id = %d and parent = %d and uid = %d limit 1",
|
||||
intval($parent),
|
||||
intval($parent),
|
||||
|
|
@ -90,7 +90,7 @@ function mood_init(&$a) {
|
|||
|
||||
$item_id = item_store($arr);
|
||||
if($item_id) {
|
||||
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||
q("UPDATE `item` SET `plink` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
dbesc($a->get_baseurl() . '/display/' . $poster['nickname'] . '/' . $item_id),
|
||||
intval($uid),
|
||||
intval($item_id)
|
||||
|
|
@ -139,4 +139,4 @@ function mood_content(&$a) {
|
|||
|
||||
return $o;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue