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

Making detailed settings for hours


مشاهدة المشاركة في الموضوع بالعرض العادي
look/images/icons/i1.gif [مجابه] Making detailed settings for hours
  14-10-2011 08:58 صباحاً  
Soliman
معلومات الكاتب
Old, but does not prevent that by adding the solution with respect to time Making detailed settings for hours


To make history last post on the subject appear on the home page instead of the time when the past history

Open the file: engine/ibs/functions.class.php

And search for:
CODE
function BackHTML($text)


Place the top:

CODE
function arabi_time_ago($input,$type = 'ty')
{
/*
get it from :http://css-tricks.com/snippets/php/time-ago-function/
translated by :codeboxy
*/
   if($input > time()){
   return false;
   exit;
   }
    $period = array ("seconds", "minute", "hour", "Day", "week", "month", "Year", "decade");
    $periods = array ("sec", "minutes", "hours", "days", "weeks", "months", "years", "decade");
    $periodtw = array ("two seconds", "minutes", "hours", "day", "two weeks", "two months", "two", "decade");   
   
   $lengths = array("60","60","24","7","4.35","12","10");

   $now = time();
    $difference = $now - $input;
   for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) {
      $difference /= $lengths[$j];
   }

   $difference = round($difference);
    if($difference == 2){
    $x = $periodtw[$j];
      return "ago $x";
   }elseif($difference != 1 and $difference <= 10) {
    $x= $periods[$j];
       return "ago $difference $x";
   }else{
    $x = $period[$j];
     return "ago $difference $x";
   }


}


# And save the file

--------------------------------------------

Open the file: includes/functions.class.php
And search for:
CODE
$forum[&#39;last_date&#39;] = $PowerBB->functions->date($forum_last_time1);

And replace with:
CODE
$forum[&#39;last_date&#39;] = $PowerBB->sys_functions->arabi_time_ago($forum_last_time1);


# And save the file


Ended ...


الساعة الآن 09:08 AM