mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
Bugtracker #4293 - load LAN files in PLUGIN shortcode
This commit is contained in:
@@ -12,7 +12,8 @@ if($sql->db_Select('menus','menu_id, menu_pages',"menu_name = '$name' AND (menu_
|
|||||||
{
|
{
|
||||||
$row = $sql->db_Fetch();
|
$row = $sql->db_Fetch();
|
||||||
$show_menu = TRUE;
|
$show_menu = TRUE;
|
||||||
if($row['menu_pages']){
|
if($row['menu_pages'])
|
||||||
|
{
|
||||||
list($listtype,$listpages) = explode("-",$row['menu_pages']);
|
list($listtype,$listpages) = explode("-",$row['menu_pages']);
|
||||||
$pagelist = explode("|",$listpages);
|
$pagelist = explode("|",$listpages);
|
||||||
$check_url = e_SELF."?".e_QUERY;
|
$check_url = e_SELF."?".e_QUERY;
|
||||||
@@ -24,6 +25,7 @@ if($sql->db_Select('menus','menu_id, menu_pages',"menu_name = '$name' AND (menu_
|
|||||||
if(strpos($check_url,$p) !== FALSE)
|
if(strpos($check_url,$p) !== FALSE)
|
||||||
{
|
{
|
||||||
$show_menu = TRUE;
|
$show_menu = TRUE;
|
||||||
|
break; // Speed things up a bit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -35,22 +37,15 @@ if($sql->db_Select('menus','menu_id, menu_pages',"menu_name = '$name' AND (menu_
|
|||||||
if(strpos($check_url,$p) !== FALSE)
|
if(strpos($check_url,$p) !== FALSE)
|
||||||
{
|
{
|
||||||
$show_menu = FALSE;
|
$show_menu = FALSE;
|
||||||
|
break; // Speed things up a bit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($show_menu) {
|
if($show_menu)
|
||||||
$sql->db_Mark_Time($name);
|
|
||||||
if($path != 'custom')
|
|
||||||
{
|
{
|
||||||
if(is_readable(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php")){
|
$sql->db_Mark_Time($name);
|
||||||
include_once(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php");
|
|
||||||
}
|
|
||||||
if(e_LANGUAGE != 'English' && is_readable(e_PLUGIN.$path."/languages/English.php")){
|
|
||||||
include_once(e_PLUGIN.$path."/languages/English.php");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$plugin_file = e_PLUGIN.$path."/".$name.".php";
|
$plugin_file = e_PLUGIN.$path."/".$name.".php";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,13 +54,33 @@ else
|
|||||||
if(is_readable(e_PLUGIN.$path."/".$name.".php"))
|
if(is_readable(e_PLUGIN.$path."/".$name.".php"))
|
||||||
{
|
{
|
||||||
$sql->db_Mark_Time($name);
|
$sql->db_Mark_Time($name);
|
||||||
include_lan(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php");
|
|
||||||
$plugin_file = e_PLUGIN.$path."/".$name.".php";
|
$plugin_file = e_PLUGIN.$path."/".$name.".php";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($plugin_file != "")
|
if($plugin_file != "")
|
||||||
{
|
{
|
||||||
|
// If we're showing anything, we'll need the lan file (unless 'custom') (use same logic as menu shortcode)
|
||||||
|
if($path != 'custom')
|
||||||
|
{
|
||||||
|
if (is_readable(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php"))
|
||||||
|
{
|
||||||
|
include_once(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php");
|
||||||
|
}
|
||||||
|
elseif (is_readable(e_PLUGIN.$path."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php"))
|
||||||
|
{
|
||||||
|
include_once(e_PLUGIN.$path."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
|
||||||
|
}
|
||||||
|
elseif (is_readable(e_PLUGIN.$path."/languages/English.php"))
|
||||||
|
{
|
||||||
|
include_once(e_PLUGIN.$path."/languages/English.php");
|
||||||
|
}
|
||||||
|
elseif (is_readable(e_PLUGIN.$path."/languages/English/English.php"))
|
||||||
|
{
|
||||||
|
include_once(e_PLUGIN.$path."/languages/English/English.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include(e_PLUGIN.$path."/".$name.".php");
|
include(e_PLUGIN.$path."/".$name.".php");
|
||||||
$buff = ob_get_contents();
|
$buff = ob_get_contents();
|
||||||
|
Reference in New Issue
Block a user