進階版
代碼: 選擇全部
##############################################################
## Mod Title: Glowing poster name 閃光會員名稱
## Mod Version: 1.1.0
## Author: OOHOO < webdev@phpbb-tw.net > http://phpbb-tw.net/
##
## Description: Showing poster name with glowing text.
##
## Installation Level: (easy)
## Installation Time: 1 Minutes
## Files To Edit: viewtopic.php, /templates/your_template/viewtopic_body.tpl
##############################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Note: You can adjust glowing setting by yourself.
##
#################################################################
## History:
## 1.1.0 advanced version, showing glowing color with different level
## 1.0.0 simple version
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ ACTION: 打開 ]------------------------------------------
#
viewtopic.php
#
#-----[ ACTION: 尋找 ]------------------------------------------
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_level, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_money, u.user_session_time, u.user_allow_viewonline, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
[color=red](註. 這段有幾個MOD會改到, 所以不一定會完全一樣)[/color]
#
#-----[ ACTION: 在 u.user_posts, 後加入 u.user_level, ]------------------------------------------
#
$sql = "SELECT ............. u.user_posts, u.user_level, ..............
[color=red](註. 如果你對code一點概念都沒有, 請小心改)[/color]
#
#-----[ ACTION: 尋找 ]------------------------------------------
#
//
// Again this will be handled by the templating
// code at some point
//
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
#
#-----[ ACTION: 在上面加入 ]------------------------------------------
#
//
// Username in glowing
//
if($postrow[$i]['user_level'] == 1) // Admin
{
$glowing_color = '#' . $theme['fontcolor3'];
}
else if($postrow[$i]['user_level'] == 2) // Moderator
{
$glowing_color = '#' . $theme['fontcolor2'];
}
else // normal
{
$glowing_color = 'blue';
}
[color=red](註. 顏色可以自行調整, 如: $glowing_color = '#FF8000';)[/color]
#
#-----[ ACTION: 尋找 ]------------------------------------------
#
'MINI_POST_IMG' => $mini_post_img,
#
#-----[ ACTION: 在上面加入 ]------------------------------------------
#
'GLOWING_COLOR' => $glowing_color, // Username in glowing
#
#-----[ ACTION: 打開 ]------------------------------------------
#
/templates/your_template/viewtopic_body.tpl
#
#-----[ ACTION: 尋找 ]------------------------------------------
#
<span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br />
#
#-----[ ACTION: 替換為 ]------------------------------------------
#
<span style="filter: glow(color={postrow.GLOWING_COLOR},strength=3); height:10px; color:white; padding:1px; font-size : 11px"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br />
#
#-----[ ACTION: 存檔搞定 ]------------------------------------------
#
# EoM