Changeset 1054

Show
Ignore:
Timestamp:
10/03/09 21:55:55 (4 years ago)
Author:
MDMAN
Message:

Webdisk Importer IT4All Filebase Platinum --> neue Version 1.1.0 --> kompatibel zum WBB 3.1 und Webdisk 1.1.0 --> files/lib/data/database/importer/IT4AllFilebase11xExporter.class.php angepasst. Bugfix in der Kategory-Sortierung

Location:
de.wbb-security.database.importer.it4allfb.11x
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • de.wbb-security.database.importer.it4allfb.11x/files/lib/data/database/importer/IT4AllFilebase11xExporter.class.php

    r928 r1054  
    152152        * @param        Integer $right                  RightID of category 
    153153        */ 
    154         protected function getParentID($categoryID,$left,$right) { 
    155                 $parent = $this->getDB()->getFirstRow("SELECT * FROM ".$this->dbPrefix."fp".$this->settings['dbNumber']."_cats WHERE left_id < ".$left." AND right_id > ".$right." ORDER BY `left_id` DESC"); 
     154        protected function getParentID($left,$right,$root) { 
     155                 
     156                $parent = $this->getDB()->getFirstRow("SELECT cat_id FROM ".$this->dbPrefix."fp".$this->settings['dbNumber']."_cats WHERE left_id < ".$left." AND right_id > ".$right." AND root_id = ".$root." ORDER BY `left_id` DESC");       
     157                 
    156158                if($parent['cat_id'] > 0) { 
    157159                        return $parent['cat_id'] ; 
     
    166168         */ 
    167169        public function exportCategories($offset,$limit) { 
    168                 $result = $this->getDB()->sendQuery("SELECT * FROM ".$this->dbPrefix."fp".$this->settings['dbNumber']."_cats",$limit,$offset); 
    169                 while($row = $this->getDB()->fetchArray($result)) { 
    170                         $this->getImporter()->importCategory("c".$row['cat_id'],$row['cat_name'],$row['cat_desc'],"c".$this->getParentID($row['cat_id'],$row['left_id'],$row['right_id']),$row['cat_order'],1,"",0); 
     170                $result = $this->getDB()->sendQuery("SELECT * FROM ".$this->dbPrefix."fp".$this->settings['dbNumber']."_cats ORDER BY root_id, left_id ASC",$limit,$offset); 
     171                 
     172                while($row = $this->getDB()->fetchArray($result)) { 
     173                        $this->getImporter()->importCategory("c".$row['cat_id'],$row['cat_name'],$row['cat_desc'],"c".$this->getParentID($row['left_id'],$row['right_id'],$row['root_id']),$row['cat_order'],1,"",0); 
    171174                } 
    172175        } 
     
    262265                                        "isBinary" => 1, 
    263266                                        "isImage" => 1, 
    264                                         "messageID" => $item['value'], 
    265                                         "messageType" => "database", 
    266                                         "packageID" => PACKAGE_ID, 
     267                                        "containerID" => $item['value'], 
     268                                        "containerType" => "database", 
     269                                        "packageID" => WCF::getPackageID("de.wbb-security.database"), 
    267270                                        "idHash" => StringUtil::getRandomID(), 
    268271                                        "userID" => $row['userid'], 
     
    278281                                 
    279282                                AttachmentsEditor::saveThumbnail($attachment); 
     283                                 
     284                                //update inline attachments - its dirty! 
     285                                $sql = "SELECT  itemID, content 
     286                                        FROM    wcf".WCF_N."_database_item 
     287                                        WHERE   itemID='".$item['value']."'"; 
     288 
     289                                $databaseItem = WCF::getDB()->getFirstRow($sql); 
     290                                $message = str_replace("[attach=".$row['file_id']."][/attach]","[attach=".$attachment['attachmentID']."][/attach]", $databaseItem['content']); 
     291 
     292                                if($message != $databaseItem['content']) { 
     293                                        $sql = "UPDATE 
     294                                                wcf".WCF_N."_database_item 
     295                                                SET             content='".escapeString($message)."' 
     296                                                WHERE   itemID='".$item['value']."'"; 
     297 
     298                                        WCF::getDB()->sendQuery($sql); 
     299 
     300                                } 
    280301                        } 
    281302                         
  • de.wbb-security.database.importer.it4allfb.11x/package.xml

    r928 r1054  
    77                <standalone>0</standalone> 
    88                <isUnique>1</isUnique> 
    9                 <version>1.0.0 pl 1</version> 
     9                <version>1.1.0</version> 
    1010                <plugin>de.wbb-security.database</plugin> 
    11                 <date>2009-03-24</date> 
     11                <date>2009-10-01</date> 
    1212        </packageInformation> 
    1313 
     
    1818 
    1919        <requiredPackages> 
    20                 <requiredPackage minversion="1.0.0">com.woltlab.wcf</requiredPackage> 
     20                <requiredPackage minversion="1.1.0 RC 2">com.woltlab.wcf</requiredPackage> 
    2121                <requiredPackage minversion="1.0.0">de.wbb-security.database</requiredPackage>   
    2222                <requiredPackage minversion="1.0.0">de.wbb-security.database.importer</requiredPackage> 
     
    3333        </instructions> 
    3434         
    35         <instructions type="update" fromversion="1.0.0 RC *"> 
    36                 <files>files.tar</files> 
    37         </instructions> 
    38          
    3935        <instructions type="update" fromversion="1.0.0"> 
    4036                <files>files.tar</files> 
    4137        </instructions> 
    4238         
     39        <instructions type="update" fromversion="1.0.0 *"> 
     40                <files>files.tar</files> 
     41        </instructions>  
     42         
    4343</package>