1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 21:57:51 +02:00

Issue #6 - Removed URLs from LANs

This commit is contained in:
Cameron
2015-08-31 17:17:28 -07:00
parent 6673575a82
commit 44a6298b79
8 changed files with 125 additions and 85 deletions

View File

@@ -312,7 +312,7 @@ class lancheck
private $thirdPartyPlugins = true; private $thirdPartyPlugins = true;
private $deprecatedFiles = array('lan_download.php', 'lan_parser_functions.php', 'lan_prefs.php', 'admin/lan_download.php', 'admin/lan_modcomment.php');
function __construct() function __construct()
@@ -475,7 +475,7 @@ class lancheck
if($status['error']==FALSE) if($status['error']==FALSE)
{ {
$text = $status['message']."<br />"; $text = $status['message']."<br />";
$text .= share($status['file']); $text .= $this->share($status['file']);
$mes->addSuccess($text); $mes->addSuccess($text);
//$ns->tablerender(LAN_CREATED, $text ); //$ns->tablerender(LAN_CREATED, $text );
} }
@@ -491,6 +491,73 @@ class lancheck
/**
* Share Language File
* @param object $newfile
* Usage of e107 is granted to you provided that this function is not modified or removed in any way.
* @return
*/
private function share($newfile)
{
global $pref;
if(!$newfile || E107_DEBUG_LEVEL > 0)
{
return;
}
global $tp;
$full_link = $tp->createConstants($newfile);
$email_message = "<br />Site: <a href='".SITEURL."'>".SITENAME."</a>
<br />User: ".USERNAME."\n
<br />Email: ".USEREMAIL."\n
<br />Language: ".$_POST['language']."\n
<br />IP:".USERIP."
<br />...would like to contribute the following language pack for e107. (see attached)<br />:
<br />Missing Files: ".$_SESSION['lancheck'][$_POST['language']]['file']."
<br />Bom Errors : ".$_SESSION['lancheck'][$_POST['language']]['bom']."
<br />UTF Errors : ".$_SESSION['lancheck'][$_POST['language']]['utf']."
<br />Definition Errors : ".$_SESSION['lancheck'][$_POST['language']]['def']."
<br />Total Errors: ".$_SESSION['lancheck'][$_POST['language']]['total']."
<br />
<br />XML file: ".$_SESSION['lancheck'][$_POST['language']]['xml'];
require_once(e_HANDLER."mail.php");
$send_to = (!$_POST['contribute_pack']) ? "languagepacks@e107inc.org" : "certifiedpack@e107inc.org";
$to_name = "e107 Inc.";
$Cc = "";
$Bcc = "";
$returnpath='';
$returnreceipt='';
$inline ="";
$subject = (!$_POST['contribute_pack']) ? "[0.7 LanguagePack] " : "[0.7 Certified LanguagePack] ";
$subject .= basename($newfile);
if(!@sendemail($send_to, $subject, $email_message, $to_name, '', '', $newfile, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
{
$text = "<div style='padding:40px'>";
$text .= defined('LANG_LAN_EML') ? "<b>".LANG_LAN_EML."</b>" : "<b>There was a problem sending the language-pack. Please email your verified language pack to:</b>";
$text .= " <a href='mailto:".$send_to."?subject=".$subject."'>".$send_to."</a>";
$text .= "</div>";
return $text;
}
elseif($_POST['contribute_pack'])
{
return "<div style='padding:40px'>Pack Sent to e107 Inc. A confirmation email will be sent to ".$pref['siteadminemail']." once it is received.<br />Please also make sure that email coming from ".$send_to." is not blocked by your spam filter.</div>";
}
}
/** /**
* @param $language * @param $language
@@ -1098,10 +1165,11 @@ class lancheck
$diz .= "| e107 website content management system ".$lan." Language File\n"; $diz .= "| e107 website content management system ".$lan." Language File\n";
$diz .= "| Released under the terms and conditions of the\n"; $diz .= "| Released under the terms and conditions of the\n";
$diz .= "| GNU General Public License (http://gnu.org).\n"; $diz .= "| GNU General Public License (http://gnu.org).\n";
$diz .= "| Last Modified: ".date("Y/m/d H:i:s")."\n";
$diz .= "|\n"; $diz .= "|\n";
$diz .= "| ".chr(36)."URL: $writeit ".chr(36)."\n"; // $diz .= "| ".chr(36)."URL: $writeit ".chr(36)."\n";
$diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n"; // $diz .= "| ".chr(36)."Revision: 1.0 ".chr(36)."\n";
$diz .= "| ".chr(36)."Id: ".date("Y/m/d H:i:s")." ".chr(36)."\n"; // $diz .= "| ".chr(36)."Id: ".date("Y/m/d H:i:s")." ".chr(36)."\n";
$diz .= "| ".chr(36)."Author: ".USERNAME." ".chr(36)."\n"; $diz .= "| ".chr(36)."Author: ".USERNAME." ".chr(36)."\n";
$diz .= "+---------------------------------------------------------------+\n"; $diz .= "+---------------------------------------------------------------+\n";
$diz .= "*".chr(47)."\n\n"; $diz .= "*".chr(47)."\n\n";
@@ -1436,13 +1504,27 @@ class lancheck
$fl = e107::getFile(); $fl = e107::getFile();
$tp = e107::getParser();
$ret = array(); $ret = array();
if($lang_array = $fl->get_files($comp_dir, ".php$","standard",$depth)){ if($lang_array = $fl->get_files($comp_dir, ".php$","standard",$depth)){
sort($lang_array); sort($lang_array);
} }
foreach($lang_array as $k=> $f)
{
$path = str_replace(e_LANGUAGEDIR.e_LANGUAGE."/", "", $f['path'].$f['fname']);
if(in_array($path, $this->deprecatedFiles))
{
unset($lang_array[$k]);
}
}
if(strpos($comp_dir,e_LANGUAGEDIR) !== false) if(strpos($comp_dir,e_LANGUAGEDIR) !== false)
{ {
$regexp = "#.php#"; $regexp = "#.php#";
@@ -1518,7 +1600,10 @@ class lancheck
} }
} }
return $ret; return $ret;
} }
@@ -1625,7 +1710,17 @@ class lancheck
// $text .= "<input class='btn btn-primary' type='button' style='width:60px' name='but_$i' value=\"".LAN_EDIT."\" onclick=\"window.location='".e_SELF."?f=".$comp_dir."/languages/".$lnk."&amp;lan=".$target_lan."&amp;mode={$mode}'\" /> "; // $text .= "<input class='btn btn-primary' type='button' style='width:60px' name='but_$i' value=\"".LAN_EDIT."\" onclick=\"window.location='".e_SELF."?f=".$comp_dir."/languages/".$lnk."&amp;lan=".$target_lan."&amp;mode={$mode}'\" /> ";
$text .= "<a class='btn btn-primary' style='width:60px' href'".e_REQUEST_URI."&amp;f=".$comp_dir."/languages/".$lnk."&amp;lan=".$target_lan."&amp;type={$mode}'>".LAN_EDIT."</a> "; $parms = $_GET;
$parms['sub'] = 'edit';
$parms['file'] = $comp_dir."/languages/".$lnk;
$parms['lan'] = $this->transLanguage;
$parms['iframe'] = 1;
$parms['type'] = $mode;
$editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&amp;');
$text .= "<a href='".$editUrl."' class='e-modal btn btn-primary' data-modal-caption='".str_replace("../","",$comp_dir)."' style='width:60px' >".LAN_EDIT."</a> "; // href='".e_REQUEST_URI."&amp;f=".$comp_dir."/languages/".$lnk."&amp;lan=".$target_lan."&amp;type={$mode}'
// <a href='".$editUrl."' data-modal-caption='".$subpath."' class='e-modal btn btn-primary' type='button' style='width:60px'>".LAN_EDIT."</a>";
$text .="</td></tr>"; $text .="</td></tr>";

View File

@@ -792,73 +792,6 @@ if (isset($_POST['create_tables']) && $_POST['language'])
/**
* Share Language File
* @param object $newfile
* Usage of e107 is granted to you provided that this function is not modified or removed in any way.
* @return
*/
function share($newfile)
{
global $pref;
if(!$newfile || E107_DEBUG_LEVEL > 0)
{
return;
}
global $tp;
$full_link = $tp->createConstants($newfile);
$email_message = "<br />Site: <a href='".SITEURL."'>".SITENAME."</a>
<br />User: ".USERNAME."\n
<br />Email: ".USEREMAIL."\n
<br />Language: ".$_POST['language']."\n
<br />IP:".USERIP."
<br />...would like to contribute the following language pack for e107. (see attached)<br />:
<br />Missing Files: ".$_SESSION['lancheck'][$_POST['language']]['file']."
<br />Bom Errors : ".$_SESSION['lancheck'][$_POST['language']]['bom']."
<br />UTF Errors : ".$_SESSION['lancheck'][$_POST['language']]['utf']."
<br />Definition Errors : ".$_SESSION['lancheck'][$_POST['language']]['def']."
<br />Total Errors: ".$_SESSION['lancheck'][$_POST['language']]['total']."
<br />
<br />XML file: ".$_SESSION['lancheck'][$_POST['language']]['xml'];
require_once(e_HANDLER."mail.php");
$send_to = (!$_POST['contribute_pack']) ? "languagepacks@e107inc.org" : "certifiedpack@e107inc.org";
$to_name = "e107 Inc.";
$Cc = "";
$Bcc = "";
$returnpath='';
$returnreceipt='';
$inline ="";
$subject = (!$_POST['contribute_pack']) ? "[0.7 LanguagePack] " : "[0.7 Certified LanguagePack] ";
$subject .= basename($newfile);
if(!@sendemail($send_to, $subject, $email_message, $to_name, '', '', $newfile, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
{
$text = "<div style='padding:40px'>";
$text .= defined('LANG_LAN_EML') ? "<b>".LANG_LAN_EML."</b>" : "<b>There was a problem sending the language-pack. Please email your verified language pack to:</b>";
$text .= " <a href='mailto:".$send_to."?subject=".$subject."'>".$send_to."</a>";
$text .= "</div>";
return $text;
}
elseif($_POST['contribute_pack'])
{
return "<div style='padding:40px'>Pack Sent to e107 Inc. A confirmation email will be sent to ".$pref['siteadminemail']." once it is received.<br />Please also make sure that email coming from ".$send_to." is not blocked by your spam filter.</div>";
}
}

View File

@@ -74,7 +74,7 @@ define("LANINS_049", "The two passwords you entered are not the same. Please go
define("LANINS_050", "XML Extension"); define("LANINS_050", "XML Extension");
define("LANINS_051", "Installed"); define("LANINS_051", "Installed");
define("LANINS_052", "Not Installed"); define("LANINS_052", "Not Installed");
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_053", "e107 v2.x requires the PHP XML Extension to be installed. Please contact your host or read the information at [x] before continuing");
// define("LANINS_054", " before continuing"); // define("LANINS_054", " before continuing");
define("LANINS_055", "Install Confirmation"); define("LANINS_055", "Install Confirmation");
define("LANINS_056", "6"); define("LANINS_056", "6");

View File

@@ -64,7 +64,7 @@ define("LAN_dl_51", "Reporting download: ");
//define("LAN_dl_52", "Guest");//LAN_GUEST //define("LAN_dl_52", "Guest");//LAN_GUEST
define("LAN_dl_53", "Click to view download"); define("LAN_dl_53", "Click to view download");
define("LAN_dl_54", "An administrator will be made aware of this download, please leave a message if you feel it necessary."); define("LAN_dl_54", "An administrator will be made aware of this download, please leave a message if you feel it necessary.");
define("LAN_dl_55", "<b>Do not</b> use this form to contact the admin for any other reason."); define("LAN_dl_55", "Do not use this form to contact the admin for any other reason.");
// define("LAN_dl_56", "Report broken download"); already defined above. // define("LAN_dl_56", "Report broken download"); already defined above.
define("LAN_dl_57", "reported by"); define("LAN_dl_57", "reported by");
define("LAN_dl_58", "The following download has been reported as broken from site"); define("LAN_dl_58", "The following download has been reported as broken from site");
@@ -93,6 +93,6 @@ define("LAN_dl_75", "no image available ");
//define("LAN_dl_76", "Go to page"); //FIXME Use Generic //define("LAN_dl_76", "Go to page"); //FIXME Use Generic
define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of downloads define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of downloads
define('LAN_dl_78', "That download has been disabled or discontinued. Please check in the [link=--LINK--]downloads area[/link] for a more recent version."); define('LAN_dl_78', "That download has been disabled or discontinued. Please check in the [downloads area] for a more recent version.");
?> ?>

View File

@@ -138,10 +138,13 @@ if ($type == "file")
if (check_class($row['download_category_class']) && check_class($row['download_class'])) if (check_class($row['download_category_class']) && check_class($row['download_class']))
{ {
if ($row['download_active'] == 0) if ($row['download_active'] == 0) // Inactive download - don't allow
{ // Inactive download - don't allow {
require_once(HEADERF); require_once(HEADERF);
$ns->tablerender(LAN_ERROR, "<div style='text-align:center'>".str_replace('--LINK--',e_HTTP.'download.php',LAN_dl_78).'</div>'); $search = array("[","]");
$replace = array("<a href='".e_HTTP."download.php'>", "</a>");
$ns->tablerender(LAN_ERROR, "<div class='alert alert-warning' style='text-align:center'>".str_replace($search, $replace, LAN_dl_78).'</div>');
require_once(FOOTERF); require_once(FOOTERF);
exit(); exit();
} }

View File

@@ -18,7 +18,7 @@
define("LAN_LASTSEEN_1", "Last Seen Menu"); define("LAN_LASTSEEN_1", "Last Seen Menu");
//online //online
define('LAN_ONLINE_TRACKING_MESSAGE', "Online user tracking is currently disabled, please enable it [link=".e_ADMIN."users.php?options]here[/link][br]"); define('LAN_ONLINE_TRACKING_MESSAGE', "Online user tracking is currently disabled, please enable it [here]");
define("LAN_ONLINE_1", "Guests: "); define("LAN_ONLINE_1", "Guests: ");
define("LAN_ONLINE_2", "Members: "); define("LAN_ONLINE_2", "Members: ");
define("LAN_ONLINE_3", "On this page: "); define("LAN_ONLINE_3", "On this page: ");

View File

@@ -48,7 +48,14 @@ class online_shortcodes
function sc_online_tracking_disabled() function sc_online_tracking_disabled()
{ {
return e107::getParser()->toHTML(LAN_ONLINE_TRACKING_MESSAGE,TRUE); $url = e_ADMIN."users.php?mode=main&amp;action=prefs";
$srch = array("[","]");
$repl = array("<a href='".$url."'>", "</a>");
$message = str_replace($srch,$repl, LAN_ONLINE_TRACKING_MESSAGE);
return e107::getParser()->toHTML($message, true);
} }

View File

@@ -840,7 +840,9 @@ class e_install
$PHPColor = ($version_fail == false) ? "text-success" : "text-error"; $PHPColor = ($version_fail == false) ? "text-success" : "text-error";
$xmlColor = ($xml_installed == true) ? "text-success" : "text-error"; $xmlColor = ($xml_installed == true) ? "text-success" : "text-error";
$mysqlColor = ($mysql_pass == true) ? "text-success" : "text-error"; $mysqlColor = ($mysql_pass == true) ? "text-success" : "text-error";
$xmlExtensionLink = "<a href='http://php.net/manual/en/ref.xml.php'>php.net</a>";
$output = " $output = "
<table class='table table-striped table-bordered' style='width: 100%; margin-left: auto; margin-right: auto;'> <table class='table table-striped table-bordered' style='width: 100%; margin-left: auto; margin-right: auto;'>
<tr> <tr>
@@ -864,7 +866,7 @@ class e_install
<tr> <tr>
<td>".LANINS_050."</td> <td>".LANINS_050."</td>
<td>".($xml_installed ? LANINS_051 : LANINS_052)."</td> <td>".($xml_installed ? LANINS_051 : LANINS_052)."</td>
<td class='{$xmlColor}'>".($xml_installed ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : LANINS_053)."</td> <td class='{$xmlColor}'>".($xml_installed ? "<i class='glyphicon glyphicon-ok'></i> ".LANINS_017 : str_replace("[x]",$xmlExtensionLink, LANINS_053) )."</td>
</tr> </tr>
</table>\n"; </table>\n";
$this->finish_form(); $this->finish_form();