Changeset 590

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

automerge commit

Location:
team/michiel/import_blogs
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • team/michiel/import_blogs

    • Property svnmerge-integrated changed from /trunk:1-584 to /trunk:1-589
  • team/michiel/import_blogs/CSS-Documentation

    r325 r590  
    4242                                        span.log_post_commentsrss : tag for the RSS url for single post 
    4343                                        span.log_post_trackbacklink : tag for the trackback url for single post 
     44 
     45                        div.log_dossierinfo : container tag for dossier info and links to other articles in the dossier 
     46 
     47                                div.log_dossierinfo a : hyperlink to the article 
    4448 
    4549                        div.log_comment : container tag for comments on single post 
  • team/michiel/import_blogs/common/mvblog.php

    r573 r590  
    420420                                        $text = $this->strip_invalid_xml(stripslashes(str_replace("##BREAKPOINT##", "<a name=\"READMORE\"></a>", $row["body"]))); 
    421421                                        $text = $this->replace_num_ref($text); 
     422                                        $text = $this->replace_dossier_ref($text); 
    422423                                        $text = $this->plugman->run_hooks("text_output", $text); 
    423424                                        echo $text; 
     
    443444                                <?php } ?> 
    444445                        </div> 
    445                         <a name="comments"></a> 
     446                </div> 
     447                <div class="log_dossierinfo"> 
     448                        <?php 
     449                        if ($row["dossier_id"]) { 
     450                                echo $this->dossiers[$row["dossier_id"]]["name"]; 
     451                                echo "<br />"; 
     452                                //get dossier articles 
     453                                $dq = sprintf("SELECT id, title FROM articles WHERE active=1 AND public=1 AND dossier_id = %d ORDER BY date", $row["dossier_id"]); 
     454                                $dr = $this->db->query($dq); 
     455                                while ($dossieritem = $dr->fetchRow(MDB2_FETCHMODE_ASSOC)) { 
     456                                        if ($dossieritem["id"] == $row["id"]) 
     457                                                echo $dossieritem["title"]."<br />"; 
     458                                        else 
     459                                                echo sprintf("<a href=\"index.php?action=view&amp;id=%d\">%s</a><br />", $dossieritem["id"], $dossieritem["title"]); 
     460                                } 
     461                        } 
     462                        ?> 
    446463                </div> 
    447464                <div class="log_comment"> 
     465                        <a name="comments"></a> 
    448466                        <?php 
    449467                        if (!$errormode) { 
  • team/michiel/import_blogs/common/mvblog_common.php

    r576 r590  
    126126        /* __construct {{{ */ 
    127127        /** 
    128          * Setup stuff and handle settings etc and populate the data containers 
     128         * Setup stuff and handle settings etc and populate the data containers. 
     129         * 
     130         * If one of the default values for the function parameters is changed,  
     131         * please also change the call in mvblog_upgrade constructor. 
    129132         * 
    130133         * @param string $plugindir Directory where the plugins are. 
    131134         * @param int $adminmode Must be 1 if in the admin interface. 
    132135         * @param int $upgrade If set to 1 the data containers will not be populated to allow upgrades to them. 
    133          * 
    134          * If one of the default values is changed, please also change the call in mvblog_upgrade constructor. 
    135136         */ 
    136137        public function __construct($plugindir="plugins/", $adminmode=0, $upgrade=0) { 
     
    630631                        $i = 0; 
    631632                        while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { 
    632                                 if (array_key_exists("replace_references", $options) && $options["replace_references"] == 1) 
     633                                if (array_key_exists("replace_references", $options) && $options["replace_references"] == 1) { 
    633634                                        $row["body"] = $this->replace_num_ref($row["body"]); 
     635                                        $row["body"] = $this->replace_dossier_ref($row["body"]); 
     636                                } 
    634637                                $posts["posts"][$i] = $row; 
    635638                                $i++; 
     
    665668        } 
    666669        /* }}} */ 
     670        /* replace_dossier_ref {{{ */ 
     671        /** 
     672         * Replace references to dossiers in a piece of data. 
     673         * 
     674         * You can reference to dossiers in postdata by including 
     675         * a string like [#d<dossiernumber>]. 
     676         * The output will be: <a href="index.php?action=viewdossier&id=<dossiernumber>">dossiertitle</a> 
     677         * 
     678         * @param string $data The code to do the replacement in 
     679         * @return string input with the postreference code replaced 
     680         */ 
     681        public function replace_dossier_ref($data) { 
     682                //replace [#dnumber] with a link to this dossier and replace the number with the dossier title 
     683                preg_match_all("/\[#d(\d{1,})\]/s", $data, $matches); 
     684                if (count($matches[0])) { 
     685                        // we have something to replace 
     686                        foreach ($matches[0] as $k => $v) { 
     687                                $q = sprintf("SELECT name FROM dossiers WHERE id = %d", $matches[1][$k]); 
     688                                $r = $this->db->query($q); 
     689                                $ref = $r->fetchRow(MDB2_FETCHMODE_ASSOC); 
     690                                $data = str_replace($matches[0][$k], "<a href=\"".$this->webroot."index.php?action=viewdossier&amp;id=".$matches[1][$k]."\">".$ref["name"]."</a>", $data); 
     691                        } 
     692                } 
     693                return $data; 
     694        } 
     695        /* }}} */ 
     696 
    667697        /* output methods */ 
    668698        /* html_header: {{{ */