forked from science-ation/science-ation
Fixed depreacated issues and warnings
This commit is contained in:
parent
9892d738d4
commit
8630024655
@ -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','<span class="requiredfield">*</span>');
|
||||
@ -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 "<img align=\"right\" src=\"".$config['SFIABDIRECTORY']."/data/logo-200.gif\" border=\"0\">";
|
||||
|
||||
//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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
|
@ -39,6 +39,7 @@
|
||||
function loadLanguagePacks()
|
||||
{
|
||||
$ret=array();
|
||||
//// FIXME Replace!
|
||||
if($packs=file("http://www.sfiab.ca/languages/langpacklist.txt"))
|
||||
{
|
||||
$num=count($packs);
|
||||
|
@ -81,10 +81,10 @@ $q->execute();
|
||||
$trclass = ($trclass == 'odd') ? 'even' : 'odd';
|
||||
echo "<tr class=\"$trclass\">";
|
||||
echo "<td align=\"right\">";
|
||||
if($r->cat==$category)
|
||||
echo "<b>".i18n($r->cat)."</b>";
|
||||
if($r['cat']==$category)
|
||||
echo "<b>".i18n($r['cat'])."</b>";
|
||||
else
|
||||
echo "<a href=\"".$_SERVER['PHP_SELF']."?category=".urlencode($r->cat)."\">".i18n($r->cat)."</a>";
|
||||
echo "<a href=\"".$_SERVER['PHP_SELF']."?category=".urlencode($r['cat'])."\">".i18n($r['cat'])."</a>";
|
||||
echo "</td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
@ -41,6 +41,7 @@
|
||||
function loadVersions()
|
||||
{
|
||||
$ret=array();
|
||||
// FIXME Replace
|
||||
if($v=file("http://www.sfiab.ca/version.txt"))
|
||||
{
|
||||
list($version,$date)=split("\t",trim($v[0]));
|
||||
|
@ -24,19 +24,22 @@
|
||||
<?
|
||||
|
||||
function config_editor_load($category, $year)
|
||||
{ global $pdo;
|
||||
{
|
||||
global $pdo;
|
||||
$query = "SELECT * FROM config WHERE year='$year' AND category='$category' ORDER BY ord";
|
||||
$q = $pdo->prepare($query);
|
||||
print($pdo->errorInfo());
|
||||
$q->execute();
|
||||
//print_r($pdo->errorInfo());
|
||||
|
||||
|
||||
$var = array();
|
||||
while($r=$q->fetch()) {
|
||||
$var[$r->var]['val'] = $r->val;
|
||||
$var[$r->var]['desc'] = $r->description;
|
||||
$var[$r->var]['category'] = $r->category;
|
||||
$var[$r->var]['ord'] = $r->ord;
|
||||
$var[$r->var]['type'] = $r->type;
|
||||
$var[$r->var]['type_values'] = $r->type_values;
|
||||
$var[$r['var']]['val'] = $r['val'];
|
||||
$var[$r['var']]['desc'] = $r['description'];
|
||||
$var[$r['var']]['category'] = $r['category'];
|
||||
$var[$r['var']]['ord'] = $r['ord'];
|
||||
$var[$r['var']]['type'] = $r['type'];
|
||||
$var[$r['var']]['type_values'] = $r['type_values'];
|
||||
}
|
||||
return $var;
|
||||
}
|
||||
@ -200,6 +203,7 @@ function config_editor($category, $year, $array_name, $self)
|
||||
if($biggest>30) $size=30;
|
||||
else $size=$biggest+1;
|
||||
|
||||
|
||||
//make sure size is at minimum 8, this way if all fields are empty you dont end up with 1 character long text boxes
|
||||
if($size<8) $size=8;
|
||||
|
||||
|
@ -174,7 +174,7 @@ function questions_update_question($qs)
|
||||
`db_heading`='".$qs['db_heading']."',
|
||||
`required`='".$qs['required']."',
|
||||
`ord`=".intval($qs['ord']."
|
||||
WHERE id='{$qs['id']}' ");
|
||||
WHERE id='{$qs['id']}' "));
|
||||
$stmt->execute();
|
||||
echo $pdo->errorInfo();
|
||||
}
|
||||
@ -369,17 +369,17 @@ function questions_editor($section, $year, $array_name, $self)
|
||||
echo error(i18n("Invalid question"));
|
||||
}
|
||||
}
|
||||
if($showform)
|
||||
if($showform and headers_sent())
|
||||
{
|
||||
echo "<table class=\"summarytable\">";
|
||||
echo "<tr><td>".i18n("Question")."</td><td>";
|
||||
echo "<input size=\"60\" type=\"text\" name=\"${array_name}[question]\" value=\"".htmlspecialchars($q['question'])."\">\n";
|
||||
echo "<input size=\"60\" type=\"text\" name=\"{$array_name}[question]\" value=\"".htmlspecialchars($q['question'])."\">\n";
|
||||
echo "</td></tr>";
|
||||
echo "<tr><td>".i18n("Table Heading")."</td><td>";
|
||||
echo "<input size=\"20\" type=\"text\" name=\"${array_name}[db_heading]\" value=\"".htmlspecialchars($q['db_heading'])."\">\n";
|
||||
echo "<input size=\"20\" type=\"text\" name=\"{$array_name}[db_heading]\" value=\"".htmlspecialchars($q['db_heading'])."\">\n";
|
||||
echo "</td></tr>";
|
||||
echo "<tr><td>".i18n("Type")."</td><td>";
|
||||
echo "<select name=\"${array_name}[type]\">";
|
||||
echo "<select name=\"{$array_name}[type]\">";
|
||||
if($q['type']=="check") $sel="selected=\"selected\""; else $sel="";
|
||||
echo "<option $sel value=\"check\">".i18n("Check box")."</option>\n";
|
||||
if($q['type']=="yesno") $sel="selected=\"selected\""; else $sel="";
|
||||
@ -392,7 +392,7 @@ function questions_editor($section, $year, $array_name, $self)
|
||||
echo "</select>";
|
||||
echo "</td>";
|
||||
echo "<tr><td>".i18n("Required?")."</td><td>";
|
||||
echo "<select name=\"${array_name}[required]\">";
|
||||
echo "<select name=\"{$array_name}[required]\">";
|
||||
if($q['required']=="yes") $sel="selected=\"selected\""; else $sel="";
|
||||
echo "<option $sel value=\"yes\">".i18n("Yes")."</option>\n";
|
||||
if($q['required']=="no") $sel="selected=\"selected\""; else $sel="";
|
||||
|
Loading…
Reference in New Issue
Block a user