أهلا وسهلا بك زائرنا الكريم في منتدى دعم PBBoard الرسمي، لكي تتمكن من المشاركة ومشاهدة جميع أقسام المنتدى وكافة الميزات ، يجب عليك إنشاء حساب جديد بالتسجيل بالضغط هنا أو تسجيل الدخول اضغط هنا إذا كنت عضواً .

مكن إضافة معدل مشاركات العضو في قالب writer_info


مشاهدة المشاركة في الموضوع بالعرض العادي
look/images/icons/i1.gif مكن إضافة معدل مشاركات العضو في قالب writer_info
  21-10-2012 11:51 صباحاً  
Soliman
معلومات الكاتب
تفضل الطريقة لإضافة معدل المشاركات اليومية تحتاج تركيز



حرر ملف includes/functions.class.php

وابحث عن :

CODE
function GetEditorTools()<br />




واضف اعلاها :



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('_', '&nbsp;', 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/post-49052&num=2


تم تحرير المشاركة بواسطة :Soliman بتاريخ:21-10-2012 11:53 صباحاً



الساعة الآن 04:54 PM