diff --git a/common.inc.php b/common.inc.php index 04a4a9b..5ec4de9 100644 --- a/common.inc.php +++ b/common.inc.php @@ -27,8 +27,8 @@ header("Content-Type: text/html; charset=utf8"); //set error reporting to not show notices, for some reason some people's installation dont set this by default //so we will set it in the code instead just to make sure -#error_reporting(E_ALL); -error_reporting( E_ALL ^ E_WARNING ); +error_reporting(E_ALL); +#error_reporting( E_ALL ^ E_WARNING ); #error_reporting( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED ); define('REQUIREDFIELD','*'); @@ -86,7 +86,7 @@ else $dsn = "mysql:host=db;dbname=sfiab;charset=utf8mb4"; -$pdo = new PDO($dsn,$DBUSER,$DBPASS,$dsn_options); +$pdo = new PDO($dsn,$DBUSER,$DBPASS); if(!$pdo) { @@ -195,7 +195,7 @@ require_once("theme/{$config['theme_icons']}/icons.php"); require_once("committee.inc.php"); -session_start(); + if($config['SFIABDIRECTORY'] == '') { session_name("SFIABSESSID"); @@ -205,6 +205,8 @@ if($config['SFIABDIRECTORY'] == '') { session_set_cookie_params(0,$config['SFIABDIRECTORY']); } +session_start(); + //detect the browser first, so we know what icons to use - we store this in the config array as well //even though its not configurable by the fair if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE")) @@ -230,6 +232,7 @@ else } } //now if no language has been set yet, lets set it to the default language + if(!$_SESSION['lang']) { //first try the default language, if that doesnt work, use "en" @@ -1086,7 +1089,7 @@ function output_page_text($textname) } //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br - if(strlen($r->text)==strlen(strip_tags($r->text))) + if($r->text !== null and strlen($r->text)==strlen(strip_tags($r->text))) echo nl2br($r->text); else echo $r->text; @@ -1108,7 +1111,7 @@ function output_page_cms($filename) echo ""; //if it looks like we have HTML content, dont do a nl2br, if there's no html, then do the nl2br - if(strlen($r->text)==strlen(strip_tags($r->text))) + if($r->text !== null and strlen($r->text)==strlen(strip_tags($r->text))) echo nl2br($r->text); else echo $r->text; diff --git a/config/backuprestore.php b/config/backuprestore.php index 4dc3d05..b219120 100644 --- a/config/backuprestore.php +++ b/config/backuprestore.php @@ -50,7 +50,7 @@ while($tr=$tableq->fetch(PDO::FETCH_NUM)) { $str="INSERT INTO `$table` ("; unset($fields); $fields=array(); - while($cr=$columnq->fetch(PDO:;FETCH_OBJ)) { + while($cr=$columnq->fetch(PDO:FETCH_OBJ)) { $str.="`".$cr->Field."`,"; $fields[]=$cr->Field; } diff --git a/config/categories.php b/config/categories.php index 0f71f64..15668ab 100644 --- a/config/categories.php +++ b/config/categories.php @@ -31,7 +31,7 @@ array('Committee Main' => 'committee_main.php', 'SFIAB Configuration' => 'config/index.php', 'Age Categories' => 'config/categories.php'),"project_age_categories"); - } else + } else { send_header("Age Categories", array('Committee Main' => 'committee_main.php', 'SFIAB Configuration' => 'config/index.php'),"project_age_categories"); diff --git a/config/divisions.php b/config/divisions.php index 3414c51..86bfd9b 100644 --- a/config/divisions.php +++ b/config/divisions.php @@ -218,7 +218,7 @@ if($_GET['action']=="edit" || $_GET['action']=="new") { $tempcat=" "; }else{ $tempcat=""; - while($categoryr=$c->fetch(PDO::FETCH_OBJ){ + while($categoryr=$c->fetch(PDO::FETCH_OBJ)){ $tempcat.=",".$categoryr->category; } $tempcat=substr($tempcat,1); diff --git a/config/languagepacks.php b/config/languagepacks.php index c166009..21c377a 100644 --- a/config/languagepacks.php +++ b/config/languagepacks.php @@ -39,6 +39,7 @@ function loadLanguagePacks() { $ret=array(); + //// FIXME Replace! if($packs=file("http://www.sfiab.ca/languages/langpacklist.txt")) { $num=count($packs); diff --git a/config/variables.php b/config/variables.php index 46b6796..b0943a7 100644 --- a/config/variables.php +++ b/config/variables.php @@ -81,10 +81,10 @@ $q->execute(); $trclass = ($trclass == 'odd') ? 'even' : 'odd'; echo "
".i18n("Question")." | "; - echo "\n"; + echo "\n"; echo " |
".i18n("Table Heading")." | "; - echo "\n"; + echo "\n"; echo " |
".i18n("Type")." | "; - echo " | "; echo "
".i18n("Required?")." | ";
- echo " |