Hack.inc.php and the new 6.5 way of adding variables - 05/28/2004 8:46 AM
okay we have been tossing around the idea of a centralized file we could call hack.inc.php which esential have the following lines in it
<?
// DO NOT EDIT THIS SECTION
// Require the library
require ("main.inc.php");
?>
and would be placed in the includes directory and ALL scripts can then be pointed to that file instead of the main.inc.php it would enable people to make easy conversions from one version to another by just copying the new hack.inc.php to the new versions includes directory and then editing that ONE file..
Essentially all scripts would have the following
// DO NOT EDIT THIS SECTION
// Require the library
require ("/your/path/to/threads/includes/hack.inc.php");
instead of the one pointing to main.inc.php
also great news..the way 6.5 handles extra config variables is ya don;t paste em into the config.inc.php anymore you can do the following.
1. Create file called configextras.php in the /ubbthreads/includes directory and add
variables similar to the following basically any extra variables you need that do not come with the main config.inc.php:
$config['PPost_Host'] = "localhost";
$config['PPost_Database'] = "<yourdatabase>";
$theme['game_table_width'] = "";
$theme['game_cell_padding'] = "";
then
1a. In ubbtinc.php
FIND
require_once("$configdir/config.inc.php");
require_once("$thispath/mysql.inc.php");
require_once("$thispath/includes/theme.inc.php");
ADD BELOW IT
require_once("$thispath/includes/configextras.php");
that will autoload any configuration variables from the configextras.php into the config.inc.php or theme.inc.php file
thats a plus for we modders
<?
// DO NOT EDIT THIS SECTION
// Require the library
require ("main.inc.php");
?>
and would be placed in the includes directory and ALL scripts can then be pointed to that file instead of the main.inc.php it would enable people to make easy conversions from one version to another by just copying the new hack.inc.php to the new versions includes directory and then editing that ONE file..
Essentially all scripts would have the following
// DO NOT EDIT THIS SECTION
// Require the library
require ("/your/path/to/threads/includes/hack.inc.php");
instead of the one pointing to main.inc.php
also great news..the way 6.5 handles extra config variables is ya don;t paste em into the config.inc.php anymore you can do the following.
1. Create file called configextras.php in the /ubbthreads/includes directory and add
variables similar to the following basically any extra variables you need that do not come with the main config.inc.php:
$config['PPost_Host'] = "localhost";
$config['PPost_Database'] = "<yourdatabase>";
$theme['game_table_width'] = "";
$theme['game_cell_padding'] = "";
then
1a. In ubbtinc.php
FIND
require_once("$configdir/config.inc.php");
require_once("$thispath/mysql.inc.php");
require_once("$thispath/includes/theme.inc.php");
ADD BELOW IT
require_once("$thispath/includes/configextras.php");
that will autoload any configuration variables from the configextras.php into the config.inc.php or theme.inc.php file
thats a plus for we modders