diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index 343c1ef9c..0f1d3eb3b 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -771,7 +771,7 @@ class banlist_form_ui extends e_admin_form_ui - return $this->selectbox('banlist_bantype',$ipAdministrator->banTypes, $curVal); + return $this->select('banlist_bantype',$ipAdministrator->banTypes, $curVal); break; case 'filter': @@ -817,7 +817,7 @@ class banlist_form_ui extends e_admin_form_ui $opts[$curVal] = e107::getParser()->toDate($curVal, 'short'); } - return $this->selectbox('banlist_banexpires',$opts, $curVal); + return $this->select('banlist_banexpires',$opts, $curVal); // return $frm->text('banlist_banexpires',$curVal); break; diff --git a/e107_admin/cache.php b/e107_admin/cache.php index 6925096fa..896b19ee1 100644 --- a/e107_admin/cache.php +++ b/e107_admin/cache.php @@ -50,7 +50,7 @@ if (isset($_POST['submit_cache'])) if (isset($_POST['trigger_empty_cache'])) { - e107::getLog()->logSuccess(CACLAN_6); + e107::getLog()->addSuccess(CACLAN_6); switch ($_POST['option_clear_cache']) { case 'empty_contentcache': diff --git a/e107_admin/db.php b/e107_admin/db.php index bfdbb44bd..c1cabf781 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -22,7 +22,7 @@ if(!getperms('0')) if(isset($_POST['back'])) { - header("location: ".e_SELF); + e107::redirect(e_SELF); exit(); } diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index 2b119de82..6b6f6117b 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -29,8 +29,6 @@ require_once("auth.php"); $mes = e107::getMessage(); - - // Change the active emote pack if (isset($_POST['active'])) { @@ -38,7 +36,7 @@ if (isset($_POST['active'])) { $pref['smiley_activate'] = (int) $_POST['smiley_activate']; e107::getLog()->add($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, ''); - e107::getConfig()->set('smiley_activate',$pref['smiley_activate'])->save(true,true,true); + e107::getConfig()->set('smiley_activate', $pref['smiley_activate'])->save(true, true, true); $update = true; } @@ -55,34 +53,34 @@ if (isset($_POST['active'])) $fl = e107::getFile(); $emote = new emotec; -$one_pack = FALSE; +$one_pack = false; $filtered = e107::getParser()->filter($_POST); // Check for pack-related buttons pressed -foreach($filtered as $key => $value) +foreach ($filtered as $key => $value) { - if(strpos($key, "subPack_") !== false) + if (strpos($key, "subPack_") !== false) { $subpack = str_replace("subPack_", "", $key); $emote->emoteConf($subpack); break; } - if(strpos($key, "XMLPack_") !== false) + if (strpos($key, "XMLPack_") !== false) { $subpack = str_replace("XMLPack_", "", $key); $emote->emoteXML($subpack); break; } - if(strpos($key, "defPack_") !== false) + if (strpos($key, "defPack_") !== false) { - e107::getConfig()->set('emotepack', str_replace("defPack_", "", $key))->save(true,true,true); + e107::getConfig()->set('emotepack', str_replace("defPack_", "", $key))->save(true, true, true); e107::getLog()->add('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, ''); break; } - if(strpos($key, "scanPack_") !== false) + if (strpos($key, "scanPack_") !== false) { $one_pack = str_replace("scanPack_", "", $key); break; @@ -92,26 +90,27 @@ foreach($filtered as $key => $value) // $ns->tablerender($caption, $mes->render() . $text); $check = $emote->installCheck($one_pack); -if($check!==FALSE) +if ($check !== false) { - $emote -> listPacks(); + $emote->listPacks(); } - class emotec { - var $packArray; // Stores an array of all available emote packs (as subdirectory names) + + var $packArray; // Stores an array of all available emote packs (as subdirectory names) function __construct() { + /* constructor */ $fl = e107::getFile(); - $this -> packArray = $fl->get_dirs(e_IMAGE."emotes"); + $this->packArray = $fl->get_dirs(e_IMAGE . "emotes"); - if(isset($_POST['sub_conf'])) - { // Update stored pack configuration - $this -> saveConf(); + if (isset($_POST['sub_conf'])) + { // Update stored pack configuration + $this->saveConf(); } } @@ -119,24 +118,25 @@ class emotec // List available emote packs function listPacks() { + $pref = e107::getPref(); $frm = e107::getForm(); $fl = e107::getFile(); $ns = e107::getRender(); - $mes = e107::getMessage(); + $mes = e107::getMessage(); $text = "
-
- ".EMOLAN_1." + + " . EMOLAN_1 . " @@ -145,18 +145,18 @@ class emotec
- ".EMOLAN_4.": + " . EMOLAN_4 . ":
- ".$frm->checkbox('smiley_activate', 1, varset($pref['smiley_activate'],0))." + " . $frm->checkbox('smiley_activate', 1, varset($pref['smiley_activate'], 0)) . "
- ".$frm->admin_button('active','active','update',LAN_UPDATE)." + " . $frm->admin_button('active', 'active', 'update', LAN_UPDATE) . "
@@ -165,9 +165,9 @@ class emotec $text .= "
-
+
- ".EMOLAN_13." + " . EMOLAN_13 . " @@ -177,59 +177,57 @@ class emotec - - - - + + + + "; - $reject = '~^emoteconf|\.html$|\.php$|\.txt$'; // Files to exclude - foreach($this -> packArray as $pack) + $reject = '~^emoteconf|\.html$|\.php$|\.txt$'; // Files to exclude + foreach ($this->packArray as $pack) { - $can_scan = FALSE; - $emoteArray = $fl -> get_files(e_IMAGE.'emotes/'.$pack, $reject); + $can_scan = false; + $emoteArray = $fl->get_files(e_IMAGE . 'emotes/' . $pack, $reject); $text .= " - - + - + @@ -246,38 +244,39 @@ class emotec "; - $ns->tablerender(EMOLAN_PAGE_TITLE, $mes->render().$text); + $ns->tablerender(EMOLAN_PAGE_TITLE, $mes->render() . $text); } // Configure an individual emote pack function emoteConf($packID) { + global $e107, $sysprefs; $frm = e107::getForm(); $tp = e107::getParser(); $fl = e107::getFile(); - $ns = e107::getRender(); + $ns = e107::getRender(); $packID = $tp->filter($packID); - $corea = "emote_".$packID; + $corea = "emote_" . $packID; - $emotecode = $sysprefs -> getArray($corea); - $reject = '~^emoteconf|\.html$|\.php$|\.txt$|\.pak$|\.xml|\.phpBB'; // Files to exclude - $emoteArray = $fl -> get_files(e_IMAGE."emotes/".$packID, $reject); + $emotecode = $sysprefs->getArray($corea); + $reject = '~^emoteconf|\.html$|\.php$|\.txt$|\.pak$|\.xml|\.phpBB'; // Files to exclude + $emoteArray = $fl->get_files(e_IMAGE . "emotes/" . $packID, $reject); $eArray = array(); - foreach($emoteArray as $value) + foreach ($emoteArray as $value) { $eArray[] = array('path' => $value['path'], 'fname' => $value['fname']); } //XXX Not sure if we need to know rhe number of files found - count($eArray) -
Total ".count($eArray)." files found
$text = " - +
- ".LAN_EDIT." -
".$tp->lanVars(EMOLAN_31, count($eArray))."
+ " . LAN_EDIT . " +
" . $tp->lanVars(EMOLAN_31, count($eArray)) . "
".LAN_NAME."".EMOLAN_3."".LAN_STATUS."".LAN_OPTIONS."" . LAN_NAME . "" . EMOLAN_3 . "" . LAN_STATUS . "" . LAN_OPTIONS . "
{$pack} + {$pack} "; - foreach($emoteArray as $emote) + foreach ($emoteArray as $emote) { if (strpos($emote['fname'], ".pak") !== false - || strpos($emote['fname'], ".xml") !== false - || strpos($emote['fname'], "phpBB") !== false) + || strpos($emote['fname'], ".xml") !== false + || strpos($emote['fname'], "phpBB") !== false) { - $can_scan = TRUE; // Allow re-scan of config files + $can_scan = true; // Allow re-scan of config files } //elseif (!strstr($emote['fname'], ".txt") && !strstr($emote['fname'], ".bak") && !strstr($emote['fname'], ".html") && !strstr($emote['fname'], ".php") ) else { // Emote file found (might get other non-image files, but shouldn't) - $text .= " "; + $text .= " "; } } $text .= " ".($pref['emotepack'] == $pack ? "".LAN_ACTIVE."" : "")."" . ($pref['emotepack'] == $pack ? "" . LAN_ACTIVE . "" : "") . " "; - - - - - $text .= $frm->admin_button('subPack_'.$pack,'edit','default',LAN_CONFIGURE); - + + + $text .= $frm->admin_button('subPack_' . $pack, 'edit', 'default', LAN_CONFIGURE); + if ($can_scan && ($pack != 'default')) { - // $text .= ""; - $text .= $frm->admin_button('scanPack_'.$pack,'active','default',EMOLAN_26); + // $text .= ""; + $text .= $frm->admin_button('scanPack_' . $pack, 'active', 'default', EMOLAN_26); } - - $text .= $frm->admin_button('XMLPack_'.$pack,'submit','default',EMOLAN_28); + + $text .= $frm->admin_button('XMLPack_' . $pack, 'submit', 'default', EMOLAN_28); $text .= "
@@ -286,15 +285,15 @@ class emotec - - - + + + "; - foreach($eArray as $emote) + foreach ($eArray as $emote) { $ename = $emote['fname']; $evalue = str_replace(".", "!", $ename); @@ -303,18 +302,18 @@ class emotec if (!isset($emotecode[$evalue])) { - $file_back = '  '.EMOLAN_37.''; + $file_back = '  ' . EMOLAN_37 . ''; } elseif (!$emotecode[$evalue]) { - $text_back = '  '.EMOLAN_38.''; + $text_back = '  ' . EMOLAN_38 . ''; } $text .= " - - + + "; @@ -325,23 +324,24 @@ class emotec
".EMOLAN_5."".LAN_NAME."".EMOLAN_6." ( ".EMOLAN_7." )" . EMOLAN_5 . "" . LAN_NAME . "" . EMOLAN_6 . " ( " . EMOLAN_7 . " )
".$ename."{$file_back}" . $ename . "{$file_back} - {$text_back} + {$text_back}
"; - - - $text .= $frm->admin_button('sub_conf', 'no-value', 'update', LAN_SAVE); - $text .= $frm->admin_button('cancel','no-value', 'cancel' ,LAN_CANCEL); - + + + $text .= $frm->admin_button('sub_conf', 'no-value', 'update', LAN_SAVE); + $text .= $frm->admin_button('cancel', 'no-value', 'cancel', LAN_CANCEL); + $text .= "
"; - $ns->tablerender(EMOLAN_PAGE_TITLE.SEP.LAN_EDIT.": '".$packID."'", $text); + $ns->tablerender(EMOLAN_PAGE_TITLE . SEP . LAN_EDIT . ": '" . $packID . "'", $text); } // Generate an XML file - packname.xml in root emoticon directory - function emoteXML($packID, $strip_xtn = TRUE) + function emoteXML($packID, $strip_xtn = true) { + global $sysprefs; $mes = e107::getMessage(); $fl = e107::getFile(); @@ -349,34 +349,37 @@ class emotec $packID = $tp->filter($packID); - $fname = e_IMAGE."emotes/".$packID."/emoticons.xml"; - $backname = e_IMAGE."emotes/".$packID."/emoticons.bak"; + $fname = e_IMAGE . "emotes/" . $packID . "/emoticons.xml"; + $backname = e_IMAGE . "emotes/" . $packID . "/emoticons.bak"; - $corea = "emote_".$packID; - $emotecode = $sysprefs -> getArray($corea); + $corea = "emote_" . $packID; + $emotecode = $sysprefs->getArray($corea); - $reject = '~^emoteconf|\.html$|\.php$|\.txt$|\.pak$|\.xml|\.phpBB'; // Files to exclude - $emoteArray = $fl -> get_files(e_IMAGE."emotes/".$packID, $reject); + $reject = '~^emoteconf|\.html$|\.php$|\.txt$|\.pak$|\.xml|\.phpBB'; // Files to exclude + $emoteArray = $fl->get_files(e_IMAGE . "emotes/" . $packID, $reject); $eArray = array(); - foreach($emoteArray as $value) + foreach ($emoteArray as $value) { $eArray[] = $value['fname']; } - $f_string = "\n\n\n\n"; + $f_string = "\n\n\n\n"; - foreach($eArray as $emote) + foreach ($eArray as $emote) { // Optionally strip file extension $evalue = str_replace(".", "!", $emote); - if ($strip_xtn) $ename = substr($emote,0,strrpos($emote,'.')); + if ($strip_xtn) + { + $ename = substr($emote, 0, strrpos($emote, '.')); + } $f_string .= "\n"; - foreach (explode(' ',$tp -> toForm($emotecode[$evalue])) as $v) + foreach (explode(' ', $tp->toForm($emotecode[$evalue])) as $v) { if (trim($v)) { - $f_string .= "\t".htmlentities($v)."\n"; + $f_string .= "\t" . htmlentities($v) . "\n"; } } $f_string .= "\n"; @@ -384,17 +387,23 @@ class emotec $f_string .= "\n\n"; - if (is_file($backname)) unlink($backname); // Delete any old backup - - if (is_file($fname)) rename($fname,$backname); - - if (file_put_contents($fname,$f_string) === FALSE) + if (is_file($backname)) { - $mes->addWarning(''.EMOLAN_30.':'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname)); + unlink($backname); + } // Delete any old backup + + if (is_file($fname)) + { + rename($fname, $backname); + } + + if (file_put_contents($fname, $f_string) === false) + { + $mes->addWarning('' . EMOLAN_30 . ':' . str_replace(e_IMAGE, e_IMAGE_ABS, $fname)); } else { - $mes->addSuccess(''.EMOLAN_29.':'.str_replace(e_IMAGE, e_IMAGE_ABS, $fname)); + $mes->addSuccess('' . EMOLAN_29 . ':' . str_replace(e_IMAGE, e_IMAGE_ABS, $fname)); } } @@ -402,6 +411,7 @@ class emotec // Save configuration for an emote pack that's been edited function saveConf() { + $sql = e107::getDb(); $tp = e107::getParser(); @@ -409,267 +419,286 @@ class emotec $packID = $_POST['packID']; unset($_POST['sub_conf'], $_POST['packID']); $encoded_emotes = $tp->toDB($_POST); - // $tmp = addslashes(serialize($encoded_emotes)); - $tmp = e107::getArrayStorage()->WriteArray($encoded_emotes); + // $tmp = addslashes(serialize($encoded_emotes)); + $tmp = e107::serialize($encoded_emotes); - if ($sql->select("core", "*", "e107_name='emote_".$packID."'")) + if ($sql->select("core", "*", "e107_name='emote_" . $packID . "'")) { - e107::getMessage()->addAuto($sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$packID."' "), 'update', LAN_SETSAVED, false, false); + e107::getMessage()->addAuto($sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_" . $packID . "' "), 'update', LAN_SETSAVED, false, false); } else { - e107::getMessage()->addAuto($sql->insert("core", "'emote_".$packID."', '$tmp' "), 'insert', LAN_SETSAVED, false, false); + e107::getMessage()->addAuto($sql->insert("core", "'emote_" . $packID . "', '$tmp' "), 'insert', LAN_SETSAVED, false, false); } } // Identify currently selected emote pack. Read in any new ones // Return false to disable listing of packs - function installCheck($do_one = FALSE) + function installCheck($do_one = false) { + global $e107; - $sql = e107::getDb(); + $sql = e107::getDb(); $fl = e107::getFile(); $ns = e107::getRender(); $mes = e107::getMessage(); // Pick up a list of emote packs from the database $pack_local = array(); - if ($sql->select("core","*","`e107_name` LIKE 'emote_%'")) + if ($sql->select("core", "*", "`e107_name` LIKE 'emote_%'")) { while ($row = $sql->fetch()) - { - $pack_local[substr($row['e107_name'],6)] = TRUE; - } + { + $pack_local[substr($row['e107_name'], 6)] = true; + } } - foreach($this -> packArray as $value) + foreach ($this->packArray as $value) { - if(strpos($value,' ')!==FALSE) - { // Highlight any directory names containing spaces - not allowed + if (strpos($value, ' ') !== false) + { // Highlight any directory names containing spaces - not allowed $msg = " - ".EMOLAN_17." ".EMOLAN_18.": -
".LAN_NAME.": {$value}
-
".EMOLAN_20.": ".e_IMAGE_ABS."emotes/
+ " . EMOLAN_17 . " " . EMOLAN_18 . ": +
" . LAN_NAME . ": {$value}
+
" . EMOLAN_20 . ": " . e_IMAGE_ABS . "emotes/
"; $mes->addError($msg); - $ns->tablerender(EMOLAN_PAGE_TITLE.' - '.EMOLAN_21, $mes->render()); - return FALSE; + $ns->tablerender(EMOLAN_PAGE_TITLE . ' - ' . EMOLAN_21, $mes->render()); + + return false; } - if (array_key_exists($value,$pack_local)) + if (array_key_exists($value, $pack_local)) { unset($pack_local[$value]); } - if (($do_one == $value) || !$do_one && (!$sql->select("core", "*", "e107_name='emote_".$value."' "))) + if (($do_one == $value) || !$do_one && (!$sql->select("core", "*", "e107_name='emote_" . $value . "' "))) { // Pack info not in DB, or to be re-scanned - $no_error = TRUE; - $File_type = EMOLAN_32.":"; + $no_error = true; + $File_type = EMOLAN_32 . ":"; // Array of all files in the directory of the selected emote pack - $fileArray = $fl -> get_files(e_IMAGE."emotes/".$value); // We actually want all the files in the directory + $fileArray = $fl->get_files(e_IMAGE . "emotes/" . $value); // We actually want all the files in the directory $confFile = ''; - foreach($fileArray as $k => $file) + foreach ($fileArray as $k => $file) { - if(strpos($file['fname'], ".xml") !== false) + if (strpos($file['fname'], ".xml") !== false) { $confFile = array('file' => $file['fname'], 'type' => "xml"); } - else if(strpos($file['fname'], ".pak") !== false) + elseif (strpos($file['fname'], ".pak") !== false) { $confFile = array('file' => $file['fname'], 'type' => "pak"); } - else if(strpos($file['fname'], ".php") !== false) + elseif (strpos($file['fname'], ".php") !== false) { $confFile = array('file' => $file['fname'], 'type' => "php"); } if ($confFile) { - unset($fileArray[$k]); - break; + unset($fileArray[$k]); + break; } } /* .pak file */ - if($confFile['type'] == "pak") + if ($confFile['type'] == "pak") { - $filename = e_IMAGE."emotes/".$value."/".$confFile['file']; - $pakconf = file ($filename); + $filename = e_IMAGE . "emotes/" . $value . "/" . $confFile['file']; + $pakconf = file($filename); $contentArray = array(); - foreach($pakconf as $line) + foreach ($pakconf as $line) { - if(trim($line) && strpos($line, "=+") !== false && strpos($line, ".txt") === false && strpos($line, ".html") === false && strpos($line, "cvs") === false) $contentArray[] = $line; + if (trim($line) && strpos($line, "=+") !== false && strpos($line, ".txt") === false && strpos($line, ".html") === false && strpos($line, "cvs") === false) + { + $contentArray[] = $line; + } } $confArray = array(); - foreach($contentArray as $pakline) + foreach ($contentArray as $pakline) { - $tmp = explode("=+:", $pakline); - $confIC = str_replace(".", "!", $tmp[0]); - $confArray[$confIC] = trim($tmp[2]); + $tmp = explode("=+:", $pakline); + $confIC = str_replace(".", "!", $tmp[0]); + $confArray[$confIC] = trim($tmp[2]); } // $tmp = addslashes(serialize($confArray)); $tmp = e107::serialize($confArray); - $File_type = EMOLAN_22.":"; + $File_type = EMOLAN_22 . ":"; } /* end */ /* .xml file */ - if($confFile['type'] == "xml") + if ($confFile['type'] == "xml") { - $filename = e_IMAGE."emotes/".$value."/".$confFile['file']; + $filename = e_IMAGE . "emotes/" . $value . "/" . $confFile['file']; $contents = file_get_contents($filename); $confArray = array(); $xml_type = 0; - if ((strpos($contents, "") !== FALSE) && (strpos($contents, "") !== FALSE)) - { // xep-0038 format - /* Example: - - :-) - :) - happy.png - choir.wav - */ - preg_match_all("#\(.*?)\<\/icon\>#si", $contents, $match); + if ((strpos($contents, "") !== false) && (strpos($contents, "") !== false)) + { // xep-0038 format + /* Example: + + :-) + :) + happy.png + choir.wav + */ + preg_match_all("#\(.*?)\<\/icon\>#si", $contents, $match); - $xml_type = 1; + $xml_type = 1; // $match[0] - complete emoticon entry // $match[1] - match string and object specification - $item_index = 1; + $item_index = 1; } - elseif (strpos($contents, ""; - preg_match_all("#\(.*?)\<\/emoticon\>#si", $contents, $match); + preg_match_all("#\(.*?)\<\/emoticon\>#si", $contents, $match); - $xml_type = 2; + $xml_type = 2; // $match[0] - complete emoticon entry // $match[1] - filename (may or may not not have file extension/suffix) // $match[2] - match string(s) representing emote - $item_index = 2; + $item_index = 2; } if ($xml_type) { - for($a=0, $aMax = count($match[0]); $a < $aMax; $a++) - { - $e_file = ''; - switch ($xml_type) + for ($a = 0, $aMax = count($match[0]); $a < $aMax; $a++) { - case 1 : // xep-0038 - // Pull out a file name (only support first image type) - its in $fmatch[1] - if (preg_match("#\(.*?)\<\/object\>#si",$match[1][$a],$fmatch)) + $e_file = ''; + switch ($xml_type) { - $e_file = $fmatch[1]; + case 1 : // xep-0038 + // Pull out a file name (only support first image type) - its in $fmatch[1] + if (preg_match("#\(.*?)\<\/object\>#si", $match[1][$a], $fmatch)) + { + $e_file = $fmatch[1]; // echo "xep-0038 file: ".$e_file."
"; - // Pull out all match strings - need to pick out any language definitions for posterity - // but currently accept all language strings - preg_match_all("#\|\s*?xml\:lang\=\"(.*?)\"\>)(.*?)\<\/text\>#si", $match[1][$a], $match2); - // $match2[1] is the languages - // $match2[2] is the match strings - $codet = implode(" ",$match2[2]); + // Pull out all match strings - need to pick out any language definitions for posterity + // but currently accept all language strings + preg_match_all("#\|\s*?xml\:lang\=\"(.*?)\"\>)(.*?)\<\/text\>#si", $match[1][$a], $match2); + // $match2[1] is the languages + // $match2[2] is the match strings + $codet = implode(" ", $match2[2]); + } + break; + case 2 : + $e_file = $match[1][$a]; + // Now pull out all the 'match' strings + preg_match_all("#\(.*?)\<\/string\>#si", $match[2][$a], $match2); + $codet = implode(" ", $match2[1]); + break; } - break; - case 2 : - $e_file = $match[1][$a]; - // Now pull out all the 'match' strings - preg_match_all("#\(.*?)\<\/string\>#si", $match[2][$a], $match2); - $codet = implode(" ",$match2[1]); - break; - } - // $e_file has the emote file name - // $match2 has an array of substitution strings + // $e_file has the emote file name + // $match2 has an array of substitution strings - $file = ''; - foreach($fileArray as $emote) - { // Check that the file exists - if (strpos($e_file,".") === FALSE) - { // File extension not specified - accept any file extension for match - if(strpos($emote['fname'], $e_file.".") === 0) - { - $file = str_replace(".", "!", $emote['fname']); - break; + $file = ''; + foreach ($fileArray as $emote) + { // Check that the file exists + if (strpos($e_file, ".") === false) + { // File extension not specified - accept any file extension for match + if (strpos($emote['fname'], $e_file . ".") === 0) + { + $file = str_replace(".", "!", $emote['fname']); + break; + } + } + else + { // File extension specified - do simple match + if ($emote['fname'] == $e_file) + { + $file = str_replace(".", "!", $emote['fname']); + break; + } + } } - } - else - { // File extension specified - do simple match - if($emote['fname'] == $e_file) + // Only add if the file exists. OK if no definition - might want to be added + if ($file) { - $file = str_replace(".", "!", $emote['fname']); - break; - } - } - } - // Only add if the file exists. OK if no definition - might want to be added - if ($file) - { - $confArray[$file] = $codet; + $confArray[$file] = $codet; + } } - } } else { - //echo "Unsupported XML File Format

