[BETA] Database Manager

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Hacker~
Registered User
Posts: 233
Joined: Wed Apr 10, 2002 12:41 am
Location: Houston, Tx Never too far to Travel and see Otep
Contact:

Post by Hacker~ »

pollix wrote: WORKS great! I have it installed on my forum now. are there any updates coming out soon?


Yes when my current version is approved , you will see the updates.. right now your running older version ;)
Hacker
pollix
Registered User
Posts: 153
Joined: Tue Jul 23, 2002 6:29 pm
Location: Ridgecrest, CA
Contact:

Post by pollix »

I know this is a bit much...how hard would it be where we could literally go in like phpmyadmin and mess around with the entire database? I'm not able to access phpmyadmin at work, and have to do all database stuff at home. With your mod now, I'm able to do some minor installs with the database. But being able to go in through phpbb and mess with my database is

a. lazy of me
b. sounds cool for me
c. might interest other lazy people like myself. :D

Thanks
Hacker~
Registered User
Posts: 233
Joined: Wed Apr 10, 2002 12:41 am
Location: Houston, Tx Never too far to Travel and see Otep
Contact:

Post by Hacker~ »

lol :lol: The reason i left it as i did , is because if you know the command

DROP TABLE php_users

ect ect then you can easily manage any tables connected to phpBB :D I would look at php.net a bit if you dont know the sql commands ;) they have a good respritory of them ..

Perhaps in future edition i will make a fully compatable " mini phpmyadmin " module for phpBB users :D
Hacker
Hacker~
Registered User
Posts: 233
Joined: Wed Apr 10, 2002 12:41 am
Location: Houston, Tx Never too far to Travel and see Otep
Contact:

Post by Hacker~ »

Minor cosmetic changes and input changes

This mod with the changes below is phpBB 2.0.4 Compliant.. these changes must be done using the code below for the mod to continue working..


admin_edit_db.php

Code: Select all

<? 
define('IN_PHPBB', 1); 

if( !empty($setmodules) ) 
{ 
   $file = basename(__FILE__); 
   $module['XtremeMods']['Database Manager'] = "$file"; 
   return; 
} 
// 
// Load default header 
// 
$no_page_header = TRUE; 
$phpbb_root_path = "../"; 
require($phpbb_root_path . 'extension.inc'); 
require($phpbb_root_path . 'config.php'); 
require('pagestart.' . $phpEx); 
   
    //filename: admin_edit_db.php 
    //edit the dbhost dbusername and dbpassword below to corrospond with your information 
   if ($mode == 'submit') 
   { 
   $phpbb_root_path = "../"; 
   require($phpbb_root_path . 'config.php'); 
   $connection = mysql_connect("$dbhost","$dbuser","$dbpasswd") or die (" couldnt connect to database "); 
   $db = mysql_select_db("$dbname", $connection) or die (" couldnt connect to database "); 
    
   // sql query 
   // edit the altering table to corrospond with the database prefix your using ex: phpbb_users 
    
   $sql = "$query"; 
   $sql_result = mysql_query($sql,$connection) or die ("couldnt execute the query"); 
    
   if (!$sql_result) { 
      echo "<h1>Couldnt install the change</h1>"; 
	  
      }else{ 
      include('page_header_admin.'.$phpEx); 
      
      $template->set_filenames(array( 
      'body' => 'admin/admin_edit_dbW.tpl') 
      ); 
      $template->pparse('body'); 
       
      } 
       
      } 
       
   else if ($mode == '') 
   { 
   include('page_header_admin.'.$phpEx); 
    $template->set_filenames(array( 
      'body' => 'admin/admin_edit_db.tpl') 
   ); 
    
   $template->assign_vars(array( 
      'DBHOST' => $dbhost, 
      'DBNAME' => $dbname, 
      'DBUSER' => $dbuser, 
      'DBPASSWD' => $dbpasswd, 
      'TBLNAME' => $tblname, 
      "S_PROFILE_ACTION" => append_sid("admin_edit_db.$phpEx?mode=submit"),
	  'QUERY' => $query )
      
    ); 
    
   $template->pparse('body'); 
      include('page_footer_admin.'.$phpEx); 
   } 
         
?>

admin_edit_db.tpl

Code: Select all

<h1>XtremeMods Database Manager</h1> 

<p><font size=2 face=verdana>Using this you can alter a database table related to phpBB.. <br></font></p> 

<form action="{S_PROFILE_ACTION}" method="post"> 
  <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> 
   <tr> 
     <th class="thHead" colspan="2">XM Database Manager v1.0.3[Alpha]</th> 
   </tr> 
   <tr> 
     <td class="row1">Database Host: [ ex: Localhost ]</td> 
     <td class="row2"><input type="text" size="25" name="dbhost" value="{DBHOST}" class="post" /></td> 
   </tr> 
   <tr> 
     <td class="row1">Username:</td> 
     <td class="row2"><input type="text" name="dbuser" value="{DBUSER}" class="post"></td> 
   </tr> 
   <tr> 
     <td class="row1">Password:</td> 
     <td class="row2"><input type="password" name="dbpasswd" VALUE="{DBPASSWD}" class="post"></td> 
   </tr> 
   <tr> 
     <td class="row1">Database Name:</td> 
     <td class="row2"><input type="text" name="dbname" VALUE="{DBNAME}" class="post"></td> 
   </tr> 

