Changeset 68

Show
Ignore:
Timestamp:
10/29/07 11:41:39 (6 years ago)
Author:
d0nut
Message:

optimized the tagging wbb package (especially the system tagger)

Location:
taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded
Files:
4 added
3 modified

Legend:

Unmodified
Added
Removed
  • taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/files/lib/acp/action/UpdateTaggingReloaded.class.php

    r59 r68  
    7474                                        JOIN            wbb".WBB_N."_post p 
    7575                                        ON              wbb.postID = p.postID 
    76                                         WHERE           userID = -1 
     76                                        WHERE           userID = {$systemTaggerUserID} 
    7777                                        AND             p.threadID = {$threadID};"; 
    7878 
     
    8080 
    8181                                if(count($tags) > 0) { 
    82                                         // INSERT tagging<->post 
    83                                         $sql = "INSERT INTO     wbb".WBB_N."_taggingreloaded 
    84                                                                 (postID)  
    85                                                 VALUES          ({$first_post});"; 
     82                                        $sql = "SELECT          taggingID 
     83                                                FROM            wbb".WBB_N."_taggingreloaded 
     84                                                WHERE           postID = {$first_post};"; 
     85                                        $row = WCF::getDB()->getFirstRow($sql); 
     86                                         
     87                                        // is there an tagging entry? 
     88                                        if(isset($row['taggingID'])) { 
     89                                                $taggingID = $row['taggingID']; 
     90                                        } else { 
     91                                                // INSERT tagging<->post 
     92                                                $sql = "INSERT INTO     wbb".WBB_N."_taggingreloaded 
     93                                                                        (postID)  
     94                                                        VALUES          ({$first_post});"; 
    8695 
    87                                         WBBCore::getDB()->sendQuery($sql); 
    88                                         $taggingID = WBBCore::getDB()->getInsertID(); 
     96                                                WBBCore::getDB()->sendQuery($sql); 
     97                                                $taggingID = WBBCore::getDB()->getInsertID(); 
     98                                        } 
    8999 
    90100                                        // save tags 
     
    94104                        } 
    95105                } 
    96                  
    97                 $sql = "UPDATE  wbb1_1_post SET systemTagged = 1 WHERE threadID IN (".implode(',', $threadIDs)."); "; 
     106 
     107                $sql = "UPDATE          wbb1_1_post  
     108                        SET      
     109                                        systemTagged = 1  
     110                        WHERE           threadID IN (".implode(',', $threadIDs)."); "; 
     111                WBBCore::getDB()->sendQuery($sql); 
    98112 
    99113                $this->executed(); 
  • taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/files/lib/system/cronjob/TaggingReloadedCronjob.class.php

    r59 r68  
    11<?php 
    22require_once(WCF_DIR.'lib/data/cronjobs/Cronjob.class.php'); 
    3 require_once(WCF_DIR.'lib/util/MapDiscover.class.php'); 
     3require_once(WBB_DIR.'lib/acp/action/UpdateTaggingReloaded.class.php'); 
    44 
    55/** 
  • taggingreloaded/optionals/de.easy-coding.wbb.taggingreloaded/package.xml

    r59 r68  
    1818                <requiredpackage minversion="1.0.0">com.woltlab.wcf</requiredpackage> 
    1919                <requiredpackage minversion="3.0.0">com.woltlab.wbb</requiredpackage> 
    20                 <requiredpackage minversion="0.4.0">de.easy-coding.wcf.taggingreloaded</requiredpackage> 
     20                <requiredpackage minversion="0.3.0">de.easy-coding.wcf.taggingreloaded</requiredpackage> 
    2121        </requiredpackages> 
    2222 
     
    2828                <cronjobs>cronjobs.xml</cronjobs> 
    2929        </instructions> 
     30         
     31        <instructions type="update" fromversion="0.0.3"> 
     32                <files>files.tar</files> 
     33                <templates>templates.tar</templates> 
     34                <sql>update.sql</sql> 
     35                <eventlistener>eventlistener.xml</eventlistener> 
     36                <cronjobs>cronjobs.xml</cronjobs> 
     37        </instructions> 
    3038</package>