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 水槽レンタル 大阪      ♥ 10 phút kiểm soát đường huyết hiệu quả      ♥ SHEET Đừng hỏi vì sao tôi buồn      ♥ Thuế thu nhập cá nhân là gì?      ♥ Những Bột Màu Gây Ô Nhiễm Trong Sản Xuất      ♥ Top 5 cửa hàng bảo hộ lao động tại Đồng Nai      ♥ SHEET Dấu chôn tình buồn      ♥ ローフード      ♥ CÔNG TRÌNH CẦU PHONG CHÂU - LÂM THAO - PHÚ THỌ      ♥ 水槽レンタル 大阪      ♥ SHEET Je ne T'ainme Plus - Anh Ko Còn yêu em nữa      ♥ Tại sao dầu gội thảo dược ngày càng      ♥ 水槽レンタル 大阪      ♥ ファイナンシャルプランナー 大阪      ♥ Hóa đơn VAT là gì? Quy định 2025 thế nào?      ♥ 長岡京 買取 貴金属      ♥ Au88 - Nhà cái hàng đầu châu Á      ♥ 芦屋 買取 金      ♥ Au88 – Nhà cái đáng tin cậy cho người chơi Việt      ♥ AU88: Tổng quan về một nhà cái đẳng cấp      
 
Reply to this topicStart new topicStart Poll

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

Chủ đề tương tự ở topic view


Tacaza
post Dec 22 2005, 10:56 AM
Gửi vào: #1


Group Icon

The chALLeNgER
**********
Thành viên: 1
Nhập: 3-July 05
Bài viết: 3,003
Tiền mặt: 1,210
Thanked: 1572
Cấp bậc: 43
------
Giới tính: Male
Sinh nhật: 3 Tháng 4 - 1983
Đến từ: Hà Nội
------
Xem blog
Bạn bè: 253 (Xem)
Thêm vào nhóm bạn bè
Gửi thiệp điện tử
Trang thông tin





Similar Topics 1.0.1

Written by: ntd1712

Description:
- This mod adds a table at the bottom of a topic and displays other topics that are silimar in topic (title).

File to edit:
./cache/lang_cache/lang_topic.php
./sources/action_public/topic.php

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

Mở: ./cache/lang_cache/lang_topic.php

Tìm:

CODE

<?php

