mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 01:25:21 +02:00
Merge pull request #3622 from annando/new-dba
Enhanced dba functions, several replaced database calls
This commit is contained in:
commit
e6e8ebbac5
16 changed files with 183 additions and 367 deletions
|
@ -423,9 +423,7 @@ function display_content(App $a, $update = 0) {
|
|||
intval($r[0]['parent']));
|
||||
|
||||
if ($unseen) {
|
||||
q("UPDATE `item` SET `unseen` = 0 WHERE `parent` = %d AND `unseen`",
|
||||
intval($r[0]['parent'])
|
||||
);
|
||||
dba::update('item', array('unseen' => false), array('parent' => $r[0]['parent'], 'unseen' => true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -794,18 +794,12 @@ function network_content(App $a, $update = 0) {
|
|||
|
||||
|
||||
if (!$group && !$cid && !$star) {
|
||||
|
||||
$unseen = q("SELECT `id` FROM `item` WHERE `unseen` AND `uid` = %d LIMIT 1",
|
||||
intval(local_user()));
|
||||
$unseen = dba::select('item', array('id'), array('unseen' => true, 'uid' => local_user()), array('limit' => 1));
|
||||
|
||||
if (dbm::is_result($unseen)) {
|
||||
$r = q("UPDATE `item` SET `unseen` = 0
|
||||
WHERE `unseen` = 1 AND `uid` = %d",
|
||||
intval(local_user())
|
||||
);
|
||||
$r = dba::update('item', array('unseen' => false), array('uid' => local_user(), 'unseen' => true));
|
||||
}
|
||||
} elseif ($update_unseen) {
|
||||
|
||||
$unseen = q("SELECT `id` FROM `item` ".$update_unseen. " LIMIT 1");
|
||||
|
||||
if (dbm::is_result($unseen)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue