Changeset 590
- Timestamp:
- 09/02/07 23:00:37 (15 months ago)
- Location:
- team/michiel/import_blogs
- Files:
-
- 4 modified
-
. (modified) (1 prop)
-
CSS-Documentation (modified) (1 diff)
-
common/mvblog.php (modified) (2 diffs)
-
common/mvblog_common.php (modified) (3 diffs)
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 42 42 span.log_post_commentsrss : tag for the RSS url for single post 43 43 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 44 48 45 49 div.log_comment : container tag for comments on single post -
team/michiel/import_blogs/common/mvblog.php
r573 r590 420 420 $text = $this->strip_invalid_xml(stripslashes(str_replace("##BREAKPOINT##", "<a name=\"READMORE\"></a>", $row["body"]))); 421 421 $text = $this->replace_num_ref($text); 422 $text = $this->replace_dossier_ref($text); 422 423 $text = $this->plugman->run_hooks("text_output", $text); 423 424 echo $text; … … 443 444 <?php } ?> 444 445 </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&id=%d\">%s</a><br />", $dossieritem["id"], $dossieritem["title"]); 460 } 461 } 462 ?> 446 463 </div> 447 464 <div class="log_comment"> 465 <a name="comments"></a> 448 466 <?php 449 467 if (!$errormode) { -
team/michiel/import_blogs/common/mvblog_common.php
r576 r590 126 126 /* __construct {{{ */ 127 127 /** 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. 129 132 * 130 133 * @param string $plugindir Directory where the plugins are. 131 134 * @param int $adminmode Must be 1 if in the admin interface. 132 135 * @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.135 136 */ 136 137 public function __construct($plugindir="plugins/", $adminmode=0, $upgrade=0) { … … 630 631 $i = 0; 631 632 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) { 633 634 $row["body"] = $this->replace_num_ref($row["body"]); 635 $row["body"] = $this->replace_dossier_ref($row["body"]); 636 } 634 637 $posts["posts"][$i] = $row; 635 638 $i++; … … 665 668 } 666 669 /* }}} */ 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&id=".$matches[1][$k]."\">".$ref["name"]."</a>", $data); 691 } 692 } 693 return $data; 694 } 695 /* }}} */ 696 667 697 /* output methods */ 668 698 /* html_header: {{{ */
