資料:http://gamania.idv.tw/Lineage/viewtopic.php?t=3432
代碼: 選擇全部
#################################################################
## Mod Title: Search_Self_Topics
## Mod Version: 1.0.1
## Author: OOHOO <webdev> http://phpbb-tw.net/
##
## Description: View all topics you have posted.
##
## Installation Level: (easy)
## Installation Time: 1-5 Minutes
## Files To Edit: search.php, includes/page_header.php, language/your_language/lang_main.php,
## templates/your_templates/index_body.tpl
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Note: The original idea of this MOD is from "Topics that you have start"
## (by Bosskev <bosskev2k2>, Morpheus <morpheus2matrix>
## and AbelaJohnB <abela>), I just got the other way to do it.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ ACTION: OPEN ]------------------------------------------
#
search.php
#
#-----[ ACTION: FIND ]------------------------------------------
#
//
// Cycle through options ...
//
if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
{
//
// Flood control
//
$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "se.session_ip = '$user_ip'" : 'se.session_user_id = ' . $userdata['user_id'];
$sql = 'SELECT MAX(sr.search_time) AS last_search_time
FROM ' . SEARCH_TABLE . ' sr, ' . SESSIONS_TABLE . " se
WHERE sr.session_id = se.session_id
AND $where_sql";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) <intval>sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['last_search_time']) > 0 && ($current_time - intval($row['last_search_time'])) <intval> $lang['Search_your_posts'],
#
#-----[ ACTION: AFTER, ADD ]------------------------------------------
#
'L_SEARCH_SELF_TOPICS' => $lang['Search_your_topics'], // Search_Self_Topics
#
#-----[ ACTION: FIND ]------------------------------------------
#
'U_SEARCH_SELF' => append_sid('search.'.$phpEx.'?search_id=egosearch'),
#
#-----[ ACTION: AFTER, ADD ]------------------------------------------
#
'U_SEARCH_SELF_TOPICS' => append_sid('search.'.$phpEx.'?search_id=egosearch_topic'), // Search_Self_Topics
#
#-----[ ACTION: OPEN ]------------------------------------------
#
language/your_language/lang_main.php
#
#-----[ ACTION: FIND ]------------------------------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#-----[ ACTION: BEFORE, ADD ]------------------------------------------
#
$lang['Search_your_topics'] = "檢視您發表的主題"; // Search_Self_Topics
#
#-----[ ACTION: OPEN ]------------------------------------------
#
templates/your_templates/index_body.tpl
#
#-----[ ACTION: FIND ]------------------------------------------
#
<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a>
#
#-----[ ACTION: BEFORE, ADD ]------------------------------------------
#
<a href="{U_SEARCH_SELF_TOPICS}" class="gensmall">{L_SEARCH_SELF_TOPICS}<br>
#
#-----[ ACTION: SAVE & CLOSE FILE ]------------------------------------------
#
# EoM