تفضل الطريقة لإضافة معدل المشاركات اليومية تحتاج تركيز
حرر ملف includes/functions.class.php
وابحث عن :
CODE
function GetEditorTools()
واضف اعلاها :
CODE
function pbb_number_format($number, $decimals = 0, $bytesize = false)
{
global $PowerBB;
$type = '';
if (empty($number))
{
return 0;
}
else if (preg_match('#^(\\d+(?:\\.\\d+)?)(?>\\s*)([mkg])b?$#i', trim($number), $matches))
{
switch(strtolower($matches[2]))
{
case 'g':
$number = $matches[1] * 1073741824;
break;
case 'm':
$number = $matches[1] * 1048576;
break;
case 'k':
$number = $matches[1] * 1024;
break;
default:
$number = $matches[1] * 1;
}
}
if ($bytesize)
{
if ($number >= 1073741824)
{
$number = $number / 1073741824;
$decimals = 2;
$type = " GB";
}
else if ($number >= 1048576)
{
$number = $number / 1048576;
$decimals = 2;
$type = " MB";
}
else if ($number >= 1024)
{
$number = $number / 1024;
$decimals = 1;
$type = " KB";
}
else
{
$decimals = 0;
$type = " $vbphrase[bytes]";
}
}
return str_replace('_', ' ', number_format($number, $decimals)) . $type;
}
ثم حرر ملف : modules/topic.module.php
وابحث عن :
CODE
$extraEmptyFields=$PowerBB->extrafield->getEmptyLoginFields(true);
واضف اعلاه :
CODE
if ($jointime < 1)
{
// User has been a member for less than one day.
$postsperday = $PowerBB->functions->pbb_number_format($this->Info['posts']);
}
else
{
$postsperday = $PowerBB->functions->pbb_number_format($this->Info['posts'] / $jointime, 2);
}
$this->Info['postsperday'] = $postsperday;
إذا كنت تستخدم نسخة من الجيل الثاني ابحث عن :
CODE
if (is_numeric($this->RInfo[$this->x]['register_date']))
اضف اعلاه :
CODE
$jointime = ($PowerBB->_CONF['now'] - $this->RInfo[$this->x]['register_date']) / 86400; // Days Joined
if ($jointime < 1)
{
// User has been a member for less than one day.
$postsperday = $PowerBB->functions->pbb_number_format($this->RInfo[$this->x]['posts']);
}
else
{
$postsperday = $PowerBB->functions->pbb_number_format($this->RInfo[$this->x]['posts'] / $jointime, 2);
}
$this->Info['postsperday'] = $postsperday;
حرر قالب: writer_info
ابحث عن :
CODE
{$lang['posts']} :
{$Info['posts']}
</div>
اضف اسفله :
CODE
{if {$Info['postsperday']} != ''}
<div class="writer_info" align="right">
بمعدل :
{$Info['postsperday']} يومياً
</div>
{/if}
إذا كنت تستخدم نسخة من ال جيل الثالث :
ابحث عن :
CODE
$ReplierInfo = $PowerBB->core->GetInfo($MemberArr,'member');
اضف اسفله :
CODE
$jointime = ($PowerBB->_CONF['now'] - $ReplierInfo['register_date']) / 86400; // Days Joined
if ($jointime < 1)
{
// User has been a member for less than one day.
$postsperday = $PowerBB->functions->pbb_number_format($ReplierInfo['posts']);
}
else
{
$postsperday = $PowerBB->functions->pbb_number_format($ReplierInfo['posts'] / $jointime, 2);
}
$ReplierInfo['postsperday'] = $postsperday;
حرر قالب: writer_info
ابحث عن :
CODE
{$lang['posts']} :
{$ReplierInfo['posts']}
</div>
اضف اسفله :
CODE
{if {$ReplierInfo['postsperday']} != ''}
<div class="writer_info" align="right">
بمعدل :
{$ReplierInfo['postsperday']} يومياً
</div>
{/if}
أنتهى ..
وهنا اضافة مشابهه لهاك اسمه النشاط للجيل الثاني
https://pbboard.info/forums/index.php?page=post&show=1&id=49052&num=2