Changeset 77 for taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/files/lib/acp/action/UpdateTaggingReloadedAction.class.php
- Timestamp:
- 11/03/07 18:55:26 (6 years ago)
- Files:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/files/lib/acp/action/UpdateTaggingReloadedAction.class.php
r68 r77 16 16 public $everything = true; 17 17 18 protected function buildQuery() { 18 /** 19 * 20 * @param count 21 */ 22 protected function buildQuery($count=false) { 19 23 if($this->everything) { 20 $ sql = "SELECTpostID,24 $columns = " postID, 21 25 threadID, 22 message 26 message"; 27 28 $sql = "SELECT ".($count?'COUNT(*) AS count':$columns)." 23 29 FROM wbb".WBB_N."_post 24 30 ORDER BY threadID ASC, … … 27 33 OFFSET ".($this->limit * $this->loop); 28 34 } else { 29 $ sql = "SELECTp2.postID,35 $columns = " p2.postID, 30 36 p2.threadID, 31 p2.message 37 p2.message"; 38 39 $sql = "SELECT ".($count?'COUNT(*) AS count':$columns)." 32 40 FROM wbb".WBB_N."_post p 33 41 JOIN wbb".WBB_N."_thread t … … 37 45 WHERE p.systemTagged = 0 38 46 ORDER BY p2.threadID ASC, 39 p2.postID DESC"; 47 p2.postID DESC 48 LIMIT ".$this->limit." 49 OFFSET ".($this->limit * $this->loop); 40 50 } 41 51 … … 50 60 $threadIDs = array(); 51 61 $systemTaggerUserID = -1; 62 $text = ''; 63 64 // count board 65 $sql = $this->buildQuery(true); 66 $row = WCF::getDB()->getFirstRow($sql); 67 $count = $row['count']; 52 68 53 69 // get all posts … … 59 75 $threadID = $row['threadID']; 60 76 $threadIDs[] = $threadID; 61 62 77 $msg = TaggingReloadedUtil::bbcode2text($row['message']); 63 78 $text .= $msg; … … 66 81 $tags = TaggingReloadedUtil::text2tags($text); 67 82 $first_post = $row['postID']; 68 83 69 84 // CLEANUP system tags 70 85 $sql = "DELETE FROM wbb".WBB_N."_taggingreloaded, 71 86 wcf".WCF_N."_taggingreloaded 72 USING wbb".WBB_N."_taggingreloaded wbb73 NATURAL JOIN wcf".WCF_N."_taggingreloaded wcf74 JOIN wbb".WBB_N."_post p75 ON wbb .postID = p.postID76 WHERE userID = {$systemTaggerUserID}77 AND p.threadID = {$threadID};";87 USING wbb".WBB_N."_taggingreloaded 88 NATURAL JOIN wcf".WCF_N."_taggingreloaded 89 JOIN wbb".WBB_N."_post 90 ON wbb".WBB_N."_taggingreloaded.postID = wbb".WBB_N."_post.postID 91 WHERE wcf".WCF_N."_taggingreloaded.userID = {$systemTaggerUserID} 92 AND wbb".WBB_N."_post.threadID = {$threadID};"; 78 93 79 WBBCore::getDB()->sendQuery($sql); 80 94 WCF::getDB()->sendQuery($sql); 81 95 if(count($tags) > 0) { 82 96 $sql = "SELECT taggingID … … 94 108 VALUES ({$first_post});"; 95 109 96 W BBCore::getDB()->sendQuery($sql);110 WCF::getDB()->sendQuery($sql); 97 111 $taggingID = WBBCore::getDB()->getInsertID(); 98 112 } … … 109 123 systemTagged = 1 110 124 WHERE threadID IN (".implode(',', $threadIDs)."); "; 111 W BBCore::getDB()->sendQuery($sql);125 WCF::getDB()->sendQuery($sql); 112 126 113 127 $this->executed(); 128 129 if($this->everything) { 114 130 115 if($this->everything) {116 131 $this->calcProgress(($this->limit * $this->loop), $count); 117 132 $this->nextLoop();
