Changeset 330
- Timestamp:
- 03/15/08 20:34:30 (5 years ago)
- Location:
- taggingreloaded
- Files:
-
- 4 added
- 2 modified
-
files/lib/page/TaggingPage.class.php (modified) (1 diff)
-
files/lib/system/cache (added)
-
files/lib/system/cache/CacheBuilderTaggingReloadedTagging.class.php (added)
-
optionals/de.easy-coding.wbb.taggingreloaded/files/lib/system/cache (added)
-
optionals/de.easy-coding.wbb.taggingreloaded/files/lib/system/cache/CacheBuilderBuddylooWhiteList.class.php (added)
-
optionals/de.easy-coding.wbb.taggingreloaded/files/lib/system/event/listener/TaggingReloadedWBBPageListener.class.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
taggingreloaded/files/lib/page/TaggingPage.class.php
r172 r330 34 34 35 35 if(empty($this->tag)) { 36 // order by weight and cut 37 $sql = "SELECT tag, 38 SUM(weight) AS weight 39 FROM wcf".WCF_N."_taggingreloaded wcf 40 GROUP BY tag 41 ORDER BY weight DESC 42 LIMIT 200"; 43 // SUM( weight ) * IF(COUNT(tag), 1.2, 1 ) 36 $minLifetime = 0; 37 $maxLifetime = 43200; // 12h 44 38 45 // order by tag 46 $sql = "SELECT tag,weight FROM ($sql) A ORDER BY tag ASC"; 39 WCF::getCache()->addResource( 40 'taggingreloaded.wcf.taggingpage', 41 WCF_DIR.'cache/cache.taggingreloaded.wcf.taggingpage.php', 42 WCF_DIR.'lib/system/cache/CacheBuilderTaggingReloadedTagging.class.php', 43 $minLifetime, 44 $maxLifetime 45 ); 47 46 48 // query 49 $result = WCF::getDB()->sendQuery($sql); 50 while ($row = WCF::getDB()->fetchArray($result)) { 51 $this->tags[$row['tag']] = array( 52 'weight'=> $row['weight'], 53 'color'=> 0, 54 'size'=> 0, 55 'url' => $this->rewriter->publicParseTagURLs($row['tag']) 56 ); 57 } 58 47 $this->tags = WCF::getCache()->get('taggingreloaded.wcf.taggingpage'); 59 48 $this->tags = TaggingReloadedUtil::beautify($this->tags); 60 49 } -
taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/files/lib/system/event/listener/TaggingReloadedWBBPageListener.class.php
r178 r330 7 7 require_once(WCF_DIR.'lib/util/TaggingReloadedUtil.class.php'); 8 8 require_once(WCF_DIR.'lib/system/event/listener/TaggingReloadedPageListener.class.php'); 9 require_once(WBB_DIR.'lib/data/board/BoardListTaggingReloaded.class.php');10 9 11 10 // seo imports … … 49 48 50 49 /** 51 * reads by board52 */53 protected function queryTagsByBoard() {54 // order by weight and cut55 $sql = "SELECT tag,56 SUM(weight) AS weight57 FROM wcf".WCF_N."_taggingreloaded wcf58 NATURAL JOIN wbb".WBB_N."_taggingreloaded wbb59 JOIN wbb".WBB_N."_post p60 ON wbb.postID = p.postID61 JOIN wbb".WBB_N."_thread t62 ON p.threadID = t.threadID63 WHERE t.boardID IN (".implode(',', $this->boards).")64 GROUP BY tag65 ORDER BY weight DESC66 LIMIT 50";67 68 return $sql;69 }70 71 /**72 50 * reads (threaddata) by post 73 51 */ … … 145 123 break; 146 124 case 'BoardPage': 147 $boardID = $this->eventObj->boardID; 148 $boardList = new BoardListTaggingReloaded($boardID); 149 $boardList->renderBoards(); 150 $this->readSubBoards($boardList->getSubBoards()); 151 $this->boards[] = $boardID; 152 153 $sql = $this->queryTagsByBoard(); 125 $minLifetime = 0; 126 $maxLifetime = 43200; //12 h 127 128 WCF::getCache()->addResource( 129 'taggingreloaded.wbb.boards', 130 WCF_DIR.'cache/cache.taggingreloaded.wbb.boards.php', 131 WCF_DIR.'lib/system/cache/CacheBuilderTaggingReloadedBoards.class.php', 132 $minLifetime, 133 $maxLifetime 134 ); 154 135 break; 155 136 case 'TaggingPage':
