พัฒนาโดย ::VSE
Version ::2.0.0
ดาวน์โหลด ::https://www.mindphp.com/download/files/39-37-topic-preview-zip.html
ไฟล์ที่ใช้ในการติดตั้ง
search.php,
viewforum.php,
includes/ucp/ucp_prefs.php,
styles/prosilver/template/overall_footer.html,
styles/prosilver/template/overall_header.html,
styles/prosilver/template/search_results.html,
styles/prosilver/template/ucp_prefs_view.html,
styles/prosilver/template/viewforum_body.html
วิธีการติดตั้ง
เปิดไฟล์ =>search.php
ค้นหา ::
โค้ด: เลือกทั้งหมด
$sql = "SELECT $sql_select
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
if(!class_exists('phpbb_topic_preview'))
{
include($phpbb_root_path . 'includes/topic_preview.' . $phpEx);
}
$topic_preview = new phpbb_topic_preview();
$sql_from = $topic_preview->modify_sql_join($sql_from);
$sql_select = $topic_preview->modify_sql_select($sql_select);
// END Topic Preview Mod
โค้ด: เลือกทั้งหมด
'U_VIEW_POST' => (!empty($row['post_id'])) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . (($u_hilit) ? '&hilit=' . $u_hilit : '')) . '#p' . $row['post_id'] : '')
));
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
if(isset($topic_preview))
{
$topic_preview->display_topic_preview($row, 'searchresults');
}
// END Topic Preview Mod
ค้นหา ::
โค้ด: เลือกทั้งหมด
if ($forum_data['forum_type'] == FORUM_POST)
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
if(!class_exists('phpbb_topic_preview'))
{
include($phpbb_root_path . 'includes/topic_preview.' . $phpEx);
}
$topic_preview = new phpbb_topic_preview();
$sql_array = $topic_preview->modify_sql_array($sql_array);
// END Topic Preview Mod
โค้ด: เลือกทั้งหมด
WHERE ' . $db->sql_in_set('topic_id', array_keys($shadow_topic_list));
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
$sql = $topic_preview->modify_sql($sql);
// END Topic Preview Mod
โค้ด: เลือกทั้งหมด
'S_TOPIC_TYPE_SWITCH' => ($s_type_switch == $s_type_switch_test) ? -1 : $s_type_switch_test)
);
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
$topic_preview->display_topic_preview($row, 'topicrow');
// END Topic Preview Mod
ค้นหา ::
โค้ด: เลือกทั้งหมด
add_form_key('ucp_prefs_view');
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
$user->add_lang('mods/info_acp_topic_preview');
// END Topic Preview Mod
โค้ด: เลือกทั้งหมด
'wordcensor' =>
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview Mod
'topic_preview' => request_var('topic_preview', (int) $user->data['user_topic_preview']),
// END Topic Preview Mod
โค้ด: เลือกทั้งหมด
'user_post_show_days' => $data['post_st'],
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview MOD
'user_topic_preview' => $data['topic_preview'],
// END Topic Preview MOD
โค้ด: เลือกทั้งหมด
'S_DISABLE_CENSORS' => $data['wordcensor'],
โค้ด: เลือกทั้งหมด
// BEGIN Topic Preview MOD
'S_DISPLAY_TOPIC_PREVIEW' => $data['topic_preview'],
'S_TOPIC_PREVIEW' => $config['topic_preview_limit'],
// END Topic Preview MOD
ค้นหา ::
โค้ด: เลือกทั้งหมด
</body>
โค้ด: เลือกทั้งหมด
<!-- IF S_JQUERY_TOPIC_PREVIEW -->
<script type="text/javascript">
window.jQuery || document.write(unescape('%3Cscript src="{ROOT_PATH}styles/topic_preview_assets/jquery.min.js" type="text/javascript"%3E%3C/script%3E'));
</script>
<script src="{ROOT_PATH}styles/topic_preview_assets/topic_preview.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("dt[title]").topicPreview({
"dir" : "{S_CONTENT_DIRECTION}", // do not change
"theme" : "light", // use "light" or "dark" topic preview theme
"delay" : 1500, // sets the delay before showing topic previews (in milliseconds)
"width" : 360, // sets the width of topic previews (in pixels)
"left" : 35, // sets the position offset from the left (in pixels)
"drift" : 15, // sets the amount of vertical animation, use negative values to change direction (in pixels)
"noavatar" : "{ROOT_PATH}styles/topic_preview_assets/no_avatar.png"
});
});
</script>
<!-- ENDIF -->
ค้นหา ::
โค้ด: เลือกทั้งหมด
</head>
โค้ด: เลือกทั้งหมด
<!-- IF S_JQUERY_TOPIC_PREVIEW -->
<link href="{ROOT_PATH}styles/topic_preview_assets/topic_preview.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->
ค้นหา ::
โค้ด: เลือกทั้งหมด
<dt <!-- IF searchresults.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
โค้ด: เลือกทั้งหมด
background-repeat: no-repeat;"<!-- ENDIF -->
โค้ด: เลือกทั้งหมด
<!-- IF searchresults.TOPIC_PREVIEW_TEXT --> title="{searchresults.TOPIC_PREVIEW_TEXT}" id="t{searchresults.TOPIC_ID}"<!-- ENDIF -->
โค้ด: เลือกทั้งหมด
<!-- IF not S_IS_BOT --><a href="{searchresults.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{searchresults.LAST_POST_TIME}<br /> </span>
</dd>
</dl>
โค้ด: เลือกทั้งหมด
<!-- IF searchresults.TOPIC_PREVIEW_TEXT and S_JQUERY_TOPIC_PREVIEW -->
<div id="topic_preview_t{searchresults.TOPIC_ID}" style="display:none;">
<!-- IF searchresults.TOPIC_PREVIEW_TEXT2 --><strong>{L_FIRST_POST}</strong><hr /><!-- ENDIF -->
<!-- IF searchresults.TOPIC_PREVIEW_AVATAR --><div class="topic_preview_avatar">{searchresults.TOPIC_PREVIEW_AVATAR}</div><!-- ENDIF -->
<div class="topic_preview_text_first"></div>
<!-- IF searchresults.TOPIC_PREVIEW_TEXT2 -->
<div class="topic_preview_break"></div>
<strong>{L_LAST_POST}</strong><hr />
<!-- IF searchresults.TOPIC_PREVIEW_AVATAR2 --><div class="topic_preview_avatar">{searchresults.TOPIC_PREVIEW_AVATAR2}</div><!-- ENDIF -->
<div class="topic_preview_text_last">{searchresults.TOPIC_PREVIEW_TEXT2}</div>
<!-- ENDIF -->
</div>
<!-- ENDIF -->
ค้นหา ::
โค้ด: เลือกทั้งหมด
<hr />
โค้ด: เลือกทั้งหมด
<!-- IF S_TOPIC_PREVIEW -->
<dl>
<dt><label for="topic_preview1">{L_DISPLAY_TOPIC_PREVIEW}:</label></dt>
<dd>
<label for="topic_preview1"><input type="radio" name="topic_preview" id="topic_preview1" value="1"<!-- IF S_DISPLAY_TOPIC_PREVIEW --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label for="topic_preview0"><input type="radio" name="topic_preview" id="topic_preview0" value="0"<!-- IF not S_DISPLAY_TOPIC_PREVIEW --> checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
ค้นหา ::
โค้ด: เลือกทั้งหมด
<dt<!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
โค้ด: เลือกทั้งหมด
title="{topicrow.TOPIC_FOLDER_IMG_ALT}"
โค้ด: เลือกทั้งหมด
id="t{topicrow.TOPIC_ID}" title="<!-- IF topicrow.TOPIC_PREVIEW_TEXT -->{topicrow.TOPIC_PREVIEW_TEXT}<!-- ELSE -->{topicrow.TOPIC_FOLDER_IMG_ALT}<!-- ENDIF -->"
โค้ด: เลือกทั้งหมด
<!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{topicrow.LAST_POST_TIME}</span>
</dd>
</dl>
โค้ด: เลือกทั้งหมด
<!-- IF topicrow.TOPIC_PREVIEW_TEXT and S_JQUERY_TOPIC_PREVIEW -->
<div id="topic_preview_t{topicrow.TOPIC_ID}" style="display:none;">
<!-- IF topicrow.TOPIC_PREVIEW_TEXT2 --><strong>{L_FIRST_POST}</strong><hr /><!-- ENDIF -->
<!-- IF topicrow.TOPIC_PREVIEW_AVATAR --><div class="topic_preview_avatar">{topicrow.TOPIC_PREVIEW_AVATAR}</div><!-- ENDIF -->
<div class="topic_preview_text_first"></div>
<!-- IF topicrow.TOPIC_PREVIEW_TEXT2 -->
<div class="topic_preview_break"></div>
<strong>{L_LAST_POST}</strong><hr />
<!-- IF topicrow.TOPIC_PREVIEW_AVATAR2 --><div class="topic_preview_avatar">{topicrow.TOPIC_PREVIEW_AVATAR2}</div><!-- ENDIF -->
<div class="topic_preview_text_last">{topicrow.TOPIC_PREVIEW_TEXT2}</div>
<!-- ENDIF -->
</div>
<!-- ENDIF -->
การแสดงผลการติดตั้ง
ในส่วนของ admin ในส่วนของ User