1
Modifications and Packages / Mod Crowns เพิ่มไอค่อนประจำกลุ่มหน้าชื่อสมาชิก
« เมื่อ: มีนาคม 02, 2011, 12:49:45 PM »
Crowns
ไฟล์ที่ต้องทำการแก้ไข
ManageMembergroups.php
ค้นหา
ModSettings.php
ค้นหา
แทนที่ด้วย
Load.php
ค้นหา
Subs.php
ค้นหาเครื่องหมาย ?> (อยู่ก่อนบรรทัดสุดท้าย) เพิ่มก่อนที่หา
ค้นหา
แทนที่ด้วย
BoardIndex.php
ค้นหา
ManageMembergroups.template.php
ค้นหา
ค้นหา
MessageIndex.template.php
ค้นหา
ค้นหา
Profile.template.php
ค้นหา
PersonalMessage.template.php
ค้นหา
ค้นหา
เพิ่มหลังที่หา
Who.template.php
ค้นหา
echo '
Modifications.thai-utf8.php
ค้นหาเครื่องหมาย ?> (อยู่ก่อนบรรทัดสุดท้าย) เพิ่มก่อนที่หา
โหลดไฟล์แนบขึ้นไปรูทไดเรคทอรี (ที่เดียวกับไฟล์ SSI.php) รันไฟล์โดยการพิมพ์ http://ชื่อเว็บคุณ/installdb1.php เพื่อเพิ่มฟิลด์ในฐานข้อมูล
ดาวน์โหลดไฟล์รูปไปไว้บนไดเรคทอรี Themes/ธีมที่ใช้/images
- ม็อดนี้จะทำการเพิ่มไอค่อนประจำกลุ่มในหน้าชื่อสมาชิก
- สามารถกำหนดความต่างของไอค่อนประจำกลุ่ม ระหว่างกลุ่มสมาชิกพิเศษและกลุ่มสมาชิกที่นับกระทู้พื้นฐาน
- รูปที่จะใช้เป็นไอค่อน ให้อัพโหลดเข้าไปไว้ในไดเรคทอรี default/images
- วิธีการเปลี่ยนหรือเพิ่มไอค่อน เข้าไปที่Admin => Membergroups => Edit Membergroups,
คลิก Modify และใส่ชื่อไฟล์ที่ต้องการเพิ่ม - วิธีเปิดหรือปิดการใช้งาน
สำหรับ SMF 2.0 RC1: Admin => Modifications => Crown.
สำหรับ SMF 1.1.X: Admin => Features and Options => Crown.
ไฟล์ที่ต้องทำการแก้ไข
ManageMembergroups.php
ค้นหา
โค๊ด: (php) [Select]
SELECT ID_GROUP, groupName, minPosts, onlineColor, starsแทนที่ด้วยโค๊ด: (php) [Select]
SELECT ID_GROUP, groupName, minPosts, onlineColor, stars, crownค้นหาโค๊ด: (php) [Select]
'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],แทนที่ด้วยโค๊ด: (php) [Select]
'color' => empty($row['onlineColor']) ? '' : $row['onlineColor'],
'crown' => empty($row['crown']) ? '' : '<span style="padding-right: 2px;"><img src="' . $settings['images_url'] . '/' . $row['crown'] . '" alt="" /></span>',ค้นหาโค๊ด: (php) [Select]
// !!! Don't set onlineColor for the Moderators group?แทนที่ด้วยโค๊ด: (php) [Select]
$_POST['crown'] = isset($_POST['crown']) ? $_POST['crown'] : '';
// !!! Don't set onlineColor for the Moderators group?ค้นหาโค๊ด: (php) [Select]
maxMessages = $_POST[max_messages], minPosts = $_POST[min_posts], stars = '$_POST[stars]'แทนที่ด้วยโค๊ด: (php) [Select]
maxMessages = $_POST[max_messages], minPosts = $_POST[min_posts], stars = '$_POST[stars]', crown = '$_POST[crown]'ค้นหาโค๊ด: (php) [Select]
SELECT groupName, minPosts, onlineColor, maxMessages, starsแทนที่ด้วยโค๊ด: (php) [Select]
SELECT groupName, minPosts, onlineColor, maxMessages, stars, crownค้นหาโค๊ด: (php) [Select]
'color' => $row['onlineColor'],แทนที่ด้วยโค๊ด: (php) [Select]
'color' => $row['onlineColor'],
'crown' => $row['crown'], ModSettings.php
ค้นหา
โค๊ด: (php) [Select]
$context['sub_template'] = 'show_settings';
$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',เพิ่มหลังที่หาโค๊ด: (php) [Select]
'crown' => 'ModifyCrownSettings',ค้นหา โค๊ด: (php) [Select]
'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
'is_last' => true,
), แทนที่ด้วย
โค๊ด: (php) [Select]
'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
'is_last' => false,
),
'crown' => array(
'title' => $txt['crown'],
'href' => $scripturl . '?action=featuresettings;sa=crown;sesc=' . $context['session_id'],
'is_last' => true,
),ค้นหาโค๊ด: (php) [Select]
require_once($sourcedir . '/ManageServer.php');
$subActions = array(
'basic' => 'ModifyBasicSettings',
'layout' => 'ModifyLayoutSettings',
'karma' => 'ModifyKarmaSettings',เพิ่มหลังที่หาโค๊ด: (php) [Select]
'crown' => 'ModifyCrownSettings',ค้นหาเครื่องหมาย ?> (อยู่ก่อนบรรทัดสุดท้าย) เพิ่มก่อนที่หาโค๊ด: (php) [Select]
function ModifyCrownSettings()
{
global $txt, $scripturl, $context, $settings, $sc, $modSettings;
$config_vars = array(
array('check', 'hide_index_page'),
array('check', 'topic_started_by'),
array('check', 'topic_last_post'),
array('check', 'hide_msg_display'),
array('check', 'hide_profile'),
array('check', 'hide_personal_msgs'),
array('check', 'show_memberlist'),
array('check', 'hide_who_is_online'),
array('check', 'hide_board_index'),
'',
array('check', 'avatar_in_whos_online'),
'',
);
// Saving?
if (isset($_GET['save']))
{
checkSession();
saveDBSettings($config_vars);
writeLog();
redirectexit('action=featuresettings;sa=crown');
}
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=crown';
$context['settings_title'] = '<span style="color: gray; font-weight: normal; font-size: 7pt; float: right;">Crown version 1.0 by Bulakbol</span>' . $txt['crown'];
prepareDBSettingContext($config_vars);
}Load.php
ค้นหา
โค๊ด: (php) [Select]
'permissions' => array()แทนที่ด้วยโค๊ด: (php) [Select]
'permissions' => array(),
'group_id' => empty($user_settings['ID_GROUP']) ? (!empty($user_settings['ID_POST_GROUP']) ? $user_settings['ID_POST_GROUP'] : '') : $user_settings['ID_GROUP'],ค้นหาโค๊ด: (php) [Select]
'group_color' => $profile['member_group_color'],แทนที่ด้วยโค๊ด: (php) [Select]
'group_color' => $profile['member_group_color'],
'group_item' => !empty($profile['ID_GROUP']) ? get_group_color($profile['ID_GROUP']) : (!empty($profile['ID_POST_GROUP']) ? get_group_color($profile['ID_POST_GROUP']) : ''),ค้นหาโค๊ด: (php) [Select]
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),
);แทนที่ด้วยโค๊ด: (php) [Select]
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),
);
// Board moderator?
if (strtolower($memberContext[$user]['group']) == 'moderator')
$memberContext[$user]['group_item'] = get_group_color(3);ค้นหาโค๊ด: (php) [Select]
'email' => &$user_info['email']แทนที่ด้วยโค๊ด: (php) [Select]
'email' => &$user_info['email'],
'group_item' => !$user_info['is_guest'] ? get_group_color($user_info['group_id']) : '',Subs.php
ค้นหาเครื่องหมาย ?> (อยู่ก่อนบรรทัดสุดท้าย) เพิ่มก่อนที่หา
โค๊ด: (php) [Select]
// Get group color and crown.
function get_group_color($group_id)
{
global $db_prefix, $settings;
if ($group_id == 0)
return;
$group_item = array(
'color' => array(),
'crown' => array()
);
$request = db_query("
SELECT onlineColor, crown
FROM {$db_prefix}membergroups
WHERE ID_GROUP = $group_id
LIMIT 1", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$group_item['color'] = empty($row['onlineColor']) ? '' : $row['onlineColor'];
$group_item['crown'] = empty($row['crown']) ? '' : '<span style="padding-right: 2px;"><img src="' . $settings['images_url'] . '/' . $row['crown'] . '" alt="" /></span>';
}
mysql_free_result($request);
return $group_item;
}
MessageIndex.php ค้นหา
โค๊ด: (php) [Select]
t.ID_FIRST_MSG, mf.posterTime AS firstPosterTime,แทนที่ด้วยโค๊ด: (php) [Select]
t.ID_FIRST_MSG, mf.posterTime AS firstPosterTime, memf.ID_GROUP AS first_id_group,
memf.ID_POST_GROUP AS first_id_post_group, meml.ID_GROUP AS last_id_group, meml.ID_POST_GROUP AS last_id_post_groupค้นหาโค๊ด: (php) [Select]
'id' => $row['firstID_MEMBER'],แทนที่ด้วยโค๊ด: (php) [Select]
'id' => $row['firstID_MEMBER'],
'group_item' => get_group_color(!empty($row['first_id_group']) ? $row['first_id_group'] : $row['first_id_post_group']),ค้นหาโค๊ด: (php) [Select]
'id' => $row['lastID_MEMBER'], แทนที่ด้วย
โค๊ด: (php) [Select]
'id' => $row['lastID_MEMBER'],
'group_item' => get_group_color(!empty($row['last_id_group']) ? $row['last_id_group'] : $row['last_id_post_group']),BoardIndex.php
ค้นหา
โค๊ด: (php) [Select]
$context['users_online'][$row['logTime'] . $row['memberName']] = array(แทนที่ด้วยโค๊ด: (php) [Select]
// add crown if there is one
if (empty($modSettings['hide_board_index']) && $row['ID_GROUP'] > 0)
{
$group_item = get_group_color($row['ID_GROUP']);
$link = $group_item['crown'] . $link;
}
$context['users_online'][$row['logTime'] . $row['memberName']] = array(ManageMembergroups.template.php
ค้นหา
โค๊ด: (php) [Select]
<tr class="titlebg"><td colspan="4" style="padding: 4px;">', $txt['membergroups_regular'], '</td></tr>
<tr class="catbg3">แทนที่ด้วยโค๊ด: (php) [Select]
<tr class="titlebg"><td colspan="5" style="padding: 4px;">', $txt['membergroups_regular'], '</td></tr>
<tr class="catbg3">
<td width="4%">', $txt['crown'], '</td>ค้นหาโค๊ด: (php) [Select]
<td class="windowbg2">', empty($group['color']) ? ( $group['can_search'] ? $group['link'] : $group['name'] ) : '<span style="color: ' . $group['color'] . '">' . ( $group['can_search'] ? $group['link'] : $group['name']) . '</span>', $group['id'] == 1 ? ' (<a href="' . $scripturl . '?action=helpadmin;help=membergroup_administrator" onclick="return reqWin(this.href);">?[/url])' : ($group['id'] == 3 ? ' (<a href="' . $scripturl . '?action=helpadmin;help=membergroup_moderator" onclick="return reqWin(this.href);">?[/url])' : ''), '</td>เพิ่มก่อนที่หาโค๊ด: (php) [Select]
<td class="windowbg" align="center">', $group['crown'], '</td> ค้นหา
โค๊ด: (php) [Select]
<td colspan="4" align="right" style="padding-top: 1ex; padding-bottom: 2ex;">แทนที่ด้วยโค๊ด: (php) [Select]
<td colspan="5" align="right" style="padding-top: 1ex; padding-bottom: 2ex;">ค้นหาโค๊ด: (php) [Select]
<tr class="titlebg"><td colspan="5" style="padding: 4px;">', $txt['membergroups_post'], '</td></tr>
<tr class="catbg3">แทนที่ด้วยโค๊ด: (php) [Select]
<tr class="titlebg"><td colspan="6" style="padding: 4px;">', $txt['membergroups_post'], '</td></tr>
<tr class="catbg3">
<td width="4%">', $txt['crown'], '</td>ค้นหาโค๊ด: (php) [Select]
<td class="windowbg2">', empty($group['color']) ? ($group['can_search'] ? $group['link'] : $group['name']) : '<span style="color: ' . $group['color'] . '">' . ($group['can_search'] ? $group['link'] : $group['name']) . '</span>', '</td>เพิ่มก่อนที่หาโค๊ด: (php) [Select]
<td class="windowbg" align="center">', $group['crown'], '</td>ค้นหาโค๊ด: (php) [Select]
<td colspan="5" align="right" style="padding-top: 1ex; padding-bottom: 2ex;">
<input type="submit" value="', $txt['membergroups_add_group'], '" style="margin: 4px;" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="hidden" name="postgroup" value="1" />
</form>แทนที่ด้วยโค๊ด: (php) [Select]
<td colspan="6" align="right" style="padding-top: 1ex; padding-bottom: 2ex;">
<input type="submit" value="', $txt['membergroups_add_group'], '" style="margin: 4px;" />
</td>
</tr>
</table>
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="hidden" name="postgroup" value="1" />
</form>ค้นหาโค๊ด: (php) [Select]
<tr class="windowbg2">
<th align="right" style="padding-top: 1em;">
<label for="max_messages_input">', $txt['membergroups_max_messages'], ':</label>แทนที่ด้วยโค๊ด: (php) [Select]
<tr class="windowbg2">
<th align="right" style="padding-top: 1em;">
<label for="crown_input">', $txt['crown_image_filename'], ':</label>
</th>
<td>
', $txt['membergroups_images_url'], '
<input type="text" name="crown" value="', $context['group']['crown'], '" />
<img src="', $settings['images_url'], '/', $context['group']['crown'] == '' ? 'blank.gif' : $context['group']['crown'], '" alt="*" />
</td>
</tr>
<tr class="windowbg2">
<th align="right" style="padding-top: 1em;">
<label for="max_messages_input">', $txt['membergroups_max_messages'], ':</label>ค้นหาโค๊ด: (php) [Select]
<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' ', $context['user']['name'] , '</span>แทนที่ด้วยโค๊ด: (php) [Select]
<span style="font-size: 130%;">', !empty($context['user']['group_item']['crown']) && empty($modSettings['hide_index_page']) ? $context['user']['group_item']['crown'] : $txt['hello_member_ndt']. ' ', '<b', !empty($context['user']['group_item']['color']) && empty($modSettings['hide_index_page']) ?
(' style="color: '. $context['user']['group_item']['color']. ';">') : '> ', $context['user']['name'] , '</span>MessageIndex.template.php
ค้นหา
โค๊ด: (php) [Select]
<td class="windowbg2" valign="middle" width="14%">แทนที่ด้วยโค๊ด: (php) [Select]
<td class="windowbg2" valign="middle" width="14%"><span style="float: left;">', !empty($topic['first_post']['member']['group_item']['crown']) && !empty($modSettings['topic_started_by']) ? $topic['first_post']['member']['group_item']['crown'] : '', '</span>ค้นหาโค๊ด: (php) [Select]
', $txt[525], ' ', $topic['last_post']['member']['link'], 'แทนที่ด้วยโค๊ด: (php) [Select]
', $txt[525], ' ', !empty($topic['last_post']['member']['group_item']['crown']) && !empty($modSettings['topic_last_post']) ? $topic['last_post']['member']['group_item']['crown'] : '', $topic['last_post']['member']['link'], 'Display.template.php ค้นหา
โค๊ด: (php) [Select]
', $message['member']['link'], 'แทนที่ด้วยโค๊ด: (php) [Select]
', (!empty($message['member']['group_item']['crown']) && empty($modSettings['hide_msg_display']) ? $message['member']['group_item']['crown'] : ''), $message['member']['link'], 'Profile.template.php
ค้นหา
โค๊ด: (php) [Select]
<td>', $txt[68], ': </td>
<td>',แทนที่ด้วยโค๊ด: (php) [Select]
<td>', $txt[68], ': </td>
<td>', (!empty($context['member']['group_item']['crown']) && empty($modSettings['hide_profile']) ? $context['member']['group_item']['crown'] : ''),PersonalMessage.template.php
ค้นหา
โค๊ด: (php) [Select]
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
',แทนที่ด้วยโค๊ด: (php) [Select]
<td valign="top" width="16%" rowspan="2" style="overflow: hidden;">
', (!empty($message['member']['group_item']['crown']) && empty($modSettings['hide_personal_msgs']) ? $message['member']['group_item']['crown'] : ''), '',
>Memberlist.template.php ค้นหา
โค๊ด: (php) [Select]
function template_main()
{
global $context, $settings, $options, เพิ่มหลังที่หา
โค๊ด: (php) [Select]
$modSettings,ค้นหาโค๊ด: (php) [Select]
<td class="windowbg" align="left">', $member['link'], '</td>แทนที่ด้วยโค๊ด: (php) [Select]
<td class="windowbg" align="left">', (!empty($member['group_item']['crown']) && !empty($modSettings['show_memberlist']) ? $member['group_item']['crown'] : ''), $member['link'], '</td>Who.template.php
ค้นหา
โค๊ด: (php) [Select]
global $context, $settings,แทนที่ด้วยโค๊ด: (php) [Select]
global $context, $settings, $modSettings,ค้นหาecho '
โค๊ด: (php) [Select]
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>แทนที่ด้วยโค๊ด: (php) [Select]
if (!empty($member['avatar']['href']) && empty($modSettings['avatar_in_whos_online']))
echo '<img src="', $member['avatar']['href'], '" width="30" alt="" />';
elseif (empty($modSettings['avatar_in_whos_online']))
echo '<img src="', $settings['images_url'], '/shadow.gif" width="30" alt="" />';
echo '
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>ค้นหาโค๊ด: (php) [Select]
' . $member['name'] . '[/url]', '</span>';แทนที่ด้วยโค๊ด: (php) [Select]
' . (!empty($member['group_item']['crown']) && empty($modSettings['hide_who_is_online']) ? $member['group_item']['crown'] : '') . $member['name'] . '[/url]', '</span>';Modifications.thai-utf8.php
ค้นหาเครื่องหมาย ?> (อยู่ก่อนบรรทัดสุดท้าย) เพิ่มก่อนที่หา
โค๊ด: (php) [Select]
// Crowns
$txt['crown'] = 'Crown';
$txt['crown_image_filename'] = 'Crown image filename';
$txt['hide_index_page'] = 'Do not show in index page';
$txt['topic_started_by'] = 'Show in topic index "Started by:"';
$txt['topic_last_post'] = 'Show in topic index "Last post:"';
$txt['hide_msg_display'] = 'Do not show in message display';
$txt['hide_profile'] = 'Do not show in Profile';
$txt['hide_personal_msgs'] = 'Do not show in Personal messages';
$txt['show_memberlist'] = 'Show in memberlist';
$txt['hide_who_is_online'] = 'Do not show in "who\'s online"';
$txt['hide_board_index'] = 'Do not show in board index online list';
$txt['avatar_in_whos_online'] = 'Do not show avatar in who\'s online';โหลดไฟล์แนบขึ้นไปรูทไดเรคทอรี (ที่เดียวกับไฟล์ SSI.php) รันไฟล์โดยการพิมพ์ http://ชื่อเว็บคุณ/installdb1.php เพื่อเพิ่มฟิลด์ในฐานข้อมูล
ดาวน์โหลดไฟล์รูปไปไว้บนไดเรคทอรี Themes/ธีมที่ใช้/images


)