mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 05:37:32 +02:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -92,11 +92,11 @@ class user_shortcodes extends e_shortcode
|
||||
$chatposts = 0; // In case plugin not installed
|
||||
if (e107::isInstalled("chatbox_menu"))
|
||||
{
|
||||
$chatposts = $sql->count("chatbox");
|
||||
$chatposts = intval($sql->count("chatbox"));
|
||||
}
|
||||
e107::setRegistry('total_chatposts', $chatposts);
|
||||
}
|
||||
return ($chatposts!=0) ? round(($this->var['user_chats']/$chatposts) * 100, 2): 0;
|
||||
return ($chatposts > 0) ? round(($this->var['user_chats']/$chatposts) * 100, 2) : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ class user_shortcodes extends e_shortcode
|
||||
$sql = e107::getDb();
|
||||
if(!$commentposts = e107::getRegistry('total_commentposts'))
|
||||
{
|
||||
$commentposts = $sql->count("comments");
|
||||
$commentposts = intval($sql->count("comments"));
|
||||
e107::setRegistry('total_commentposts', $commentposts);
|
||||
}
|
||||
return ($commentposts!=0) ? round(($this->var['user_comments']/$commentposts) * 100, 2): 0;
|
||||
return ($commentposts > 0) ? round(($this->var['user_comments']/$commentposts) * 100, 2) : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,11 +119,11 @@ class user_shortcodes extends e_shortcode
|
||||
$sql = e107::getDb();
|
||||
if(!$forumposts = e107::getRegistry('total_forumposts'))
|
||||
{
|
||||
$forumposts = (e107::isInstalled("forum")) ? $sql->count("forum_thread"): 0;
|
||||
$forumposts = (e107::isInstalled("forum")) ? intval($sql->count("forum_thread")) : 0;
|
||||
e107::setRegistry('total_forumposts', $forumposts);
|
||||
$user_forumposts = $sql->count("forum_thread","(*)","where thread_user=".$this->var['user_id']);
|
||||
}
|
||||
return ($forumposts!==0) ? round(($user_forumposts/$forumposts) * 100, 2): 0;
|
||||
return ($forumposts > 0) ? round(($user_forumposts/$forumposts) * 100, 2) : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -386,7 +386,7 @@ class e_install
|
||||
// $page_info = nl2br(LANINS_023);
|
||||
$page_info = "<div class='alert alert-block alert-info'>Please fill in the form below with your MySQL details. If you do not know this information, please contact your hosting provider. You may hover over each field for additional information.</div>";
|
||||
$e_forms->start_form("versions", $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING'] == "debug" ? "?debug" : ""));
|
||||
$isrequired = (($_SERVER['SERVER_ADDR'] == "127.0.0.1") || ($_SERVER['SERVER_ADDR'] == "localhost")) ? "" : "required='required'"; // + regex for 198.168.x.x
|
||||
$isrequired = (($_SERVER['SERVER_ADDR'] == "127.0.0.1") || ($_SERVER['SERVER_ADDR'] == "localhost") || ($_SERVER['SERVER_ADDR'] == "::1") || preg_match('^192\.168\.\d{1,3}\.\d{1,3}$',$_SERVER['SERVER_ADDR'])) ? "" : "required='required'"; // Deals with IP V6, and 192.168.x.x address ranges, could be improved to validate x.x to a valid IP but for this use, I dont think its required to be that picky.
|
||||
|
||||
$output = "
|
||||
<div style='width: 100%; padding-left: auto; padding-right: auto;'>
|
||||
|
Reference in New Issue
Block a user