Changeset 188 for branches

Show
Ignore:
Timestamp:
07/09/06 15:40:22 (2 years ago)
Author:
michiel
Message:

rewrote functions_blog.php to class in mvblog.php
Made the whole thing 'short_open_tags = Off' compatible

Location:
branches/class-rewrite
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • branches/class-rewrite/common/hosts.php

    r175 r188  
    1 <? 
     1<?php 
    22/* 
    33 * MvBlog -- An open source no-noncence blogtool 
    44 * 
    5  * Copyright (C) 2005, Michiel van Baak 
     5 * Copyright (C) 2005-2006, Michiel van Baak 
    66 * Logo design (C) 2005, Sofie van Tendeloo 
    77 * 
  • branches/class-rewrite/common/livesearch.php

    r118 r188  
    1 <? 
     1<?php 
    22function db_init() { 
    33        session_start(); 
  • branches/class-rewrite/common/rss.php

    r154 r188  
    1 <? 
     1<?php 
    22/* 
    33 * MvBlog -- An open source no-noncence blogtool 
     
    1616 * at the top of the source tree. 
    1717 */ 
    18 require("functions_blog.php"); 
     18require("mvblog.php"); 
     19$mvblog = new MvBlog(); 
    1920//get all the authors in an array 
    20 $res =& $db->query("SELECT * FROM authors"); 
     21$res =& $mvblog->db->query("SELECT * FROM authors"); 
    2122 
    2223if (PEAR::isError($res)) { 
     
    2728        $authors[$row["id"]]["fullname"] = $row["fullname"]; 
    2829        $authors[$row["id"]]["email"]    = $row["email"]; 
    29 } 
    30 //same with categories 
    31 $res =& $db->query("SELECT * FROM categories"); 
    32  
    33 if (PEAR::isError($res)) { 
    34         die($res->getMessage()); 
    35 } 
    36  
    37 while ($res->fetchInto($row, DB_FETCHMODE_ASSOC)) { 
    38         $categories[$row["id"]] = $row["name"]; 
    3930} 
    4031 
     
    5546        $comments = false; 
    5647} 
    57 $res =& $db->limitQuery($sql, 0, 20); 
     48$res =& $mvblog->db->limitQuery($sql, 0, 20); 
    5849 
    5950if (PEAR::isError($res)) { 
     
    8273        } else { 
    8374                echo "\t\t\t<link>".$url."index.php?action=view&amp;id=".$row["id"]."$link</link>\n"; 
    84                 echo "\t\t\t<category>".$categories[$row["categories_id"]]."</category>\n"; 
     75                echo "\t\t\t<category>".$mvblog->categories[$row["categories_id"]]."</category>\n"; 
    8576                echo "\t\t\t<guid isPermaLink=\"true\">".$url."index.php?action=view&amp;id=".$row["id"]."$link</guid>\n"; 
    8677                if (!$comments) { 
     
    8980                } 
    9081        } 
    91         echo "\t\t\t<description>".strip_bbcode(strip_tags(str_replace("##BREAKPOINT##", "", stripslashes($row["body"]))))."</description>\n"; 
     82        echo "\t\t\t<description>".$mvblog->strip_bbcode(strip_tags(str_replace("##BREAKPOINT##", "", stripslashes($row["body"]))))."</description>\n"; 
    9283        echo "\t\t\t<pubDate>".date("r", $row["date"])."</pubDate>\n"; 
    9384 
  • branches/class-rewrite/common/tb.php

    r118 r188  
    1 <? 
     1<?php 
    22/* 
    33 * MvBlog -- An open source no-noncence blogtool 
    44 * 
    5  * Copyright (C) 2005, Michiel van Baak 
     5 * Copyright (C) 2005-2006, Michiel van Baak 
    66 * Logo design (C) 2005, Sofie van Tendeloo 
    77 * 
     
    1717 */ 
    1818 
    19 require("functions_blog.php"); 
     19require("mvblog.php"); 
     20$mvblog = new MvBlog(); 
    2021 
    2122function tb_response($error=0, $errorstr="") { 
     
    3940/* check to see if this article is here */ 
    4041$sql = sprintf("SELECT COUNT(*) AS count FROM articles WHERE active = 1 AND public = 1 AND id = %d", $tb_id); 
    41 $res =& $db->query($sql); 
     42$res =& $mvblog->db->query($sql); 
    4243$res->fetchInto($row, DB_FETCHMODE_ASSOC); 
    4344if (!$row["count"]) { 
     
    6768        preg_quote(strip_tags($title), "'") 
    6869); 
    69 $res =& $db->query($sql); 
     70$res =& $mvblog->db->query($sql); 
    7071if (PEAR::isError($res)) { 
    7172        tb_response(1, "Something went wrong with inserting your trackback in the comments system. error:".$res->getUserInfo()); 
  • branches/class-rewrite/index.php

    r172 r188  
    1 <? 
     1<?php 
    22/* 
    33 * MvBlog -- An open source no-noncence blogtool 
     
    1717 */ 
    1818 
    19 require("common/functions_blog.php"); 
    20 html_header(); 
     19require("common/mvblog.php"); 
     20$mvblog = new MvBlog(); 
     21$mvblog->html_header(); 
    2122        ?> 
    2223        <div id="if_container"> 
     
    2425                <div id="if_bar1"></div> 
    2526                <div id="if_page_header"> 
    26                         <h1 class="page_title"><a href="index.php" class="page_header"><?=blog_get_title()?></a></h1> 
     27                        <h1 class="page_title"><a href="index.php" class="page_header"><?php echo $mvblog->blog_get_title(); ?></a></h1> 
    2728                </div> 
    2829                <div id="if_page"> 
    2930                        <table><tr> 
    3031                                <td valign="top" width="90%" id="if_content_container"> 
    31                                         <p class="first"><?=blog_get_description()?></p> 
    32                                         <? blog_content(0,0); ?> 
     32                                        <p class="first"><?php echo $mvblog->blog_get_description(); ?></p> 
     33                                        <?php $mvblog->blog_content(0,0); ?> 
    3334                                </td> 
    3435                                <td valign="top" id="if_sidebar_container"> 
     
    3637                                                <li> 
    3738                                                        <h2>Users</h2> 
    38                                                         <? blog_show_login(); ?> 
     39                                                        <?php $mvblog->blog_show_login(); ?> 
    3940                                                </li> 
    4041                                                <li> 
    4142                                                        <h2>Site</h2> 
    42                                                         <? blog_default_links(); ?> 
     43                                                        <?php $mvblog->blog_default_links(); ?> 
    4344                                                </li> 
    4445                                                <li> 
    4546                                                        <h2>Style</h2> 
    46                                                         <? blog_show_styleswitcher(); ?> 
     47                                                        <?php $mvblog->blog_show_styleswitcher(); ?> 
    4748                                                </li> 
    4849                                                <li> 
    4950                                                        <h2>Monthly Archive</h2> 
    50                                                         <? blog_archive_links(); ?> 
     51                                                        <?php $mvblog->blog_archive_links(); ?> 
    5152                                                </li> 
    5253                                                <li> 
    5354                                                        <h2>Category Archive</h2> 
    54                                                         <? blog_cats_links(); ?> 
     55                                                        <?php $mvblog->blog_cats_links(); ?> 
    5556                                                </li> 
    5657                                                <li> 
    5758                                                        <h2>Search</h2> 
    58                                                         <? blog_show_search(); ?> 
     59                                                        <?php $mvblog->blog_show_search(); ?> 
    5960                                                </li> 
    6061                                                <li> 
    6162                                                        <h2>Links etc.</h2> 
    62                                                         <? blog_show_menulinks(); ?> 
     63                                                        <?php $mvblog->blog_show_menulinks(); ?> 
    6364                                                </li> 
    6465                                        </ul> 
    6566                                </td> 
    6667                        </tr></table> 
    67 <? html_footer(); ?> 
     68<?php $mvblog->html_footer(); ?>