diff --git a/class2.php b/class2.php index 3582c39b7..27f0312b7 100644 --- a/class2.php +++ b/class2.php @@ -1098,7 +1098,7 @@ if(e_ADMIN_AREA) // Load admin phrases ASAP if(!defined('THEME')) { - if (e_ADMIN_AREA && varsettrue($pref['admintheme'])) + if (e_ADMIN_AREA && vartrue($pref['admintheme'])) { //We have now e_IFRAME mod and USER_AREA force // && (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index 4105690df..7a36ffd94 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -875,7 +875,7 @@ switch ($action) if (!isset($banlist_notes)) $banlist_notes = ''; $page_title = array('edit' => BANLAN_60, 'add' => BANLAN_9, 'whedit' => BANLAN_59, 'whadd' => BANLAN_58); - $rdns_warn = varsettrue($pref['enable_rdns']) ? '' : '
'.BANLAN_12.'
'; + $rdns_warn = vartrue($pref['enable_rdns']) ? '' : '
'.BANLAN_12.'
'; $next = ($action == 'whedit' || $action == 'whadd') ? '?white' : '?list'; // Edit/add form first $text .= " @@ -1003,7 +1003,7 @@ switch ($action) $error = true; $mes->addError(BANLAN_47); } - if(empty($files) || varsettrue($files[0]['error'])) + if(empty($files) || vartrue($files[0]['error'])) { $error = true; if(varset($files[0]['message'])) diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php index 4ecc83416..0e4eb5d44 100644 --- a/e107_admin/fileinspector.php +++ b/e107_admin/fileinspector.php @@ -1118,7 +1118,7 @@ class file_inspector { - if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss']) + if (!deftrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss']) { $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; //echo "\n"; diff --git a/e107_admin/footer.php b/e107_admin/footer.php index 0d7ca70c0..17dde4410 100644 --- a/e107_admin/footer.php +++ b/e107_admin/footer.php @@ -96,7 +96,7 @@ if (varset($e107_popup) != 1) // B.2 Send footer template, stop timing, send simple page stats // //NEW - Iframe mod - if (!defsettrue('e_IFRAME')) + if (!deftrue('e_IFRAME')) { parse_admin($ADMIN_FOOTER); } diff --git a/e107_admin/header.php b/e107_admin/header.php index 4a7285583..4e0dc9086 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -281,7 +281,7 @@ if (isset($eplug_css) && $eplug_css) } //NEW - Iframe mod -if (!defsettrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss'] && !vartrue($_GET['configure'])) +if (!deftrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss'] && !vartrue($_GET['configure'])) { $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; //echo "\n"; diff --git a/e107_admin/image.php b/e107_admin/image.php index b8cae5aac..b60cba260 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -2406,7 +2406,7 @@ if (isset($_POST['submit_avdelete_multi'])) $search_users = $sql->db_getList('ALL', FALSE, FALSE, 'user_id'); foreach($_POST['multiaction'] as $uid) { - if (varsettrue($search_users[$uid])) + if (vartrue($search_users[$uid])) { $avname = avatar($search_users[$uid]['user_image']); if (strpos($avname, "http://") === FALSE) diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php index 634e39886..a8dae2320 100644 --- a/e107_admin/lancheck.php +++ b/e107_admin/lancheck.php @@ -360,7 +360,7 @@ class lancheck } // Write the language file. - if(isset($_POST['submit']) && varsettrue($_POST['lan']) && in_array($_POST['lan'],$acceptedLans)) + if(isset($_POST['submit']) && vartrue($_POST['lan']) && in_array($_POST['lan'],$acceptedLans)) { $this->write_lanfile($_POST['lan']); @@ -368,7 +368,7 @@ class lancheck } // Edit the Language File. - if(varsettrue($_GET['f']) && varsettrue($_GET['lan']) && in_array($_GET['lan'],$acceptedLans)) + if(vartrue($_GET['f']) && vartrue($_GET['lan']) && in_array($_GET['lan'],$acceptedLans)) { if (!$_GET['mode']) @@ -491,13 +491,13 @@ class lancheck $icon = ($_SESSION['lancheck'][$_POST['language']]['total']>0) ? ADMIN_FALSE_ICON : ADMIN_TRUE_ICON; - $errors_diz = (defsettrue('LAN_CHECK_23')) ? LAN_CHECK_23 : "Errors Found"; + $errors_diz = (deftrue('LAN_CHECK_23')) ? LAN_CHECK_23 : "Errors Found"; $message .= $errors_diz.": ".$_SESSION['lancheck'][$_POST['language']]['total']; - $just_go_diz = (defsettrue('LAN_CHECK_20')) ? LAN_CHECK_20 : "Generate Language Pack"; - $lang_sel_diz = (defsettrue('LAN_CHECK_21')) ? LAN_CHECK_21 : "Verify Again"; - $lan_pleasewait = (defsettrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : "Please Wait"; + $just_go_diz = (deftrue('LAN_CHECK_20')) ? LAN_CHECK_20 : "Generate Language Pack"; + $lang_sel_diz = (deftrue('LAN_CHECK_21')) ? LAN_CHECK_21 : "Verify Again"; + $lan_pleasewait = (deftrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : "Please Wait"; $message .= "

@@ -540,7 +540,7 @@ class lancheck $kom_start = chr(47)."*"; $kom_end = "*".chr(47); - if(varsettrue($_SESSION['lancheck-edit-file'])) + if(vartrue($_SESSION['lancheck-edit-file'])) { $writeit = $_SESSION['lancheck-edit-file']; } @@ -614,7 +614,7 @@ class lancheck $defvar = $_POST['newdef'][$i]; } - if($_POST['newdef'][$i] == "LC_ALL" && varsettrue($_SESSION['lancheck-edit-file'])) + if($_POST['newdef'][$i] == "LC_ALL" && vartrue($_SESSION['lancheck-edit-file'])) { $message .= $notdef_start.'setlocale('.htmlentities($defvar).','.$deflang.');
'.$notdef_end; $input .= $notdef_start."setlocale(".$defvar.",".$deflang.");".$notdef_end; diff --git a/e107_admin/language.php b/e107_admin/language.php index cca024937..fccf9c62e 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -946,8 +946,8 @@ function show_packs() $release_diz = defined("LANG_LAN_30") ? LANG_LAN_30 : "Release Date"; $compat_diz = defined("LANG_LAN_31") ? LANG_LAN_31 : "Compatibility"; - $lan_pleasewait = (defsettrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : "Please Wait"; - $lan_displayerrors = (defsettrue('LANG_LAN_33')) ? LANG_LAN_33 : "Display only errors during verification"; + $lan_pleasewait = (deftrue('LAN_PLEASEWAIT')) ? $tp->toJS(LAN_PLEASEWAIT) : "Please Wait"; + $lan_displayerrors = (deftrue('LANG_LAN_33')) ? LANG_LAN_33 : "Display only errors during verification"; $text = "
@@ -1021,7 +1021,7 @@ function show_packs() $srch = array("[","]"); $repl = array("",""); - $diz = (defsettrue("LANG_LAN_28")) ? LANG_LAN_28 : "Check this box if you're an [e107 certified translator]."; + $diz = (deftrue("LANG_LAN_28")) ? LANG_LAN_28 : "Check this box if you're an [e107 certified translator]."; $checked = varset($_COOKIE['e107_certified']) == 1 ? true : false; diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index 394a2aa56..e5c7904c0 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -1004,7 +1004,7 @@ class mailout_main_ui extends e_admin_ui $text .= " ".LAN_MAILOUT_57." "; - $checked = (varsettrue($pref['smtp_keepalive']) ) ? "checked='checked'" : ''; + $checked = (vartrue($pref['smtp_keepalive']) ) ? "checked='checked'" : ''; $text .= " "; @@ -1271,8 +1271,8 @@ class mailout_main_ui extends e_admin_ui $smtp_opts[] = 'pop3auth'; break; } - if (varsettrue($_POST['smtp_keepalive'])) $smtp_opts[] = 'keepalive'; - if (varsettrue($_POST['smtp_useVERP'])) $smtp_opts[] = 'useVERP'; + if (vartrue($_POST['smtp_keepalive'])) $smtp_opts[] = 'keepalive'; + if (vartrue($_POST['smtp_useVERP'])) $smtp_opts[] = 'useVERP'; $temp['smtp_options'] = implode(',',$smtp_opts); diff --git a/e107_admin/menus.php b/e107_admin/menus.php index d37eaf718..67ceab52c 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -644,7 +644,7 @@ class e_layout */ - $this->curLayout = varsettrue($_GET['configure'], $pref['sitetheme_deflayout']); + $this->curLayout = vartrue($_GET['configure'], $pref['sitetheme_deflayout']); $this->renderLayout($this->curLayout); diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index e17bc0979..c780a72ed 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -1053,7 +1053,7 @@ class admin_newspost function parseRequest($qry) { $tmp = explode(".", $qry); - $action = varsettrue($tmp[0], 'main'); + $action = vartrue($tmp[0], 'main'); $sub_action = varset($tmp[1], ''); $id = isset($tmp[2]) && is_numeric($tmp[2]) ? intval($tmp[2]) : 0; $this->_sort_order = isset($tmp[2]) && !is_numeric($tmp[2]) ? $tmp[2] : 'desc'; @@ -2149,7 +2149,7 @@ class admin_newspost $_POST['news_body'] = $row['submitnews_item']; $_POST['cat_id'] = $row['submitnews_category']; - if (defsettrue('e_WYSIWYG')) + if (deftrue('e_WYSIWYG')) { if (substr($_POST['news_body'],-7,7) == '[/html]') $_POST['news_body'] = substr($_POST['news_body'],0,-7); if (substr($_POST['news_body'],0,6) == '[html]') $_POST['news_body'] = substr($_POST['news_body'],6); diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 11319a38f..9a95011e6 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -127,7 +127,7 @@ class pluginmanager_form extends e_form { $text .= ($this->plug['plugin_installflag'] ? "plug['plugin_id']}\" title='".EPL_ADLAN_1."' >".ADMIN_UNINSTALLPLUGIN_ICON."" : "plug['plugin_id']}\" title='".EPL_ADLAN_0."' >".ADMIN_INSTALLPLUGIN_ICON.""); // $text .= ($this->plug['plugin_installflag'] ? "" : ""); - if (PLUGIN_SHOW_REFRESH && !varsettrue($this->plug_vars['plugin_php'])) + if (PLUGIN_SHOW_REFRESH && !vartrue($this->plug_vars['plugin_php'])) { $text .= "

plug['plugin_id']}'\" title='".'Refresh plugin settings'."' value='".'Refresh plugin settings'."' /> "; } diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 5f0943ccf..034dd1f41 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -91,20 +91,22 @@ if(e_AJAX_REQUEST) echo $mp->renderLoginForm(); exit; break; - + + /* case 'download': $string = base64_decode($_GET['src']); parse_str($string, $p); $mp = $themec->getMarketplace(); $mp->generateAuthKey($e107SiteUsername, $e107SiteUserpass); // Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers) - echo "
Connecting...\n"; flush(); // FIXME change the modal default label, default is Loading...
+			echo "
Connecting...\n"; flush();
 			// download and flush
 			$mp->download($p['id'], $p['mode'], $p['type']);
 			echo "
"; flush(); exit; break; - + */ + case 'info': $string = base64_decode($_GET['src']); parse_str($string,$p); diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index b2fad3591..a49d50d68 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -183,7 +183,7 @@ class e107Update { $installed = call_user_func("update_".$func); //?! (LAN_UPDATE == $_POST[$func]) - if(varsettrue($_POST['update_core'][$func]) && !$installed) + if(vartrue($_POST['update_core'][$func]) && !$installed) { if(function_exists("update_".$func)) { @@ -203,8 +203,8 @@ class e107Update } } else - { - $mes->addDebug("could run 'update_".$func); + { + $mes->addDebug("could run 'update_".$func); } //} @@ -881,7 +881,7 @@ function update_706_to_800($type='') } // Check need for user timezone before we delete the field - if (varsettrue($pref['signup_option_timezone'])) + if (vartrue($pref['signup_option_timezone'])) { if ($sql->db_Field('user', 'user_timezone', '', TRUE) && !$sql->db_Field('user_extended','user_timezone','',TRUE)) { @@ -1143,8 +1143,8 @@ function update_706_to_800($type='') asort($exclude); } else - { - $exclude = false; + { + $exclude = false; } $dbv->compareAll($exclude); // core & plugins, but not plugins calling for an update with xxxxx_setup.php @@ -1498,8 +1498,8 @@ function update_706_to_800($type='') } else - { -// $log->addDebug("Media COUNT was ".$count. " LINE: ".__LINE__); + { +// $log->addDebug("Media COUNT was ".$count. " LINE: ".__LINE__); } // Check for Legacy Download Images. @@ -1652,9 +1652,9 @@ function update_706_to_800($type='') } else - { + { $log->toFile('upgrade_v1_to_v2_check'); - + } diff --git a/e107_admin/updateadmin.php b/e107_admin/updateadmin.php index ae3fb85bf..ce76c40a7 100644 --- a/e107_admin/updateadmin.php +++ b/e107_admin/updateadmin.php @@ -36,7 +36,7 @@ if (isset($_POST['update_settings'])) $userData['data']['user_password'] = $sql->escape($userMethods->HashPassword($_POST['a_password'], $currentUser['user_loginname']), FALSE); unset($_POST['a_password']); unset($_POST['a_password2']); - if (varsettrue($pref['allowEmailLogin'])) + if (vartrue($pref['allowEmailLogin'])) { $user_prefs = e107::getArrayStorage()->unserialize($currentUser['user_prefs']); $user_prefs['email_password'] = $userMethods->HashPassword($new_pass, $email); diff --git a/e107_admin/upload.php b/e107_admin/upload.php index 5d91e3230..f5f5696de 100644 --- a/e107_admin/upload.php +++ b/e107_admin/upload.php @@ -507,10 +507,10 @@ switch ($action) $file_text = "\n"; foreach ($_POST['file_class_select'] as $k => $c) { - if (!isset($_POST['file_line_delete_'.$c]) && varsettrue($_POST['file_type_list'][$k])) + if (!isset($_POST['file_line_delete_'.$c]) && vartrue($_POST['file_type_list'][$k])) { // echo "Key: {$k} Class: {$c} Delete: {$_POST['file_line_delete'][$k]} List: {$_POST['file_type_list'][$k]} Size: {$_POST['file_maxupload'][$k]}
"; - $file_text .= " \n"; + $file_text .= " \n"; } } $file_text .= "
\n"; diff --git a/e107_core/bbcodes/bb_block.php b/e107_core/bbcodes/bb_block.php index 70a5fcb6f..fcdb04cd4 100644 --- a/e107_core/bbcodes/bb_block.php +++ b/e107_core/bbcodes/bb_block.php @@ -31,9 +31,9 @@ class bb_block extends e_bb_base $parms = eHelper::scParams($parm); $safe = array(); - if(varsettrue($parms['class'])) $safe['class'] = eHelper::secureClassAttr($parms['class']); - if(varsettrue($parms['id'])) $safe['id'] = eHelper::secureIdAttr($parms['id']); - if(varsettrue($parms['style'])) $safe['style'] = eHelper::secureStyleAttr($parms['style']); + if(vartrue($parms['class'])) $safe['class'] = eHelper::secureClassAttr($parms['class']); + if(vartrue($parms['id'])) $safe['id'] = eHelper::secureIdAttr($parms['id']); + if(vartrue($parms['style'])) $safe['style'] = eHelper::secureStyleAttr($parms['style']); if($safe) { return '[block='.eHelper::buildAttr($safe).']'.$code_text.'[/block]'; @@ -54,8 +54,8 @@ class bb_block extends e_bb_base $class = e107::getBB()->getClass('block').(varset($parms['class']) ? ' '.$parms['class'] : ''); $class = ' class="'.$class.'"'; - $id = varsettrue($parms['id']) ? ' id="'.eHelper::secureIdAttr($parms['id']).'"' : ''; - $style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; + $id = vartrue($parms['id']) ? ' id="'.eHelper::secureIdAttr($parms['id']).'"' : ''; + $style = vartrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; if(empty($code_text)) $code_text = ''; return ''.$code_text.''; diff --git a/e107_core/bbcodes/bb_h.php b/e107_core/bbcodes/bb_h.php index a27c3737c..111e5abb1 100644 --- a/e107_core/bbcodes/bb_h.php +++ b/e107_core/bbcodes/bb_h.php @@ -67,8 +67,8 @@ class bb_h extends e_bb_base $class = " class='".e107::getBB()->getClass($h)."'"; // consistent classes across all themes. - $id = varsettrue($parms['id']) ? ' id='.eHelper::secureIdAttr($parms['id']) : ''; - $style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; + $id = vartrue($parms['id']) ? ' id='.eHelper::secureIdAttr($parms['id']) : ''; + $style = vartrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; return "<{$h}{$id}{$class}{$style}>".$code_text.""; } diff --git a/e107_core/bbcodes/bb_img.php b/e107_core/bbcodes/bb_img.php index 51d5da0de..e172c7a59 100644 --- a/e107_core/bbcodes/bb_img.php +++ b/e107_core/bbcodes/bb_img.php @@ -20,9 +20,9 @@ class bb_img extends e_bb_base $parms = eHelper::scParams($parm); $safe = array(); - if(varsettrue($parms['class'])) $safe['class'] = eHelper::secureClassAttr($parms['class']); - if(varsettrue($parms['id'])) $safe['id'] = eHelper::secureIdAttr($parms['id']); - if(varsettrue($parms['style'])) $safe['style'] = eHelper::secureStyleAttr($parms['style']); + if(vartrue($parms['class'])) $safe['class'] = eHelper::secureClassAttr($parms['class']); + if(vartrue($parms['id'])) $safe['id'] = eHelper::secureIdAttr($parms['id']); + if(vartrue($parms['style'])) $safe['style'] = eHelper::secureStyleAttr($parms['style']); if($safe) { return '[img='.eHelper::buildAttr($safe).']'.$code_text.'[/img]'; @@ -202,7 +202,7 @@ class bb_img extends e_bb_base // Check for whether we can display image down here - so we can show image name if appropriate - if (!varsettrue($pref['image_post']) || !check_class($pref['image_post_class'])) + if (!vartrue($pref['image_post']) || !check_class($pref['image_post_class'])) { switch ($pref['image_post_disabled_method']) { diff --git a/e107_core/bbcodes/bb_p.php b/e107_core/bbcodes/bb_p.php index cbaac8e08..6d306642f 100644 --- a/e107_core/bbcodes/bb_p.php +++ b/e107_core/bbcodes/bb_p.php @@ -62,8 +62,8 @@ class bb_p extends e_bb_base $class = " ".e107::getBB()->getClass('p'); // consistent classes across all themes. - $id = varsettrue($parms['id']) ? ' id="'.eHelper::secureIdAttr($parms['id']).'"' : ''; - $style = varsettrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; + $id = vartrue($parms['id']) ? ' id="'.eHelper::secureIdAttr($parms['id']).'"' : ''; + $style = vartrue($parms['style']) ? ' style="'.eHelper::secureStyleAttr($parms['style']).'"' : ''; return "".$code_text.'

'; } diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 679a90c0b..581155218 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1483,7 +1483,7 @@ Inverse 10 10 // ---------------- Cameron's Bit --------------------------------- - if(!varsettrue($pref['admin_separate_plugins'])) + if(!vartrue($pref['admin_separate_plugins'])) { // Convert Plugin Categories to Core Categories. $convert = array( @@ -1517,7 +1517,7 @@ Inverse 10 10 // ------------------------------------------------------------------ //added option to disable leave/logout (ll) - more flexibility for theme developers - if(!varsettrue($parms['disable_ll'])) + if(!vartrue($parms['disable_ll'])) { // $menu_vars += $this->getOtherNav('home'); } diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 8db0a8fd1..36d1af545 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -153,7 +153,7 @@ class news_shortcodes extends e_shortcode function sc_trackback($parm) { global $pref; - if(!varsettrue($pref['trackbackEnabled'])) { return ''; } + if(!vartrue($pref['trackbackEnabled'])) { return ''; } $news_item = $this->news_item; $news_item['#'] = 'track'; diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index 280d2d04d..21bbd74ff 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -186,7 +186,7 @@ class signup_shortcodes extends e_shortcode function sc_signup_loginname() { global $rs, $pref; - if (varsettrue($pref['predefinedLoginName'])) + if (vartrue($pref['predefinedLoginName'])) { return LAN_SIGNUP_67; } diff --git a/e107_core/shortcodes/single/imageselector.php b/e107_core/shortcodes/single/imageselector.php index c0d966d30..bf908ce88 100644 --- a/e107_core/shortcodes/single/imageselector.php +++ b/e107_core/shortcodes/single/imageselector.php @@ -27,7 +27,7 @@ function imageselector_shortcode($parm = '', $mod = '') $path = ""; // remove the default path if a constant is used. } - $scaction = varsettrue($scaction, 'all'); + $scaction = vartrue($scaction, 'all'); $text = ''; $name_id = e107::getForm()->name2id($name); $imagelist = array(); diff --git a/e107_core/shortcodes/single/nextprev.php b/e107_core/shortcodes/single/nextprev.php index a452b3cd6..971b0c06d 100644 --- a/e107_core/shortcodes/single/nextprev.php +++ b/e107_core/shortcodes/single/nextprev.php @@ -409,7 +409,7 @@ function nextprev_shortcode($parm = '') if($total_pages > 1) { - if(varsettrue($pref['old_np'])) + if(vartrue($pref['old_np'])) { $NP_PRE_ACTIVE = ''; diff --git a/e107_handlers/admin_log_class.php b/e107_handlers/admin_log_class.php index 534babdc3..d83a7ae8d 100644 --- a/e107_handlers/admin_log_class.php +++ b/e107_handlers/admin_log_class.php @@ -1,11 +1,11 @@ addSuccess("Successfully executed")->save('PREF_01'); * @example Log Only: e107::getAdminLog()->addSuccess("Successfully executed",false)->save('PREF_01'); * @example Log Array Diff: e107::getAdminLog()->addArray($array1, $array2)->save('PREF_01'); - * @example Log Array Diff and Add to Message Handler: e107::getAdminLog()->addArray($array1, $array2, E_MESSAGE_ERROR )->save('PREF_01'); - * -*/ + * @example Log Array Diff and Add to Message Handler: e107::getAdminLog()->addArray($array1, $array2, E_MESSAGE_ERROR )->save('PREF_01'); + * +*/ if (!defined('e107_INIT')) { exit; } -define('LOG_MESSAGE_NODISPLAY', 'nodisplay'); - +define('LOG_MESSAGE_NODISPLAY', 'nodisplay'); + /** * Admin logging class. * * @package e107 * @subpackage e107_handlers - * @version $Id$; - * @author e107steved + * @version $Id$; + * @author e107steved */ class e_admin_log { @@ -47,16 +47,16 @@ class e_admin_log protected $logFile = null; - /** - * Log messages - * @var array - */ + /** + * Log messages + * @var array + */ protected $_messages; protected $_allMessages; // similar to $_messages except it is never flushed. - - + + /** * Constructor. Sets up constants and overwrites default options where set. * @@ -98,14 +98,14 @@ class e_admin_log define('USER_AUDIT_BANNED', 22); // User banned define('USER_AUDIT_BOUNCE_RESET', 23); // User bounce reset define('USER_AUDIT_TEMP_ACCOUNT', 24); // User temporary account - - // Init E_MESSAGE_* constants if not already done + + // Init E_MESSAGE_* constants if not already done // e107::getMessage(); - just include, message handler is creating session in construct // it breaks stuff (see class2 - language detection and comments) - require_once(e_HANDLER.'message_handler.php'); + require_once(e_HANDLER.'message_handler.php'); $this->_messages = array(); $this->_allMessages = array(); - + } /** @@ -175,7 +175,7 @@ class e_admin_log { // handled inside e_log_event(); - /* + /* $tmp = array(); if (isset($event_detail['data'])) { @@ -187,7 +187,7 @@ class e_admin_log } $event_detail = implode("[!br!]\n", $tmp); unset($tmp); - */ + */ } else @@ -313,7 +313,7 @@ class e_admin_log //--------------------------------------- // Rolling Log //--------------------------------------- - if (($target_logs & LOG_TO_ROLLING) && varsettrue($pref['roll_log_active'])) + if (($target_logs & LOG_TO_ROLLING) && vartrue($pref['roll_log_active'])) { // Rolling log // Process source_call info @@ -462,7 +462,7 @@ class e_admin_log * * @return bool true if changes found and logged, false otherwise. */ - function logArrayDiffs($new, $old, $event, $logNow = true) + function logArrayDiffs($new, $old, $event, $logNow = true) { // $changes = array(); @@ -478,7 +478,7 @@ class e_admin_log { $this->logMessage($changes, LOG_MESSAGE_NODISPLAY, E_MESSAGE_INFO); } - + return TRUE; } @@ -528,24 +528,24 @@ class e_admin_log } $this->add($event, $logString, E_LOG_INFORMATIVE, ''); } - + /** - * The next two routines accept and buffers messages which are destined for both admin log and message handler + * The next two routines accept and buffers messages which are destined for both admin log and message handler */ /** * Add a message to the queue * * @param string $text - the message text for logging/display - * @param int $type - the 'importance' of the message. E_MESSAGE_SUCCESS|E_MESSAGE_ERROR|E_MESSAGE_INFO|E_MESSAGE_DEBUG|E_MESSAGE_NODISPLAY + * @param int $type - the 'importance' of the message. E_MESSAGE_SUCCESS|E_MESSAGE_ERROR|E_MESSAGE_INFO|E_MESSAGE_DEBUG|E_MESSAGE_NODISPLAY * (Values as used in message handler, apart from the last, which causes the message to not be passed to the message handler * @param boolean|int $logLevel - TRUE to give same importance as for message display. FALSE to not log. * one of the values specified for $mesLevel to determine the prefix attached to the log message - * @param boolean $session add session message - * - * @return e_admin_log + * @param boolean $session add session message + * + * @return e_admin_log */ - public function logMessage($text, $type = '', $logLevel = TRUE, $session = FALSE) + public function logMessage($text, $type = '', $logLevel = TRUE, $session = FALSE) { if(is_array($text)) @@ -558,17 +558,17 @@ class e_admin_log e107::getMessage()->addDebug("Log Message was empty: ".print_a($bt[1],true)); return $this; // changing to text will break chained methods. } - - if(!$type) $type = E_MESSAGE_INFO; + + if(!$type) $type = E_MESSAGE_INFO; if($logLevel === TRUE) $logLevel = $type; $logArray = array('message' => $text, 'dislevel' => $type, 'loglevel' => $logLevel, 'session' => $session, 'time'=>time()); - + $this->_messages[] = $logArray; $this->_allMessages[] = $logArray; - - return $this; - } + + return $this; + } @@ -607,18 +607,18 @@ class e_admin_log } - /** - * Add an error message to the log queue - * - * @param string $text - * @param boolean $message if true (default) - register with eMessage handler, set to false to hide. - * @param boolean $session add session message - * @return e_admin_log - */ - public function addError($text, $message = true, $session = false) - { - return $this->logMessage($text, ($message ? E_MESSAGE_ERROR : LOG_MESSAGE_NODISPLAY), E_MESSAGE_ERROR, $session); - } + /** + * Add an error message to the log queue + * + * @param string $text + * @param boolean $message if true (default) - register with eMessage handler, set to false to hide. + * @param boolean $session add session message + * @return e_admin_log + */ + public function addError($text, $message = true, $session = false) + { + return $this->logMessage($text, ($message ? E_MESSAGE_ERROR : LOG_MESSAGE_NODISPLAY), E_MESSAGE_ERROR, $session); + } /** @@ -681,7 +681,7 @@ class e_admin_log * @param int $logImportance - passed directly to admin log * @param string $logEventCode - passed directly to admin log * @param string $mstack [optional] message stack passed to message handler - * @return e_admin_log + * @return e_admin_log */ public function flushMessages($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false) { @@ -690,34 +690,34 @@ class e_admin_log $resultTypes = array(E_MESSAGE_SUCCESS - 'Success', E_MESSAGE_ERROR => 'Fail'); // Add LANS here. Could add other codes $separator = ''; $logString = ''; - foreach ($this->_messages as $m) + foreach ($this->_messages as $m) { if ($m['loglevel'] !== FALSE) { $logString .= $separator; if ($m['loglevel'] == LOG_MESSAGE_NODISPLAY) { $logString .= ' '; } // Indent supplementary messages - // Not sure about next line - might want to log the
as text, rather than it forcing a newline - $logString .= strip_tags(str_replace(array('
', '
', '
'), '[!br!]', $m['message'])); + // Not sure about next line - might want to log the
as text, rather than it forcing a newline + $logString .= strip_tags(str_replace(array('
', '
', '
'), '[!br!]', $m['message'])); if (isset($resultTypes[$m['loglevel']])) { $logString .= ' - '.$resultTypes[$m['loglevel']]; } $separator = '[!br!]'; } - if ($m['dislevel'] != LOG_MESSAGE_NODISPLAY) + if ($m['dislevel'] != LOG_MESSAGE_NODISPLAY) { if($mstack) { $mes->addStack($m['message'], $mstack, $m['dislevel'], $m['session']); // move to main stack OUTSIDE if needed } - else $mes->add($m['message'], $m['dislevel'], $m['session']); + else $mes->add($m['message'], $m['dislevel'], $m['session']); } } e107::getAdminLog()->add($logTitle, $logString, $logImportance, $logEventCode); $this->_messages = array(); // Clear the memory for reuse - - return $this; + + return $this; } @@ -751,8 +751,8 @@ class e_admin_log $head .= "-------------------------------------------------------------------------------------------\n\n"; } else - { - return; + { + return; } foreach($this->_allMessages as $m) @@ -785,9 +785,9 @@ class e_admin_log } } else - { + { $app = null; - $text = $head . $text; + $text = $head . $text; } if(file_put_contents($fileName, $text, $app)) @@ -796,8 +796,8 @@ class e_admin_log return $this->logFile; } elseif(getperms('0') && E107_DEBUG_LEVEL > 0) - { - echo "Could Save to Log File: ".$fileName; + { + echo "Could Save to Log File: ".$fileName; } return false; diff --git a/e107_handlers/core_functions.php b/e107_handlers/core_functions.php index 5d260ee3e..25805bac6 100644 --- a/e107_handlers/core_functions.php +++ b/e107_handlers/core_functions.php @@ -63,8 +63,7 @@ function defset($str, $default='') */ function varsettrue(&$val, $default='') { - if (isset($val) && $val) { return $val; } - return $default; + return vartrue($val, $default); } /** @@ -76,7 +75,9 @@ function varsettrue(&$val, $default='') */ function vartrue(&$val, $default='') { - return varsettrue($val, $default); + + if (isset($val) && $val) { return $val; } + return $default; } /** @@ -468,7 +469,7 @@ class e_array { /** * @DEPRECATED: Use e107::unserialize(); instead. * Returns an array from stored array data. - * + * @deprecated * @param string $ArrayData * @return array stored data */ diff --git a/e107_handlers/db_table_admin_class.php b/e107_handlers/db_table_admin_class.php index 5b768fb42..c82da291a 100644 --- a/e107_handlers/db_table_admin_class.php +++ b/e107_handlers/db_table_admin_class.php @@ -292,7 +292,7 @@ class db_table_admin { $def .= ' default '.$list['default']; } - if (varsettrue($list['autoinc'])) + if (vartrue($list['autoinc'])) { $def .= ' auto_increment'; } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index b7df405bd..a637d70ae 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -3287,7 +3287,7 @@ class e107 if ( (!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory || ($isPluginDir && (strpos(e_PAGE,'_admin.php') !== false || strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory - || (varsettrue($eplug_admin) || defsettrue('ADMIN_AREA')) // Admin forced + || (vartrue($eplug_admin) || deftrue('ADMIN_AREA')) // Admin forced || (preg_match('/^\/(.*?)\/user(settings\.php|\/edit)(\?|\/)(\d+)$/i', $_SERVER['REQUEST_URI']) && ADMIN) ) { diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 62821d3d0..e9695e21c 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -1390,15 +1390,15 @@ class e_parse extends e_parser } // Turn off a few things if not enabled in options - if(!varsettrue($pref['smiley_activate'])) + if(!vartrue($pref['smiley_activate'])) { $opts['emotes'] = FALSE; } - if(!varsettrue($pref['make_clickable'])) + if(!vartrue($pref['make_clickable'])) { $opts['link_click'] = FALSE; } - if(!varsettrue($pref['link_replace'])) + if(!vartrue($pref['link_replace'])) { $opts['link_replace'] = FALSE; } diff --git a/e107_handlers/e_ranks_class.php b/e107_handlers/e_ranks_class.php index ee3da05b6..4fc6340b9 100644 --- a/e107_handlers/e_ranks_class.php +++ b/e107_handlers/e_ranks_class.php @@ -28,7 +28,7 @@ class e_ranks //Check to see if we can get it from cache if($force == false && ($ranks = $e107->ecache->retrieve_sys('nomd5_user_ranks'))) { - $this->ranks = $e107->arrayStorage->ReadArray($ranks); + $this->ranks = e107::unserialize($ranks); } else { diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index f22802a87..fdb8492ab 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -2452,7 +2452,7 @@ class e_form $count = 0; foreach($fieldarray as $key=>$val) { - if ((in_array($key, $columnPref) || $key=='options' || varsettrue($val['forced'])) && !vartrue($val['nolist'])) + if ((in_array($key, $columnPref) || $key=='options' || vartrue($val['forced'])) && !vartrue($val['nolist'])) { $class = vartrue($val['class']) ? 'class="'.$val['class'].'"' : ''; $width = vartrue($val['width']) ? ' style="width:'.$val['width'].'"' : ''; @@ -2523,7 +2523,7 @@ class e_form "; - if($querypattern!="" && !varsettrue($val['nosort']) && $key != "options" && $key != "checkboxes") + if($querypattern!="" && !vartrue($val['nosort']) && $key != "options" && $key != "checkboxes") { $from = ($key == $field) ? $fromval : 0; $srch = array("[FIELD]","[ASC]","[FROM]"); diff --git a/e107_handlers/iphandler_class.php b/e107_handlers/iphandler_class.php index 60ebe8e4d..355417cfc 100644 --- a/e107_handlers/iphandler_class.php +++ b/e107_handlers/iphandler_class.php @@ -894,7 +894,7 @@ class eIPHandler } // User is banned hereafter - just need to sort out the details. - if (varsettrue($pref['ban_retrigger']) && varsettrue($pref['ban_durations'][$row['banlist_bantype']])) + if (vartrue($pref['ban_retrigger']) && vartrue($pref['ban_durations'][$row['banlist_bantype']])) { // May need to retrigger ban period $sql->db_Update('banlist', "`banlist_banexpires`=".intval(time()+($pref['ban_durations'][$row['banlist_bantype']]*60*60)), "WHERE `banlist_ip`='{$row['banlist_ip']}'"); $this->regenerateFiles(); @@ -979,7 +979,7 @@ class eIPHandler //$admin_log->e_log_event(4, __FILE__."|".__FUNCTION__."@".__LINE__, "BANLIST_11", 'LAN_AL_BANLIST_11', $ban_ip, FALSE, LOG_TO_ROLLING); return FALSE; } */ - if(varsettrue($pref['enable_rdns_on_ban'])) + if(vartrue($pref['enable_rdns_on_ban'])) { $ban_message .= 'Host: '.$this->get_host_name($ban_ip); } @@ -990,7 +990,7 @@ class eIPHandler 'banlist_ip' => $ban_ip , 'banlist_bantype' => $bantype , 'banlist_datestamp' => time() , - 'banlist_banexpires' => (varsettrue($pref['ban_durations'][$bantype]) ? time()+($pref['ban_durations'][$bantype]*60*60) : 0) , + 'banlist_banexpires' => (vartrue($pref['ban_durations'][$bantype]) ? time()+($pref['ban_durations'][$bantype]*60*60) : 0) , 'banlist_admin' => $ban_user , 'banlist_reason' => $ban_message , 'banlist_notes' => $ban_notes diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 155bddc7f..ca2bc9ed7 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1033,7 +1033,7 @@ class e_jsmanager break; case 'header': - $this->renderFile(varsettrue($this->_runtime_header[$zone], array()), $external, 'Header JS include - zone #'.$zone, $mod); + $this->renderFile(vartrue($this->_runtime_header[$zone], array()), $external, 'Header JS include - zone #'.$zone, $mod); unset($this->_runtime_header[$zone]); break; @@ -1075,13 +1075,13 @@ class e_jsmanager } else { - $this->renderFile(varsettrue($this->_runtime_footer[$zone], array()), $external, 'Footer JS include - priority #'.$zone, $mod); + $this->renderFile(vartrue($this->_runtime_footer[$zone], array()), $external, 'Footer JS include - priority #'.$zone, $mod); unset($this->_runtime_footer[$zone]); } break; case 'header_inline': - $this->renderInline(varsettrue($this->_runtime_header_src[$zone], array()), 'Header JS - zone #'.$zone); + $this->renderInline(vartrue($this->_runtime_header_src[$zone], array()), 'Header JS - zone #'.$zone); unset($this->_runtime_header_src[$zone]); break; @@ -1097,7 +1097,7 @@ class e_jsmanager } else { - $this->renderInline(varsettrue($this->_runtime_footer_src[$zone], array()), 'Footer JS - priority #'.$zone); + $this->renderInline(vartrue($this->_runtime_footer_src[$zone], array()), 'Footer JS - priority #'.$zone); unset($this->_runtime_footer_src[$zone]); } break; @@ -1354,7 +1354,7 @@ class e_jsmanager public function getCurrentTheme() { // XXX - USERTHEME is defined only on user session init - return ($this->isInAdmin() ? e107::getPref('admintheme') : defsettrue('USERTHEME', e107::getPref('sitetheme'))); + return ($this->isInAdmin() ? e107::getPref('admintheme') : deftrue('USERTHEME', e107::getPref('sitetheme'))); } /** diff --git a/e107_handlers/language_class.php b/e107_handlers/language_class.php index 7c74d4e1c..d3b668bc9 100644 --- a/e107_handlers/language_class.php +++ b/e107_handlers/language_class.php @@ -435,7 +435,7 @@ class language{ if(false !== $this->detect && !$force) return $this->detect; $this->_cookie_domain = ''; - if(varsettrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== FALSE)) + if(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== FALSE)) { $detect_language = (e_SUBDOMAIN) ? $this->isValid(e_SUBDOMAIN) : $pref['sitelanguage']; // Done in session handler now, based on MULTILANG_SUBDOMAIN value diff --git a/e107_handlers/login.php b/e107_handlers/login.php index 2bfff369a..a67377519 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -401,7 +401,7 @@ class userlogin if($forceLogin === 'provider') return true; - if ($this->lookEmail && varsettrue($pref['passwordEncoding'])) + if ($this->lookEmail && vartrue($pref['passwordEncoding'])) { $tmp = e107::getArrayStorage()->unserialize($this->userData['user_prefs']); if(!$tmp && $this->userData['user_prefs']) $tmp = unserialize($this->userData['user_prefs']); // try old storage type diff --git a/e107_handlers/mail_manager_class.php b/e107_handlers/mail_manager_class.php index 719a1beeb..1b71206a7 100644 --- a/e107_handlers/mail_manager_class.php +++ b/e107_handlers/mail_manager_class.php @@ -401,8 +401,7 @@ class e107MailManager } if (isset($data['mail_target_info'])) { - $array = new ArrayData; - $tmp = $array->ReadArray($data['mail_target_info']); + $tmp = e107::unserialize($data['mail_target_info']); $res['mail_target_info'] = $tmp; } return $res; diff --git a/e107_handlers/mailout_class.php b/e107_handlers/mailout_class.php index 3db883d20..65cc4fcfc 100644 --- a/e107_handlers/mailout_class.php +++ b/e107_handlers/mailout_class.php @@ -89,7 +89,7 @@ class core_mailout $res = array(); foreach ($this->selectFields as $k) { - if (varsettrue($_POST[$k])) + if (vartrue($_POST[$k])) { $res[$k] = $tp->toDB($_POST[$k]); } diff --git a/e107_handlers/menumanager_class.php b/e107_handlers/menumanager_class.php index ffd7d3717..b751dee20 100644 --- a/e107_handlers/menumanager_class.php +++ b/e107_handlers/menumanager_class.php @@ -58,7 +58,7 @@ class e_menuManager { } else { - $this->curLayout = varsettrue($_GET['configure'], $pref['sitetheme_deflayout']); + $this->curLayout = vartrue($_GET['configure'], $pref['sitetheme_deflayout']); } $this->dbLayout = ($this->curLayout != $pref['sitetheme_deflayout']) ? $this->curLayout : ""; //menu_layout is left blank when it's default. @@ -1154,7 +1154,7 @@ class e_menuManager { function menuSetCode($matches, &$ret) { - if(!$matches || !varsettrue($matches[1])) + if(!$matches || !vartrue($matches[1])) { return; } diff --git a/e107_handlers/message_handler.php b/e107_handlers/message_handler.php index 34397836c..76c569ac7 100644 --- a/e107_handlers/message_handler.php +++ b/e107_handlers/message_handler.php @@ -383,7 +383,7 @@ class eMessage { return constant('EMESSLAN_TITLE_'.strtoupper($type.'_'.$message_stack)); } - return defsettrue('EMESSLAN_TITLE_'.strtoupper($type), ''); + return deftrue('EMESSLAN_TITLE_'.strtoupper($type), ''); } diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index cb1c4071a..71ebb5261 100644 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -1535,7 +1535,7 @@ class e_model extends e_object $cached = e107::getCache()->retrieve_sys($this->getCacheString(true), false, $this->_cache_force); if(false !== $cached) { - return e107::getArrayStorage()->ReadArray($cached); + return e107::unserialize($cached); } return false; diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 7b282904c..60862fcee 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -370,7 +370,7 @@ class e_db_mysql $userstring = ( USER === true ? USERNAME : "LAN_ANONYMOUS"); $ip = e107::getIPHandler()->getIP(FALSE); $qry = $tp->toDB($log_query); - $this->db_Insert('dblog', "0, {$time_sec}, {$time_usec}, '{$log_type}', 'DBDEBUG', {$uid}, '{$userstring}', '{$ip}', '', '{$log_remark}', '{$qry}'"); + $this->insert('dblog', "0, {$time_sec}, {$time_usec}, '{$log_type}', 'DBDEBUG', {$uid}, '{$userstring}', '{$ip}', '', '{$log_remark}', '{$qry}'"); } @@ -1280,7 +1280,10 @@ class e_db_mysql } } } - + + /** + * @deprecated use $sql->delete(); + */ function db_Delete($table, $arg = '', $debug = FALSE, $log_type = '', $log_remark = '') { return $this->delete($table, $arg, $debug, $log_type, $log_remark); @@ -2191,8 +2194,7 @@ class e_db_mysql $temp = file_get_contents(e_CACHE_DB.$tableName.'.php', FILE_TEXT); if ($temp !== FALSE) { - $array = e107::getArrayStorage(); - $typeDefs = $array->ReadArray($temp); + $typeDefs = e107::unserialize($temp); unset($temp); $this->dbFieldDefs[$tableName] = $typeDefs; } diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php index 1193d027a..2061a7ab6 100644 --- a/e107_handlers/news_class.php +++ b/e107_handlers/news_class.php @@ -476,7 +476,7 @@ class e_news_item extends e_front_model $val = $this->field($field, ''); //do more with $parm array, just an example here - if(varsettrue($parm['format'])) + if(vartrue($parm['format'])) { switch ($parm['format']) { @@ -485,7 +485,7 @@ class e_news_item extends e_front_model $method = 'toHTML'; $callback = e107::getParser(); $parm['arg'] = explode(',', varset($parm['arg'])); - $parm['arg'][0] = varsettrue($parm['arg'][0]) ? true : false; //to boolean + $parm['arg'][0] = vartrue($parm['arg'][0]) ? true : false; //to boolean $params = array($val); //value is always the first callback argument $params += $parm['arg']; break; diff --git a/e107_handlers/phpmailer/mailout_process.php b/e107_handlers/phpmailer/mailout_process.php index 90a8e7494..0b33fb66f 100644 --- a/e107_handlers/phpmailer/mailout_process.php +++ b/e107_handlers/phpmailer/mailout_process.php @@ -111,13 +111,13 @@ $email_info = unserialize($row['gen_chardata']); // Gives us sender_name, sende $mail = new PHPMailer(); - $mail->From = varsettrue($email_info['sender_email'],$pref['siteadminemail']); - $mail->FromName = varsettrue($email_info['sender_name'], $pref['siteadmin']); + $mail->From = vartrue($email_info['sender_email'],$pref['siteadminemail']); + $mail->FromName = vartrue($email_info['sender_name'], $pref['siteadmin']); // $mail->Host = "smtp1.site.com;smtp2.site.com"; if ($pref['mailer']== 'smtp') { $mail->Mailer = "smtp"; - $mail->SMTPKeepAlive = varsettrue($pref['smtp_keepalive']) ? TRUE : FALSE; + $mail->SMTPKeepAlive = vartrue($pref['smtp_keepalive']) ? TRUE : FALSE; if($pref['smtp_server']) { $mail->Host = $pref['smtp_server']; @@ -205,7 +205,7 @@ $email_info = unserialize($row['gen_chardata']); // Gives us sender_name, sende $mail_head .= "\n"; $mail_head .= "\n"; - if (varsettrue($email_info['use_theme'])) + if (vartrue($email_info['use_theme'])) { $theme = $THEMES_DIRECTORY.$pref['sitetheme']."/"; $style_css = file_get_contents(e_THEME.$pref['sitetheme']."/style.css"); diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index c065e4d6e..1f7dfdcff 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -392,7 +392,7 @@ class e107plugin { // print_a($plug_info); $pluginDBList[$plugin_path]['status'] = 'update'; - $pluginDBList[$plugin_path]['plugin_category'] = (varsettrue($plug_info['category'])) ? $plug_info['category'] : "misc"; + $pluginDBList[$plugin_path]['plugin_category'] = (vartrue($plug_info['category'])) ? $plug_info['category'] : "misc"; } // If plugin not installed, and version number of files changed, update version as well @@ -2140,7 +2140,7 @@ class e107plugin case 'uninstall': //If uninstalling, remove all userclasses (active or inactive) - if (varsettrue($this->unInstallOpts['delete_userclasses'], FALSE)) + if (vartrue($this->unInstallOpts['delete_userclasses'], FALSE)) { $status = $this->manage_userclass('remove', $name, $description) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $mes->add('Removing Userclass: '.$name, $status); @@ -2205,7 +2205,7 @@ class e107plugin case 'uninstall': //If uninstalling, remove all extended fields (active or inactive) - if (varsettrue($this->unInstallOpts['delete_xfields'], FALSE)) + if (vartrue($this->unInstallOpts['delete_xfields'], FALSE)) { $status = ($this->manage_extended_field('remove', $name, $attrib, $source)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $mes->add('Removing Extended Field: '.$name.' ... ', $status); diff --git a/e107_handlers/session_handler.php b/e107_handlers/session_handler.php index 6096c1218..446ef0f95 100644 --- a/e107_handlers/session_handler.php +++ b/e107_handlers/session_handler.php @@ -443,7 +443,7 @@ class e_session if (empty($this->_options['domain'])) { // MULTILANG_SUBDOMAIN set during initial language detection in language handler - $doma = ((!e_SUBDOMAIN || defsettrue('MULTILANG_SUBDOMAIN')) && e_DOMAIN != FALSE) ? ".".e_DOMAIN : FALSE; // from v1.x + $doma = ((!e_SUBDOMAIN || deftrue('MULTILANG_SUBDOMAIN')) && e_DOMAIN != FALSE) ? ".".e_DOMAIN : FALSE; // from v1.x $this->_options['domain'] = $doma; } diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index 45374a7d1..4d50aeb94 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -1162,7 +1162,7 @@ class e_parse_shortcode } else { - $cur_shortcodes = $eArrayStorage->ReadArray($sc_cache); + $cur_shortcodes = e107::unserialize($sc_cache); $sc_batch = ""; } } diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 8f9509f33..3e4d685a0 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -216,7 +216,7 @@ class sitelinks { return; } - $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !varsettrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE; + $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !vartrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE; foreach($this->eLinkList[$main_linkid] as $val) // check that something in the submenu is actually selected. { @@ -236,7 +236,7 @@ class sitelinks foreach ($this->eLinkList[$main_linkid] as $sub) { $id = "sub_".$sub['link_id']; - $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !varsettrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$id]) && is_array($this->eLinkList[$id])) ? TRUE : FALSE; + $sub['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !vartrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$id]) && is_array($this->eLinkList[$id])) ? TRUE : FALSE; $class = "sublink-level-".($level+1); $class .= ($css_class) ? " ".$css_class : ""; $text .= $this->makeLink($sub, TRUE, $aSubStyle,$class ); @@ -1251,9 +1251,9 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']); // valid URLs - $replace[1] = str_replace(array('&', '&'), array('&', '&'), varsettrue($e107_vars[$act]['link'], "#{$act}")); + $replace[1] = str_replace(array('&', '&'), array('&', '&'), vartrue($e107_vars[$act]['link'], "#{$act}")); $replace[2] = ''; - if (varsettrue($e107_vars[$act]['include'])) + if (vartrue($e107_vars[$act]['include'])) { $replace[2] = $e107_vars[$act]['include']; //$replace[2] = $js ? " onclick=\"showhideit('".$act."');\"" : " onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\""; @@ -1286,7 +1286,7 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } $START_SUB = $tmpl['start_sub']; } - if (varsettrue($e107_vars[$act]['sub'])) + if (vartrue($e107_vars[$act]['sub'])) { $replace[6] = $id ? " id='eplug-nav-{$rid}-sub'" : ''; $replace[7] = ' '.varset($e107_vars[$act]['link_class'], 'e-expandit'); diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index 90f8bdab3..1acc139aa 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -1683,11 +1683,14 @@ class themeHandler } - + /** + * @param $name + */ function installContentCheck($name) { $file = e_THEME.$name."/install/install.xml"; $frm = e107::getForm(); + $tp = e107::getParser(); if(!is_readable($file)) { @@ -1711,7 +1714,7 @@ class themeHandler $data = array('x'=> $count, 'y' => $val['@attributes']['name']); $lan = "Replace/Overwrite [x] record(s) in your [y] table. "; - $text .= "
  • ".$lng->translate($lan, $data)."
  • "; + $text .= "
  • ".$tp->lanVars($lan, $data)."
  • "; } $text .= " @@ -1734,19 +1737,12 @@ class themeHandler e107::getXml()->e107Import($file, 'replace', true, false); // Overwrite specific core pref and tables entries. $mes->addSuccess(LAN_UPDATED); } - - - - - - - - - - - + /** + * @param $theme + * @return int|string + */ function findDefault($theme) { if(varset($_POST['layout_default'])) diff --git a/e107_handlers/user_model.php b/e107_handlers/user_model.php index f1420ae64..69c4e33fd 100644 --- a/e107_handlers/user_model.php +++ b/e107_handlers/user_model.php @@ -1608,8 +1608,8 @@ class e_user extends e_user_model if(!$adapter->getUserProfile()->identifier) continue; - $id = $providerId.'_'.$adapter->getUserProfile()->identifier; - $where[] = "user_xup='".$sql->escape($id)."'"; + $id = $providerId.'_'.$adapter->getUserProfile()->identifier; + $where[] = "user_xup='".$sql->escape($id)."'"; } $where = implode(' OR ', $where); if($sql->db_Select('user', 'user_id, user_password, user_xup', $where)) @@ -2626,7 +2626,7 @@ class e_user_pref extends e_front_model if(!empty($data)) { // BC - $data = substr($data, 0, 5) == "array" ? e107::getArrayStorage()->ReadArray($data) : unserialize($data); + $data = substr($data, 0, 5) == "array" ? e107::unserialize($data) : unserialize($data); if(!$data) $data = array(); } else $data = array(); diff --git a/e107_handlers/validator_class.php b/e107_handlers/validator_class.php index fb3209aff..d835a9658 100644 --- a/e107_handlers/validator_class.php +++ b/e107_handlers/validator_class.php @@ -1010,7 +1010,7 @@ class validatorClass } else { - if (!varsettrue($defs['fieldOptional'])) + if (!vartrue($defs['fieldOptional'])) { $ret['errors'][$dest] = ERR_MISSING_VALUE; // No source value } @@ -1021,7 +1021,7 @@ class validatorClass $value = $sourceFields[$src]; if (!$errNum && isset($defs['enablePref'])) { // Only process this field if a specified pref enables it - if (!varsettrue($pref[$defs['enablePref']])) + if (!vartrue($pref[$defs['enablePref']])) { continue; // Just loop to the next field - ignore this one. } @@ -1049,7 +1049,7 @@ class validatorClass { if ($value == '') { - if (!varsettrue($defs['fieldOptional'])) + if (!vartrue($defs['fieldOptional'])) { $errNum = ERR_MISSING_VALUE; } @@ -1061,7 +1061,7 @@ class validatorClass } if (!$errNum && isset($defs['maxLength']) && $tp->ustrlen($value) > $defs['maxLength']) { - if (varsettrue($defs['longtrim'])) + if (vartrue($defs['longtrim'])) { $value = substr($value,0,$defs['maxLength']); } @@ -1240,7 +1240,7 @@ class validatorClass if (isset($definitions[$f])) { $options = $definitions[$f]; // Validation options to use - if (!varsettrue($options['fieldOptional']) || ($v != '')) + if (!vartrue($options['fieldOptional']) || ($v != '')) { $toDo = explode(',',$options['vetMethod']); foreach ($toDo as $vm) @@ -1281,7 +1281,7 @@ class validatorClass } break; case 3 : // Check email address against remote server - if (varsettrue($pref['signup_remote_emailcheck'])) + if (vartrue($pref['signup_remote_emailcheck'])) { require_once(e_HANDLER."mail_validation_class.php"); list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL); diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 91a0b18a6..65c4391d0 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -1081,7 +1081,7 @@ class xmlClass // var_dump(e107::getArrayStorage()->ReadArray($val['@value'])); // echo $val['@value'].'
    '; // } - $value = strpos($val['@value'], 'array (') === 0 ? e107::getArrayStorage()->ReadArray($val['@value']) : $val['@value']; + $value = strpos($val['@value'], 'array (') === 0 ? e107::unserialize($val['@value']) : $val['@value']; $pref[$name] = $value; // $mes->add("Setting up ".$prefType." Pref [".$name."] => ".$value, E_MESSAGE_DEBUG); diff --git a/e107_plugins/alt_auth/alt_auth_adminmenu.php b/e107_plugins/alt_auth/alt_auth_adminmenu.php index 18bcbf796..19b12894b 100755 --- a/e107_plugins/alt_auth/alt_auth_adminmenu.php +++ b/e107_plugins/alt_auth/alt_auth_adminmenu.php @@ -139,7 +139,7 @@ class alt_auth_admin extends alt_auth_base $ret = ''; foreach ($this->alt_auth_user_fields as $f => $v) { - if (varsettrue($v['showAll']) || varsettrue($v[$tableType])) + if (vartrue($v['showAll']) || vartrue($v[$tableType])) { $ret .= ""; if ($v['optional'] == FALSE) $ret .= '* '; @@ -196,7 +196,7 @@ class alt_auth_admin extends alt_auth_base $ret = array(); foreach ($this->alt_auth_user_fields as $f => $v) { - if (varsettrue($v['showAll']) || varsettrue($v[$tableType])) + if (vartrue($v['showAll']) || vartrue($v[$tableType])) { // $fieldname = $tableType.'_'.$v['optname']; $fieldname = $tableType.'_xf_'.$f; // Name of the input box diff --git a/e107_plugins/banner/admin_banner.php b/e107_plugins/banner/admin_banner.php index ecd6c4118..de5f76020 100644 --- a/e107_plugins/banner/admin_banner.php +++ b/e107_plugins/banner/admin_banner.php @@ -674,7 +674,7 @@ if (isset($_POST['delete_cancel'])) // delete cancelled - redirect back to 'mana exit; } -if (vartrue($action) == "delete" && $sub_action && varsettrue($_POST['delete_confirm'])) // delete has been confirmed, process +if (vartrue($action) == "delete" && $sub_action && vartrue($_POST['delete_confirm'])) // delete has been confirmed, process { if($sql->db_Delete("banner", "banner_id=".intval($sub_action))) { diff --git a/e107_plugins/download/admin_download.php b/e107_plugins/download/admin_download.php index f5ff40510..9183b44de 100644 --- a/e107_plugins/download/admin_download.php +++ b/e107_plugins/download/admin_download.php @@ -557,9 +557,9 @@ if ($action == "uopt") $file_text = "\n"; foreach ($_POST['file_class_select'] as $k => $c) { - if (!isset($_POST['file_line_delete_'.$c]) && varsettrue($_POST['file_type_list'][$k])) + if (!isset($_POST['file_line_delete_'.$c]) && vartrue($_POST['file_type_list'][$k])) { - $file_text .= " \n"; + $file_text .= " \n"; } } $file_text .= ""; diff --git a/e107_plugins/download/e_list.php b/e107_plugins/download/e_list.php index ee9ab2c73..00ebf288f 100644 --- a/e107_plugins/download/e_list.php +++ b/e107_plugins/download/e_list.php @@ -60,9 +60,9 @@ class list_download $rowheading = $this->parent->parse_heading($row['download_name']); $record['icon'] = $bullet; $record['heading'] = "".$rowheading.""; - $record['author'] = (varsettrue($this->parent->settings['author']) ? $row['download_author'] : ""); - $record['category'] = (varsettrue($this->parent->settings['category']) ? "".$row['download_category_name']."" : ""); - $record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['download_datestamp']) : ""); + $record['author'] = (vartrue($this->parent->settings['author']) ? $row['download_author'] : ""); + $record['category'] = (vartrue($this->parent->settings['category']) ? "".$row['download_category_name']."" : ""); + $record['date'] = (vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['download_datestamp']) : ""); $record['info'] = ""; $list_data[] = $record; diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index 835423431..e94fb5871 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -205,7 +205,7 @@ if (USER && vartrue($allread) != TRUE && $total_new_threads && $total_new_thread $fVars->INFO .= "
    ".LAN_FORUM_0057.''.(e_QUERY != 'new' ? ", ".LAN_FORUM_0058."" : ''); } -if (USER && varsettrue($forum->prefs->get('track')) && e_QUERY != 'track') +if (USER && vartrue($forum->prefs->get('track')) && e_QUERY != 'track') { $fVars->INFO .= "
    ".LAN_FORUM_0030.''; } diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index f3b444985..ca8ee148b 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -454,12 +454,12 @@ class e107forum $e107 = e107::getInstance(); if($tmp = $e107->ecache->retrieve_sys('forum_perms')) { - $this->permList = $e107->arrayStorage->ReadArray($tmp); + $this->permList = e107::unserialize($tmp); } else { $this->_getForumPermList(); - $tmp = $e107->arrayStorage->WriteArray($this->permList, false); + $tmp = e107::serialize($this->permList, false); $e107->ecache->set_sys('forum_perms', $tmp); } unset($tmp); diff --git a/e107_plugins/list_new/list.php b/e107_plugins/list_new/list.php index 933b0569b..0c5b0f91c 100644 --- a/e107_plugins/list_new/list.php +++ b/e107_plugins/list_new/list.php @@ -56,12 +56,12 @@ if(e_QUERY) } //set mode -$rc->mode = (varsettrue($mode) == 'new' ? 'new_page' : 'recent_page'); +$rc->mode = (vartrue($mode) == 'new' ? 'new_page' : 'recent_page'); //parse page $text = $rc->displayPage(); -$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); +$caption = vartrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); $rc->e107->ns->tablerender($caption, $text); unset($text); diff --git a/e107_plugins/list_new/list_admin_class.php b/e107_plugins/list_new/list_admin_class.php index da610157e..27525487c 100644 --- a/e107_plugins/list_new/list_admin_class.php +++ b/e107_plugins/list_new/list_admin_class.php @@ -117,7 +117,7 @@ class list_admin $this->row['FIELD'] = ""; for($i=0;$iparent->sections);$i++) { - $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_display", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_display"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; + $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_display", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_display"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; } $text .= $this->parseTemplate('TOPIC_ROW'); @@ -129,7 +129,7 @@ class list_admin $this->row['FIELD'] = ""; for($i=0;$iparent->sections);$i++) { - $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_open", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; + $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_open", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; } $text .= $this->parseTemplate('TOPIC_ROW'); @@ -141,7 +141,7 @@ class list_admin $this->row['FIELD'] = ""; for($i=0;$iparent->sections);$i++) { - $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_author", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; + $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_author", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; } $text .= $this->parseTemplate('TOPIC_ROW'); @@ -153,7 +153,7 @@ class list_admin $this->row['CONTID'] = "list-new-{$type}-expandable-category"; for($i=0;$iparent->sections);$i++) { - $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_category", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; + $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_category", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; } $text .= $this->parseTemplate('TOPIC_ROW'); @@ -165,7 +165,7 @@ class list_admin $this->row['CONTID'] = "list-new-{$type}-expandable-date"; for($i=0;$iparent->sections);$i++) { - $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_date", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; + $this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_date", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$this->parent->titles[$i]."
    "; } $text .= $this->parseTemplate('TOPIC_ROW'); diff --git a/e107_plugins/list_new/list_class.php b/e107_plugins/list_new/list_class.php index 597588798..e4d99c51b 100644 --- a/e107_plugins/list_new/list_class.php +++ b/e107_plugins/list_new/list_class.php @@ -160,17 +160,17 @@ class listclass for($i=0;$isections);$i++) { $s = $this->sections[$i]; - if(varsettrue($this->list_pref[$s."_".$mode."_display"]) == '1') + if(vartrue($this->list_pref[$s."_".$mode."_display"]) == '1') { - $arr[$s]['caption'] = varsettrue($this->list_pref[$s."_".$mode."_caption"]); - $arr[$s]['display'] = varsettrue($this->list_pref[$s."_".$mode."_display"]); - $arr[$s]['open'] = varsettrue($this->list_pref[$s."_".$mode."_open"]); - $arr[$s]['author'] = varsettrue($this->list_pref[$s."_".$mode."_author"]); - $arr[$s]['category'] = varsettrue($this->list_pref[$s."_".$mode."_category"]); - $arr[$s]['date'] = varsettrue($this->list_pref[$s."_".$mode."_date"]); - $arr[$s]['icon'] = varsettrue($this->list_pref[$s."_".$mode."_icon"]); - $arr[$s]['amount'] = varsettrue($this->list_pref[$s."_".$mode."_amount"]); - $arr[$s]['order'] = varsettrue($this->list_pref[$s."_".$mode."_order"]); + $arr[$s]['caption'] = vartrue($this->list_pref[$s."_".$mode."_caption"]); + $arr[$s]['display'] = vartrue($this->list_pref[$s."_".$mode."_display"]); + $arr[$s]['open'] = vartrue($this->list_pref[$s."_".$mode."_open"]); + $arr[$s]['author'] = vartrue($this->list_pref[$s."_".$mode."_author"]); + $arr[$s]['category'] = vartrue($this->list_pref[$s."_".$mode."_category"]); + $arr[$s]['date'] = vartrue($this->list_pref[$s."_".$mode."_date"]); + $arr[$s]['icon'] = vartrue($this->list_pref[$s."_".$mode."_icon"]); + $arr[$s]['amount'] = vartrue($this->list_pref[$s."_".$mode."_amount"]); + $arr[$s]['order'] = vartrue($this->list_pref[$s."_".$mode."_order"]); $arr[$s]['section'] = $s; } } @@ -224,7 +224,7 @@ class listclass while($row = $sql->fetch()) { $content_types[] = "content_".$row['content_id']; - if(varsettrue($mode) == "add") + if(vartrue($mode) == "add") { $this->sections[] = "content_".$row['content_id']; $this->titles[] = $content_name." : ".$row['content_heading']; @@ -602,11 +602,11 @@ class listclass global $qs; $lvisit = defined('USERLV') ? USERLV : time() + 1000; // Set default value - if(varsettrue($qs[0]) == "new") + if(vartrue($qs[0]) == "new") { - if(varsettrue($this->list_pref['new_page_timelapse'])) + if(vartrue($this->list_pref['new_page_timelapse'])) { - if(varsettrue($this->list_pref['new_page_timelapse_days']) && is_numeric($this->list_pref['new_page_timelapse_days'])) + if(vartrue($this->list_pref['new_page_timelapse_days']) && is_numeric($this->list_pref['new_page_timelapse_days'])) { $days = $this->list_pref['new_page_timelapse_days']; } @@ -660,7 +660,7 @@ class listclass } } } - $bullet = varsettrue($bullet, $default_bullet); + $bullet = vartrue($bullet, $default_bullet); return $bullet; } @@ -782,7 +782,7 @@ class listclass $arr = $this->prepareSectionArray($this->mode); //timelapse - if(varsettrue($qs[0]) == "new") + if(vartrue($qs[0]) == "new") { $text .= $this->displayTimelapse(); } diff --git a/e107_plugins/list_new/list_new_menu.php b/e107_plugins/list_new/list_new_menu.php index f52172ca6..91e6acb72 100644 --- a/e107_plugins/list_new/list_new_menu.php +++ b/e107_plugins/list_new/list_new_menu.php @@ -44,7 +44,7 @@ $rc->mode = "new_menu"; //parse menu $text = $rc->displayMenu(); -$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); +$caption = vartrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); $caption = $rc->e107->tp->toHtml($caption, FALSE, 'USER_TITLE'); $text = $rc->e107->tp->toHtml($text, TRUE, 'USER_BODY'); $rc->e107->ns->tablerender($caption, $text, 'list_new'); diff --git a/e107_plugins/list_new/list_recent_menu.php b/e107_plugins/list_new/list_recent_menu.php index e92762c39..382172f41 100644 --- a/e107_plugins/list_new/list_recent_menu.php +++ b/e107_plugins/list_new/list_recent_menu.php @@ -44,7 +44,7 @@ $rc->mode = "recent_menu"; //parse menu $text = $rc->displayMenu(); -$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); +$caption = vartrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1); $caption = $rc->e107->tp->toHtml($caption, FALSE, 'USER_TITLE'); $text = $rc->e107->tp->toHtml($text, TRUE, 'USER_BODY'); $rc->e107->ns->tablerender($caption, $text, 'list_recent'); diff --git a/e107_plugins/list_new/list_shortcodes.php b/e107_plugins/list_new/list_shortcodes.php index e6c7639a9..e9dde9d16 100644 --- a/e107_plugins/list_new/list_shortcodes.php +++ b/e107_plugins/list_new/list_shortcodes.php @@ -84,7 +84,7 @@ class list_shortcodes function sc_list_displaystyle() { //open sections if content exists ? yes if true, else use individual setting of section - return (varsettrue($this->list_pref[$this->rc->mode."_openifrecords"]) && is_array($this->rc->data['records']) ? "" : $this->rc->data['display']); + return (vartrue($this->list_pref[$this->rc->mode."_openifrecords"]) && is_array($this->rc->data['records']) ? "" : $this->rc->data['display']); } function sc_list_col_cols() diff --git a/e107_plugins/list_new/section/list_comment.php b/e107_plugins/list_new/section/list_comment.php index de1d8058f..23a7bd128 100644 --- a/e107_plugins/list_new/section/list_comment.php +++ b/e107_plugins/list_new/section/list_comment.php @@ -76,7 +76,7 @@ class list_comment $record['heading'] = $this->parent->e107->tp->toHTML($rowheading, true); } $category = ''; - if(varsettrue($this->parent->settings['category'])) + if(vartrue($this->parent->settings['category'])) { if($row['comment_category_url']) { @@ -87,8 +87,8 @@ class list_comment $record['category'] = $row['comment_category_heading']; } } - $record['author'] = (varsettrue($this->parent->settings['author']) ? $row['comment_author'] : ''); - $record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['comment_datestamp']) : ""); + $record['author'] = (vartrue($this->parent->settings['author']) ? $row['comment_author'] : ''); + $record['date'] = (vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['comment_datestamp']) : ""); $record['icon'] = $bullet; $record['info'] = ''; diff --git a/e107_plugins/list_new/section/list_members.php b/e107_plugins/list_new/section/list_members.php index 855d2c2b6..fd45bbea0 100644 --- a/e107_plugins/list_new/section/list_members.php +++ b/e107_plugins/list_new/section/list_members.php @@ -54,7 +54,7 @@ class list_members $record['heading'] = (USER ? "".$rowheading."" : $rowheading); $record['category'] = ''; $record['author'] = ''; - $record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : ""); + $record['date'] = (vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : ""); $record['info'] = ''; $list_data[] = $record; } diff --git a/e107_plugins/list_new/section/list_news.php b/e107_plugins/list_new/section/list_news.php index 83c9fad2d..e7c25e452 100644 --- a/e107_plugins/list_new/section/list_news.php +++ b/e107_plugins/list_new/section/list_news.php @@ -45,7 +45,7 @@ class list_news $bullet = $this->parent->getBullet($this->parent->settings['icon']); $list_caption = $this->parent->settings['caption']; - $list_display = (varsettrue($this->parent->settings['open']) ? '' : 'none'); + $list_display = (vartrue($this->parent->settings['open']) ? '' : 'none'); $qry = " SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name @@ -72,7 +72,7 @@ class list_news $record['heading'] = "".$rowheading.""; $record['author'] = ''; - if(varsettrue($this->parent->settings['author'])) + if(vartrue($this->parent->settings['author'])) { if($row['news_author'] == 0) { @@ -80,7 +80,7 @@ class list_news } else { - if(varsettrue($row['news_author_name'])) + if(vartrue($row['news_author_name'])) { $record['author'] = "".$row['news_author_name'].""; } @@ -88,13 +88,13 @@ class list_news } $record['category'] = ''; - if(varsettrue($this->parent->settings['category'])) + if(vartrue($this->parent->settings['category'])) { $record['category'] = "".$row['news_category_name'].""; } $record['date'] = ''; - if(varsettrue($this->parent->settings['date'])) + if(vartrue($this->parent->settings['date'])) { $record['date'] = $this->parent->getListDate($row['news_datestamp']); } diff --git a/e107_plugins/login_menu/login_menu.php b/e107_plugins/login_menu/login_menu.php index b1437a8ed..345b5a013 100644 --- a/e107_plugins/login_menu/login_menu.php +++ b/e107_plugins/login_menu/login_menu.php @@ -102,7 +102,7 @@ if (USER == TRUE || ADMIN == TRUE) // ------------ News Stats ----------- - if (varsettrue($loginPrefs['new_news'])) + if (vartrue($loginPrefs['new_news'])) { $nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'"; $menu_data['new_news'] = $sql->count("news", "(*)", "WHERE `news_datestamp` > {$time} AND news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (news_class REGEXP ".$nobody_regexp.")"); @@ -111,7 +111,7 @@ if (USER == TRUE || ADMIN == TRUE) // ------------ Comments Stats ----------- - if (varsettrue($loginPrefs['new_comments'])) + if (vartrue($loginPrefs['new_comments'])) { $menu_data['new_comments'] = $sql->count('comments', '(*)', 'WHERE `comment_datestamp` > '.$time); $new_total += $menu_data['new_comments']; @@ -119,7 +119,7 @@ if (USER == TRUE || ADMIN == TRUE) // ------------ Member Stats ----------- - if (varsettrue($loginPrefs['new_members'])) + if (vartrue($loginPrefs['new_members'])) { $menu_data['new_users'] = $sql->count('user', '(user_join)', 'WHERE user_join > '.$time); $new_total += $menu_data['new_users']; @@ -127,7 +127,7 @@ if (USER == TRUE || ADMIN == TRUE) // ------------ Enable stats / other --------------- - $menu_data['enable_stats'] = $menu_data || varsettrue($loginPrefs['external_stats']) ? true : false; + $menu_data['enable_stats'] = $menu_data || vartrue($loginPrefs['external_stats']) ? true : false; $menu_data['new_total'] = $new_total + $loginClass->get_stats_total(); $menu_data['link_bullet'] = $bullet; $menu_data['link_bullet_src'] = $bullet_src; @@ -176,7 +176,7 @@ else } $text = ''.varsettrue($value['link_label'], '['.LOGIN_MENU_L44.']').''; + $links[] = ''.vartrue($value['link_label'], '['.LOGIN_MENU_L44.']').''; } $plug_data = $this->get_plugin_data($id); @@ -276,11 +276,11 @@ class login_menu_class { $ret = ''; $lbox_infos = $this->parse_external_list(false); - $lbox_infos = varsettrue($lbox_infos['stats'], array()); + $lbox_infos = vartrue($lbox_infos['stats'], array()); if(!$lbox_infos) return ''; - $enabled = varsettrue($this->loginPrefs['external_stats']) ? explode(',', $this->loginPrefs['external_stats']) : array(); + $enabled = vartrue($this->loginPrefs['external_stats']) ? explode(',', $this->loginPrefs['external_stats']) : array(); $num = 1; foreach ($lbox_infos as $id => $stack) @@ -314,7 +314,7 @@ class login_menu_class function get_stats_total() { $lbox_infos = $this->parse_external_list(true, false); - if(!varsettrue($lbox_infos['stats'])) + if(!vartrue($lbox_infos['stats'])) { return 0; } @@ -380,7 +380,7 @@ class login_menu_class foreach($link_items as $key => $value) { - if(!varsettrue($value['link_url'])) + if(!vartrue($value['link_url'])) { unset($link_items[$key]); } diff --git a/e107_plugins/login_menu/login_menu_shortcodes.php b/e107_plugins/login_menu/login_menu_shortcodes.php index a5f138213..6668b8e32 100755 --- a/e107_plugins/login_menu/login_menu_shortcodes.php +++ b/e107_plugins/login_menu/login_menu_shortcodes.php @@ -267,10 +267,10 @@ class login_menu_shortcodes extends e_shortcode function sc_lm_external_links($parm='') { global $tp, $menu_pref, $login_menu_shortcodes, $LOGIN_MENU_EXTERNAL_LINK; - if(!varsettrue($menu_pref['login_menu']['external_links'])) return ''; + if(!vartrue($menu_pref['login_menu']['external_links'])) return ''; $lbox_infos = login_menu_class::parse_external_list(true, false); $lbox_active = $menu_pref['login_menu']['external_links'] ? explode(',', $menu_pref['login_menu']['external_links']) : array(); - if(!varsettrue($lbox_infos['links'])) return ''; + if(!vartrue($lbox_infos['links'])) return ''; $ret = ''; foreach ($lbox_active as $stackid) { $lbox_items = login_menu_class::clean_links(varset($lbox_infos['links'][$stackid])); @@ -287,13 +287,13 @@ class login_menu_shortcodes extends e_shortcode function sc_lm_external_link($parm='') { $lbox_item = getcachedvars('login_menu_linkdata'); - return $parm == 'href' ? $lbox_item['link_url'] : ''; + return $parm == 'href' ? $lbox_item['link_url'] : ''; } function sc_lm_external_link_label($parm='') { $lbox_item = getcachedvars('login_menu_linkdata'); - return varsettrue($lbox_item['link_label'], '['.LOGIN_MENU_L44.']'); + return vartrue($lbox_item['link_label'], '['.LOGIN_MENU_L44.']'); } function sc_lm_stats($parm='') @@ -361,9 +361,9 @@ class login_menu_shortcodes extends e_shortcode function sc_lm_plugin_stats($parm='') { global $tp, $menu_pref, $new_total, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR; - if(!varsettrue($menu_pref['login_menu']['external_stats'])) return ''; + if(!vartrue($menu_pref['login_menu']['external_stats'])) return ''; $lbox_infos = login_menu_class::parse_external_list(true, false); - if(!varsettrue($lbox_infos['stats'])) return ''; + if(!vartrue($lbox_infos['stats'])) return ''; $lbox_active_sorted = $menu_pref['login_menu']['external_stats'] ? explode(',', $menu_pref['login_menu']['external_stats']) : array(); $ret = array(); $sep = varset($LM_STATITEM_SEPARATOR, '
    '); @@ -400,7 +400,7 @@ class login_menu_shortcodes extends e_shortcode function sc_lm_message($parm='') { global $tp, $LOGIN_MENU_MESSAGE; - if(!defsettrue('LOGINMESSAGE')) return ''; + if(!deftrue('LOGINMESSAGE')) return ''; if($parm == "popup"){ $srch = array("
    ","'"); $rep = array("\\n","\'"); @@ -415,7 +415,7 @@ class login_menu_shortcodes extends e_shortcode function sc_lm_message_text($parm='') { - return defsettrue('LOGINMESSAGE', ''); + return deftrue('LOGINMESSAGE', ''); } diff --git a/e107_plugins/newforumposts_main/admin_config.php b/e107_plugins/newforumposts_main/admin_config.php index 3dd2dfcba..5d8102f18 100644 --- a/e107_plugins/newforumposts_main/admin_config.php +++ b/e107_plugins/newforumposts_main/admin_config.php @@ -32,6 +32,7 @@ if(isset($_POST['updatesettings'])) $pref['nfp_posts'] = intval(vartrue($_POST['nfp_posts'])); $pref['nfp_layer_height'] = intval(($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200)); save_prefs(); + } $ns->tablerender($caption, $mes->render() . $text); diff --git a/e107_plugins/newsfeed/newsfeed_functions.php b/e107_plugins/newsfeed/newsfeed_functions.php index 5b2fe75ae..52de4fe30 100644 --- a/e107_plugins/newsfeed/newsfeed_functions.php +++ b/e107_plugins/newsfeed/newsfeed_functions.php @@ -79,7 +79,7 @@ class newsfeedClass if (!$force && $temp = $e107->ecache->retrieve(NEWSFEED_LIST_CACHE_TAG)) { - $this->feedList = $eArrayStorage->ReadArray($temp); + $this->feedList = e107::unserialize($temp); return; } } @@ -91,9 +91,9 @@ class newsfeedClass $fieldList = 'newsfeed_id, newsfeed_name, newsfeed_url, newsfeed_timestamp, newsfeed_description, newsfeed_image, newsfeed_active, newsfeed_updateint'; } - if ($sql -> db_Select("newsfeed", $fieldList, '`newsfeed_active` > 0')) // Read in all the newsfeed info on the first go + if ($sql->select("newsfeed", $fieldList, '`newsfeed_active` > 0')) // Read in all the newsfeed info on the first go { - while ($row = $sql->db_Fetch(MYSQL_ASSOC)) + while ($row = $sql->fetch(MYSQL_ASSOC)) { $nfID = $row['newsfeed_id']; @@ -112,7 +112,7 @@ class newsfeedClass if ($this->useCache) { // Cache enabled - we need to save some updated info - $temp = $eArrayStorage->WriteArray($this->feedList, FALSE); + $temp = e107::serialize($this->feedList, FALSE); $e107->ecache->set(NEWSFEED_LIST_CACHE_TAG,$temp); } } @@ -242,7 +242,7 @@ class newsfeedClass } } - return $eArrayStorage->ReadArray($this->newsList[$feedID]['newsfeed_data']); + return e107::unserialize($this->newsList[$feedID]['newsfeed_data']); } diff --git a/e107_plugins/online/lastseen_menu.php b/e107_plugins/online/lastseen_menu.php index 784e6360e..c39dfd49d 100644 --- a/e107_plugins/online/lastseen_menu.php +++ b/e107_plugins/online/lastseen_menu.php @@ -30,7 +30,7 @@ else $menu_pref = e107::getConfig('menu')->getPref(''); $tp = e107::getParser(); -$num = intval(varsettrue($menu_pref['online_ls_amount'],10)); +$num = intval(vartrue($menu_pref['online_ls_amount'],10)); $sql -> db_Select('user', 'user_id, user_name, user_currentvisit', 'ORDER BY user_currentvisit DESC LIMIT 0,'.$num, 'nowhere'); $lslist = $sql -> db_getList(); @@ -43,7 +43,7 @@ foreach($lslist as $row) } $text .= $tp -> parseTemplate($LASTSEEN_TEMPLATE['end'], TRUE); -$caption = varsettrue($menu_pref['online_ls_caption'],LAN_LASTSEEN_1); +$caption = vartrue($menu_pref['online_ls_caption'],LAN_LASTSEEN_1); $ns->tablerender($caption, $text, 'lastseen'); ?> \ No newline at end of file diff --git a/e107_plugins/online/online_menu.php b/e107_plugins/online/online_menu.php index c57020f0b..08cc143c8 100644 --- a/e107_plugins/online/online_menu.php +++ b/e107_plugins/online/online_menu.php @@ -116,7 +116,7 @@ else $img = (is_readable(THEME.'images/online_menu.png') ? "" : ''); -$caption = $img.' '.varsettrue($menu_pref['online_caption'],LAN_ONLINE_10); +$caption = $img.' '.vartrue($menu_pref['online_caption'],LAN_ONLINE_10); if (getperms('1')) { diff --git a/e107_plugins/pm/e_cron.php b/e107_plugins/pm/e_cron.php index 91d2e619e..7306e24c8 100644 --- a/e107_plugins/pm/e_cron.php +++ b/e107_plugins/pm/e_cron.php @@ -131,13 +131,14 @@ class pm_cron // include plugin-folder in the name. // Start of the 'real' code - if ($this->ourDB->db_Select('generic', '*', "`gen_type` = 'pm_bulk' LIMIT 1")) + if ($this->ourDB->select('generic', '*', "`gen_type` = 'pm_bulk' LIMIT 1")) { - $pmRow = $this->ourDB->db_Fetch(MYSQL_ASSOC); + $pmRow = $this->ourDB->fetch(MYSQL_ASSOC); $this->logLine("\r\n\r\n".str_replace('--NUM--',$pmRow['gen_intdata'],LAN_EC_PM_06).date('D j M Y G:i:s')); - $this->ourDB->db_Delete('generic', "`gen_type` = 'pm_bulk' AND `gen_id` = ".$pmRow['gen_id']); - $array = new ArrayData; - $pmData = $array->ReadArray($pmRow['gen_chardata']); + + $this->ourDB->delete('generic', "`gen_type` = 'pm_bulk' AND `gen_id` = ".$pmRow['gen_id']); + + $pmData = e107::unserialize($pmRow['gen_chardata']); unset($pmRow); $this->pmClass = new private_message; $this->pmClass->add($pmData); diff --git a/e107_plugins/tagwords/tagwords.php b/e107_plugins/tagwords/tagwords.php index 7bee31196..07948e248 100644 --- a/e107_plugins/tagwords/tagwords.php +++ b/e107_plugins/tagwords/tagwords.php @@ -24,12 +24,12 @@ require_once(HEADERF); require_once(e_PLUGIN."tagwords/tagwords_class.php"); $tag = new tagwords(); //echo e107::getUrl()->create('tagwords/search/area', 'area=news&q=something'); -if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) ) +if(vartrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) ) { header("location:".SITEURL); exit; } -if(varsettrue($_GET['q'])) +if(vartrue($_GET['q'])) { $tag->TagSearchResults(); } diff --git a/e107_plugins/tagwords/tagwords_class.php b/e107_plugins/tagwords/tagwords_class.php index 15c94773e..91839e807 100644 --- a/e107_plugins/tagwords/tagwords_class.php +++ b/e107_plugins/tagwords/tagwords_class.php @@ -360,12 +360,12 @@ class tagwords if($tagarea!='menu') { //if user is able to manually set a area - if(varsettrue($this->pref['tagwords_view_area'])=='1') + if(vartrue($this->pref['tagwords_view_area'])=='1') { foreach($this->tagwords as $area) { //limit data to only one area, if so, which area - if(varsettrue($_GET['area'])==$area) + if(vartrue($_GET['area'])==$area) { $ins = "e_tagwords_{$area}"; $typeqry = " AND tag_type='".$this->$ins->settings['table']."'"; @@ -434,7 +434,7 @@ class tagwords //MENU if($tagarea=='menu') { - if(varsettrue($this->pref['tagwords_menu_default_sort'])==1) + if(vartrue($this->pref['tagwords_menu_default_sort'])==1) { //alphabetically ksort($array, SORT_STRING); @@ -449,7 +449,7 @@ class tagwords //PAGE //user can set own sort - if(varsettrue($this->pref['tagwords_view_sort'])==1) + if(vartrue($this->pref['tagwords_view_sort'])==1) { $s = varset($_GET['sort'],''); switch($s) @@ -463,7 +463,7 @@ class tagwords arsort($array); break; default: - if(varsettrue($this->pref['tagwords_default_sort'])==1) + if(vartrue($this->pref['tagwords_default_sort'])==1) { //alphabetically ksort($array, SORT_STRING); @@ -480,7 +480,7 @@ class tagwords } else { - if(varsettrue($this->pref['tagwords_default_sort'])==1) + if(vartrue($this->pref['tagwords_default_sort'])==1) { //alphabetically ksort($array, SORT_STRING); @@ -530,7 +530,7 @@ class tagwords //decide whether to show the taglist or the tagcloud //user can set own tag style - if(varsettrue($this->pref['tagwords_view_style'])=='1') + if(vartrue($this->pref['tagwords_view_style'])=='1') { $t = varset($_GET['type'],''); switch($t) @@ -542,14 +542,14 @@ class tagwords $type='list'; break; default: - $type = (varsettrue($this->pref['tagwords_default_style'])=='1' ? 'cloud' : 'list'); + $type = (vartrue($this->pref['tagwords_default_style'])=='1' ? 'cloud' : 'list'); break; } } else { //user cannot set tag style, so use default tag style value - $type = (varsettrue($this->pref['tagwords_default_style'])=='1' ? 'cloud' : 'list'); + $type = (vartrue($this->pref['tagwords_default_style'])=='1' ? 'cloud' : 'list'); } //show the taglist or tagcloud @@ -807,7 +807,7 @@ class tagwords $sql->gen("SELECT * FROM #core WHERE e107_name='".$this->table."' "); } $row = $sql->fetch(); - $p = $this->e107->arrayStorage->ReadArray($row['e107_value']); + $p = e107::unserialize($row['e107_value']); //validation if(!array_key_exists('tagwords_activeareas', $p)) diff --git a/e107_plugins/tagwords/tagwords_menu.php b/e107_plugins/tagwords/tagwords_menu.php index 3c0f539ad..6cb1035eb 100644 --- a/e107_plugins/tagwords/tagwords_menu.php +++ b/e107_plugins/tagwords/tagwords_menu.php @@ -18,7 +18,7 @@ $e107 = e107::getInstance(); require_once(e_PLUGIN."tagwords/tagwords_class.php"); $tag = new tagwords(); -if(varsettrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) ) +if(vartrue($tag->pref['tagwords_class']) && !check_class($tag->pref['tagwords_class']) ) { return; } diff --git a/e107_plugins/tagwords/tagwords_shortcodes.php b/e107_plugins/tagwords/tagwords_shortcodes.php index 922139d92..091b43b3d 100644 --- a/e107_plugins/tagwords/tagwords_shortcodes.php +++ b/e107_plugins/tagwords/tagwords_shortcodes.php @@ -49,7 +49,7 @@ class tagwords_shortcodes extends e_shortcode switch($sc_mode) { case 'menu': - if(varsettrue($tag->pref['tagwords_menu_view_search'])!=1) + if(vartrue($tag->pref['tagwords_menu_view_search'])!=1) { return; } @@ -65,7 +65,7 @@ class tagwords_shortcodes extends e_shortcode break; case 'search': - if(varsettrue($tag->pref['tagwords_view_search'])!=1) + if(vartrue($tag->pref['tagwords_view_search'])!=1) { return; } @@ -80,7 +80,7 @@ class tagwords_shortcodes extends e_shortcode break; default: - if(varsettrue($tag->pref['tagwords_view_search'])!=1) + if(vartrue($tag->pref['tagwords_view_search'])!=1) { return; } @@ -94,7 +94,7 @@ class tagwords_shortcodes extends e_shortcode function sc_tag_area_heading() { global $tag; - return (varsettrue($tag->area->settings['caption']) ? defset($tag->area->settings['caption'], $tag->area->settings['caption']) : ''); + return (vartrue($tag->area->settings['caption']) ? defset($tag->area->settings['caption'], $tag->area->settings['caption']) : ''); } function sc_tag_link($parm, $sc_mode) @@ -158,13 +158,13 @@ class tagwords_shortcodes extends e_shortcode return $tag->number; break; case 'menu': - if(varsettrue($tag->pref['tagwords_menu_view_freq'])==1) + if(vartrue($tag->pref['tagwords_menu_view_freq'])==1) { return $tag->number; } break; default: - if(varsettrue($tag->pref['tagwords_view_freq'])==1) + if(vartrue($tag->pref['tagwords_view_freq'])==1) { return $tag->number; } @@ -176,7 +176,7 @@ class tagwords_shortcodes extends e_shortcode { global $tag; - if(varsettrue($tag->pref['tagwords_view_sort'])==1) + if(vartrue($tag->pref['tagwords_view_sort'])==1) { $s = varset($_GET['sort'],''); switch($s) @@ -207,7 +207,7 @@ class tagwords_shortcodes extends e_shortcode { global $tag; - if(varsettrue($tag->pref['tagwords_view_style'])==1) + if(vartrue($tag->pref['tagwords_view_style'])==1) { $t = varset($_GET['type'],''); switch($t) @@ -237,7 +237,7 @@ class tagwords_shortcodes extends e_shortcode function sc_tag_area() { global $tag; - if(varsettrue($tag->pref['tagwords_view_area'])==1) + if(vartrue($tag->pref['tagwords_view_area'])==1) { $text = " "; return ''; } @@ -269,7 +269,7 @@ class tagwords_shortcodes extends e_shortcode function sc_tag_options() { global $tag; - if( varsettrue($tag->pref['tagwords_view_search'])==1 || varsettrue($tag->pref['tagwords_view_sort'])==1 || varsettrue($tag->pref['tagwords_view_style'])==1 || varsettrue($tag->pref['tagwords_view_area'])==1 ) + if( vartrue($tag->pref['tagwords_view_search'])==1 || vartrue($tag->pref['tagwords_view_sort'])==1 || vartrue($tag->pref['tagwords_view_style'])==1 || vartrue($tag->pref['tagwords_view_area'])==1 ) { return e107::getParser()->parseTemplate($tag->template['options'], true, $tag->shortcodes); } diff --git a/install.php b/install.php index 54cf20595..2b9f6fccd 100644 --- a/install.php +++ b/install.php @@ -632,9 +632,9 @@ class e_install $page_content .= "
    Deleted existing database"; } else - { + { $success = false; - $page_content .= "

    ".LANINS_043.nl2br("\n\n".LANINS_083."\n".mysql_error().""); + $page_content .= "

    ".LANINS_043.nl2br("\n\n".LANINS_083."\n".mysql_error().""); } } @@ -1448,9 +1448,9 @@ class e_install */ public function install_plugin($plugpath) //FIXME - requires default plugin table entries, see above. { - e107::getDb()->db_Select_gen("SELECT * FROM #plugin WHERE plugin_path = '".$plugpath."' LIMIT 1"); - $row = e107::getDb()->db_Fetch(MYSQL_ASSOC); - e107::getSingleton('e107plugin')->install_plugin($row['plugin_id']); + e107::getDb()->gen("SELECT * FROM #plugin WHERE plugin_path = '".$plugpath."' LIMIT 1"); + $row = e107::getDb()->fetch(MYSQL_ASSOC); + e107::getPlugin()->install_plugin($row['plugin_id']); e107::getMessage()->reset(false, false, true); diff --git a/online.php b/online.php index 46adf8866..68595a362 100644 --- a/online.php +++ b/online.php @@ -271,7 +271,7 @@ Think these are no longer used $online_location_page = ADMINAREA; } - $ONLINE_TABLE_ICON = (varsettrue($pref['plug_installed']['pm']) && $oid != USERID ? $tp->parseTemplate("{SENDPM={$oid}}", 'sendpm.sc') : ""); + $ONLINE_TABLE_ICON = (vartrue($pref['plug_installed']['pm']) && $oid != USERID ? $tp->parseTemplate("{SENDPM={$oid}}", 'sendpm.sc') : ""); $ONLINE_TABLE_USERNAME = "{$oname}"; $ONLINE_TABLE_LOCATION = ($class_check ? "{$online_location_page}" : $online_location_page); diff --git a/search.php b/search.php index 9b2525f5a..a3d2409e6 100644 --- a/search.php +++ b/search.php @@ -205,8 +205,8 @@ class search extends e_shortcode - return " ".LAN_SEARCH_29."  - ".LAN_SEARCH_30; + return " ".LAN_SEARCH_29."  + ".LAN_SEARCH_30; } function sc_search_dropdown($parm = '') @@ -1123,7 +1123,7 @@ $enhanced_types['be'] = LAN_SEARCH_27.':'; $SEARCH_VARS->ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'"; // advanced search config -if (!varsettrue($_GET['adv']) || $_GET['t'] == 'all') +if (!vartrue($_GET['adv']) || $_GET['t'] == 'all') { foreach ($_GET as $gk => $gv) { diff --git a/submitnews.php b/submitnews.php index bc25a5db9..9d6fd6827 100644 --- a/submitnews.php +++ b/submitnews.php @@ -55,7 +55,7 @@ if (isset($_POST['submitnews_submit']) && $_POST['submitnews_title'] && $_POST[' } // ==== Process File Upload ==== - if (FILE_UPLOADS && $_FILES['file_userfile'] && varsettrue($pref['subnews_attach']) && varsettrue($pref['upload_enabled']) && check_class($pref['upload_class'])) + if (FILE_UPLOADS && $_FILES['file_userfile'] && vartrue($pref['subnews_attach']) && vartrue($pref['upload_enabled']) && check_class($pref['upload_class'])) { require_once(e_HANDLER.'upload_handler.php'); $uploaded = process_uploaded_files(e_UPLOAD, FALSE, array('file_mask' => 'jpg,gif,png', 'max_file_count' => 1)); diff --git a/usersettings.php b/usersettings.php index d2280ec67..0ce50fb64 100644 --- a/usersettings.php +++ b/usersettings.php @@ -306,7 +306,7 @@ if (isset($_POST['updatesettings']) || isset($_POST['SaveValidatedInfo'])) if (isset($_POST['updatesettings'])) { - if (!varsettrue($pref['auth_method'])) + if (!vartrue($pref['auth_method'])) { $pref['auth_method'] = 'e107'; } @@ -788,7 +788,7 @@ if ($error) { $temp[] = validatorClass::makeErrorList($allData,'USER_ERR_','%n - %x - %t: %v', '
    ', $userMethods->userVettingInfo); } - if (varsettrue($eufVals['errors'])) + if (vartrue($eufVals['errors'])) { $temp[] = '
    '.validatorClass::makeErrorList($eufVals,'USER_ERR_','%n - %x - %t: %v', '
    ', NULL); }