phpbb mods - NBS






 

 

phpbb mods - NBS

View Full Version : phpbb mods


bulldogg
09-Sep-2006, 12:29 PM
can we install mods or wont it work, ive managed to install admin suerlist and portal and portal admin, but with the portal i have to run a db install with each new forum :(

i had to remove the portal and admin portal since i had problems with it

whats the rule on installing mods if there is one?

NightStorm
09-Sep-2006, 01:56 PM
Anything that would require SQL (pretty much everything) needs to have the tables and junk added to add_forum_sql.php and delete_forum_sql.php, so that it is executed at creation time.
Note that any pre-existing boards will need the sql edits done manually, as this will only affect new creations.

bulldogg
09-Sep-2006, 02:11 PM
hmm, will i need phpmyadmin to do this editing cause i dont have access to that. and could you explain more about the tables and junk added to add_forum_sql.php and delete_forum_sql.php, so that it is executed at creation time.

Derek
09-Sep-2006, 03:19 PM
Actually it is new_forum_sql.php, not add_forum_sql.php. You do not need phpMyAdmin access to do that. All you do is look in the readme for the mods, and they usually say what SQL queries to execute, you would just paste that list into new_forum_sql.php, and add table prefixes to it like I already have for the existing stuff.

For example, say you are installing phpBB Security by aUsTiN, which is one of my favorite mods, if you look in his install/installer.php file, there is SQL queries his mod adds. Here is a few of them taken from his installer...


$sql[] = "DROP TABLE IF EXISTS ". $table_prefix ."phpBBSecurity";
$sql[] = "CREATE TABLE `". $table_prefix ."phpBBSecurity` (
`ban_id` mediumint(8) NOT NULL auto_increment,
`ban_ip` varchar(15) NOT NULL default '',
`ban_reason` varchar(50) NOT NULL default '0',
`ban_date` int(10) NOT NULL default '0',
`ban_attempts` int(10) NOT NULL default '0',
`ban_link` text NOT NULL,
PRIMARY KEY (`ban_id`)
) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1;";

$sql[] = "INSERT INTO ". CONFIG_TABLE ." (config_name, config_value) VALUES ('phpBBSecurity_login_limit', '3');";
$sql[] = "INSERT INTO ". CONFIG_TABLE ." (config_name, config_value) VALUES ('phpBBSecurity_notify_admin', '1');";


This is a great example because I also use the same variable name for each query in my new_forum_sql.php file. Since he's using an array called $sql for his queries (which is what I use as well), then all we need to do is add the prefix for the new forums. To do this, you simply change ". $table_prefix ." to
" . $accessname . ". You also need to change ". CONFIG_TABLE ." to " . $accessname . "_config. Please note that there might be other constants in the queries that some mods use to install their database stuff. Some of them might be USERS_TABLE, SEARCH_TABLE, etc. Those will have to be changed so they look like my example for CONFIG_TABLE above. Now since his mod added some new tables to the database, we need to add code to remove them when sites are deleted. We simply do this in delete_forum_sql.php. Since it was only one table we just need to add one new line to this file.

$sql[] = "DROP TABLE " . $forum3['accessname'] . "_phpBBSecurity;";

There is currently not a feature to execute queries on forums that already exist, but I will be adding this feature in the next beta, so I suggest that if you already have existing forums to wait till the next beta to start adding mods.

Derek

bulldogg
09-Sep-2006, 03:57 PM
so with portal mod there is a mysql php file i have to run for it to work, do i add the stuff from there into new_forum_sql.php?

an idea would be to make an easy mod installer thing for multi forum scripts

Derek
09-Sep-2006, 06:43 PM
You will have to open the installer for the folder for the portal mod, and find the sql queries that it adds to the database, then follow the rest of my instructions above to add it to the new_forum_sql.php file.

luky
20-Sep-2006, 10:51 AM
First reply helped me. Should sticky that quote.