"; - $mes->addWarning(EMOLAN_33); - $no_error = FALSE; + //echo "Unsupported XML File Format

"; + $mes->addWarning(EMOLAN_33); + $no_error = false; } // Save pack info in the database - // $tmp = addslashes(serialize($confArray)); - $tmp = e107::getArrayStorage()->WriteArray($confArray); - $File_type = EMOLAN_23.":"; + // $tmp = addslashes(serialize($confArray)); + $tmp = e107::serialize($confArray); + $File_type = EMOLAN_23 . ":"; } - if($confFile['type'] == "php") + if ($confFile['type'] == "php") { - include_once(e_IMAGE."emotes/".$value."/".$confFile['file']); - $File_type = EMOLAN_24.":"; - $tmp = $_emoteconf; // Use consistent name + include_once(e_IMAGE . "emotes/" . $value . "/" . $confFile['file']); + $File_type = EMOLAN_24 . ":"; + $tmp = $_emoteconf; // Use consistent name } if ($no_error) { - if ($do_one) - { // Assume existing pack - $sql->update("core", "`e107_value`='{$tmp}' WHERE `e107_name`='emote_".$value."'"); - } - else - { // Assume new pack - $sql->insert("core", "'emote_".$value."', '{$tmp}' "); - } - $mes->addInfo("{$File_type} '{$value}'"); + if ($do_one) // Assume existing pack + { + $update = array( + 'e107_name' => 'emote_' . $value, + 'e107_value' => $tmp, + 'WHERE' => "e107_name = 'emote_" . $value . "'" + ); + + $sql->update("core", $update); + + } + else + { // Assume new pack + + $insert = array( + 'e107_name' => 'emote_' . $value, + 'e107_value' => $tmp + ); + + $sql->insert("core", $insert); + } + $mes->addInfo("{$File_type} '{$value}'"); } else { // Error occurred - $mes->addError(EMOLAN_27.": '{$value}'"); + $mes->addError(EMOLAN_27 . ": '{$value}'"); } } } - if (count($pack_local)) { - foreach ($pack_local as $p => $d) + foreach ($pack_local as $p => $d) { - if($p == '0') + if ($p == '0') { $p = ''; } - if($sql->delete("core","`e107_name` = 'emote_{$p}'")) - { - $mes->addInfo(EMOLAN_34.":".$p.EMOLAN_35); - } + if ($sql->delete("core", "`e107_name` = 'emote_{$p}'")) + { + $mes->addInfo(EMOLAN_34 . ":" . $p . EMOLAN_35); + } } } - return TRUE; + return true; } } + + require_once("footer.php"); /** * Handle page DOM within the page header @@ -678,15 +707,16 @@ require_once("footer.php"); */ function headerjs() { -/* require_once(e_HANDLER.'js_helper.php'); + /* require_once(e_HANDLER.'js_helper.php'); - $ret = " - - - "; + $ret = " + + + "; - return $ret;*/ + return $ret;*/ } + ?> \ No newline at end of file diff --git a/e107_admin/links.php b/e107_admin/links.php index c53623a72..1c4955aad 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -247,7 +247,7 @@ class links_admin_ui extends e_admin_ui ";*/ } - $text .= $ui->selectbox('sublink_type', $optarrayp, $this->getPosted('sublink_type'), '', true); + $text .= $ui->select('sublink_type', $optarrayp, $this->getPosted('sublink_type'), '', true); $text .= " @@ -677,7 +677,7 @@ class links_admin_form_ui extends e_admin_form_ui $cats = $this->getController()->getLinkArray($catid); $ret = array(); $this->_parent_select_array(0, $cats, $ret); - return $this->selectbox('link_parent', $ret, $value, array('size'=>'xlarge','default' => LAN_SELECT."...")); + return $this->select('link_parent', $ret, $value, array('size'=>'xlarge','default' => LAN_SELECT."...")); break; case 'batch': @@ -700,7 +700,7 @@ class links_admin_form_ui extends e_admin_form_ui if($mode == 'write') { - return $this->selectbox('link_function',$this->linkFunctions,$curVal,array('size'=>'xlarge','default'=> "(".LAN_OPTIONAL.")")); + return $this->select('link_function',$this->linkFunctions,$curVal,array('size'=>'xlarge','default'=> "(".LAN_OPTIONAL.")")); } else diff --git a/e107_admin/meta.php b/e107_admin/meta.php index 9cd043766..38c210b44 100644 --- a/e107_admin/meta.php +++ b/e107_admin/meta.php @@ -44,11 +44,11 @@ if (isset($_POST['metasubmit'])) $meta_author[$lan] = $pref['meta_author'][$lan]; } - $meta_tag[e_LANGUAGE] = strip_if_magic(rtrim($_POST['meta'])); - $meta_diz[e_LANGUAGE] = strip_if_magic(rtrim($_POST['meta_description'])); - $meta_keywords[e_LANGUAGE] = strip_if_magic(rtrim($_POST['meta_keywords'])); - $meta_copyright[e_LANGUAGE] = strip_if_magic(rtrim($_POST['meta_copyright'])); - $meta_author[e_LANGUAGE] = strip_if_magic(rtrim($_POST['meta_author'])); + $meta_tag[e_LANGUAGE] = rtrim($_POST['meta']); + $meta_diz[e_LANGUAGE] = rtrim($_POST['meta_description']); + $meta_keywords[e_LANGUAGE] = rtrim($_POST['meta_keywords']); + $meta_copyright[e_LANGUAGE] = rtrim($_POST['meta_copyright']); + $meta_author[e_LANGUAGE] = rtrim($_POST['meta_author']); $pref['meta_news_summary'] = intval($_POST['meta_news_summary']); $pref['meta_tag'] = $meta_tag; diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 68eb0f550..0eb59eb7e 100755 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -43,7 +43,7 @@ if(!deftrue('e_DEBUG_PLUGMANAGER')) if(isset($_POST['uninstall_cancel'])) { - header("location:".e_SELF); + e107::redirect(e_SELF); exit; } diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 3439c043c..34b399569 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -18,7 +18,7 @@ require_once ("../class2.php"); if(isset($_POST['newver'])) { - header("location:http://e107.org/index.php"); + e107::redirect("https://e107.org/index.php"); exit(); } diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 38ed52cab..abf151d46 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -129,7 +129,7 @@ class theme_admin extends e_admin_dispatcher case 'preview': // Theme Info Ajax $tm = (string) $_GET['id']; - $data = $themec->getThemeInfo($tm); + $data = e107::getTheme($tm)->get(); // $themec->getThemeInfo($tm); echo $themec->renderThemeInfo($data); // exit; break; @@ -160,7 +160,7 @@ class theme_admin extends e_admin_dispatcher if(!empty($_GET['id'])) { $tm = (string) $_GET['id']; - $data = $themec->getThemeInfo($tm); + $data = e107::getTheme($tm)->get(); // $themec->getThemeInfo($tm); echo $themec->renderThemeInfo($data); } @@ -1634,9 +1634,7 @@ TEMPLATE; $frm = e107::getForm(); - $list = e107::getTheme()->clearCache()->getThemeList(); // (e_THEME); - - $folders = array_keys($list); + $folders = e107::getTheme()->clearCache()->getList('id'); // array_keys($list); $text = $frm->open('copytheme','get','theme.php?mode=convert'); $text .= " diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 5f10599bc..dab48f1b8 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -1370,7 +1370,7 @@ function update_706_to_800($type='') if ($nt_changed) { $s_prefs = $tp -> toDB($notify_prefs); - $s_prefs = $eArrayStorage -> WriteArray($s_prefs); + $s_prefs = e107::serialize($s_prefs); // Could we use $sysprefs->set($s_prefs,'notify_prefs') instead - avoids caching problems ???? $status = ($sql -> update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'") !== FALSE) ? E_MESSAGE_DEBUG : E_MESSAGE_ERROR; $message = str_replace('[x]',$nt_changed,LAN_UPDATE_20); diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index 6de0d9358..b5670fbaf 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -137,7 +137,7 @@ if(varset($_GET['mode']) == "ajax") break; } } - +/* if (isset($_POST['cancel'])) { header('location:'.e_SELF); @@ -148,7 +148,7 @@ if (isset($_POST['cancel_cat'])) { header("location:".e_SELF."?cat"); exit; -} +}*/ function js() { diff --git a/e107_core/templates/fpw_template.php b/e107_core/templates/fpw_template.php index b6ea18143..bed5dde23 100644 --- a/e107_core/templates/fpw_template.php +++ b/e107_core/templates/fpw_template.php @@ -93,6 +93,7 @@ $FPW_TEMPLATE['form'] = ' '; + $FPW_TEMPLATE['header'] = '
'; $FPW_TEMPLATE['footer'] = '
'; diff --git a/e107_handlers/admin_log_class.php b/e107_handlers/admin_log_class.php index 74b118a1c..69586092b 100644 --- a/e107_handlers/admin_log_class.php +++ b/e107_handlers/admin_log_class.php @@ -714,7 +714,7 @@ class e_admin_log /** - * @DEPRECATED + * @deprecated * BC Alias for addError(); */ public function logError($text, $message = true, $session = false) diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index 1adfb1b52..1a5402076 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -464,7 +464,7 @@ class e_array { // e107::getDebug()->log("Json data found"); - if(e_DEBUG === true && json_last_error() != JSON_ERROR_NONE && !e107::isCli()) + if(deftrue('e_DEBUG') && json_last_error() != JSON_ERROR_NONE && !e107::isCli()) { e107::getDebug()->log("e107::unserialize() Parser Error (json)"); @@ -623,9 +623,7 @@ class e_array { function write($ArrayData, $AddSlashes = true) { - - return $this->serialize($ArrayData, $AddSlashes); - + return $this->serialize($ArrayData, $AddSlashes); } /** diff --git a/e107_handlers/e_db_pdo_class.php b/e107_handlers/e_db_pdo_class.php index 683f98c18..63977adca 100644 --- a/e107_handlers/e_db_pdo_class.php +++ b/e107_handlers/e_db_pdo_class.php @@ -2080,11 +2080,11 @@ class e_db_pdo implements e_db */ function escape($data, $strip = true) { - +/* if ($strip) { $data = strip_if_magic($data); - } + }*/ $this->_getMySQLaccess(); diff --git a/e107_handlers/e_ranks_class.php b/e107_handlers/e_ranks_class.php index 1e8a66ef6..c62dfa4d4 100644 --- a/e107_handlers/e_ranks_class.php +++ b/e107_handlers/e_ranks_class.php @@ -55,7 +55,7 @@ class e_ranks } } } - $e107->ecache->set_sys('nomd5_user_ranks', $e107->arrayStorage->WriteArray($this->ranks, false)); + $e107->ecache->set_sys('nomd5_user_ranks', e107::serialize($this->ranks, false)); } // defaults diff --git a/e107_handlers/file_class.php b/e107_handlers/file_class.php index 6de23a608..842262fd9 100644 --- a/e107_handlers/file_class.php +++ b/e107_handlers/file_class.php @@ -1128,7 +1128,7 @@ } else { - header("location: {$e107->base_path}"); + e107::redirect(); // ("location: {$e107->base_path}"); exit(); } } @@ -1189,7 +1189,7 @@ } else { - header("location: " . e_BASE . "index.php"); + e107::redirect(); exit(); } } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 9f9652c95..650c3b9d7 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -3061,7 +3061,7 @@ class e_form if(is_array($filterArray)) { - $text .= $this->selectbox($filterName, $filterArray, $filterVal); + $text .= $this->select($filterName, $filterArray, $filterVal); } // $text .= $this->admin_button($submitName,LAN_SEARCH,'search'); @@ -6106,7 +6106,7 @@ var_dump($select_options);*/ $k = str_replace('_template.php', '', $files['fname']); $templates[$k] = implode(' ', array_map('ucfirst', explode('_', $k))); //TODO add LANS? } - $ret = (vartrue($parms['raw']) ? $templates : $this->selectbox($key, $templates, $value)); + $ret = (vartrue($parms['raw']) ? $templates : $this->select($key, $templates, $value)); break; case 'checkboxes': @@ -6316,7 +6316,7 @@ var_dump($select_options);*/ if(!is_array($eloptions)) parse_str($eloptions, $eloptions); unset($parms['__options']); if(vartrue($eloptions['multiple']) && !is_array($value)) $value = explode(',', $value); - $ret = vartrue($eloptions['pre']).$this->selectbox($key, $options, $value, $eloptions).vartrue($eloptions['post']); + $ret = vartrue($eloptions['pre']).$this->select($key, $options, $value, $eloptions).vartrue($eloptions['post']); break; case null: diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 8045fdd69..49f912079 100755 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -334,7 +334,7 @@ class e_object */ public function toString($AddSlashes = false) { - return (string) e107::getArrayStorage()->WriteArray($this->toArray(), $AddSlashes); + return (string) e107::serialize($this->toArray(), $AddSlashes); } /** @@ -1829,11 +1829,11 @@ class e_model extends e_object $value = $this->getData($key); if(is_array($value)) { - return e107::getArrayStorage()->WriteArray($value, $AddSlashes); + return e107::serialize($value, $AddSlashes); } return (string) $value; } - return (string) e107::getArrayStorage()->WriteArray($this->toArray(), $AddSlashes); + return (string) e107::serialize($this->toArray(), $AddSlashes); } public function destroy() diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 5b98ebe39..07d360bd2 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -1097,7 +1097,7 @@ class e_db_mysql implements e_db case 'array': if(is_array($fieldValue)) { - return "'".e107::getArrayStorage()->WriteArray($fieldValue, true)."'"; + return "'".e107::serialize($fieldValue, true)."'"; } return "'". (string) $fieldValue."'"; break; @@ -2000,10 +2000,10 @@ class e_db_mysql implements e_db */ function escape($data, $strip = true) { - if ($strip) + /* if ($strip) { $data = strip_if_magic($data); - } + }*/ $this->provide_mySQLaccess(); diff --git a/e107_handlers/pref_class.php b/e107_handlers/pref_class.php index aa01298e8..ab3948037 100644 --- a/e107_handlers/pref_class.php +++ b/e107_handlers/pref_class.php @@ -637,8 +637,8 @@ class e_pref extends e_front_model elseif(e107::getDb()->getLastErrorNumber()) { if(!$disallow_logs) - $log->logError('mySQL error #'.e107::getDb()->getLastErrorNumber().': '.e107::getDb()->getLastErrorText(), true, $session_messages) - ->logError('Settings not saved.', true, $session_messages) + $log->addError('mySQL error #'.e107::getDb()->getLastErrorNumber().': '.e107::getDb()->getLastErrorText(), true, $session_messages) + ->addError('Settings not saved.', true, $session_messages) ->flushMessages('PREFS_03', E_LOG_INFORMATIVE, '', $this->prefid); e107::getMessage()->moveStack($this->prefid); @@ -651,7 +651,7 @@ class e_pref extends e_front_model //add errors to the eMessage stack //$this->setErrors(true, $session_messages); old - doesn't needed anymore if(!$disallow_logs) - $log->logError('Settings not saved.', true, $session_messages) + $log->addError('Settings not saved.', true, $session_messages) ->flushMessages('LAN_FIXME', E_LOG_INFORMATIVE, '', $this->prefid); e107::getMessage()->moveStack($this->prefid); @@ -695,7 +695,7 @@ class e_pref extends e_front_model { if(is_array($cache_string)) { - $cache_string = e107::getArrayStorage()->WriteArray($cache_string, false); + $cache_string = e107::serialize($cache_string, false); } if(is_bool($save)) { @@ -1283,7 +1283,7 @@ class prefs $$name[$key] = $tp->toDB($prefvalue); } } - $tmp = e107::getArrayStorage()->WriteArray($$name, FALSE); // $this->set() adds slashes now + $tmp = e107::serialize($$name, FALSE); // $this->set() adds slashes now // $tmp = serialize($$name); $this->set($tmp, $name, $table, $uid); } diff --git a/e107_handlers/rate_class.php b/e107_handlers/rate_class.php index 897459c90..ffde86f6e 100644 --- a/e107_handlers/rate_class.php +++ b/e107_handlers/rate_class.php @@ -525,7 +525,7 @@ class rater if($ajax == false) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } else diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index fec36ffff..10fa2f280 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -559,7 +559,7 @@ class e_theme /** * Get a list of all themes in theme folder and its data. - * @deprecated + * @deprecated Use getList($mode) instead * @see load(); * @param bool|false xml|false * @param bool|false $force force a refresh ie. ignore cached list. @@ -567,7 +567,7 @@ class e_theme */ public static function getThemeList($mode = false, $force = false) { - trigger_error(''.__METHOD__.' is deprecated.', E_USER_DEPRECATED); // NO LAN + trigger_error(''.__METHOD__.' is deprecated. Use getList() instead.', E_USER_DEPRECATED); // NO LAN $themeArray = array(); @@ -1401,7 +1401,7 @@ class themeHandler } /** - * @deprecated + * @deprecated Use e107::getTheme($file)->get(); instead. * @param string $file - theme folder name. * @return array|mixed */ @@ -1619,7 +1619,7 @@ class themeHandler } // auth - $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); + // $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); // do the request, retrieve and parse data $xdata = $mp->call('getList', array( diff --git a/e107_handlers/upload_handler.php b/e107_handlers/upload_handler.php index d307cadc4..8d0568438 100644 --- a/e107_handlers/upload_handler.php +++ b/e107_handlers/upload_handler.php @@ -561,35 +561,9 @@ function file_upload($uploaddir, $avatar = FALSE, $fileinfo = "", $overwrite = " */ function get_image_mime($filename, $extended = false) { - // mime types as returned from image_type_to_mime_type() - // and associated file extensions - $imageExtensions = array( - 'image/gif' => array('gif'), - 'image/jpeg' => array('jpg'), - 'image/png' => array('png'), - 'application/x-shockwave-flash' => array('swf', 'swc'), - 'image/psd' => array('psd'), - 'image/bmp' => array('bmp'), - 'image/tiff' => array('tiff'), - 'application/octet-stream' => array('jpc', 'jpx', 'jb2'), - 'image/jp2' => array('jp2'), - 'image/iff' => array('iff'), - 'image/vnd.wap.wbmp' => array('wbmp'), - 'image/xbm' => array('xbm'), - 'image/vnd.microsoft.icon' => array('ico') - ); + trigger_error(__METHOD__.' is deprecated. Use e107::getFile()->getImageMime($filename, $extended); instead.', E_USER_DEPRECATED); - $ret = image_type_to_mime_type(exif_imagetype($filename)); - - if($extended) - { - return array( - $ret, - $ret && isset($imageExtensions[$ret]) ? $imageExtensions[$ret]: array() - ); - } - - return $ret; + return e107::getFile()->getImageMime($filename, $extended); } @@ -824,61 +798,9 @@ function get_image_mime($filename, $extended = false) */ function get_XML_filetypes($def_file = FALSE, $file_mask = '') { - $ret = array( - ); - if ($def_file === FALSE) - return $ret; + trigger_error(__METHOD__.' is deprecated. Use e107::getFile()->getAllowedFileTypes(); instead.', E_USER_DEPRECATED); - if ($file_mask) - { - $file_array = explode(',', $file_mask); - foreach ($file_array as $k=>$f) - { - $file_array[$k] = trim($f); - } - } - - if ($def_file && is_readable(e_SYSTEM.$def_file)) - { - $xml = e107::getXml(); - // class tag should be always array - $xml->setOptArrayTags('class'); - $temp_vars = $xml->loadXMLfile(e_SYSTEM.$def_file, 'filetypes', false); - if ($temp_vars === FALSE) - { - echo "Error reading XML file: {$def_file}
"; - return $ret; - } - foreach ($temp_vars['class'] as $v1) - { - $v = $v1['@attributes']; - if (check_class($v['name'])) - { - $current_perms[$v['name']] = array( - 'type'=>$v['type'], 'maxupload'=>$v['maxupload'] - ); - $a_filetypes = explode(',', $v['type']); - foreach ($a_filetypes as $ftype) - { - $ftype = strtolower(trim(str_replace('.', '', $ftype))); // File extension - - if (!$file_mask || in_array($ftype, $file_array)) - { // We can load this extension - if (isset($ret[$ftype])) - { - $ret[$ftype] = file_size_decode($v['maxupload'], $ret[$ftype], 'gt'); // Use largest value - } - else - { - $ret[$ftype] = file_size_decode($v['maxupload']); - } - } - } - } - } - } - - return $ret; + return e107::getFile()->getAllowedFileTypes(); } diff --git a/e107_handlers/user_model.php b/e107_handlers/user_model.php index 5e28b598c..f213dc831 100644 --- a/e107_handlers/user_model.php +++ b/e107_handlers/user_model.php @@ -385,6 +385,11 @@ class e_user_model extends e_admin_model return '(^|,)('.str_replace(',', '|', $this->getClassList(true)).')(,|$)'; } + /** + * @param $class + * @param bool $allowMain + * @return bool + */ final public function checkClass($class, $allowMain = true) { // FIXME - replace check_class() here @@ -922,7 +927,7 @@ class e_user_model extends e_admin_model $editor = $this->getEditor(); if($this->getId() === $editor->getId() || $editor->isMainAdmin() || $editor->checkAdminPerms('4')) $perm = true; - return ($perm || (!in_array($field, array('user_admin', 'user_perms', 'user_prefs', 'user_password') && $editor->checkClass($this->_memberlist_access)))); + return ($perm || (!in_array($field, array('user_admin', 'user_perms', 'user_prefs', 'user_password')) && $editor->checkClass($this->_memberlist_access))); } /** @@ -2188,7 +2193,7 @@ class e_user_extended_model extends e_admin_model * @param mixed $value * @param boolean $short if true, 'user_' prefix will be added to field name * @param boolean $strict if false no Applicable check will be made - * @return e_user_model + * @return e_user_model|e_user_extended_model */ public function setSystem($field, $value, $short = true, $strict = true) { @@ -2483,7 +2488,7 @@ class e_user_extended_structure_model extends e_model * * @param string $field * @param mixed $value - * @return e_user_model + * @return e_user_model|e_user_extended_structure_model */ public function setValue($field, $value) { @@ -2577,7 +2582,7 @@ class e_user_extended_structure_tree extends e_tree_model /** * @param string $name name field value - * @return e_user_extended_structure_model + * @return e_user_extended_structure_model|e_model */ public function getNodeByName($name) { diff --git a/e107_languages/English/admin/help/menus.php b/e107_languages/English/admin/help/menus.php index 6c7115a46..61d617b4c 100644 --- a/e107_languages/English/admin/help/menus.php +++ b/e107_languages/English/admin/help/menus.php @@ -12,7 +12,7 @@ if(!defined('e107_INIT')){ exit; } if (!getperms("2")) { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/e107_plugins/faqs/admin_config.php b/e107_plugins/faqs/admin_config.php index 6616dec89..df3255dbd 100644 --- a/e107_plugins/faqs/admin_config.php +++ b/e107_plugins/faqs/admin_config.php @@ -171,7 +171,7 @@ class faq_cat_form_ui extends e_admin_form_ui break; case 'write': - return $this->selectbox('faq_info_parent', $controller->getFaqCategoryTree(), $curVal); + return $this->select('faq_info_parent', $controller->getFaqCategoryTree(), $curVal); break; case 'filter': @@ -367,7 +367,7 @@ class faq_admin_form_ui extends e_admin_form_ui case 'write': - return $this->selectbox('faq_parent', $controller->getFaqCategoryTree(), $curVal).$this->hidden('pending', $pending); + return $this->select('faq_parent', $controller->getFaqCategoryTree(), $curVal).$this->hidden('pending', $pending); break; case 'filter': diff --git a/e107_plugins/forum/forum_uploads.php b/e107_plugins/forum/forum_uploads.php index 70ad97f4a..3dc3d451e 100644 --- a/e107_plugins/forum/forum_uploads.php +++ b/e107_plugins/forum/forum_uploads.php @@ -18,7 +18,7 @@ if (!$e107->isInstalled('forum')) if(!USER) { - header("location:".e_PLUGIN."forum/forum.php"); + e107::redirect(e_PLUGIN."forum/forum.php"); exit; } diff --git a/e107_plugins/gallery/admin_gallery.php b/e107_plugins/gallery/admin_gallery.php index eb37abb11..a82b002a0 100644 --- a/e107_plugins/gallery/admin_gallery.php +++ b/e107_plugins/gallery/admin_gallery.php @@ -678,7 +678,7 @@ class gallery_cat_admin_form_ui extends e_admin_form_ui break; case 'write': - return $this->selectbox('gallery_category_parent', $controller->getDownloadCategoryTree(), $curVal); + return $this->select('gallery_category_parent', $controller->getDownloadCategoryTree(), $curVal); break; case 'filter': diff --git a/e107_plugins/newsletter/admin_config.php b/e107_plugins/newsletter/admin_config.php index 43c12a3f5..293eb50c0 100644 --- a/e107_plugins/newsletter/admin_config.php +++ b/e107_plugins/newsletter/admin_config.php @@ -646,7 +646,7 @@ class newsletter } if ($subscribers_total_count<1) { - header("location:".e_SELF); + e107::redirect(e_SELF); exit; } // Loop through each user in the array subscribers_list & sanatize diff --git a/e107_plugins/pm/pm_class.php b/e107_plugins/pm/pm_class.php index 9188b502a..a4d109bec 100755 --- a/e107_plugins/pm/pm_class.php +++ b/e107_plugins/pm/pm_class.php @@ -624,7 +624,7 @@ class private_message } else { - $var = strip_if_magic($var); + // $var = strip_if_magic($var); $var = str_replace("'", ''', trim($var)); // Display name uses entities for apostrophe $where = "user_name LIKE '".$sql->escape($var, FALSE)."'"; } diff --git a/e107_plugins/poll/admin_config.php b/e107_plugins/poll/admin_config.php index 30e2aaaf9..f2b8f1180 100644 --- a/e107_plugins/poll/admin_config.php +++ b/e107_plugins/poll/admin_config.php @@ -23,10 +23,10 @@ require_once(e_PLUGIN."poll/poll_class.php"); require_once(e_HANDLER."userclass_class.php"); require_once(e_HANDLER."form_handler.php"); // FIXME using 'form' instead of 'e_form' -if(isset($_POST)) +/*if(isset($_POST)) { $_POST = strip_if_magic($_POST); -} +}*/ $rs = new form; $poll = new poll; diff --git a/e107_web/utilities/dbgen.php b/e107_web/utilities/dbgen.php index dc649eedd..c31678432 100644 --- a/e107_web/utilities/dbgen.php +++ b/e107_web/utilities/dbgen.php @@ -140,7 +140,7 @@ if ($table) echo "Unexpected field type: {$k} => {$v['type']}
"; } } - $toSave = $eArrayStorage->WriteArray($outDefs, FALSE); // 2nd parameter to TRUE if needs to be written to DB + $toSave = e107::serialize($outDefs, FALSE); // 2nd parameter to TRUE if needs to be written to DB } //======================================================== diff --git a/print.php b/print.php index 39ec96e0b..de8597e70 100644 --- a/print.php +++ b/print.php @@ -17,7 +17,7 @@ e107::coreLan('print'); $qs = explode(".", e_QUERY,2); if ($qs[0] == "") { - header("location:".e_BASE."index.php"); + e107::redirect(); exit; } diff --git a/rate.php b/rate.php index 80eaa0a48..fed95645c 100644 --- a/rate.php +++ b/rate.php @@ -30,7 +30,7 @@ if(!e_AJAX_REQUEST) // Legacy method. $returnurl = $tp -> toDB($qs[2]); $rate = (int) $qs[3]; e107::getRate()->submitVote($table,$itemid,$rate); - header("location:".$returnurl); + e107::redirect($returnurl); exit; } else // Ajax Used. diff --git a/search.php b/search.php index f89430061..1c0cb0875 100644 --- a/search.php +++ b/search.php @@ -1027,7 +1027,7 @@ if ($perform_search) if (isset($_GET['t'][$google_id]) && ($_GET['t']==$google_id) && $_GET['t'][$google_id]) { // echo "We think google should be used using checkboxes
"; - header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); + e107::redirect("http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); exit; } } @@ -1035,7 +1035,7 @@ if ($perform_search) { if (isset($_GET['t']) && $_GET['t'] == $google_id) { - header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); + e107::redirect("http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query))); exit; } } diff --git a/user.php b/user.php index d5a926e36..a6245c92f 100644 --- a/user.php +++ b/user.php @@ -96,7 +96,7 @@ if (isset($_POST['delp'])) $row = $sql->fetch(); @unlink(e_AVATAR_UPLOAD.$row['user_sess']); $sql->update("user", "user_sess='' WHERE user_id=".intval($tmp[1])); - header("location:".e_SELF."?id.".$tmp[1]); + e107::redirect(e_SELF."?id.".$tmp[1]); exit; } }