Mod Name:Membergroup Color
http://custom.simplemachines.org/mods/index.php?mod=1077File Edits./Sources/ManageSettings.phpหา:
// Statistics.
array('check', 'trackStats'),
array('check', 'hitStats'),
'',
ใส่ก่อนที่หา:
// MCLegendII
array('text', 'arrange_mclegend'),
'',
./Sources/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'];
}
./Themes/default/BoardIndex.template.phpหา:
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
แทนที่ด้วย:
if (!empty($context['membergroups']))
./Themes/default/languages/ManageSettings.english.phpหา:
?>
ใส่ก่อนที่หา:
$txt['arrange_mclegend'] = '<span style="color: blue;">Membergroup legend display arrangement.</span><br /><span class="smalltext">(Must be separated by comma. i.e. 1,2,8,7,6,5,4)</span>';
Codemclegenddb2b3.php
(ไฟล์mclegenddb2b3.php จากMCLegendII.2.zipหรือMCLegendII.2_RC1.zip ก็ได้)