[Phpbbkb-checkins] SF.net SVN: phpbbkb: [9] root
Status: Alpha
Brought to you by:
markthedaemon
|
From: <mar...@us...> - 2006-10-14 02:56:39
|
Revision: 9
http://svn.sourceforge.net/phpbbkb/?rev=9&view=rev
Author: markthedaemon
Date: 2006-10-13 19:56:33 -0700 (Fri, 13 Oct 2006)
Log Message:
-----------
Added the initial commit of the install file. Obviously more queries to add to this.
TODO: Change header; add queries; fix bugs.
It's 4am and i've probably missed something really important out. Forgive me :P
Added Paths:
-----------
root/install/
root/install/kb_install.php
Added: root/install/kb_install.php
===================================================================
--- root/install/kb_install.php (rev 0)
+++ root/install/kb_install.php 2006-10-14 02:56:33 UTC (rev 9)
@@ -0,0 +1,84 @@
+<?php
+/***************************************************************************
+ * kb_install.php
+ * -------------------
+ *
+ * copyright: phpBB KB Group
+ * site: http://www.phpbbknowledgebase.com
+ * SF Project Page: http://www.sourceforge.net/projects/phpbbkb
+ *
+ ***************************************************************************/
+
+/***************************************************************************
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ ***************************************************************************/
+
+define('IN_PHPBB', true);
+$phpbb_root_path = './../';
+include($phpbb_root_path . 'extension.inc');
+include($phpbb_root_path . 'common.'.$phpEx);
+
+//
+// Start session management
+//
+$userdata = session_pagestart($user_ip, PAGE_INDEX);
+init_userprefs($userdata);
+//
+// End session management
+//
+
+
+if( !$userdata['session_logged_in'] )
+{
+ $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
+ header($header_location . append_sid("login.$phpEx?redirect=phpbb_sql_generator.$phpEx", true));
+ exit;
+}
+
+if( $userdata['user_level'] != ADMIN )
+{
+ message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
+}
+
+
+$page_title = 'Updating the database';
+include($phpbb_root_path . 'includes/page_header.'.$phpEx);
+
+echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
+echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';
+
+
+$sql = array();
+$sql[] = "ALTER TABLE " . $table_prefix . "forums ADD cat_kb tinyint(1) unsigned default 0";
+
+for( $i = 0; $i < count($sql); $i++ )
+{
+ if( !$result = $db->sql_query ($sql[$i]) )
+ {
+ $error = $db->sql_error();
+
+ echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
+ }
+ else
+ {
+ echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
+ }
+}
+
+
+echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
+
+echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. ';
+echo 'Please be sure to delete this file now.<br />';
+echo 'If you have run into any errors, please visit the '.
+ '<a href="http://www.phpbbknowledgebase.com" target="_blank">phpBB Knowledge Base Forums</a> or the <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=415458" target="_blank">phpBB.com topic</a> and ask someone for help.</span></td></tr>';
+echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day, and thanks for using the phpBB Knowledge Base MODification!</a></span></td></table>';
+
+include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
+
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|