สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $sourcedir/ManageSettings.php
ค้นหา -->>
// Stats, compression, cookies.... server type stuff.
เพิ่มไว้ก่อน -->>
// MCLegendII
array('text', 'arrange_mclegend'),
'',
file $sourcedir/BoardIndex.php
ค้นหา -->>
$context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array());
เพิ่มไว้หลัง -->>
elseif (!empty($modSettings['arrange_mclegend']))
{
// group color legend
global $smcFunc, $scripturl;
$context['mc_legend'] = array();
$result = $smcFunc['db_query']('', '
SELECT online_color, group_name, id_group
FROM {db_prefix}membergroups',
array()
);
while ($row = $smcFunc['db_fetch_assoc']($result))
{
if (allowedTo('view_mlist'))
$link = '<a href="' . $scripturl . '?action=groups;sa=members;group=' . $row['id_group'] . '" ' . ($row['online_color'] ? 'style="color: ' . $row['online_color'] . '"' : '') . '>' . $row['group_name'] . '</a>';
else
$link = !empty($row['online_color']) ? '<span style="color: ' . $row['online_color'] . ';">'. $row['group_name'] . '</span>' : $row['group_name'];
$context['mc_legend'][] = array (
'id' => $row['id_group'],
'link' => $link,
);
}
$smcFunc['db_free_result']($result);
$context['mcl_group'] = explode(',', $modSettings['arrange_mclegend'], 30);
foreach($context['mcl_group'] AS $key => $dummy)
for ($i = 0; $i < count($context['mc_legend']); $i++)
if ($context['mc_legend'][$i]['id'] == $context['mcl_group'][$key])
$context['membergroups'][] = $context['mc_legend'][$i]['link'];
}
file $themedir/BoardIndex.template.php
ค้นหา -->>
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<br />[' . implode('] [', $context['membergroups']) . ']';
แก้เป็น -->>
if (!empty($context['membergroups']))
echo '<div style="padding-top: 2px; margin-top: 2px; border-top: 1px solid #c6c6c6;">
[' . implode('] [', $context['membergroups']) . ']', '</div>';
file $languagedir/Help.thai-utf8.php
เพิ่ม -->>
$helptxt['arrange_mclegend'] = 'Arrange the display of your membergroups color legend. Enter the group id number and must be separated by comma. No comma after the last number. (i.e. 1,2,8,7,6,5,4).
To enable the display, disable the "Show group key on board index" from Admin -> Current Theme, under Theme Settings tab.';
file $languagedir/ManageSettings.thai-utf8.php
เพิ่ม -->>
$txt['arrange_mclegend'] = '<span style="color: blue;">จัดเรียงลำดับความสำคัญของกลุ่มสมาชิก</span><br /><span class="smalltext">(คั่นแต่ละกลุ่มด้วยจุลภาค เช่น 1,2,8,7,6,5,4)</span>';
สร้างไฟล์: mclegenddb2.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/mclegenddb2.php -->> Enter เสร็จแล้วลบทิ้ง
<?php
if (file_exists(dirname(__FILE__) . '/SSI.php') && !defined('SMF'))
require_once(dirname(__FILE__) . '/SSI.php');
elseif (!defined('SMF'))
die('<b>Error:</b> Cannot update database.');
if(!array_key_exists('db_insert', $smcFunc))
db_extend('packages');
$smcFunc['db_insert']('ignore', '{db_prefix}settings',
array ('variable' => 'string', 'value' => 'string'),
array ('arrange_mclegend', '1,2,8,7,6,5,4'),
array()
);
?>
ลิงค์หัวข้อ:
http://dexmore.com/topic/2029