不知道這叫什麼MOD呢?
我搜尋了標題顏色,標題。。。等
都找不到類似的主題
版主: 版主管理群
viewforum.php的部分我照著改好了#-----[ OPEN ]------------------------------------------
#\r
viewforum.php
#
#----[ FIND ]------------------------------------------
#
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( $topic_rowset[$i]['topic_color'] )
{
$topic_color = '#'.$topic_rowset[$i]['topic_color'];
}
else
{
$topic_color = '';
}
$topic_title = "<font color = '" . $topic_color . "'>" . $topic_title . "</color>";
if ( $userdata['user_level'] == MOD | $userdata['user_level'] == ADMIN )
{
$u_topic_color = append_sid("topiccolor.$phpEx?id=".$topic_id);
$a_topic_color = "<a href=" . $u_topic_color . ">(C)</a>";
}
else
{
$u_topic_color = '';
$a_topic_color = '';
}
#
#-----[ FIND ]------------------------------------------
#
'L_TOPIC_FOLDER_ALT' => $folder_alt,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'U_TOPIC_COLOR' => $u_topic_color,
'A_TOPIC_COLOR' => $a_topic_color,
#
#-----[ OPEN ]------------------------------------------
#
templates/XXX/viewforum_body.tpl (xxx stands for your template name, do this for all your templates)
#
#-----[ FIND ]------------------------------------------
#
{topicrow.GOTO_PAGE}
#
#-----[ INLINE, AFTER, ADD ]------------------------------------------
#
{topicrow.A_TOPIC_COLOR}
#
#-----[ SAVE AND UPLOAD ALL ]------------------------------------------
#
#
# EoM
#
這個部分都取代為{TOPICS_LIST_BOX}了<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
<tr>
<th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_REPLIES} </th>
<th width="100" align="center" class="thTop" nowrap="nowrap"> {L_AUTHOR} </th>
<th width="50" align="center" class="thTop" nowrap="nowrap"> {L_VIEWS} </th>
<th align="center" class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN topicrow -->
<tr>
<td class="row1" align="center" valign="middle" width="20"><img src="{topicrow.TOPIC_FOLDER_IMG}" width="19" height="18" alt="{topicrow.L_TOPIC_FOLDER_ALT}" title="{topicrow.L_TOPIC_FOLDER_ALT}" /></td>
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />
{topicrow.GOTO_PAGE}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
<td class="row3" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
<td class="row3Right" align="center" valign="middle" nowrap="nowrap"><span class="postdetails">{topicrow.LAST_POST_TIME}<br />{topicrow.LAST_POST_AUTHOR} {topicrow.LAST_POST_IMG}</span></td>
</tr>
<!-- END topicrow -->
<!-- BEGIN switch_no_topics -->
<tr>
<td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen">{L_NO_TOPICS}</span></td>
</tr>
<!-- END switch_no_topics -->
<tr>
<td class="catBottom" align="center" valign="middle" colspan="6" height="28"><span class="genmed">{L_DISPLAY_TOPICS}: {S_SELECT_TOPIC_DAYS}
<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
</span></td>
</tr>
</table>
<?php
/***************************************************************************
* topiccolor.php
* -------------------
* begin : Thursday, December 18, 2003
* copyright : (C) 2003 Lyrthion
* email : lyrthion@yahoo.co.uk
*
* $Id: topiccolor.php 2003/12/18
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management
//
if ( $userdata['user_level'] == MOD | $userdata['user_level']== ADMIN )
{
$page_title = 'Topic Color Change Panel';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
if ( isset($HTTP_GET_VARS['id']) )
{
$id = intval($HTTP_GET_VARS['id']);
}
else
{
message_die(GENERAL_ERROR, "Must specify Topic ID");
}
if ( isset($HTTP_GET_VARS['submit']) && intval($HTTP_GET_VARS['submit']) == 'Submit' )
{
$update_topic_color = $HTTP_GET_VARS['color'];
$sql = "UPDATE " . TOPICS_TABLE . " SET topic_color ='" . $update_topic_color . "' WHERE topic_id =" . $id;
if( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update topic color", '', __LINE__, __FILE__, $sql);
}
$redirect = "viewtopic.'.$phpEx.'?t=$id";
message_die(GENERAL_MESSAGE, 'Color '.$update_topic_color.' Updated. <a href = viewtopic.'.$phpEx.'?t='.$id.'>回到文章.</a>');
}
else
{
$sql = "SELECT topic_color FROM " . TOPICS_TABLE . " WHERE topic_id = $id";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get users", "", __LINE__, __FILE__, $sql);
}
$topic_color = $db->sql_fetchrow($result);
$topic_color = $topic_color['topic_color'];
$s_hidden_fields = '<input type="hidden" name="id" value="' . $id . '">';
$template->set_filenames(array(
"body" => "topic_color.tpl")
);
$template->assign_vars(array(
'L_COLOR_TITLE' => '更換顏色',
'L_COLOR_EXPLAIN' => '選擇標題顏色HEX格式. 範例 = FFFFFF (white). 不用加上 #',
'TOPIC_COLOR' => $topic_color,
'L_COLOR' => '標題顏色',
'L_SUBMIT' => '送出',
'HIDDEN_VAR' => $s_hidden_fields,
'S_POST_ACTION' => append_sid('topiccolor.'.$phpEx.'?mode=submit&id='.$id, true))
);
}}
else
{ message_die(GENERAL_ERROR, "You are not permitted to perform this action"); }
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
建議您:soda98 寫:我裝了這個之後, admin 確實可以看到給我改color的(c)
但我click (c) 之後, 就出現:
出現的錯處如下, 請問知那裡出錯
Could not update topic color
DEBUG MODE
SQL Error : 1054 Unknown column 'topic_color' in 'field list'
SELECT topic_color FROM phpbb_topics WHERE topic_id = 14143
Line : 66
File : topiccolor.php