Update of /cvsroot/php-blog/jBlog
In directory sc8-pr-cvs1:/tmp/cvs-serv17237
Modified Files:
jBlog_admin_installer.inc.php jBlog_plugin_api.php
Log Message:
Fix installation
Index: jBlog_admin_installer.inc.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_admin_installer.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- jBlog_admin_installer.inc.php 10 Mar 2003 21:05:28 -0000 1.10
+++ jBlog_admin_installer.inc.php 10 Mar 2003 22:25:51 -0000 1.11
@@ -231,57 +231,61 @@
fwrite($fp, $f);
fclose($fp);
echo "<b>Done.</b><br>";
- if (IN_JBLOG!==true) {
+ if (IN_JBLOG!==true) {
+ define('IN_JBLOG', true);
- // Create .htaccess
- $a = file("./htaccess.tpl");
- $fp = @fopen("./.htaccess", "w");
- if (!is_resource($fp)) {
- echo "<font color='#ff0000'>Error: Could not create .htaccess file, create it yourself:<pre>\n";
- echo implode("\n", $a);
- }
- else {
- for($x=0; $x<count($a); $x++) {
- fwrite($fp, str_replace("{PREFIX}", $_POST["jBlogHTTPPath"],$a[$x])."\n");
- }
- fclose($fp);
- }
+ // Create .htaccess
+ $a = file("./htaccess.tpl");
+ $fp = @fopen("./.htaccess", "w");
+ if (!is_resource($fp)) {
+ echo "<font color='#ff0000'>Error: Could not create .htaccess file, create it yourself:<pre>\n";
+ echo implode("\n", $a);
+ }
+ else {
+ for($x=0; $x<count($a); $x++) {
+ fwrite($fp, str_replace("{PREFIX}", $_POST["jBlogHTTPPath"],$a[$x])."\n");
+ }
+ fclose($fp);
+ }
- // Create tables
- echo "Attempting to setup Database...<br>";
- @mysql_select_db($_POST["dbName"]);
- $queries = jBlog_parse_sql_tables('./db.sql');
- $queries = str_replace("{PREFIX}", $_POST['dbPrefix'], $queries);
- foreach ($queries as $query) {
- mysql_query($query);
- }
- if($_POST['want_mail'] == true) {
- $mail_comments = 1;
- } else {
- $mail_comments = 0;
- }
- $query = "INSERT INTO $_POST[dbPrefix]authors
- (username, password, email, mail_comments)
- VALUES('$_POST[user]',
- password('$_POST[pass]'),
- '$_POST[email]',
- $mail_comments) ";
- mysql_query($query);
+ // Create tables
+ echo "Attempting to setup Database...<br>";
+ @mysql_select_db($_POST["dbName"]);
+ $queries = jBlog_parse_sql_tables('./db.sql');
+ $queries = str_replace("{PREFIX}", $_POST['dbPrefix'], $queries);
+ foreach ($queries as $query) {
+ mysql_query($query);
+ }
+ if($_POST['want_mail'] == true) {
+ $mail_comments = 1;
+ } else {
+ $mail_comments = 0;
+ }
+ $query = "INSERT INTO $_POST[dbPrefix]authors
+ (username, password, email, mail_comments)
+ VALUES('$_POST[user]',
+ password('$_POST[pass]'),
+ '$_POST[email]',
+ $mail_comments) ";
+ mysql_query($query);
- $text = mysql_escape_string(file_get_contents('./jBlog.css'));
- $query = "INSERT into $_POST[dbPrefix]css values(NULL, 'default', '$text')";
- if (!mysql_query($query)) {
+ $text = mysql_escape_string(file_get_contents('./jBlog.css'));
+ $query = "INSERT into $_POST[dbPrefix]css values(NULL, 'default', '$text')";
+ if (!mysql_query($query)) {
echo mysql_error();
}
-
+
/* register default plugins */
+
+ $GLOBALS['jBlog']['dbPrefix'] = $_POST['dbPrefix'];
+ $GLOBALS['jBlog']['dbName'] = $_POST['dbName'];
include_once "jBlog_plugin_api.php";
jblog_plugin_api::register_default_plugins();
- echo "<p>Welcome to jBlog!</b><p>";
- echo "Write down your password: ".$_POST["pass"]." and <a href='".$_POST["jBlogHTTPPath"]."'>check out your blog</a>";
- session_destroy();
- }
+ echo "<p>Welcome to jBlog!</b><p>";
+ echo "Write down your password: ".$_POST["pass"]." and <a href='".$_POST["jBlogHTTPPath"]."'>check out your blog</a>";
+ session_destroy();
+ }
}
}
break;
Index: jBlog_plugin_api.php
===================================================================
RCS file: /cvsroot/php-blog/jBlog/jBlog_plugin_api.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- jBlog_plugin_api.php 10 Mar 2003 22:11:19 -0000 1.5
+++ jBlog_plugin_api.php 10 Mar 2003 22:25:52 -0000 1.6
@@ -1,6 +1,8 @@
<?php
if (IN_JBLOG !== true) die ("Don't hack!");
+include_once 'jBlog_functions.inc.php';
+
/* This file defines the plugin API for jBlog.
* By extending these classes, you can add your own code
* to appear in the sidebar(s) of jBlog.
|