Changeset 573 for team

Show
Ignore:
Timestamp:
09/02/07 20:00:32 (15 months ago)
Author:
www-data
Message:

automerge commit

Location:
team/michiel/import_blogs
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • team/michiel/import_blogs

    • Property svnmerge-integrated changed from /trunk:1-567 to /trunk:1-572
  • team/michiel/import_blogs/common/mvblog.php

    r564 r573  
    238238                                                                <?php 
    239239                                                                $categories = explode(",", $row["categories_ids"]); 
    240                                                                 foreach ($categories as $v) 
    241                                                                         echo htmlspecialchars($this->categories[$v]["name"])."&nbsp;"; 
     240                                                                foreach ($categories as $v) { 
     241                                                                        if (array_key_exists($v, $this->categories)) 
     242                                                                                echo htmlspecialchars($this->categories[$v]["name"])."&nbsp;"; 
     243                                                                } 
    242244                                                                ?> 
    243245                                                        </h2> 
     
    401403                                                <?php 
    402404                                                $categories = explode(",", $row["categories_ids"]); 
    403                                                 foreach ($categories as $v) 
    404                                                         echo htmlspecialchars($this->categories[$v]["name"])."&nbsp;"; 
     405                                                foreach ($categories as $v) { 
     406                                                        if (array_key_exists($v, $this->categories)) 
     407                                                                echo htmlspecialchars($this->categories[$v]["name"])."&nbsp;"; 
     408                                                } 
    405409                                                ?> 
    406410                                        </h2> 
  • team/michiel/import_blogs/common/mvblog_admin.php

    r570 r573  
    939939                                                <?php echo gettext("category").":&nbsp;"; ?> 
    940940                                                <?php 
    941                                                 $categories = explode(",", $row["categories_ids"]); 
    942                                                 foreach ($categories as $v) 
    943                                                         echo $this->categories[$v]["name"]."&nbsp;"; 
     941                                                if (array_key_exists("categories_ids", $row)) { 
     942                                                        $categories = explode(",", $row["categories_ids"]); 
     943                                                        foreach ($categories as $v) { 
     944                                                                if (array_key_exists($v, $this->categories)) 
     945                                                                        echo $this->categories[$v]["name"]."&nbsp;"; 
     946                                                        } 
     947                                                } 
    944948                                                ?> 
    945949                                        </h2> 
     
    11101114         */ 
    11111115        public function save_post($post) { 
     1116                if (!array_key_exists("categories_ids", $post)) 
     1117                        $post["categories_ids"] = array(); 
    11121118                if ($post["id"]) { 
    11131119                        $sql = sprintf("SELECT date,active FROM articles WHERE id = %d", $post["id"]); 
  • team/michiel/import_blogs/common/mvblog_common.php

    r564 r573  
    111111        /* methods */ 
    112112        /* __construct {{{ */ 
    113         public function __construct($plugindir="plugins/", $adminmode=0) { 
     113        /** 
     114         * Setup stuff and handle settings etc and populate the data containers 
     115         * 
     116         * @param string $plugindir Directory where the plugins are. 
     117         * @param int $adminmode Must be 1 if in the admin interface. 
     118         * @param int $upgrade If set to 1 the data containers will not be populated to allow upgrades to them. 
     119         * 
     120         * If one of the default values is changed, please also change the call in mvblog_upgrade constructor. 
     121         */ 
     122        public function __construct($plugindir="plugins/", $adminmode=0, $upgrade=0) { 
    114123                /* start session and output buffering */ 
    115124                session_start(); 
     
    159168                $this->_get_active_plugins(); 
    160169 
    161                 /* populate the authors array */ 
    162                 $this->_get_authors(); 
    163  
    164                 /* populate the categories array */ 
    165                 $this->_get_categories(); 
    166  
    167                 /* populate the menuitems array */ 
    168                 $this->_get_menuitems(); 
     170                if (!$upgrade) { 
     171                        /* populate the authors array */ 
     172                        $this->_get_authors(); 
     173 
     174                        /* populate the categories array */ 
     175                        $this->_get_categories(); 
     176 
     177                        /* populate the menuitems array */ 
     178                        $this->_get_menuitems(); 
     179                } 
    169180 
    170181                /* plugin handling */ 
  • team/michiel/import_blogs/common/mvblog_upgrade.php

    r552 r573  
    6464         */ 
    6565        public function __construct() { 
    66                 parent::__construct(); 
     66                parent::__construct("plugins/", 0, 1); 
    6767        } 
    6868        /* }}} */ 
  • team/michiel/import_blogs/common/rdf.php

    r529 r573  
    5959                $categories = explode(",", $row["categories_ids"]); 
    6060                $category_names = array(); 
    61                 foreach ($categories as $v) 
    62                         $category_names[] = $mvblog->categories[$v]["name"]; 
     61                foreach ($categories as $v) { 
     62                        if (array_key_exists($v, $mvblog->categories)) 
     63                                $category_names[] = $mvblog->categories[$v]["name"]; 
     64                } 
    6365                $items[$i]["category"] = implode(", ", $category_names); 
    6466        } 
  • team/michiel/import_blogs/common/rss.php

    r529 r573  
    111111        } else { 
    112112                echo "\t\t\t<link>".$url."index.php?action=view&amp;id=".$row["id"]."$link</link>\n"; 
    113                 $categories = explode(",", $row["categories_ids"]); 
     113                if (array_key_exists("categories_ids", $row)) 
     114                        $categories = explode(",", $row["categories_ids"]); 
     115                else 
     116                        $categories = array(); 
    114117                echo "\t\t\t<category>"; 
    115118                $category_names = array(); 
    116                 foreach ($categories as $v) 
    117                         $category_names[] = $mvblog->categories[$v]["name"]; 
     119                foreach ($categories as $v) { 
     120                        if (array_key_exists($v, $mvblog->categories)) 
     121                                $category_names[] = $mvblog->categories[$v]["name"]; 
     122                } 
    118123                echo implode(", ", $category_names); 
    119124                echo "</category>\n";