Changeset 591

Show
Ignore:
Timestamp:
09/02/07 23:10:37 (10 months ago)
Author:
michiel
Message:

added page with info about a dossier and all articles in the dossier.
Based on the archive overviews.
Added new div.log_dossier_description for the info

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CSS-Documentation

    r587 r591  
    1616 
    1717                        h1.log_archive_h1 : tag for an archive (monthly or category) 
     18 
     19                        div.log_dossier_description : Header above page with articles in a specific dossier 
    1820 
    1921                        div.log_post : container tag for post (excl. comments) 
  • trunk/common/mvblog.php

    r587 r591  
    167167                        /* article related functions */ 
    168168                        case "view"         : $this->show_article($_REQUEST["id"]);      break; 
     169                        case "viewdossier"  : $this->get_articles($start, $limit, 0, $_REQUEST["id"]);      break; 
    169170                        case "post_comment" : $this->post_comment($_POST);               break; 
    170171                        case "rss"          : header("Location: common/rss.php");        break; 
     
    189190         * @param int $limit the ammount of items to show 
    190191         * @param int $archive type of archive. 0 = none, 1 = archive by date, 2 = archive by category, 3 = archive of asides, 4 = old old old 
    191          */ 
    192         public function get_articles($start, $limit, $archive=0) { 
     192         * @param int $dossier if not 0 show info about dossier 
     193         */ 
     194        public function get_articles($start, $limit, $archive=0, $dossier=0) { 
    193195                // FB: 20070304: Check key and set a default if not set. 
    194196                if (array_key_exists("top", $_REQUEST)) { 
     
    209211                        "top"                => $top, 
    210212                        "archive"            => $archive, 
     213                        "dossier"            => $dossier, 
    211214                        "replace_references" => 1 
    212215                ); 
     
    217220 
    218221                echo $posts["title"]; 
     222 
     223                if ($posts["is_dossier"]) 
     224                        echo $posts["desc"]; 
    219225 
    220226                if ($posts["total_count"]) { 
     
    12801286        } 
    12811287        /* }}} */ 
     1288        /* view_dossier {{{ */ 
     1289        /** 
     1290         * Overview page for a dossier with links to the articles 
     1291         * 
     1292         * @param int $id The dossier to show 
     1293         */ 
     1294        public function view_dossier($id) { 
     1295                 
     1296        } 
     1297        /* }}} */ 
    12821298} 
    12831299?> 
  • trunk/common/mvblog_common.php

    r588 r591  
    555555                else 
    556556                        $archive = 0; 
     557 
     558                if (array_key_exists("dossier", $options) && $options["dossier"]) 
     559                        $dossier = $options["dossier"]; 
     560                else 
     561                        $dossier = 0; 
    557562 
    558563                switch ($archive) { 
     
    600605                                break; 
    601606                        default : 
    602                                 $q = sprintf("AND date <= %d AND public=1", $options["max_time"]); 
    603                                 $title = ""; 
    604                                 $url_prev = "index.php?top=".($options["top"]-$options["limit"]); 
    605                                 $url_next = "index.php?top=".($options["top"]+$options["limit"]); 
     607                                if ($dossier) { 
     608                                        //get dossierinfo 
     609                                        $dq = sprintf("SELECT * FROM dossiers WHERE id = %d", $dossier); 
     610                                        $dr =& $this->db->query($dq); 
     611                                        $dossierinfo = $dr->fetchRow(MDB2_FETCHMODE_ASSOC); 
     612                                        $title = $dossierinfo["name"]; 
     613                                        $desc  = $dossierinfo["desc"]; 
     614                                        $url_prev = "index.php?action=viewdossier&id=$dossier&top=".($options["top"]-$options["limit"]); 
     615                                        $url_next = "index.php?action=viewdossier&id=$dossier&top=".($options["top"]+$options["limit"]); 
     616                                        $q = sprintf("AND date <= %d AND public=1 AND dossier_id = %d", $options["max_time"], $dossier); 
     617                                } else { 
     618                                        $q = sprintf("AND date <= %d AND public=1", $options["max_time"]); 
     619                                        $title = ""; 
     620                                        $url_prev = "index.php?top=".($options["top"]-$options["limit"]); 
     621                                        $url_next = "index.php?top=".($options["top"]+$options["limit"]); 
     622                                } 
    606623                                break; 
    607624                } 
     
    611628                        "url_next" => $url_next 
    612629                ); 
     630                if ($dossier) { 
     631                        $posts["desc"]       = "<br /><br /><div class=\"log_dossier_description\">".$desc."</div><br />"; 
     632                        $posts["is_dossier"] = 1; 
     633                } 
     634 
    613635                if ($options["limit"]) { 
    614636                        $res_count =& $this->db->query("SELECT COUNT(*) FROM articles WHERE active=1 $q");