From cf4ac712bd9eecd6661e91bcd0d3199534e425e7 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 3 Jul 2015 19:39:02 -0700 Subject: [PATCH] LAN Fixes. Core language-file verification tool re-enabled and enhanced. (developer mode only) --- e107_admin/db.php | 9 +- e107_admin/language.php | 1203 +++++++++-------- .../shortcodes/batch/admin_shortcodes.php | 2 +- e107_languages/English/English.php | 2 +- e107_languages/English/lan_installer.php | 67 +- install.php | 8 +- 6 files changed, 687 insertions(+), 604 deletions(-) diff --git a/e107_admin/db.php b/e107_admin/db.php index 8741f18cb..ca53360f0 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -622,7 +622,14 @@ class system_tools $frm = e107::getForm(); e107::lan('core','installer'); - + + // Leave here until no longer experimental. - Should be placed inside lan_db.php and LANS renamed. + define('LANINS_130', "Parked Domain"); + define('LANINS_131', "The parked domain which will become a new e107 website."); + define('LANINS_132', "mydomain.com"); + define('LANINS_133', "This will create a fresh installation of e107 at the domain you specify. Using your server administration software (e.g. cPanel) - park your other domain on top of [x]"); + + e107::getMySQLConfig('user'); // prefix|server|user|password| if(!isset($POST['create_multisite'])) diff --git a/e107_admin/language.php b/e107_admin/language.php index 3ae4638ea..c7161df9b 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.php @@ -372,77 +372,8 @@ if (varset($action) == "tools" && !$rendered) } - function findIncludedFiles($script,$reverse=false) - { - $mes = e107::getMessage(); - - $data = file_get_contents($script); - - if(strpos($data, 'e_admin_dispatcher')!==false) - { - $reverse = false; - } - - $dir = dirname($script); - - $dir = str_replace("/includes","",$dir); - $plugin = basename($dir); - - if(strpos($script,'admin')!==false || strpos($script,'includes')!==false) // Admin Language files. - { - - $newLangs = array( - 0 => $dir."/languages/English/English_admin_".$plugin.".php", - 1 => $dir."/languages/English_admin_".$plugin.".php", - 2 => $dir."/languages/English_admin.php", - 3 => $dir."/languages/English/English_admin.php" - ); - } - else - { - $newLangs = array( - 0 => $dir."/languages/English/English_".$plugin.".php", - 1 => $dir."/languages/English_admin_".$plugin.".php", - 2 => $dir."/languages/English_front.php", - 3 => $dir."/languages/English/English_front.php", - 4 => $dir."/languages/English_front.php", - 5 => $dir."/languages/English/English_front.php" - ); - } - // if(strpos($data, 'e_admin_dispatcher')!==false) - { - foreach($newLangs as $path) - { - if(file_exists($path) && $reverse == false) - { - return $path; - } - } - } - - preg_match_all("/.*(include_lan|require_once|include|include_once) ?\((.*e_LANGUAGE.*?\.php)/i",$data,$match); - - $srch = array(" ",'e_PLUGIN.', 'e_LANGUAGEDIR', '.e_LANGUAGE.', "'", '"', "'."); - $repl = array("", e_PLUGIN, e_LANGUAGEDIR, "English", "", "", ""); - - foreach($match[2] as $lanFile) - { - $arrt = str_replace($srch,$repl,$lanFile); - // if(strpos($arrt,'admin')) - { - //return $arrt; - $arr[] = $arrt; - } - } - - return implode(",",$arr); - - - // return $arr[0]; - } - if(vartrue($_POST['disabled-unused']) && vartrue($_POST['disable-unused-lanfile'])) { @@ -484,57 +415,10 @@ function disableUnused($data) } -if(varset($_POST['searchDeprecated']) && varset($_POST['deprecatedLans'])) -{ - $mes = e107::getMessage(); - - // $lanfile = $_POST['deprecatedLans']; - $script = $_POST['deprecatedLans']; - - if(strpos($script,e_ADMIN)!==false) // CORE - { - $mes->addDebug("Mode: Core Admin Calculated"); - //$scriptname = str_replace("lan_","",basename($lanfile)); - $lanfile = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".basename($script); - } - else // Plugin - { - $mes->addDebug("Mode: Search Plugins"); - $lanfile = findIncludedFiles($script,vartrue($_POST['deprecatedLansReverse'])); - } - - if(!is_readable($script)) - { - $mes->addError("Not Readable: ".$script); - // $script = $scriptname; // matching files. lan_xxxx.php and xxxx.php - } - - $found = findIncludedFiles($script,vartrue($_POST['deprecatedLansReverse'])); - -// print_a($found); - - // Exceptions - same language loaded by several scripts. - if($lanfile == e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_e107_update.php") - { - $script = e_ADMIN."update_routines.php,".e_ADMIN."e107_update.php"; - } - - if(vartrue($_POST['deprecatedLanFile'])) //override. - { - $lanfile = $_POST['deprecatedLanFile']; - } - - if($res = unused($lanfile, $script, vartrue($_POST['deprecatedLansReverse']))) - { - $ns -> tablerender($res['caption'],$mes->render(). $res['text']); - } - - -} - +new lanDeveloper; @@ -1071,14 +955,14 @@ function show_tools() show_packs(); - return; + //return; - if(!vartrue($_SERVER['E_DEV'])) + if(e_DEVELOPER !== true) { - return; + return false; } - + lanDeveloper::form(); /* $text = "
@@ -1115,161 +999,7 @@ function show_tools()
"; */ - $text = ""; - - $text .= " -
-
- ".LANG_LAN_23." - - - - - - "; - - /* - $text .= " - - - - "; - */ - - - $fl = e107::getFile(); - $fl->mode = 'full'; - - if(!$_SESSION['languageTools_lanFileList']) - { - - $_SESSION['languageTools_lanFileList'] = $fl->get_files(e_BASE,'.*?(English|lan_).*?\.php$','standard',5); - } - - - $text .= " - - - - "; - - - $text .= " - -
".LANG_LAN_23." - - ".$frm->admin_button('ziplang','no-value','other',LANG_LAN_24)." - Check to share your language-pack with the e107 community. -
Search for Deprecated Lans - ". - $frm->select('deprecatedLansReverse',$depOptions,$_POST['deprecatedLansReverse'],'class=select')." "; - - $search = array(e_PLUGIN,e_ADMIN,e_LANGUAGEDIR,e_THEME); - $replace = array("Plugins ","Admin ","Core ","Themes "); - - - $prev = 'Core'; - $text .= ""; - - // $frm->select('deprecatedLanFile',$_SESSION['languageTools_lanFileList'], $_POST['deprecatedLanFile'],'class=select&useValues=1','Select Language File (optional)'). - $text .= $frm->admin_button('searchDeprecated',"Check",'other'); - // $text .= "".(count($lans) + count($plugs))." files found"; - $text .= " -
-
-
- "; - - - e107::getRender()->tablerender(ADLAN_132.SEP.LANG_LAN_21, $mes->render().$text); } @@ -1281,6 +1011,8 @@ function available_langpacks() $xml = e107::getXml(); $feed = e107::getPref('xmlfeed_languagepacks'); + + $text = ''; if($rawData = $xml -> loadXMLfile($feed, TRUE)) { @@ -1590,178 +1322,666 @@ function grab_lans($path, $language, $filter = "") // ----------------------- -/** - * Compare Language File against script and find unused LANs - * @param object $lanfile - * @param object $script - * @return string|boolean FALSE on error - */ -function unused($lanfile,$script,$reverse=false) + + +class lanDeveloper { - - $mes = e107::getMessage(); - $frm = e107::getForm(); - unset($_SESSION['language-tools-unused']); -// $mes->addInfo("LAN=".$lanfile."
Script = ".$script); + private $lanFile = null; + private $scriptFile = null; + private $adminFile = false; + private $commonPhrases = array(); + private $errors = 0; - - if($reverse == true) + function __construct() { - - $exclude = array("e_LANGUAGE","e_LANGUAGEDIR","e_LAN","e_LANLIST","e_LANCODE"); - - $data = file_get_contents($script); - - if(preg_match_all("/([\w_]*LAN[\w_]*)/", $data, $match)) + $ns = e107::getRender(); + $mes = e107::getMessage(); + + if(varset($_POST['searchDeprecated']) && varset($_POST['deprecatedLans'])) { - // print_a($match); - $foundLans = array(); - foreach($match[1] as $val) + + + // $lanfile = $_POST['deprecatedLans']; + $script = $_POST['deprecatedLans']; + + if(strpos($script,e_ADMIN)!==false) // CORE { - if(!in_array($val, $exclude)) - { - $foundLans[] = $val; - } + $mes->addDebug("Mode: Core Admin Calculated"); + //$scriptname = str_replace("lan_","",basename($lanfile)); + $lanfile = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".basename($script); + $this->adminFile = true; } - sort($foundLans); - $foundLans = array_unique($foundLans); - $lanDefines = implode("\n",$foundLans); - - } - - $mes->addDebug("Script: ".$script); - - $tmp = explode(",", $lanfile); - foreach($tmp as $scr) - { - if(!file_exists($scr)) + else // Root { - $mes->addError(LANG_LAN_121." ".$scr); - continue; + $mes->addDebug("Mode: Search Core Root lan calculated"); + $lanfile = e_LANGUAGEDIR.e_LANGUAGE."/lan_".basename($script); + $lanfile = str_replace("lan_install", "lan_installer", $lanfile); //quick fix., + + //$lanfile = $this->findIncludedFiles($script,vartrue($_POST['deprecatedLansReverse'])); } - - $compare[$scr] = file_get_contents($scr); - $mes->addDebug("LanFile: ".$scr); - - } - - $lanfile = $script; - } - else - { - $lanDefines = file_get_contents($lanfile); - $mes->addDebug("LanFile: ".$lanfile); - - $tmp = explode(",",$script); - foreach($tmp as $scr) - { - if(!file_exists($scr)) + + if(!is_readable($script)) { - $mes->addError(LANG_LAN_121." ".$scr); - continue; + $mes->addError("Not Readable: ".$script); + // $script = $scriptname; // matching files. lan_xxxx.php and xxxx.php } - $compare[$scr] = file_get_contents($scr); - $mes->addDebug("Script: ".$scr); - } - } - - -// print_a($compare); -// print_a($lanDefines); + $found = $this->findIncludedFiles($script,vartrue($_POST['deprecatedLansReverse'])); - if(!$compare) - { - $mes->addError(LANG_LAN_121." ".$script); - } - - if(!$lanDefines) - { - $mes->addError(LANG_LAN_121." ".$lanfile); - } +// print_a($found); - $srch = array(""); - $lanDefines = str_replace($srch,"",$lanDefines); - $lanDefines = explode("\n", $lanDefines); - - if($lanDefines) - { - $text = $frm->open('language-unused'); - $text .= " - - - - - - - "; - - foreach($compare as $k=>$val) + // Exceptions - same language loaded by several scripts. + if($lanfile == e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_e107_update.php") { - $text .= ""; + $script = e_ADMIN."update_routines.php,".e_ADMIN."e107_update.php"; + } + + if(vartrue($_POST['deprecatedLanFile'])) //override. + { + $lanfile = $_POST['deprecatedLanFile']; + } + + $this->lanFile = $lanfile; + $this->scriptFile = $script; + $this->commonPhrases = $this->getCommon(); + + // print_a($this->commonPhrases); + + if($res = $this->unused($lanfile, $script, vartrue($_POST['deprecatedLansReverse']))) + { + $ns->tablerender($res['caption'],$mes->render(). $res['text']); } - - if($reverse == true) - { - $text .= ""; - } - - $text .= " - - - "; - - // for ($i=0; $i0 && $reverse == false) - { - $text .= "
".$frm->admin_button('disabled-unused',LANG_LAN_126,'delete'). - $frm->hidden('disable-unused-lanfile',$lanfile). - $frm->hidden('deprecatedLans',$script). - - "
"; } - - $text .= $frm->close(); - - if($reverse != true) - { - $mes->addInfo("".LANG_LAN_127."
".LANG_LAN_128."
"); - } - - $ret['text'] = $mes->render().$text; - $ret['caption'] = LANG_LAN_129; - return $ret; + // print_a($this); + } - else + + + static function form() { - return FALSE; + $frm = e107::getForm(); + $mes = e107::getMessage(); + $text = ""; + + $text .= " +
+
+ ".LANG_LAN_23." +
".$lanfile."".$k."".LANG_LAN_124."
+ + + + + "; + + + $fl = e107::getFile(); + $fl->mode = 'full'; + + // $_SESSION['languageTools_lanFileList'] = null; + + if(!$_SESSION['languageTools_lanFileList']) + { + + $_SESSION['languageTools_lanFileList'] = $fl->get_files(e_LANGUAGEDIR."English",'.*?(English|lan_).*?\.php$','standard',3); + } + + // print_a($_SESSION['languageTools_lanFileList']); + + + $text .= " + + + + "; + + + $text .= " + +
Search for Deprecated Lans + ". + $frm->select('deprecatedLansReverse',$depOptions,$_POST['deprecatedLansReverse'],'class=select')." "; + + $search = array(e_PLUGIN,e_ADMIN,e_LANGUAGEDIR."English/",e_THEME); + $replace = array("Plugins ","Admin ","Core ","Themes "); + + + $prev = 'Core'; + $text .= ""; + + // $frm->select('deprecatedLanFile',$_SESSION['languageTools_lanFileList'], $_POST['deprecatedLanFile'],'class=select&useValues=1','Select Language File (optional)'). + $text .= $frm->admin_button('searchDeprecated',"Check",'other'); + // $text .= "".(count($lans) + count($plugs))." files found"; + $text .= " +
+ + + "; + + e107::getRender()->tablerender(ADLAN_132.SEP."Core Language-Pack Developer", $mes->render().$text); + + } + function getCommon() + { + $commonPhrases = file_get_contents(e_LANGUAGEDIR."English/English.php"); + + if($this->adminFile == true) + { + $commonPhrases .= file_get_contents(e_LANGUAGEDIR."English/admin/lan_admin.php"); + } + + $commonLines = explode("\n",$commonPhrases); + + $ar = array(); + + foreach($commonLines as $line) + { + if($match = getDefined($line)) + { + $id = $match['define']; + $ar[$id] = $match['value']; + } + } + + return $ar; + } + + + + function compareit($needle,$haystack, $value='',$disabled=false, $reverse=false) + { + +// return "Need=".$needle."
hack=".$haystack."
val=".$val; + $foundSimilar = FALSE; + $foundCommon = FALSE; + $ar = $this->commonPhrases; + $commonArray = array_keys($ar); + + + + // Check if a common phrases was used. + foreach($ar as $def=>$common) + { + similar_text($value, $common, $p); + + if(strtoupper(trim($value)) == strtoupper($common)) + { + //$text .= "
$common
"; + + $foundCommon = true; + break; + } + elseif($p > 75) + { + $foundSimilar = true; + break; + } + $p = 0 ; + } + + + $text = ''; + $text2 = ''; + + + foreach($haystack as $script) + { + $lines = explode("\n",$script); + + $text .= ""; + $text2 .= ($reverse == true) ? "" : ""; + + $count = 1; + foreach($lines as $ln) + { + if(preg_match("/\b".$needle."\b/i",$ln, $mtch)) + { + if($disabled) + { + $text .= ADMIN_WARNING_ICON; + $label = " Must be re-enabled"; + $this->errors++; + // $text .= "blabla"; + // $class = 'alert alert-warning'; + } + elseif($reverse == true) + { + $text .= ADMIN_TRUE_ICON; + } + + $text .= " Line:".$count." "; // "' Found"; + + if($reverse == true) + { + $text2 .= print_a($ln,true); + } + $found = true; + } + + $count++; + } + + if($reverse == true && in_array($needle,$commonArray)) + { + $found = false; + $text = ""; + $text2 = ""; + } + + if(empty($found)) + { + // echo "
Unused: ".$needle; + if($reverse == true) + { + if(in_array($needle,$commonArray)) + { + // print_a($needle); + //$color = "background-color:#E9EAF2"; + $class = ''; + $text .= ADMIN_TRUE_ICON; + $value = "".LANG_LAN_130.""; // Common Term. + } + else + { + // $color = "background-color:yellow"; + $text .= "".ADMIN_WARNING_ICON.""; + $this->errors++; + $value = LANG_LAN_131; + $class = "alert alert-warning"; + } + + } + elseif(empty($disabled)) + { + // $color = "background-color:pink"; + $class = ' '; + $label = " Unused"; + $text .= "-"; + $this->errors++; + } + + if(!$disabled) + { + $_SESSION['language-tools-unused'][] = $needle; + } + } + $text .= ""; + $text2 .= ($reverse == true) ? "" : ""; + } + + + if($foundCommon && $found) + { + //$color = "background-color:yellow"; + // $class = "alert alert-warning"; + $label .= "
".$common." ".LANG_LAN_132."
(".LANG_LAN_133." ".$def." ".LANG_LAN_134.")
"; + + // return "".$needle .$disabled. ""; + } + + elseif($foundSimilar && $found && substr($def,0,4) == "LAN_") + { + // $color = "background-color:#E9EAF2"; + $label .= " ".round($p)."% like ".$def." "; + // $disabled .= " " . $def.""; // $common; + } + + if($disabled !==false) + { + $color = "font-style:italic"; + $class = 'muted text-important '; + $label .= " Disabled"; + } + + if(empty($found) && $disabled === true) + { + // $needle = "".$needle.""; + } + + return "".$needle .$label. " + ".print_r($value,true)." + ".$text.$text2.""; + } + + + + + + /** + * Compare Language File against script and find unused LANs + * @param object $lanfile + * @param object $script + * @return string|boolean FALSE on error + */ + function unused($lanfile,$script,$reverse=false) + { + + $mes = e107::getMessage(); + $frm = e107::getForm(); + + unset($_SESSION['language-tools-unused']); + // $mes->addInfo("LAN=".$lanfile."
Script = ".$script); + + + if($reverse == true) + { + + $exclude = array("e_LANGUAGE","e_LANGUAGEDIR","e_LAN","e_LANLIST","e_LANCODE", "LANGUAGES_DIRECTORY"); + + $data = file_get_contents($script); + + if(preg_match_all("/([\w_]*LAN[\w_]*)/", $data, $match)) + { + // print_a($match); + $foundLans = array(); + foreach($match[1] as $val) + { + if(!in_array($val, $exclude)) + { + $foundLans[] = $val; + } + } + sort($foundLans); + $foundLans = array_unique($foundLans); + $lanDefines = implode("\n",$foundLans); + + } + + $mes->addDebug("Script: ".$script); + + $tmp = explode(",", $lanfile); + foreach($tmp as $scr) + { + if(!file_exists($scr)) + { + $mes->addError(LANG_LAN_121." ".$scr); + continue; + } + + $compare[$scr] = file_get_contents($scr); + $mes->addDebug("LanFile: ".$scr); + + } + + $lanfile = $script; + } + else + { + $lanDefines = file_get_contents($lanfile); + $mes->addDebug("LanFile: ".$lanfile); + + $tmp = explode(",",$script); + foreach($tmp as $scr) + { + if(!file_exists($scr)) + { + $mes->addError(LANG_LAN_121." ".$scr); + continue; + } + $compare[$scr] = file_get_contents($scr); + $mes->addDebug("Script: ".$scr); + } + } + + + + // print_a($compare); + // print_a($lanDefines); + + if(!$compare) + { + $mes->addError(LANG_LAN_121." ".$script); + } + + if(!$lanDefines) + { + $mes->addError(LANG_LAN_121." ".$lanfile); + } + + $srch = array(""); + $lanDefines = str_replace($srch,"",$lanDefines); + $lanDefines = explode("\n", $lanDefines); + + if($lanDefines) + { + $text = $frm->open('language-unused'); + $text .= " + + + + + + + + "; + + foreach($compare as $k=>$val) + { + $text .= ""; + } + + if($reverse == true) + { + $text .= ""; + } + + $text .= " + + + "; + + // for ($i=0; $icompareit($match['define'], $compare, $match['value'], $disabled, $reverse); + } + } + } + + + $text .= "
".str_replace(e_LANGUAGEDIR,"",$lanfile)."Value".str_replace("../","",$k)."".LANG_LAN_124."
"; + /* + if(count($_SESSION['language-tools-unused'])>0 && $reverse == false) + { + $text .= "
".$frm->admin_button('disabled-unused',LANG_LAN_126,'delete'). + $frm->hidden('disable-unused-lanfile',$lanfile). + $frm->hidden('deprecatedLans',$script). + + "
"; + } + */ + + $text .= $frm->close(); + + if($reverse != true) + { + $mes->addInfo("Search ENTIRE core before commenting out ANY LAN from ANY language file."); + } + + $ret['text'] = $mes->render().$text; + $ret['caption'] = "Errors: ".intval($this->errors); + + return $ret; + } + else + { + return FALSE; + } + + } + + + + + + function findIncludedFiles($script,$reverse=false) + { + $mes = e107::getMessage(); + + $data = file_get_contents($script); + + if(strpos($data, 'e_admin_dispatcher')!==false) + { + $reverse = false; + } + + $dir = dirname($script); + + $dir = str_replace("/includes","",$dir); + $plugin = basename($dir); + + if(strpos($script,'admin')!==false || strpos($script,'includes')!==false) // Admin Language files. + { + + $newLangs = array( + 0 => $dir."/languages/English/English_admin_".$plugin.".php", + 1 => $dir."/languages/English_admin_".$plugin.".php", + 2 => $dir."/languages/English_admin.php", + 3 => $dir."/languages/English/English_admin.php" + ); + } + else + { + $newLangs = array( + 0 => $dir."/languages/English/English_".$plugin.".php", + 1 => $dir."/languages/English_admin_".$plugin.".php", + 2 => $dir."/languages/English_front.php", + 3 => $dir."/languages/English/English_front.php", + 4 => $dir."/languages/English_front.php", + 5 => $dir."/languages/English/English_front.php" + ); + } + // if(strpos($data, 'e_admin_dispatcher')!==false) + { + foreach($newLangs as $path) + { + if(file_exists($path) && $reverse == false) + { + return $path; + } + } + } + + + + preg_match_all("/.*(include_lan|require_once|include|include_once) ?\((.*e_LANGUAGE.*?\.php)/i",$data,$match); + + $srch = array(" ",'e_PLUGIN.', 'e_LANGUAGEDIR', '.e_LANGUAGE.', "'", '"', "'."); + $repl = array("", e_PLUGIN, e_LANGUAGEDIR, "English", "", "", ""); + + foreach($match[2] as $lanFile) + { + $arrt = str_replace($srch,$repl,$lanFile); + // if(strpos($arrt,'admin')) + { + //return $arrt; + $arr[] = $arrt; + } + } + + return implode(",",$arr); + + + // return $arr[0]; + } + + + + + } + function getDefined($line,$script=false) { @@ -1785,146 +2005,7 @@ function getDefined($line,$script=false) -function compareit($needle,$haystack,$value='',$disabled=FALSE, $reverse=false){ - - -// return "Need=".$needle."
hack=".$haystack."
val=".$val; - //TODO Move this into a separate function (use a class for this whole script) - - $commonPhrases = file_get_contents(e_LANGUAGEDIR."English/admin/lan_admin.php"); - $commonLines = explode("\n",$commonPhrases); - - $foundSimilar = FALSE; - $foundCommon = FALSE; - - foreach($commonLines as $line) - { - if($match = getDefined($line)) - { - $id = $match['define']; - $ar[$id] = $match['value']; - } - } - $commonArray = array_keys($ar); - - // Check if a common phrases was used. - foreach($ar as $def=>$common) - { - similar_text($value, $common, $p); - - if(strtoupper(trim($value)) == strtoupper($common)) - { - //$text .= "
$common
"; - $foundCommon = TRUE; - break; - } - elseif($p > 55) - { - $foundSimilar = TRUE; - break; - } - $p = 0 ; - } - - - - foreach($haystack as $script) - { - $lines = explode("\n",$script); - - $text .= ""; - $text2 .= ($reverse == true) ? "" : ""; - - $count = 1; - foreach($lines as $ln) - { - if(preg_match("/\b".$needle."\b/i",$ln, $mtch)) - { - if($disabled) - { - $text .= ADMIN_WARNING_ICON; - } - elseif($reverse == true) - { - $text .= ADMIN_TRUE_ICON; - } - $text .= " Line:".$count." "; // "' Found"; - - if($reverse == true) - { - $text2 .= print_a($ln,true); - } - $found = TRUE; - } - - $count++; - } - - if(!$found) - { - // echo "
Unused: ".$needle; - if($reverse == true) - { - if(in_array($needle,$commonArray)) - { - $color = "background-color:#E9EAF2"; - $text .= ADMIN_TRUE_ICON; - $value = LANG_LAN_130; - } - else - { - $color = "background-color:yellow"; - $text .= "".ADMIN_WARNING_ICON.""; - $value = LANG_LAN_131; - } - - } - else - { - $color = "background-color:pink"; - $text .= "-"; - } - - if(!$disabled) - { - $_SESSION['language-tools-unused'][] = $needle; - } - } - $text .= ""; - $text2 .= ($reverse == true) ? "" : ""; - } - -// $color = $found ? "" : "background-color:pink"; - - - if($foundCommon && $found) - { - $color = "background-color:yellow"; - $disabled .= "
".$common." ".LANG_LAN_132."
(".LANG_LAN_133." ".$def." ".LANG_LAN_134.")"; - - // return "".$needle .$disabled. ""; - } - - elseif($foundSimilar && $found && substr($def,0,4) == "LAN_") - { - $color = "background-color:#E9EAF2"; - $disabled .= " ".round($p)."% like ".$def." "; - // $disabled .= " " . $def.""; // $common; - } - - if($disabled == " ".LANG_LAN_125) - { - $color = "background-color:#DFFFDF"; - } - - if(!$found) - { - $needle = "".$needle.""; - } - - return "".$needle .$disabled. "".$text.$text2.""; -} diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 3e5ea97b7..caa718bf6 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1776,7 +1776,7 @@ Inverse 10 10 $menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE; $menu_vars['language']['link'] = '#'; $menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "" ; - $menu_vars['language']['image_src'] = ADLAN_46; + $menu_vars['language']['image_src'] = null; $menu_vars['language']['sub'] = $tmp; } diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index 6c0cd3c76..2720e24e5 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -41,7 +41,7 @@ define("CORE_LAN_GB", "GB"); define("CORE_LAN_TB", "TB"); define("EMESSLAN_TITLE_INFO", "System Information"); -//define("EMESSLAN_TITLE_ERROR", "Error"); new > LAN_ERROR +define("EMESSLAN_TITLE_ERROR", "Error"); define("EMESSLAN_TITLE_SUCCESS", "Success"); define("EMESSLAN_TITLE_WARNING", "Warning"); define("EMESSLAN_TITLE_DEBUG", "System Debug"); diff --git a/e107_languages/English/lan_installer.php b/e107_languages/English/lan_installer.php index ee78748f8..bed1fe867 100644 --- a/e107_languages/English/lan_installer.php +++ b/e107_languages/English/lan_installer.php @@ -21,22 +21,22 @@ define("LANINS_002", "Step "); define("LANINS_003", "1"); define("LANINS_004", "Language Selection"); define("LANINS_005", "Please choose the language to use during installation"); -define("LANINS_006", "Set Language"); +// define("LANINS_006", "Set Language"); define("LANINS_007", "4"); define("LANINS_008", "PHP and MySQL Versions Check / File Permissions Check"); define("LANINS_009", "Retest File Permissions"); define("LANINS_010", "File not writable: "); define("LANINS_010a", "Folder not writable: "); -//define("LANINS_011", "Error"); new > LAN_ERROR +// define("LANINS_011", "Error"); new > LAN_ERROR define("LANINS_012", "MySQL Functions don't seem to exist. This probably means that either the MySQL PHP Extension isn't installed or your PHP installation wasn't compiled with MySQL support."); // help for 012 define("LANINS_013", "Couldn't determine your MySQL version number. This is a non fatal error, so please continue installing, but be aware that e107 requires MySQL >= 3.23 to function correctly."); define("LANINS_014", "File Permissions"); define("LANINS_015", "PHP Version"); -define("LANINS_016", "MySQL"); +// define("LANINS_016", "MySQL"); define("LANINS_017", "PASS"); define("LANINS_018", "Ensure all the listed files exist and are writable by the server. This normally involves CHMODing them 777, but environments vary - contact your host if you have any problems."); define("LANINS_019", "The version of PHP installed on your server isn't capable of running e107. e107 requires a PHP version of at least ".MIN_PHP_VERSION." to run correctly. Either upgrade your PHP version, or contact your host for an upgrade."); -//define("LANINS_020", "Continue Installation"); //LAN_CONTINUE +// define("LANINS_020", "Continue Installation"); //LAN_CONTINUE define("LANINS_021", "2"); define("LANINS_022", "MySQL Server Details"); define("LANINS_023", "Please enter your MySQL settings here. @@ -56,7 +56,7 @@ define("LANINS_031", "The username you wish e107 to use to connect to your MySQL define("LANINS_032", "The Password for the user you just entered. Must not contain single or double quotes."); define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. Must begin with a letter. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist."); define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema."); -define("//LANINS_035", "Continue"); // LAN_CONTINUE +// define("LANINS_035", "Continue"); // LAN_CONTINUE define("LANINS_036", "3"); define("LANINS_037", "MySQL Connection Verification"); define("LANINS_038", " and Database Creation"); @@ -69,13 +69,13 @@ define("LANINS_044", "Successfully created database."); define("LANINS_045", "Please click on the button to proceed to next stage."); define("LANINS_046", "5"); define("LANINS_047", "Administrator Details"); -define("LANINS_048", "Go Back To Last Step"); +// define("LANINS_048", "Go Back To Last Step"); define("LANINS_049", "The two passwords you entered are not the same. Please go back and try again."); define("LANINS_050", "XML Extension"); define("LANINS_051", "Installed"); define("LANINS_052", "Not Installed"); -define("LANINS_053", "e107 0.8.x requires the PHP XML Extension to be installed. Please contact your host or read the information at [link=http://php.net/manual/en/ref.xml.php]php.net[/link] before continuing"); -//not used: define("LANINS_054", " before continuing"); +define("LANINS_053", "e107 v2.x requires the PHP XML Extension to be installed. Please contact your host or read the information at [link=http://php.net/manual/en/ref.xml.php]php.net[/link] before continuing"); +// define("LANINS_054", " before continuing"); define("LANINS_055", "Install Confirmation"); define("LANINS_056", "6"); define("LANINS_057", " e107 now has all the information it needs to complete the installation. @@ -107,7 +107,7 @@ Themes: [link=http://themes.e107.org]http://themes.e107.org[/link] Thank you for trying e107, we hope it fulfils your website needs. (You can delete this message from your admin section.)"); -define("LANINS_063", "Welcome to e107"); +// define("LANINS_063", "Welcome to e107"); define("LANINS_069", "e107 has been successfully installed! @@ -123,7 +123,7 @@ define("LANINS_071", "Installation Complete"); define("LANINS_072", "Admin Username"); define("LANINS_073", "This is the name you will use to login into the site. If you wish to use this as your display name also"); define("LANINS_074", "Admin Display Name"); -define("LANINS_075", "This is the name that you wish your users to see displayed in your profile, forums and other areas. If you wish to use the same as your username then leave this blank."); +// define("LANINS_075", "This is the name that you wish your users to see displayed in your profile, forums and other areas. If you wish to use the same as your username then leave this blank."); define("LANINS_076", "Admin Password"); define("LANINS_077", "Please type the admin password you wish to use here"); define("LANINS_078", "Admin Password Confirmation"); @@ -131,7 +131,7 @@ define("LANINS_079", "Please type the admin password again for confirmation"); define("LANINS_080", "Admin Email"); define("LANINS_081", "Enter your email address"); -define("LANINS_082", "user@yoursite.com"); +// define("LANINS_082", "user@yoursite.com"); // Better table creation error reporting define("LANINS_083", "MySQL Reported Error:"); @@ -140,34 +140,34 @@ define("LANINS_085", "The installer could not select database:"); define("LANINS_086", "Admin Username, Admin Password and Admin Email are [b]required[/b] fields. Please return to the last page and ensure the information is correctly entered."); -define("LANINS_087", "Misc"); -define("LANINS_088", "Home"); -define("LANINS_089", "Downloads"); -define("LANINS_090", "Members"); -define("LANINS_091", "Submit News"); -define("LANINS_092", "Contact Us"); -define("LANINS_093", "Grants access to private menu items"); -define("LANINS_094", "Example private forum class"); -define("LANINS_095", "Integrity Check"); +// define("LANINS_087", "Misc"); +// define("LANINS_088", "Home"); +// define("LANINS_089", "Downloads"); +// define("LANINS_090", "Members"); +// define("LANINS_091", "Submit News"); +// define("LANINS_092", "Contact Us"); +// define("LANINS_093", "Grants access to private menu items"); +// define("LANINS_094", "Example private forum class"); +// define("LANINS_095", "Integrity Check"); -define("LANINS_096", 'Latest Comments'); -define("LANINS_097", '[more ...]'); -//define("LANINS_098", 'Articles'); -//define("LANINS_099", 'Articles Front Page ...'); -define("LANINS_100", 'Latest Forum Posts'); -define("LANINS_101", 'Update menu Settings'); -define("LANINS_102", 'Date / Time'); -//define("LANINS_103", 'Reviews'); -//define("LANINS_104", 'Review Front Page ...'); +// define("LANINS_096", 'Latest Comments'); +// define("LANINS_097", '[more ...]'); +// define("LANINS_098", 'Articles'); +// define("LANINS_099", 'Articles Front Page ...'); +// define("LANINS_100", 'Latest Forum Posts'); +// define("LANINS_101", 'Update menu Settings'); +// define("LANINS_102", 'Date / Time'); +// define("LANINS_103", 'Reviews'); +// define("LANINS_104", 'Review Front Page ...'); define("LANINS_105", 'A database name or prefix beginning with some digits followed by ā€œeā€ or ā€œEā€ is not acceptable'); define("LANINS_106", 'WARNING - e107 cannot write to the directories and/or files listed. While this will not stop e107 installing, it will mean that certain features are not available. You will need to change the file permissions to use these features'); define("LANINS_107", "Website Name"); -define("LANINS_108", "e.g. 'My Blog'"); +define("LANINS_108", "My Website"); define("LANINS_109", "Website Theme"); -define("LANINS_110", ""); +// define("LANINS_110", ""); define("LANINS_111", "Include Content/Configuration"); define("LANINS_112", "Quickly reproduce the look of the theme preview or demo. (If Available)"); define("LANINS_113", "Please enter a website name"); @@ -187,8 +187,3 @@ define("LANINS_126", "For security reasons you should now set the file permissio define("LANINS_127", "The database [x] already exists. Overwrite it? (any existing data will be lost)"); define("LANINS_128", "Overwrite"); define("LANINS_129", "Database not found."); - -define('LANINS_130', "Parked Domain"); -define('LANINS_131', "The parked domain which will become a new e107 website."); -define('LANINS_132', "mydomain.com"); -define('LANINS_133', "This will create a fresh installation of e107 at the domain you specify. Using your server administration software (e.g. cPanel) - park your other domain on top of [x]"); diff --git a/install.php b/install.php index 2f615c7d9..1740c8410 100644 --- a/install.php +++ b/install.php @@ -784,12 +784,12 @@ class e_install if(!function_exists("mysql_connect")) { $version_fail = true; - $mysql_note = LANINS_011; + $mysql_note = LAN_ERROR; $mysql_help = LANINS_012; } elseif (!@mysql_connect($this->previous_steps['mysql']['server'], $this->previous_steps['mysql']['user'], $this->previous_steps['mysql']['password'])) { - $mysql_note = LANINS_011; + $mysql_note = LAN_ERROR; $mysql_help = LANINS_013; } else @@ -1039,12 +1039,12 @@ class e_install - + -
".LANINS_110." +