<tr> 
     <td class="row1">Query Statement: <br>[ Ex: ALTER TABLE phpbb_users ADD user_rank2 TINYINT (5) DEFAULT 0  ]</td> 
     <td class="row2">
<textarea name="query" class="post" cols=35 rows=10 value="{QUERY}"></textarea>
</td> 
   </tr> 
    
   <tr> 
     <td class="catBottom" colspan="2" align="center"><input type="submit" name="submit" value="Do Changes" class="mainoption" /></td> 
   </tr> 
  </table> 
</form> 
       
<br clear="all" />
admin_edit_dbW.tpl

Code: Select all

<h1>XtremeMods</h1> 

<p><font size=2 face=verdana>Using this you can alter a database table related to phpBB.. <br></font></p> 

<center> Changes Successfully Completed.. Successful operation</center><p> 

<center><b>Created by : XtremeMods [<a href="http://www.xtrememods.cc">XtremeMods</a>]</b></center> 
       
<br clear="all" />

replace all your original files with these and you wont have any problems when you upgrade to phpBB 2.0.4 :D


Expect a more indepth version of this mod within the month, ive come across alot more mod time and I have plans to improve this one greatly :-) *pollix ;) *
Hacker
EwaldB
Registered User
Posts: 39
Joined: Sun Mar 02, 2003 2:50 pm

Post by EwaldB »

Top Job!
Darlantan
Registered User
Posts: 369
Joined: Wed Mar 13, 2002 1:37 pm

Post by Darlantan »

Hey Hacker,
wanna combine efforts?
I have a simple interface I've been using abit. It was just a hacked
together file cause I never knew anyone was interrested. lol :)

So when I saw this thread when browsing the mod forums just the other
day, I decided to write it up and zip it. Allthough it hasn't been tested
much I think it should do the same things yours is doing. Only I think it
also works on other phpbb supported databases other than mysql
(allthough I haven't tested hehe)

http://www.codecrush.com/repository/cc_db_001.zip
What you think Hacker?
:)
- Kris
Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah »

I think it is a great idea!!! I would help too if I knew what the heck I was doing! :wink:


Now for my problem... I am guessing that these files go here:
php root > admin/admin_edit_db.php
php root > templates/subXxx/admin/admin_edit_db.tpl
php root > templates/subXxx/admin/admin_edit_dbW.tpl

so then I get this error:

Code: Select all

<? define('IN_PHPBB', 1); if( !empty($setmodules) ) { $file = basename(__FILE__); $module['XtremeMods']['Database Manager'] = "$file"; return; } // // Load default header // $no_page_header = TRUE; $phpbb_root_path = "../"; require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'config.php'); require('pagestart.' . $phpEx); //filename: admin_edit_db.php //edit the dbhost dbusername and dbpassword below to corrospond with your information if ($mode == 'submit') { $phpbb_root_path = "../"; require($phpbb_root_path . 'config.php'); $connection = mysql_connect("$dbhost","$dbuser","$dbpasswd") or die (" couldnt connect to database "); $db = mysql_select_db("$dbname", $connection) or die (" couldnt connect to database "); // sql query // edit the altering table to corrospond with the database prefix your using ex: phpbb_users $sql = "$query"; $sql_result = mysql_query($sql,$connection) or die ("couldnt execute the query"); if (!$sql_result) { echo "<h1>Couldnt install the change</h1>"; }else{ include('page_header_admin.'.$phpEx); $template->set_filenames(array( 'body' => 'admin/admin_edit_dbW.tpl') ); $template->pparse('body'); } } else if ($mode == '') { include('page_header_admin.'.$phpEx); $template->set_filenames(array( 'body' => 'admin/admin_edit_db.tpl') ); $template->assign_vars(array( 'DBHOST' => $dbhost, 'DBNAME' => $dbname, 'DBUSER' => $dbuser, 'DBPASSWD' => $dbpasswd, 'TBLNAME' => $tblname, "S_PROFILE_ACTION" => append_sid("admin_edit_db.$phpEx?mode=submit"), 'QUERY' => $query ) ); $template->pparse('body'); include('page_footer_admin.'.$phpEx); } ?> 
or maybe not an error, just a file reading. I tried other folders for these files, but it was never posted whick ones they go in. I am sick today and it hurts to think... my eyes are sore too, so I am asking for help. Normally I try for another 3 hours... but not today.
Last edited by Hunkah on Mon Mar 17, 2003 3:25 pm, edited 1 time in total.
Antony
Registered User
Posts: 529
Joined: Wed Feb 12, 2003 9:06 am

Post by Antony »

Does this only allow admins to access?
Hunkah
Registered User
Posts: 57
Joined: Sat Mar 08, 2003 8:55 pm

Post by Hunkah »

There are three programs all going under different names all with the same theme. Maybe you all can get together and build the fattest mod (aka killer mod) going! One that interfaces better than phpMyAdmin! I know that each of you has something in your mod that would benifit the other giving us all the benifits too. Let me start by introducing you all... I have posted this in each of your threads. I will be the first to say I love you, and want to be friends. Now it is your turn... play nice!


Darlantan - CC SQL Admin - database interface
DanielT - Run MYSQl Queries from admin panel
Hacker~ - Database Manager
Post Reply

Return to “[2.0.x] MODs in Development”