1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 18:14:26 +02:00

Feature: Ability to hide the amount of chatbox posts from user profiles.

This commit is contained in:
Lóna Lore
2015-02-20 10:25:33 +01:00
parent 15865aa907
commit ae5a72b87f
4 changed files with 43 additions and 31 deletions

View File

@@ -12,11 +12,17 @@ if (!defined('e107_INIT')) { exit; }
// v2.x Standard
class chatbox_menu_user // plugin-folder + '_user'
{
function profile($udata)
{
function profile($udata)
{
$pref = e107::getPref();
if (!$pref['cb_user_addon'])
{
return array();
}
if(!$chatposts = e107::getRegistry('total_chatposts'))
{
$chatposts = 0; // In case plugin not installed
@@ -26,15 +32,15 @@ class chatbox_menu_user // plugin-folder + '_user'
}
e107::setRegistry('total_chatposts', $chatposts);
}
$perc = ($chatposts > 0) ? round(($udata['user_chats']/$chatposts) * 100, 2) : 0;
$var = array(
0 => array('label' => LAN_PLUGIN_CHATBOX_MENU_POSTS, 'text' => $udata['user_chats']." ( ".$perc."% )")
);
return $var;
}
}