* @copyright 2012 Sebastian Vassiliou
* @link http://www.magirc.org/
* @license GNU GPL Version 3, see http://www.gnu.org/licenses/gpl-3.0-standalone.html
- * @version 0.8.3
+ * @version 0.8.4
*/
ini_set('display_errors','on');
include_once('../lib/ckeditor/ckeditor.php');
require_once('lib/Admin.class.php');
-define('BASE_URL', sprintf("%s://%s%s", @$_SERVER['HTTPS'] ? 'https' : 'http', $_SERVER['SERVER_NAME'], str_replace('index.php', '', $_SERVER['SCRIPT_NAME'])));
+define('BASE_URL', sprintf("%s://%s:%s%s", @$_SERVER['HTTPS'] ? 'https' : 'http', $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], str_replace('index.php', '', $_SERVER['SCRIPT_NAME'])));
$admin = new Admin();
try {
* @copyright 2012 Sebastian Vassiliou
* @link http://www.magirc.org/
* @license GNU GPL Version 3, see http://www.gnu.org/licenses/gpl-3.0-standalone.html
- * @version 0.8.3
+ * @version 0.8.4
*/
ini_set('display_errors','on');
try {
define('DEBUG', $magirc->cfg->debug_mode);
- define('BASE_URL', sprintf("%s://%s%s", @$_SERVER['HTTPS'] ? 'https' : 'http', $_SERVER['SERVER_NAME'], str_replace('index.php', '', $_SERVER['SCRIPT_NAME'])));
+ define('BASE_URL', sprintf("%s://%s:%s%s", @$_SERVER['HTTPS'] ? 'https' : 'http', $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], str_replace('index.php', '', $_SERVER['SCRIPT_NAME'])));
$magirc->tpl->template_dir = 'theme/'.$magirc->cfg->theme.'/tpl';
$magirc->tpl->config_dir = 'theme/'.$magirc->cfg->theme.'/cfg';
$magirc->tpl->assign('cfg', $magirc->cfg);
public static function getInstance() {
if (is_null(self::$instance) === true) {
+ $db = null;
$error = false;
if (file_exists(PATH_ROOT.'conf/magirc.cfg.php')) {
include(PATH_ROOT.'conf/magirc.cfg.php');
} else {
$error = true;
}
- if (!isset($db)) {
+ if (!is_array($db)) {
$error = true;
}
if ($error) {
public static function getInstance() {
if (is_null(self::$instance) === true) {
// Check the database configuration
+ $db = null;
$error = false;
$config_file = PATH_ROOT . 'conf/denora.cfg.php';
if (file_exists($config_file)) {
} else {
$error = true;
}
- if ($error || !isset($db)) {
+ if ($error || !is_array($db)) {
die('<strong>MagIRC</strong> is not properly configured<br />Please configure the Denora database in the <a href="admin/">Admin Panel</a>');
}
$dsn = "mysql:dbname={$db['database']};host={$db['hostname']}";
$clients = array();
foreach ($result as $client) {
// Determine client name and version
+ $matches = array();
preg_match('/^(.*?)\s*(\S*\d\S*)/', str_replace(array('(',')','[',']','{','}'), '', $client['client']), $matches);
if (count($matches) == 3) {
$name = $matches[1];
});
foreach ($clients as $key => $val) {
arsort($clients[$key]['versions']);
+ unset($val);
}
// Prepare data for output
* @return array of Channel
*/
function getChannelList($datatables = false) {
- $aaData = array();
$secret_mode = Protocol::chan_secret_mode;
$private_mode = Protocol::chan_private_mode;
* @copyright 2012 Sebastian Vassiliou
* @link http://www.magirc.org/
* @license GNU GPL Version 3, see http://www.gnu.org/licenses/gpl-3.0-standalone.html
- * @version 0.8.3
+ * @version 0.8.4
**/
include_once('../lib/magirc/version.inc.php');
* @copyright 2012 Sebastian Vassiliou
* @link http://www.magirc.org/
* @license GNU GPL Version 3, see http://www.gnu.org/licenses/gpl-3.0-standalone.html
- * @version 0.8.3
+ * @version 0.8.4
*/
ini_set('display_errors','off');