Creating a New Site

A nuBuilder site consists of a database, a login page and two PHP configuration files.

nuBuilder requires several pre-populated tables to exist in the database for the system to work. Each of these tables is prefixed with zzsys_. A blank nuBuilder site called 'sample' is included in all downloads of nuBuilder, this contains all of the required tables.

The login page and configuration files live in their own directory inside the db directory where nuBuilder was installed, for example, [NUBUILDER WEBROOT]/db/mysite/ . The requirements for each of these files and some examples are detailed below.


This is the login page for the nuBuilder. A basic template is provided below.

$dbfolder = "mysite";
<body on<x>load='document.forms[0]["u"].focus()'>
  <form name='index' method='POST' action='../../productionnu2/formlogin.php?x=1&d=db/<?php echo $dbfolder; ?>'>
	User Name <input type='text' name='u'><br />
	Password <input type='password' name='p'><br />
	<input type='submit' class="button" value="Login" />


Each nuBuilder site has it's own config.php. It supports the following configuration variables.

$DBHost                 = "";
$DBName                 = "mysitedb";
$DBUser                 = "mysiteuser";
$DBPassword             = "mysitepass";
$DBGlobeadminPassword   = "mysiteglobeadmin";


The MySQL server which hosts this site's database.


The name of the database which this site uses.


Any MySQL user which has full permissions on the database specified by $DBName. By default, nuBuilder will not attempt to access any other database.


The password for the MySQL user specified by $DBUser.


An optional globeadmin password which is specific to this site. Either this password or the one specified in the global config.php can be used for logging in as globeadmin. This can be left blank to disable the site specific password.


nuBuilder expects this file to provide a function called nuRunQuery(). nuRunQuery() is used by nuBuilder for two functions: getting the details for connecting to the MySQL database and as a custom replacement for mysql_run_query(). Following is a template database.php.

function nuRunQuery($pSQL, $pStopOnQueryError = true)
global $nuQueriesRun;
global $DBHost;
global $DBName;
global $DBUser;
global $DBPassword;
        if($pSQL == '')
                $a           = array();
                $a[0]        = $DBHost;
                $a[1]        = $DBName;
                $a[2]        = $DBUser;
                $a[3]        = $DBPassword;
                return $a;
        $t = dbQuery($DBHost, $DBName, $DBUser, $DBPassword, $pSQL, $pStopOnQueryError);
        return $t;

Created by: michael. Last Modification: Friday 22 of February, 2013 11:54:54 CST by steven.