]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - scripts/inbox_users.php
Changing opacity to 1 only on the hovered notice item
[quix0rs-gnu-social.git] / scripts / inbox_users.php
index b74a212dccd0379374444e0a443f7f82baf1b6f6..7d14f0efe6258fd85e8fd5ac591148ebd0b6a7d3 100755 (executable)
@@ -62,7 +62,7 @@ foreach ($ids as $id) {
        $old_inbox = new Notice_inbox();
        $old_inbox->user_id = $user->id;
        
-       $result = $inbox->delete();
+       $result = $old_inbox->delete();
        
        if (is_null($result) || $result === false) {
                common_log_db_error($old_inbox, 'DELETE', __FILE__);
@@ -78,11 +78,12 @@ foreach ($ids as $id) {
                                                        'FROM subscription JOIN notice ON subscription.subscribed = notice.profile_id ' .
                                                        'WHERE subscription.subscriber = ' . $user->id . ' ' .
                                                        'AND notice.created >= subscription.created ' .
-                                                       'AND now() - notice.created < ' . (7 * 24 * 3600) . ' ' .
                                                        'AND NOT EXISTS (SELECT user_id, notice_id ' .
                                                        'FROM notice_inbox ' .
                                                        'WHERE user_id = ' . $user->id . ' ' . 
-                                                       'AND notice_id = notice.id)');
+                                                       'AND notice_id = notice.id) ' .
+                                                       'ORDER BY notice.created DESC ' .
+                                                       'LIMIT 0, 1000');
        
        if (is_null($result) || $result === false) {
                common_log_db_error($inbox, 'INSERT', __FILE__);
@@ -105,5 +106,6 @@ foreach ($ids as $id) {
        
        if ($cache) {
                $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id));
+               $cache->delete(common_cache_key('user:notices_with_friends:' . $user->id . ';last'));
        }
 }