New articles Năng lực quản lý: nhân tố thứ năm     ♥ Lựa chọn mục tiêu cuộc đời     ♥ 10 bí quyết cân bằng công việc và gia đình     ♥ Cô đơn trên mạng     ♥ Chứng khoán: Giấc mơ và ác mộng     ♥ Tám     ♥ Những tính năng của blog VnVista     ♥ Các mạng xã hội thống trị Google     ♥ Điều gì tạo nên một giám đốc công nghệ thông tin giỏi?     ♥ Cố gắng xóa bỏ những ấn tượng xấu     ♥ Cần một cách làm ăn mới     ♥ Tiếp thị hướng đến doanh nhân     ♥ Đưa cửa hàng thật lên chợ ảo     ♥ Bí quyết quản lý các nhân viên trẻ     ♥ Một số câu hỏi phỏng vấn “đặc biệt” của Microsoft     ♥ 4 bài học thành công trong kinh doanh     ♥ Tạo dựng hình ảnh một cô gái trẻ chuyên nghiệp     ♥ Góc “khác” của thế giới online đêm     ♥ Phong cách người Mỹ     ♥ Chỉ nghĩ đến tiền cũng làm người ta ích kỷ     
New blog entries Trẻ sơ sinh thiếu G6PD có nguy hiểm không? Việc bố      ♥ Kê khai thuế GTGT trên tờ khai 01/GTGT      ♥ 探偵 大分      ♥ Tư vấn lắp đặt màn hình LED tại tỉnh Tuyên Quang      ♥ Tư vấn lắp đặt màn hình LED tại huyện Hoài Đức      ♥ 探偵 大分      ♥ Tủ đồ nghề chia khay 7 ngăn      ♥ Rút BHXH 1 lần mất nhiều hơn được      ♥ Quy hoạch Hà Nội      ♥ SHEET Kiếp ve sầu      ♥ SHEET Vầng trăng đêm trôi      ♥ Những lưu ý khi có con thiếu men G6PD: nên cho trẻ      ♥ Xe đẩy đồ nghề cơ khí 3 ngăn 3 tầng giá tốt      ♥ Bep dien tu cong nghiep      ♥ Quy trình tự khai thuế TNDN      ♥ Cao ích mẫu mua ở đâu hợp lý?      ♥ Các mẫu sofa văn phòng phổ biến hiện nay      ♥ SHEET Mong ước kỷ niệm xưa      ♥ Báo giá màn hình led trong nhà phù hợp theo không      ♥ Tư vấn lắp đặt màn hình LED tại quận Hoàng Mai      
 
Reply to this topicStart new topicStart Poll

Liệt Kê · [ Bình Thường ] · Tách Biệt+

D2-Active member per forum, 2.0x


billythekids
post Dec 9 2005, 06:45 PM
Gửi vào: #1


Group Icon

Phó phòng
****
Thành viên: 632
Nhập: 8-December 05
Bài viết: 113
Tiền mặt: 16
Thanked: 1
Cấp bậc: 9
------
Giới tính: Male
------
Xem blog
Bạn bè: 0
Thêm vào nhóm bạn bè
Gửi thiệp điện tử
Trang thông tin





mở
sources/boards.php

trong show_subforums($fid) function

tìm
CODE

