Changeset 812

Show
Ignore:
Timestamp:
02/21/09 15:27:06 (4 years ago)
Author:
d0nut
Message:

maybe solved sitemaps requirements chaos

Location:
sitemaps
Files:
1 removed
2 modified

Legend:

Unmodified
Added
Removed
  • sitemaps/files/lib/page/SitemapsPage.class.php

    r805 r812  
    22// wcf imports 
    33require_once(WCF_DIR.'lib/page/AbstractPage.class.php'); 
    4  
    5 // rewriter util 
    6 require_once(WBB_DIR.'lib/page/PublicSEORewriter.class.php'); 
    74 
    85/** 
     
    1714 
    1815        public $index = false; 
    19         public $rewriter; 
    2016 
    2117        /** 
     
    2824                        $this->index = true; 
    2925                } 
    30  
    31                 $this->rewriter = new PublicSEORewriter(); 
    3226        } 
    3327         
  • sitemaps/optionals/de.easy-coding.wbb.sitemaps/files/lib/system/event/listener/SitemapsPageWBBListener.class.php

    r444 r812  
    66require_once(WBB_DIR.'lib/data/board/SitemapsBoard.class.php'); 
    77require_once(WBB_DIR.'lib/data/thread/SitemapsThread.class.php'); 
     8 
     9// rewriter util 
     10require_once(WBB_DIR.'lib/page/PublicSEORewriterWBB.class.php'); 
    811 
    912/** 
     
    2326        protected $eventObj; 
    2427        protected $className; 
     28         
     29        protected $rewriter; 
    2530 
    2631        /** 
     
    3035                $this->eventObj = $eventObj; 
    3136                $this->className = $className; 
     37 
     38                $this->rewriter = new PublicSEORewriterWBB(); 
    3239 
    3340                switch ($eventName) { 
     
    110117                                $tmp = new SitemapsThread($row); 
    111118 
    112                                 if($this->eventObj->rewriter === null) { 
     119                                if($this->rewriter === null) { 
    113120                                        $tmp->url = sprintf('index.php?page=Thread&threadID=%d', $row['threadID']); 
    114121                                } else { 
    115                                         $this->eventObj->rewriter->publicCacheThreads($row['threadID'], $row); 
    116                                         $tmp->url = $this->eventObj->rewriter->publicParseThreadURLs($row['threadID'], ''); 
     122                                        $this->rewriter->publicCacheThreads($row['threadID'], $row); 
     123                                        $tmp->url = $this->rewriter->publicParseThreadURLs($row['threadID'], ''); 
    117124                                } 
    118125 
     
    123130                                        $tmp = new SitemapsThread($row['threadID'], $row); 
    124131 
    125                                         if($this->eventObj->rewriter === null) { 
     132                                        if($this->rewriter === null) { 
    126133                                                        $tmp->url = sprintf('index.php?page=Thread&threadID=%d&pageNo=%d', $row['threadID'], $j); 
    127134                                        } else { 
    128                                                         $tmp->url = $this->eventObj->rewriter->publicParseMultipleThreadURLs($row['threadID'], $j, ''); 
     135                                                        $tmp->url = $this->rewriter->publicParseMultipleThreadURLs($row['threadID'], $j, ''); 
    129136                                        } 
    130137 
     
    134141 
    135142                                // titles are not used again.. clear cache 
    136                                 if($this->eventObj->rewriter !== null) $this->eventObj->rewriter->clearCache(); 
     143                                if($this->rewriter !== null) $this->rewriter->clearCache(); 
    137144                        } 
    138145                } 
     
    175182                                } 
    176183 
    177                                 if($this->eventObj->rewriter === null) { 
     184                                if($this->rewriter === null) { 
    178185                                        $this->boards[$i]->url = sprintf('index.php?page=Board&boardID=%d', $row['boardID']); 
    179186                                } else { 
    180                                         $this->boards[$i]->url = $this->eventObj->rewriter->publicParseBoardURLs($row['boardID'], ''); 
     187                                        $this->boards[$i]->url = $this->rewriter->publicParseBoardURLs($row['boardID'], ''); 
    181188                                } 
    182189 
     
    189196                                        $this->boards[$i]->time = $row['lastPostTime']; 
    190197 
    191                                         if($this->eventObj->rewriter === null) { 
     198                                        if($this->rewriter === null) { 
    192199                                                $this->boards[$i]->url = sprintf('index.php?page=Board&boardID=%d&pageNo=%d', $row['boardID'], $j); 
    193200                                        } else { 
    194                                                 $this->boards[$i]->url = $this->eventObj->rewriter->publicParseMultipleBoardURLs($row['boardID'], $j, ''); 
     201                                                $this->boards[$i]->url = $this->rewriter->publicParseMultipleBoardURLs($row['boardID'], $j, ''); 
    195202                                        } 
    196203                                } 
     
    200207 
    201208                                // titles are not used again.. clear cache 
    202                                 if($this->eventObj->rewriter !== null) $this->eventObj->rewriter->clearCache(); 
     209                                if($this->rewriter !== null) $this->rewriter->clearCache(); 
    203210                        } 
    204211                }