1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

Code optimization for speed and reduced memory usage.

This commit is contained in:
Cameron
2020-12-20 11:50:10 -08:00
parent 6b5cc07929
commit 601df26d51
91 changed files with 522 additions and 482 deletions

View File

@@ -65,7 +65,7 @@
list($oid, $oname) = explode(".", $uinfo, 2);
$online_location = $pinfo;
$online_location_page = substr(strrchr($online_location, "/"), 1);
if(!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php"))
if(strpos($online_location, "forum_") === false || strpos($online_location, "content.php") === false || strpos($online_location, "comment.php") === false)
{
$online_location_page = str_replace(".php", "", substr(strrchr($online_location, "/"), 1));
}
@@ -180,7 +180,7 @@
$scArray = array();
if(strstr($online_location, "content.php"))
if(strpos($online_location, "content.php") !== false)
{
$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
if($tmp[0] == "article")
@@ -221,7 +221,7 @@
}
}
if(strstr($online_location, "comment.php"))
if(strpos($online_location, "comment.php") !== false)
{
$tmp = explode(".php.", $online_location);
$tmp = explode(".", $tmp[1]);
@@ -253,10 +253,10 @@
}
}
if(strstr($online_location, "forum"))
if(strpos($online_location, "forum") !== false)
{
$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
if(strstr($online_location, "_viewtopic"))
if(strpos($online_location, "_viewtopic") !== false)
{
if($tmp[2])
{
@@ -281,7 +281,7 @@
$online_location_page = ONLINE_EL13 . ": \"" . CLASSRESTRICTED . "\"";
}
}
elseif(strstr($online_location, "_viewforum"))
elseif(strpos($online_location, "_viewforum") !== false)
{
$sql->select("forum", "forum_name, forum_class", "forum_id=" . intval($tmp[0]));
$forum = $sql->fetch();
@@ -293,7 +293,7 @@
$online_location_page = ONLINE_EL13 . ": \"" . CLASSRESTRICTED . "\"";
}
}
elseif(strstr($online_location, "_post"))
elseif(strpos($online_location, "_post") !== false)
{
$sql->select("forum_thread", "thread_name, thread_forum_id", "thread_forum_id=" . intval($tmp[0]) . " AND thread_parent=0");
$forum_thread = $sql->fetch();
@@ -304,7 +304,7 @@
}
}
if(strstr($online_location, "admin"))
if(strpos($online_location, "admin") !== false)
{
$class_check = false;
$online_location_page = ADMINAREA;