public static function setWatching(GWF_ForumThread $thread, $cut) { $tid = $thread->getID(); # Insert current spectator // GDO::table(__CLASS__); $row = new self(array('fowa_sess' => GWF_Session::getSessID(), 'fowa_time' => time(), 'fowa_tid' => $tid)); if (false === $row->replace()) { return false; } # Delete old $cut = time() - $cut; if (false === $row->deleteWhere("fowa_time<{$cut}")) { return false; } # Set new amount if (false === $thread->saveVar('thread_watchers', $row->countRows("fowa_tid={$tid}"))) { return false; } return true; }
public static function unsubscribeAll($userid) { $userid = (int) $userid; $table = new self(false); return $table->deleteWhere("subscr_uid={$userid}"); }