PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
jackel
Worker
Worker


Joined: Jan 15, 2009
Posts: 145
Location: Iowa, USA

PostPosted: Wed Mar 25, 2009 12:15 pm Reply with quote Back to top

Can someone show me how to make this into a SQL file

Code:

<?php
/***************************************************************************
 *                               wpm_db_update.php
 *                            ----------------------
 *
 *             copyright   : ©2003, 2005 Duvelske  (duvelske@planet.nl)
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   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);
define('WPM_INST', $table_prefix.'wpm');

//
// 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=db_update.$phpEx", true));
   exit;
}

if( $userdata['user_level'] != ADMIN )
{
   message_die(GENERAL_MESSAGE, 'You are not authorised to view this page');
}


$page_title = 'Updating the database for the WPM mod v 1.0.10';
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 for the WPM mod</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
   $sql[] = "DROP TABLE " . WPM_INST. "";
   $sql[] = "CREATE TABLE " . WPM_INST . " (name varchar(255) NOT NULL default '', value text NOT NULL) TYPE=MyISAM";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('wpm_version', '1.0.10')";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('active_wpm', '1')";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('wpm_username', 'Anonymous')";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('wpm_userid', '-1')";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('wpm_subject', 'Welcome to [sitename]!')";
   $sql[] = "INSERT INTO " . WPM_INST . " VALUES ('wpm_message', 'Hi, there [username]!')";

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">&nbsp;</td></tr>';

echo '<tr><th>End</th></tr><tr><td><span class="genmed">Instalation is ready. Delete the file now!<br />If you have encounterd some errors, please visit <a href="http://www.vitrax.org" target="_top">Vitrax support forums</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</a></span></td></table>';

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>


thanks
View user's profile Send private message
jackel
Worker
Worker


Joined: Jan 15, 2009
Posts: 145
Location: Iowa, USA

PostPosted: Wed Mar 25, 2009 8:54 pm Reply with quote Back to top

is anyone able please?

Thanks
View user's profile Send private message
evaders99
Former Moderator in Good Standing


Joined: Apr 30, 2004
Posts: 3221

PostPosted: Wed Mar 25, 2009 9:11 pm Reply with quote Back to top

Haven't tested this, but should be simple enough

Code:

DROP TABLE prefix_wpm;
CREATE TABLE prefix_wpm (name varchar(255) NOT NULL default '', value text NOT NULL) TYPE=MyISAM;
INSERT INTO prefix_wpm VALUES ('wpm_version', '1.0.10');
INSERT INTO prefix_wpm VALUES ('active_wpm', '1');
INSERT INTO prefix_wpm VALUES ('wpm_username', 'Anonymous');
INSERT INTO prefix_wpm VALUES ('wpm_userid', '-1');
INSERT INTO prefix_wpm VALUES ('wpm_subject', 'Welcome to [sitename]!');
INSERT INTO prefix_wpm VALUES ('wpm_message', 'Hi, there [username]!');
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum