Changeset 512

Show
Ignore:
Timestamp:
07/21/07 14:46:15 (16 months ago)
Author:
michiel
Message:

Merge changes from remove_multi_blog branch.

remove everything that referenced to:
'one codebase multiple weblogs'
Also stop supporting common/hosts.php as configfile.

Location:
trunk
Files:
2 removed
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/.htaccess

    r321 r512  
    66</IfModule> 
    77ErrorDocument 404 "/index.php?action=view&id=httperror&error=404" 
     8<Files *mvblog.ini> 
     9        Order deny,allow 
     10        deny from all 
     11</Files> 
  • trunk/INSTALL

    r373 r512  
    22 
    33* PHP5 (tested with apache2 cgi and apache2 module) 
    4 * PHP5 PostgreSQL module 
    5 * PEAR::DB 
    6 * PEAR::HTTP_Request (for trackbacks) 
     4* PHP5 PostgreSQL module or PHP5 MySQL module or PHP5 sqlite module 
     5* PEAR::MDB2 with apropiate backend driver 
     6* PEAR::HTTP_Request (for trackbacks) -- optional 
    77* PostgreSQL server (tested with 7.4 and 8.0) OR 
    8 * MySQL 5.0 (tested with 5.0.22 and newer) 
     8* MySQL 5.0 (tested with 5.0.22 and newer) OR 
     9* Sqlite 
    910 
    1011Installation 
    11  
    12 MvBlog can be used in 2 ways: 
    13 1. Just one weblog 
    14 2. Service for multiple weblogs on a server 
    15  
    16 Below you will find the installation guide for both uses. 
    17  
    18 1. Just one weblog 
    1912 
    2013- Unpack the .tar.gz in your DocumentRoot. 
    2114- Create a database for the blog. You can also create an optional database-user for the blog-database 
    2215- Import sql/<database_system>/mvblog.sql into the blog-database. 
    23 - Edit the common/hosts.php file and fill in the correct user, password and database name. 
     16- Copy the conf/mvblog.ini.sample to conf/mvblog.ini 
     17- Edit the conf/mvblog.ini file and fill in the correct user, password and database name. 
     18- Make sure php can write in the site_images folder (chown www-data:www-data site_images) 
    2419 
    2520The actual commands to create a database and import the sql file are not shown here. 
     
    3530 
    3631You are now ready to enjoy MvBlog. 
    37  
    38  
    39 2. Service for multiple weblogs on a server 
    40  
    41 This feature will require more installation steps. Use this method when you think more weblogs will be needed on your webserver, for instance for customers, friends, etc. 
    42  
    43 As an example, the www.mvblog.org weblog is used, as it is installed and running on a webserver which hosts multiple customers and their blogs. 
    44 If you want a different filesystem location, use those paths instead of the ones shown here. 
    45  
    46 - Unpack the .tar.gz into /var/www/mvblog 
    47 - Create a database user (e.g. mvblog) 
    48 - Create database with a name that reflects the domain/website the blog is running on (e.g. mvblog_mvblog_org) 
    49 - Create a directory that will serve as the DocumentRoot for your blog (e.g. /var/www/domains/mvblog.org/www) 
    50 - Copy the /var/www/mvblog/style directory into the new style directory (e.g. /var/www/domains/mvblog.org/www/style) 
    51 - Copy the /var/www/mvblog/index.php into the new directory 
    52 - Copy the /var/www/mvblog/favicon.ico into the new directory 
    53 - Change to the new directory (cd) 
    54 - Now you will need to create some symlinks. Below are the commands used: 
    55  
    56 For mvblog version 1.0 and before: 
    57  
    58 $ cd /var/www/domains/mvblog.org/www 
    59 $ ln -s /var/www/mvblog/UserFiles 
    60 $ ln -s /var/www/mvblog/admin 
    61 $ ln -s /var/www/mvblog/common 
    62 $ ln -s /var/www/mvblog/fckeditor 
    63  
    64 For mvblog version after 1.0: 
    65  
    66 $ cd /var/www/domains/mvblog.org/www 
    67 $ ln -s /var/www/mvblog/admin 
    68 $ ln -s /var/www/mvblog/common 
    69 $ ln -s /var/www/mvblog/xinha 
    70  
    71 - Edit the common/hosts.php file to list your hostname, etc. 
    72 - Edit your webservers config to enable the domain 
    73  
    74 Your blog can now be reached at the url associated with the DocumentRoot. 
    75  
    76 The Admin Interface can be accessed through the admin/ folder in your url. 
    77  
    78 The default admin user/password is mvblog/mvblog 
    79 I suggest you create a new user and disable the mvblog admin user as 
    80 soon as possible. 
    81  
    82 You are now ready to enjoy MvBlog. 
  • trunk/README

    r475 r512  
    1 MvBlog v 2.1 
     1MvBlog v %%VERSION%% 
    22 
    33Copyright (c) 2005-2007, Michiel van Baak <mvanbaak (AT) users (DOT) sourceforge (DOT) net> 
    44Logo design (c) 2005-2006, Sofie van Tendeloo <eldridge (AT) users (DOT) sourceforge (DOT) net> 
    55Significant work done by Ferry Boender <f.boender (AT) electricmonk (DOT) nl> 
    6 Licensed under the General Public License (GPL), see LICENSE file  
     6Licensed under the General Public License (GPL), see LICENSE file 
    77provided with this program. 
    88 
     
    2828------------------------------------------------------------------------------- 
    2929 
    30 MvBlog is a webbased tool written in PHP to manage a  
     30MvBlog is a webbased tool written in PHP to manage a 
    3131PHP::PEAR compatible written blog. 
    3232 
     
    3535 
    3636List of current features (new features marked with *) : 
    37   
     37 
    3838Managing posts 
    3939Managing authors 
     
    6363------------------------------------------------------------------------------- 
    6464 
    65   This section is intended for system administrators who would like to  
    66   offer MvBlog to the users on their systems.  
     65  This section is intended for system administrators who would like to 
     66  offer MvBlog to the users on their systems. 
    6767  See the INSTALL file 
    6868 
     
    8181 
    8282* Do not run your webserver as user root! 
    83    
     83 
    8484Also read the beautiful NO WARRANTY disclaimer in the GPL. ;) 
    8585 
    86    
     86 
    87879. Contributing. 
    8888------------------------------------------------------------------------------- 
    8989 
    90 If you wish to contribute to MvBlog,  
     90If you wish to contribute to MvBlog, 
    9191you can do so with the following things: 
    92    
     92 
    9393    * patches. 
    9494    * suggestions. 
    9595    * feature requests. 
    96    
     96 
    9797  When contributing code, please keep the following in mind: 
    98    
     98 
    9999    * Write your code according to the rest of programs code style. 
    100100    * Send in patches created with the 'diff' command and the -u flag set. 
    101101    * Patch purpose must follow the project goals. (or fix bugs, etc) 
    102     * Patches sent to me are public domain or under a GPL (compatible)  
    103       license, or they can't be added to the code.  
    104    
     102    * Patches sent to me are public domain or under a GPL (compatible) 
     103      license, or they can't be added to the code. 
     104 
    105105 
    10610610. Copyright stuff. 
     
    109109  MvBlog is Copyright by Michiel van Baak, 
    110110  licensed under the General Public License (GPL) 
    111    
     111 
    112112  Copyright (C), 2005-2007 by Michiel van Baak <mvanbaak (AT) users (DOT) sourceforge (DOT) net> 
    113    
     113 
    114114  This program is free software; you can redistribute it and/or 
    115115  modify it under the terms of the GNU General Public License 
    116   as published by the Free Software Foundation; either version 2 
    117   of the License, or (at your option) any later version. 
    118        
     116  as published by the Free Software Foundation version 2 
     117  of the License. 
     118 
    119119  This program is distributed in the hope that it will be useful, 
    120120  but WITHOUT ANY WARRANTY; without even the implied warranty of 
    121121  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
    122122  GNU General Public License for more details. 
    123        
     123 
    124124  You should have received a copy of the GNU General Public License 
    125125  along with this program; if not, write to the Free Software 
    126126  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    127                
     127 
    128128  For more information, see the COPYING file supplied with this 
    129129  program. 
     
    134134 
    135135Author: 
    136    
     136 
    137137    Michiel van Baak 
    138138    Email: mvanbaak (AT) users (DOT) sourceforge (DOT) net 
     
    141141  Please report any bugs, requests and general comments by using the project 
    142142  page at dev.mvblog.org 
    143    
     143 
    144144  You may also mail them to me. Before reporting bugs or sending contributions 
    145145  please read the Contributing section in this README. 
     
    147147  Project HomePage: http://dev.mvblog.org 
    148148 
    149    
     149 
    150150 
    15115112. Thanks 
     
    165165  -------------- 
    166166        Leonieke Aalders (Nieke) 
    167    
     167 
    168168  Testing: 
    169169  -------- 
     
    171171        Kermit    (http://xulon.info) 
    172172        f.boender (http://www.electricmonk.nl) 
    173    
     173 
    174174  Various suggestions and patches: 
    175175  -------------------------------- 
  • trunk/common/js/liveRequest.js

    r1 r512  
    1 var inputId = 'search';  
     1var inputId = 'search'; 
    22                                        // This is the id on the input/textarea that you want to use as the query. 
    3                                                                          
     3 
    44var outputId = 'searchresults'; 
    55                                        // use this to have the results populate your own ID'd tag. 
    66                                        // leave it blank and a div tag will automatically be added 
    77                                        // with an id="liveSearchResults" 
    8                                                                          
     8 
    99var processURI    = 'common/livesearch.php'; 
    1010                                        // this is the file that you request data from. 
    11                                                                          
     11 
    1212var emptyString   = ''; 
    1313                                        // What to display in the results field when there's nothing 
     
    4747 
    4848function liveReqInit() { 
    49          
     49 
    5050        inputElement  = document.getElementById(inputId); 
    5151        outputElement = document.getElementById(outputId); 
    52          
    53         if( inputElement == null || outputElement == null )  
     52 
     53        if( inputElement == null || outputElement == null ) 
    5454                return; 
    55          
    56          
     55 
     56 
    5757        if (navigator.userAgent.indexOf("Safari") > 0) { 
    5858                inputElement.addEventListener("keydown",liveReqStart,false); 
    59                  
     59 
    6060        } else if (navigator.product == "Gecko") { 
    6161                inputElement.addEventListener("keypress",liveReqStart,false); 
    62                  
     62 
    6363        } else { 
    6464                inputElement.attachEvent('onkeydown',liveReqStart); 
    6565                isIE = true; 
    6666        } 
    67          
     67 
    6868        if(emptyString == '') { 
    6969                // set the result field to hidden, or to default string 
     
    9393                        liveReq = new ActiveXObject("Microsoft.XMLHTTP"); 
    9494                } 
    95                  
     95 
    9696                liveReq.onreadystatechange = liveReqProcessReqChange; 
     97                var uri = processURI + "?s=" + encodeURI(inputElement.value); 
    9798                liveReq.open("GET", processURI + "?s=" + encodeURI(inputElement.value)); 
    9899                liveReqLast = inputElement.value; 
  • trunk/common/livesearch.php

    r501 r512  
    1818 * @copyright 2005-2007 Michiel van Baak 
    1919 */ 
    20 function db_init() { 
    21         session_start(); 
    22         require("MDB2.php"); 
    23         require("hosts.php"); 
     20require("mvblog.php"); 
     21$mvblog = new MvBlog(); 
     22//get all the authors in an array 
     23$res =& $mvblog->db->query("SELECT * FROM authors"); 
    2424 
    25         $options = array( 
    26                 "debug"       => 2, 
    27                 "portability" => MDB2_PORTABILITY_ALL, 
    28         ); 
     25if (PEAR::isError($res)) { 
     26        die($res->getMessage()); 
     27} 
    2928 
    30         $db =& MDB2::connect($dsn, $options); 
    31         if (PEAR::isError($db)) { 
    32                 die($db->getMessage()); 
    33         } 
    34         $_SESSION["filepath"] = $filepath; 
    35         return $db; 
     29while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { 
     30        $authors[$row["id"]]["fullname"] = $row["fullname"]; 
     31        $authors[$row["id"]]["email"]    = $row["email"]; 
    3632} 
    37 ob_start(); 
    38 $db = db_init(); 
    39  
    40  
    4133 
    4234$searchstring = urldecode($_REQUEST["s"]); 
     
    4941$query .= " ORDER BY date DESC"; 
    5042 
    51 $db->setLimit(5); 
    52 $res =& $db->query($query); 
     43$mvblog->db->setLimit(5); 
     44$res =& $mvblog->db->query($query); 
    5345$ret = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; 
    5446$ret .= "<channel>\n"; 
  • trunk/common/mvblog_common.php

    r490 r512  
    258258        protected function _init_db($settings = "") { 
    259259                require_once("MDB2.php"); 
    260                 if (!is_array($settings)) { 
    261                         require_once("hosts.php"); 
     260                //sqlite has a different scheme, because it's filebased 
     261                if ($settings["type"] == "sqlite") { 
     262                        if (is_dir("db")) 
     263                                $dsn = sprintf("%s:///db/%s.db?mode=0666", $settings["type"], $settings["database"]); 
     264                        elseif (is_dir("../db")) 
     265                                $dsn = sprintf("%s:///../db/%s.db?mode=0666", $settings["type"], $settings["database"]); 
    262266                } else { 
    263                         //sqlite has a different scheme, because it's filebased 
    264                         if ($settings["type"] == "sqlite") { 
    265                                 if (is_dir("db")) 
    266                                         $dsn = sprintf("%s:///db/%s.db?mode=0666", $settings["type"], $settings["database"]); 
    267                                 elseif (is_dir("../db")) 
    268                                         $dsn = sprintf("%s:///../db/%s.db?mode=0666", $settings["type"], $settings["database"]); 
    269                         } else { 
    270                                 $dsn = $settings["type"]."://".$settings["username"].":".$settings["password"]."@tcp(".$settings["hostname"].")/".$settings["database"]; 
    271                                 $dsn = sprintf("%s://%s:%s@tcp(%s)/%s", 
    272                                         $settings["type"], $settings["username"], $settings["password"], 
    273                                         $settings["hostname"], $settings["database"]); 
    274                         } 
     267                        $dsn = $settings["type"]."://".$settings["username"].":".$settings["password"]."@tcp(".$settings["hostname"].")/".$settings["database"]; 
     268                        $dsn = sprintf("%s://%s:%s@tcp(%s)/%s", 
     269                                $settings["type"], $settings["username"], $settings["password"], 
     270                                $settings["hostname"], $settings["database"]); 
    275271                } 
    276272 
     
    498494                if (array_key_exists("style", $_REQUEST)) { 
    499495                        /* Overwrite the style set in the session from the request */ 
    500                         $_SESSION["style"] = $this->_sanitize($_REQUEST["style"]);  
     496                        $_SESSION["style"] = $this->_sanitize($_REQUEST["style"]); 
    501497                } 
    502498                if (!array_key_exists("style", $_SESSION)) {