Changeset 639 for trunk

Show
Ignore:
Timestamp:
09/16/07 01:32:23 (14 months ago)
Author:
michiel
Message:

if a category description is given, show it in the 'archive of category <foo>' overview
Closes #162

Location:
trunk/common
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/common/mvblog.php

    r608 r639  
    221221                echo $posts["title"]; 
    222222 
    223                 if ($posts["is_dossier"]) 
     223                if (array_key_exists("desc", $posts)) 
    224224                        echo $posts["desc"]; 
    225225 
  • trunk/common/mvblog_common.php

    r632 r639  
    574574         */ 
    575575        protected function _get_posts($options = array()) { 
     576                $desc = false; 
     577 
    576578                if (array_key_exists("archive", $options)) 
    577579                        $archive = $options["archive"]; 
     
    617619                                $q = sprintf("AND public=1 AND aside = 0 AND date <= %d AND (categories_ids like '%%,%2\$d' OR categories_ids like '%2\$d,%%' OR categories_ids like '%%,%2\$d,%%' or categories_ids = '%2\$d')", $options["max_time"], $options["category_id"]); 
    618620                                $title = "<p><h1 class=\"log_archive_h1\">".gettext("Archive of category")." <i>".$this->categories[$options["category_id"]]["name"]."</i></h1></p>"; 
     621                                $desc  = "<br /><br /><div class=\"log_dossier_description\">".$this->categories[$options["category_id"]]["desc"]."</div><br />"; 
    619622                                $url_prev = "?action=archive_cat&amp;c=".$options["category_id"]."&amp;top=".($options["top"]-$options["limit"]); 
    620623                                $url_next = "?action=archive_cat&amp;c=".$options["category_id"]."&amp;top=".($options["top"]+$options["limit"]); 
     
    646649                                        $dossierinfo = $dr->fetchRow(MDB2_FETCHMODE_ASSOC); 
    647650                                        $title = $dossierinfo["name"]; 
    648                                         $desc  = $dossierinfo["desc"]; 
     651                                        $desc  = "<br /><br /><div class=\"log_dossier_description\">".$dossierinfo["desc"]."</div><br />"; 
    649652                                        $url_prev = "index.php?action=viewdossier&id=$dossier&top=".($options["top"]-$options["limit"]); 
    650653                                        $url_next = "index.php?action=viewdossier&id=$dossier&top=".($options["top"]+$options["limit"]); 
     
    658661                                break; 
    659662                } 
     663 
    660664                $posts = array( 
    661665                        "title"    => $title, 
     
    663667                        "url_next" => $url_next 
    664668                ); 
     669 
     670                if ($desc) 
     671                        $posts["desc"] = $desc; 
     672 
    665673                if ($dossier) { 
    666                         $posts["desc"]       = "<br /><br /><div class=\"log_dossier_description\">".$desc."</div><br />"; 
    667674                        $posts["is_dossier"] = 1; 
    668675                } else {