Changeset 512
- Timestamp:
- 07/21/07 14:46:15 (16 months ago)
- Location:
- trunk
- Files:
-
- 2 removed
- 6 modified
-
.htaccess (modified) (1 diff)
-
INSTALL (modified) (2 diffs)
-
README (modified) (11 diffs)
-
common/hosts.php.sample (deleted)
-
common/js/liveRequest.js (modified) (3 diffs)
-
common/livesearch.php (modified) (2 diffs)
-
common/mvblog_common.php (modified) (2 diffs)
-
tags (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.htaccess
r321 r512 6 6 </IfModule> 7 7 ErrorDocument 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 2 2 3 3 * PHP5 (tested with apache2 cgi and apache2 module) 4 * PHP5 PostgreSQL module 5 * PEAR:: DB6 * 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 7 7 * 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 9 10 10 11 Installation 11 12 MvBlog can be used in 2 ways:13 1. Just one weblog14 2. Service for multiple weblogs on a server15 16 Below you will find the installation guide for both uses.17 18 1. Just one weblog19 12 20 13 - Unpack the .tar.gz in your DocumentRoot. 21 14 - Create a database for the blog. You can also create an optional database-user for the blog-database 22 15 - 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) 24 19 25 20 The actual commands to create a database and import the sql file are not shown here. … … 35 30 36 31 You are now ready to enjoy MvBlog. 37 38 39 2. Service for multiple weblogs on a server40 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/mvblog47 - 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 directory52 - Copy the /var/www/mvblog/favicon.ico into the new directory53 - 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/www59 $ ln -s /var/www/mvblog/UserFiles60 $ ln -s /var/www/mvblog/admin61 $ ln -s /var/www/mvblog/common62 $ ln -s /var/www/mvblog/fckeditor63 64 For mvblog version after 1.0:65 66 $ cd /var/www/domains/mvblog.org/www67 $ ln -s /var/www/mvblog/admin68 $ ln -s /var/www/mvblog/common69 $ ln -s /var/www/mvblog/xinha70 71 - Edit the common/hosts.php file to list your hostname, etc.72 - Edit your webservers config to enable the domain73 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/mvblog79 I suggest you create a new user and disable the mvblog admin user as80 soon as possible.81 82 You are now ready to enjoy MvBlog. -
trunk/README
r475 r512 1 MvBlog v 2.11 MvBlog v %%VERSION%% 2 2 3 3 Copyright (c) 2005-2007, Michiel van Baak <mvanbaak (AT) users (DOT) sourceforge (DOT) net> 4 4 Logo design (c) 2005-2006, Sofie van Tendeloo <eldridge (AT) users (DOT) sourceforge (DOT) net> 5 5 Significant work done by Ferry Boender <f.boender (AT) electricmonk (DOT) nl> 6 Licensed under the General Public License (GPL), see LICENSE file 6 Licensed under the General Public License (GPL), see LICENSE file 7 7 provided with this program. 8 8 … … 28 28 ------------------------------------------------------------------------------- 29 29 30 MvBlog is a webbased tool written in PHP to manage a 30 MvBlog is a webbased tool written in PHP to manage a 31 31 PHP::PEAR compatible written blog. 32 32 … … 35 35 36 36 List of current features (new features marked with *) : 37 37 38 38 Managing posts 39 39 Managing authors … … 63 63 ------------------------------------------------------------------------------- 64 64 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. 67 67 See the INSTALL file 68 68 … … 81 81 82 82 * Do not run your webserver as user root! 83 83 84 84 Also read the beautiful NO WARRANTY disclaimer in the GPL. ;) 85 85 86 86 87 87 9. Contributing. 88 88 ------------------------------------------------------------------------------- 89 89 90 If you wish to contribute to MvBlog, 90 If you wish to contribute to MvBlog, 91 91 you can do so with the following things: 92 92 93 93 * patches. 94 94 * suggestions. 95 95 * feature requests. 96 96 97 97 When contributing code, please keep the following in mind: 98 98 99 99 * Write your code according to the rest of programs code style. 100 100 * Send in patches created with the 'diff' command and the -u flag set. 101 101 * 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 105 105 106 106 10. Copyright stuff. … … 109 109 MvBlog is Copyright by Michiel van Baak, 110 110 licensed under the General Public License (GPL) 111 111 112 112 Copyright (C), 2005-2007 by Michiel van Baak <mvanbaak (AT) users (DOT) sourceforge (DOT) net> 113 113 114 114 This program is free software; you can redistribute it and/or 115 115 modify it under the terms of the GNU General Public License 116 as published by the Free Software Foundation ; eitherversion 2117 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 119 119 This program is distributed in the hope that it will be useful, 120 120 but WITHOUT ANY WARRANTY; without even the implied warranty of 121 121 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 122 122 GNU General Public License for more details. 123 123 124 124 You should have received a copy of the GNU General Public License 125 125 along with this program; if not, write to the Free Software 126 126 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 127 127 128 128 For more information, see the COPYING file supplied with this 129 129 program. … … 134 134 135 135 Author: 136 136 137 137 Michiel van Baak 138 138 Email: mvanbaak (AT) users (DOT) sourceforge (DOT) net … … 141 141 Please report any bugs, requests and general comments by using the project 142 142 page at dev.mvblog.org 143 143 144 144 You may also mail them to me. Before reporting bugs or sending contributions 145 145 please read the Contributing section in this README. … … 147 147 Project HomePage: http://dev.mvblog.org 148 148 149 149 150 150 151 151 12. Thanks … … 165 165 -------------- 166 166 Leonieke Aalders (Nieke) 167 167 168 168 Testing: 169 169 -------- … … 171 171 Kermit (http://xulon.info) 172 172 f.boender (http://www.electricmonk.nl) 173 173 174 174 Various suggestions and patches: 175 175 -------------------------------- -
trunk/common/js/liveRequest.js
r1 r512 1 var inputId = 'search'; 1 var inputId = 'search'; 2 2 // This is the id on the input/textarea that you want to use as the query. 3 3 4 4 var outputId = 'searchresults'; 5 5 // use this to have the results populate your own ID'd tag. 6 6 // leave it blank and a div tag will automatically be added 7 7 // with an id="liveSearchResults" 8 8 9 9 var processURI = 'common/livesearch.php'; 10 10 // this is the file that you request data from. 11 11 12 12 var emptyString = ''; 13 13 // What to display in the results field when there's nothing … … 47 47 48 48 function liveReqInit() { 49 49 50 50 inputElement = document.getElementById(inputId); 51 51 outputElement = document.getElementById(outputId); 52 53 if( inputElement == null || outputElement == null ) 52 53 if( inputElement == null || outputElement == null ) 54 54 return; 55 56 55 56 57 57 if (navigator.userAgent.indexOf("Safari") > 0) { 58 58 inputElement.addEventListener("keydown",liveReqStart,false); 59 59 60 60 } else if (navigator.product == "Gecko") { 61 61 inputElement.addEventListener("keypress",liveReqStart,false); 62 62 63 63 } else { 64 64 inputElement.attachEvent('onkeydown',liveReqStart); 65 65 isIE = true; 66 66 } 67 67 68 68 if(emptyString == '') { 69 69 // set the result field to hidden, or to default string … … 93 93 liveReq = new ActiveXObject("Microsoft.XMLHTTP"); 94 94 } 95 95 96 96 liveReq.onreadystatechange = liveReqProcessReqChange; 97 var uri = processURI + "?s=" + encodeURI(inputElement.value); 97 98 liveReq.open("GET", processURI + "?s=" + encodeURI(inputElement.value)); 98 99 liveReqLast = inputElement.value; -
trunk/common/livesearch.php
r501 r512 18 18 * @copyright 2005-2007 Michiel van Baak 19 19 */ 20 function db_init() { 21 session_start();22 require("MDB2.php"); 23 require("hosts.php");20 require("mvblog.php"); 21 $mvblog = new MvBlog(); 22 //get all the authors in an array 23 $res =& $mvblog->db->query("SELECT * FROM authors"); 24 24 25 $options = array( 26 "debug" => 2, 27 "portability" => MDB2_PORTABILITY_ALL, 28 ); 25 if (PEAR::isError($res)) { 26 die($res->getMessage()); 27 } 29 28 30 $db =& MDB2::connect($dsn, $options); 31 if (PEAR::isError($db)) { 32 die($db->getMessage()); 33 } 34 $_SESSION["filepath"] = $filepath; 35 return $db; 29 while ($row = $res->fetchRow(MDB2_FETCHMODE_ASSOC)) { 30 $authors[$row["id"]]["fullname"] = $row["fullname"]; 31 $authors[$row["id"]]["email"] = $row["email"]; 36 32 } 37 ob_start();38 $db = db_init();39 40 41 33 42 34 $searchstring = urldecode($_REQUEST["s"]); … … 49 41 $query .= " ORDER BY date DESC"; 50 42 51 $ db->setLimit(5);52 $res =& $ db->query($query);43 $mvblog->db->setLimit(5); 44 $res =& $mvblog->db->query($query); 53 45 $ret = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; 54 46 $ret .= "<channel>\n"; -
trunk/common/mvblog_common.php
r490 r512 258 258 protected function _init_db($settings = "") { 259 259 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"]); 262 266 } 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"]); 275 271 } 276 272 … … 498 494 if (array_key_exists("style", $_REQUEST)) { 499 495 /* Overwrite the style set in the session from the request */ 500 $_SESSION["style"] = $this->_sanitize($_REQUEST["style"]); 496 $_SESSION["style"] = $this->_sanitize($_REQUEST["style"]); 501 497 } 502 498 if (!array_key_exists("style", $_SESSION)) {
