/** * @see Action::execute() */ public function execute() { parent::execute(); // count threads $sql = "SELECT\tCOUNT(*) AS count\n\t\t\tFROM\twcf" . WCF_N . "_attachment\n\t\t\tWHERE\tisImage = 1"; $row = WCF::getDB()->getFirstRow($sql); $count = $row['count']; // get attachments $threadIDs = ''; $sql = "SELECT\t\t*\n\t\t\tFROM\t\twcf" . WCF_N . "_attachment\n\t\t\tWHERE\t\tisImage = 1\n\t\t\tORDER BY\tattachmentID"; $result = WCF::getDB()->sendQuery($sql, $this->limit, $this->limit * $this->loop); if (!WCF::getDB()->countRows($result)) { $this->calcProgress(); $this->finish(); } while ($row = WCF::getDB()->fetchArray($result)) { $attachment = new AttachmentEditor(null, $row); $attachment->createThumbnail(); } $this->executed(); $this->calcProgress($this->limit * $this->loop, $count); $this->nextLoop(); }