Mod này thống kê ai đã xem mỗi chủ đề

Chạy query sau:

SQL
ALTER TABLE ibf_topics ADD ( whoread text )



Vào ACP, Skin Manager , chọn skin , Edit Root Skin Template HTML, Topic view:
Chọn TableFooter

Tìm:
CODE
<!--IBF.TOPIC_ACTIVE-->


Thêm bên dưới:

CODE
<!--IBF.TOPIC_WHO_READ-->


Vào ACP, Skin Manager , chọn skin , Edit Root Skin Template HTML, Topic View:

Add Template Bit :

New Template Bit Name: who_read_topic
New Template Bit Incoming Data Variables: $total,$who
New Template Bit Group... : skin_topic
Add New Template Bit:

CODE
<br>
<div class="borderwrap">
<div class="formsubtitle" style="padding: 4px;">Who read this topic?</div>
<div class="row1" style="padding: 4px;">$total members : $who</div>
</div>


Mở sources/topics.php
Tìm:
CODE
$this->output = str_replace( "<!--IBF.FORUM_RULES-->", $std->print_forum_rules($this->topic), $this->output );


Thêm dưới:
CODE
$DB->simple_construct( array( 'select' => '*',
     'from'   => 'members',
     'where'  => "id IN (".substr($this->topic['whoread'].",{$ibforums->member['id']}", 1).")"
       )      );
       
$DB->simple_exec();
$i=0;
while ( $rrr = $DB->fetch_row() )
{
 $i++;
 $whoread .= ($i==1) ? "<a href='{$this->base_url}showuser={$rrr['id']}'>{$rrr['name']}</a>" : ",<a href='{$this->base_url}showuser={$rrr['id']}'>{$rrr['name']}</a>";
 
}
$this->output = str_replace( "<!--IBF.TOPIC_WHO_READ-->", $this->html->who_read_topic($i,$whoread), $this->output );


Tìm tiếp:

CODE
      //-----------------------------------------
      // Update the topic views counter
      //-----------------------------------------


Ở phía dưới bạn sẽ thấy giống như này:

CODE
$DB->simple_construct( array( 'update' => 'topics',
         'set'    => 'views=views+1',
         'where'  => "tid=".$this->topic['tid'],
         'lowpro' => 1,
     )      );


Thay bằng:

CODE
$newread = (!in_array($ibforums->member['id'],explode(',',$this->topic['whoread']))) ? $this->topic['whoread'].",".$ibforums->member['id'] : $this->topic['whoread'];
      $DB->simple_construct( array( 'update' => 'topics',
         'set'    => "views=views+1,whoread='{$newread}'",
         'where'  => "tid=".$this->topic['tid'],
         'lowpro' => 1,
     )      );


That's it!