$lang = array (


Thêm dưới:

CODE

// Similar Topics
'st_main'   => "Similar Topics",
'st_title'   => "Topic Title",
'st_post_on'  => "This topic was started:",
'st_replies'  => "Replies",
'st_starter'  => "Topic Starter",
'st_views'   => "Views",
'st_lastinfo' => "Last Action",
'st_by'    => "Last post by:",
'st_nodata'   => "No entries to display",


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

Mở: ./sources/action_public/topic.php

Tìm:

CODE

 //-----------------------------------------
 // Process users active in this forum
 //-----------------------------------------


Thêm bên trên:

CODE

 //-----------------------------------------
 // Similar Topics
 //-----------------------------------------

 $this->output = str_replace( "<!--IBF.SIMILAR_TOPICS-->", $this->similar_topics(), $this->output );


Tìm:

CODE

/*-------------------------------------------------------------------------*/
// Render the moderator links
/*-------------------------------------------------------------------------*/


THêm trên:

CODE

/*-------------------------------------------------------------------------*/
// Similar Topics
/*-------------------------------------------------------------------------*/

function similar_topics()
{
 require_once( ROOT_PATH.'sources/action_public/search.php' );
 $search = new search;
 $search->ipsclass =& $this->ipsclass;

 //-----------------------------------------
 // Get forums we're allowed to read
 //-----------------------------------------

 $this->ipsclass->input['forums'] = 'all';
 $forums = $search->get_searchable_forums();
 $t_fid = ( $forums != "" ) ? "forum_id IN (".$forums.") AND " : "";

 //-----------------------------------------
 // Parse data
 //-----------------------------------------

 $boolean = "";
 if( ($this->ipsclass->DB->sql_can_fulltext_boolean() == TRUE) && ($this->ipsclass->vars['search_sql_method'] == 'ftext') )
 {
  $boolean = ' IN BOOLEAN MODE';
  $t_title = $search->filter_ftext_keywords( $this->topic['title'] );
 }
 else
 {
  $t_title = $search->filter_keywords( $this->topic['title'] );
  $t_title = str_replace("%", "", $t_title);
 }

 $t_title = trim($t_title);
 if( (! $t_title) || ($t_title == "") || (! isset($t_title)) || (strlen($t_title) < 4) )
 {
  return;
 }

 if( ($this->ipsclass->DB->sql_can_fulltext() == TRUE) && ($this->ipsclass->vars['search_sql_method'] == 'ftext') )
 {
  $db_where = " AND MATCH (title) AGAINST ('".$t_title."'".$boolean.")";
 }
 else
 {
  $t_str = explode(" ", $t_title);
  $t_cnt = count($t_str);

  for( $i = 0; $i < $t_cnt; $i++ )
  {
   if( (! empty($t_str[$i])) && (strlen($t_str[$i]) > 3) )
   {
    $words[] = "'%".$t_str[$i]."%'";
    $word[] = ( $t_cnt > 1 ) ? '('.implode(' OR LOWER(title) LIKE ', $words).')' : implode(' OR LOWER(title) LIKE ', $words);
    unset($words);
   }
  }
  $sql_words .= ' '.implode(" OR LOWER(title) LIKE ", $word);
  unset($word);

  $db_where = ( ! empty($sql_words) ) ? " AND (LOWER(title) LIKE ".$sql_words.")" : "";
 }

 $this->ipsclass->DB->simple_construct( array( 'select' => '*',
              'from'   => 'topics',
              'where'  => $t_fid."tid != ".$this->topic['tid']." AND title IS NOT NULL AND approved=1".$db_where,
              'order'  => 'last_post DESC',
              'limit'  => array(0,5) ) );
 $sql = $this->ipsclass->DB->simple_exec();

 if( $this->ipsclass->DB->get_num_rows( $sql ) )
 {
  while( $r = $this->ipsclass->DB->fetch_row( $sql ) )
  {
   $r['start_name'] = $this->ipsclass->make_profile_link( $r['starter_name'], $r['starter_id'] );
   $r['start_date'] = $this->ipsclass->get_date( $r['start_date'], 'LONG' );
   $r['replies']  = $this->ipsclass->do_number_format( intval($r['posts']) );
   $r['views']   = $this->ipsclass->do_number_format( intval($r['views']) );
   $r['last_post']  = $this->ipsclass->get_date( $r['last_post'], 'LONG' );
   $r['last_name']  = $this->ipsclass->make_profile_link( $r['last_poster_name'], $r['last_poster_id'] );

   $data['st_row'] .= $this->ipsclass->compiled_templates['skin_topic']->topic_display_similar_row( $r );
  }
 }
 else
 {
  $data['st_row'] .= "<tr><td class='row2' colspan='5' align='center'><i>{$this->ipsclass->lang['st_nodata']}</i></td></tr>";
 }

 $collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').',';

 $show['div_fo'] = 'show';
 $show['div_fc'] = 'none';

 if( strstr($collapsed_ids, ',stopics,') )
 {
  $show['div_fo'] = 'none';
  $show['div_fc'] = 'show';
 }

 return $this->ipsclass->compiled_templates['skin_topic']->topic_display_similar( $show, $data );
}




Vào Admin CP: Skin & Templates: Skin Manager: Edit Root Skin Template HTML:

Vào: Topic View --> TableFooter

Tìm:
CODE

<!--IBF.TOPIC_ACTIVE-->


Thêm bên trên:

CODE

<!--IBF.SIMILAR_TOPICS-->


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

Add Template Bit

- New Template Bit Name: topic_display_similar
- New Template Bit Incoming Data Variables: $show="",$data=""
- New Template Bit Group...: skin_topic
- Click 'Continue...' button. Dán đoạn code sau vào khung to:

CODE

<div class='borderwrap' style="display:{$show['div_fc']};" id='fc_stopics'>
<div class='maintitlecollapse'>
 <p class='expand'><a href="javascript:togglecategory('stopics',0);"><{E_PLUS}></a></p>
 <p><{CAT_IMG}> {ipb.lang['st_main']}</p>
</div>
</div>
<div class='borderwrap' style="display:{$show['div_fo']};" id='fo_stopics'>
<div class='maintitle'>
 <p class='expand'><a href="javascript:togglecategory('stopics',1);"><{E_MINUS}></a></p>
 <p><{CAT_IMG}> {ipb.lang['st_main']}</p>
</div>
<table class='ipbtable' cellspacing='1'>
 <tr>
  <th width='50%'>{ipb.lang['st_title']}</td>
  <th width='7%' align='center' nowrap='nowrap'>{ipb.lang['st_replies']}</td>
  <th width='14%' align='center' nowrap='nowrap'>{ipb.lang['st_starter']}</td>
  <th width='7%' align='center' nowrap='nowrap'>{ipb.lang['st_views']}</td>
  <th width='22%' nowrap='nowrap'>{ipb.lang['st_lastinfo']}</td>
 </tr>
 {$data['st_row']}
</table>
</div><br />


- Save Template Bit

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

Add Template Bit

- New Template Bit Name: topic_display_similar_row
- New Template Bit Incoming Data Variables: $data=""
- New Template Bit Group...: skin_topic
- Click on 'Continue...'

Dán đoạn code sau:

CODE

 <tr>
  <td class='row2'><a href="{ipb.script_url}showtopic={$data['tid']}" title="{ipb.lang['st_post_on']} {$data['start_date']}">{$data['title']}</td>
  <td class='row2' align='center'>{$data['replies']}</td>
  <td class='row2' align='center'>{$data['start_name']}</a></td>
  <td class='row2' align='center'>{$data['views']}</td>
  <td class='row2'><span class='lastaction'>{$data['last_post']}<br /><a href="{ipb.script_url}showtopic={$data['tid']}&view=getlastpost">{ipb.lang['st_by']}</a> {$data['last_name']}</a></span></td>
 </tr>


- Save Template Bit


©2005 ntd1712


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


dung_buong_tay

tamhonngoc_536

uchinhuong

MTTH

xuxusp2

Xem tất cả


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

Sao không là mặt trời, gieo hạt nắng vô tư?


 
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à: 6th August 2025 - 04:16 PM
Home | Mạng xã hội | Blog | Thiệp điện tử | Tìm kiếm | Thành viên | Sổ lịch