foreach( $forums->forum_cache[ $fid ] as $id => $forum_data )
  {
   //-----------------------------------------
   // Get all subforum stats
   // and calculate
   //-----------------------------------------

thêm vào trước đó
CODE

foreach ($forums->forum_cache[ $fid ] as $id => $fd)
  {
   $forumids[] = $fd['id'];
  }
  $forum_ids = implode(",", $forumids);
  $cut_off = ($ibforums->vars['au_cutoff'] != "") ? $ibforums->vars['au_cutoff'] * 60 : 900;
  $time = time() - $cut_off;
  $DB->simple_construct(array('select' => 's.*, t.*', 'from' => "sessions s LEFT JOIN {$ibforums->vars['sql_tbl_prefix']}topics t ON (s.in_topic=t.tid)", 'where' => '(s.in_forum IN ('.$forum_ids.') OR t.forum_id IN ('.$forum_ids.')) AND s.running_time>'.$time.' AND s.in_error!=1', 'order' => 's.running_time DESC'));
  $DB->simple_exec();
  $cached = array();
  $active = array('guests' => 0, 'members' => 0);
  $rows = array(0 => array('running_time' => time(), 'member_id' => $ibforums->member['id']));
  while ($r = $DB->fetch_row())
  {
   $rows[] = $r;
  }

cũng trong function đó tìm
CODE

$temp_html .= $this->html->ForumRow( $forums->forums_format_lastinfo( $forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );

thay lại bằng
CODE

$active = array('guests' => 0, 'members' => 0);
    foreach ($rows as $i => $result)
    {
     if ($result['in_forum'] == $forum_data['id'] || $result['forum_id'] == $forum_data['id'])
     {
      if ($result['member_id'] == 0)
      {
       $active['guests']++;
      }
      else
      {
       if (empty($cached[$result['member_id']]))
       {
        $cached[$result['member_id']] = 1;
        $active['members']++;
       }
      }
     }
    }
    $active['total'] = ($active['members'] + $active['guests']);
    if ($active['total'] > 0)
    {
     $active_members = str_replace("<#TOTAL#>", $active['total'], $ibforums->lang['active_members']);
     $active_members = str_replace("<#MEMBERS#>", $active['members'], $active_members);
     $active_members = str_replace("<#GUESTS#>", $active['guests'], $active_members);
    }
    else
    {
     $active_members = '';
    }
    $temp_html .= $this->html->ForumRow( $forums->forums_format_lastinfo( $forums->forums_calc_children( $forum_data['id'], $forum_data ) ), $active_members );

tìm tiếp trong process_all_cats() function
CODE

foreach( $forums->forum_cache['root'] as $id => $forum_data )
  {
   $cat_data = $forum_data;

thêm vào trước đó
CODE

foreach ($forums->forum_cache['root'] as $id => $fd)
  {
   $forumids[] = $fd['id'];
   if (is_array($forums->forum_cache[$fd['id']]))
   {
    foreach ($forums->forum_cache[$fd['id']] as $id => $f_d)
    {
     $forumids[] = $f_d['id'];
    }
   }
  }
  $forum_ids = implode(",", $forumids);
  $cut_off = ($ibforums->vars['au_cutoff'] != "") ? $ibforums->vars['au_cutoff'] * 60 : 900;
  $time = time() - $cut_off;
  $DB->simple_construct(array('select' => 's.*, t.*', 'from' => "sessions s LEFT JOIN {$ibforums->vars['sql_tbl_prefix']}topics t ON (s.in_topic=t.tid)", 'where' => '(s.in_forum IN ('.$forum_ids.') OR t.forum_id IN ('.$forum_ids.')) AND s.running_time>'.$time.' AND s.in_error!=1', 'order' => 's.running_time DESC'));
  $DB->simple_exec();
  $cached = array();
  $active = array('guests' => 0, 'members' => 0);
  $rows = array(0 => array('running_time' => time(), 'member_id' => $ibforums->member['id']));
  while ($r = $DB->fetch_row())
  {
   $rows[] = $r;
  }

cũng trong đó tìm
CODE

$temp_html .= $this->html->ForumRow( $forums->forums_format_lastinfo( $forums->forums_calc_children( $forum_data['id'], $forum_data ) ) );

thay băng
CODE

$active = array('guests' => 0, 'members' => 0);
      foreach ($rows as $i => $result)
      {
       if ($result['in_forum'] == $forum_data['id'] || $result['forum_id'] == $forum_data['id'])
       {
        if ($result['member_id'] == 0)
        {
         $active['guests']++;
        }
        else
        {
         if (empty($cached[$result['member_id']]))
         {
          $cached[$result['member_id']] = 1;
          $active['members']++;
         }
        }
       }
      }
      $active['total'] = ($active['members'] + $active['guests']);
      if ($active['total'] > 0)
      {
       $active_members = str_replace("<#TOTAL#>", $active['total'], $ibforums->lang['active_members']);
       $active_members = str_replace("<#MEMBERS#>", $active['members'], $active_members);
       $active_members = str_replace("<#GUESTS#>", $active['guests'], $active_members);
      }
      else
      {
       $active_members = '';
      }
      $temp_html .= $this->html->ForumRow( $forums->forums_format_lastinfo( $forums->forums_calc_children( $forum_data['id'], $forum_data ) ), $active_members );

mở lang/en/lang_boards.php
them vao
CODE

'active_members' => "<#TOTAL#> User(s) Active In This Forum: <#MEMBERS#> Members, <#GUESTS#> Guests",

nếu lang kiểu khác thì nhớ thay là
CODE

$lang['active_members'] = "<#TOTAL#> User(s) Active In This Forum: <#MEMBERS#> Members, <#GUESTS#> Guests";

giờ vô Admin CP: Skins & Templates: Skin Manager: Edit HTML: Board Index: ForumRow
Edit/Update the templates current data with the new data/edits below
CODE

Template Data Variables: $data,$active

trong cái khung thì thay lại bằng
CODE

<tr>
  <td align="center" class="row2" width="1%">{$data['img_new_post']}</td>
  <td class="row2">{$data['_queued_img']}<b><a href="{ipb.script_url}showforum={$data['id']}">{$data['name']}</a></b><br /><span class="forumdesc">{$data['description']}{$data['show_subforums']}<br /><i>{$data['moderator']}</i><br /><i>{$active}</i></span>{$data['_queued_info']}</td>
  <td align="center" class="row1">{$data['topics']}</td>
  <td align="center" class="row1">{$data['posts']}</td>
  <td class="row1" nowrap="nowrap">{$data['last_unread']} <span>{$data['last_post']}<br /><b>{ipb.lang['in']}:</b> {$data['last_topic']}<br /><b>{ipb.lang['by']}:</b> {$data['last_poster']}</span></td>
 </tr>


--------------------
Nhóm bạn bè:

Thành viên này chưa có người bạn nào trong mạng VnVista, nếu bạn muốn trở thành người bạn đầu tiên của thành viên này, hãy click vào đây


Cảnh cáo: (0%)----- 
Nếu bạn thấy bài viết này vi phạm nội quy forum, hãy click nút này:
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Thank you! Reply to this topicTopic OptionsStart new topic
 

Bản Rút Gọn Bây giờ là: 25th April 2024 - 03:01 PM
Home | Mạng xã hội | Blog | Thiệp điện tử | Tìm kiếm | Thành viên | Sổ lịch