สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $sourcedir/Load.php
ค้นหา -->>
b.id_theme, b.override_theme, b.count_posts, b.id_profile, b.redirect,
เพิ่มไว้หลัง -->>
b.font_face, b.board_color, b.desc_color, c.cat_color,
ค้นหา -->>
'name' => $row['cname'
เพิ่มไว้หลัง -->>
,
'color' => $row['cat_color'
ค้นหา -->>
'posts_count' => empty($row['count_posts']),
เพิ่มไว้หลัง -->>
'board_color' => $row['board_color'],
'desc_color' => $row['desc_color'],
'font_face' => $row['font_face'],
ค้่นหา -->>
'name' => $board_info['cat']['name'
เพิ่มไว้หลัง -->>
,
'color' => $board_info['cat']['color'
ค้นหา -->>
'name' => $board_info['name'
เพิ่มไว้หลัง -->>
,
'color' => $board_info['board_color'
ค้นหา -->>
mem.real_name, b.child_level
เพิ่มไว้หลัง -->>
, b.board_color
ค้นหา -->>
'level' => $row['child_level'],
เพิ่มไว้หลัง -->>
'color' => $row['board_color'],
file $sourcedir/Subs-BoardIndex.php
ค้นหา -->>
c.id_cat, c.name AS cat_name,' : '') . '
แก้เป็น -->>
c.cat_color, c.id_cat, c.name AS cat_name,' : '') . '
ค้นหา -->>
CASE WHEN b.redirect != {string:blank_string} THEN 1 ELSE 0 END AS is_redirect,
เพิ่มไว้หลัง -->>
b.board_color, b.desc_color, b.font_face,
ค้นหา -->>
'is_collapsed' => isset($row_board['can_collapse']) && $row_board['can_collapse'] == 1 && $row_board['is_collapsed'] > 0,
เพิ่มไว้หลัง -->>
'cat_color' => $row_board['cat_color'],
ค้นหา -->>
$categories[$row_board['id_cat']]['link'] = '<a name="c' . $row_board['id_cat'] . '" href="' . (isset($row_board['can_collapse']) ? $categories[$row_board['id_cat']]['collapse_href'] : $categories[$row_board['id_cat']]['href']) . '">' . $row_board['cat_name'] . '</a>';
แก้เป็น -->>
$categories[$row_board['id_cat']]['link'] = '<a name="c' . $row_board['id_cat'] . '" href="' . (isset($row_board['can_collapse']) ? $categories[$row_board['id_cat']]['collapse_href'] : $categories[$row_board['id_cat']]['href']) . '" style="color: '.$row_board['cat_color'].';">' . $row_board['cat_name'] . '</a>';
ค้นหา -->>
'name' => $row_board['board_name'],
เพิ่มไว้หลัง -->>
'bcolor' => $row_board['board_color'],
'dcolor' => $row_board['desc_color'],
'font_face' => $row_board['font_face'],
ค้นหา -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0" style="color: '. $row_board['board_color']. '; font-family: ' . $row_board['font_face'] . ';">' . $row_board['board_name'] . '</a>'
ค้นหา -->>
'description' => $row_board['description'],
'new' => empty($row_board['is_read']) && $row_board['poster_name'] != '',
เพิ่มไว้ก่อน -->>
'bcolor' => $row_board['board_color'],
ค้นหา -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['board_name'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0" style="color: ' . $row_board['board_color'] . '; font-family: ' . $row_board['font_face'] . ';">' . $row_board['board_name'] . '</a>'
file $sourcedir/Subs-MessageIndex.php
ค้่นหา -->>
b.child_level
เพิ่มไว้หลัง -->>
, b.board_color, b.desc_color
ค้นหา -->>
'name' => $row['board_name'],
เพิ่มไว้หลัง -->>
'bcolor' => $row['board_color'],
'dcolor' => $row['desc_color'],
file $sourcedir/ManageBoards.php
ค้นหา -->>
'id' => &$tree['node']['id'],
เพิ่มไว้หลัง -->>
'cat_color' => &$tree['node']['cat_color'],
ค้นหา -->>
'name' => &$boards[$boardid]['name'],
เพิ่มไว้หลัง -->>
'bcolor' => &$boards[$boardid]['board_color'],
ค้นหา -->>
'name' => $txt['mboards_new_cat_name'],
เพิ่มไว้หลัง -->>
'cat_color' => '',
ค้นหา -->>
'name' => $cat_tree[$_REQUEST['cat']]['node']['name'],
เพิ่มไว้หลัง -->>
'cat_color' => htmlspecialchars($cat_tree[$_REQUEST['cat']]['node']['cat_color']),
ค้นหา -->>
'true_name' => $tree['node']['name'
เพิ่มไว้หลัง -->>
,
'cat_color' => $tree['node']['cat_color'
ค้นหา -->>
$catOptions['cat_name'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['cat_name']);
เพิ่มไว้หลัง -->>
$catOptions['cat_color'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['cat_color']);
ค้นหา -->>
'name' => $txt['mboards_new_board_name'],
เพิ่มไว้หลัง -->>
'board_color' => '',
'desc_color' => '',
'font_face' => '',
$boardOptions['access_groups'] = array();
เพิ่มไว้หลัง -->>
$boardOptions['board_color'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['board_color']);
$boardOptions['desc_color'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['desc_color']);
$boardOptions['font_face'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['font_face']);
file $sourcedir/Recent.php
ค้นหา -->>
AS first_poster_name, t.id_first_msg,
เพิ่มไว้หลัง -->>
b.board_color, c.cat_color,
ค้นหา -->>
['link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['bname'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0" style="color: '. $row['board_color']. ';">' . $row['bname'] . '</a>'
ค้นหา -->>
'link' => '<a href="' . $scripturl . '#c' . $row['id_cat'] . '">' . $row['cname'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '#c' . $row['id_cat'] . '" style="color: '. $row['cat_color']. ';">' . $row['cname'] . '</a>'
file $sourcedir/Subs-Recent.php
ค้นหา -->>
m.poster_time, m.subject, m.id_topic, m.id_member, m.id_msg,
เพิ่มไว้หลัง -->>
b.board_color,
ค้นหา -->>
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0">' . $row['board_name'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '?board=' . $row['id_board'] . '.0" style="color: '. $row['board_color']. ';">' . $row['board_name'] . '</a>'
file $sourcedir/Stats.php
ค้นหา -->>
SELECT id_board, name, num_posts
เพิ่มไว้หลัง -->>
, b.board_color
ค้นหา -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0">' . $row_board['name'] . '</a>'
แก้เป็น -->>
'link' => '<a href="' . $scripturl . '?board=' . $row_board['id_board'] . '.0" style="color: '. $row_board['board_color']. ';">' . $row_board['name'] . '</a>'
file $sourcedir/Subs-Boards.php
ค้นหา -->>
if (isset($boardOptions['board_description']))
{
$boardUpdates[] = 'description = {string:board_description}';
เพิ่มไว้ก่อน -->>
// Colorize board mod
if (isset($boardOptions['board_color']))
$boardUpdates[] = 'board_color = \'' . $boardOptions['board_color'] . '\'';
if (isset($boardOptions['desc_color']))
$boardUpdates[] = 'desc_color = \'' . $boardOptions['desc_color'] . '\'';
if (isset($boardOptions['font_face']))
$boardUpdates[] = 'font_face = \'' . $boardOptions['font_face'] . '\'';
ค้นหา -->>
c.can_collapse
เพิ่มไว้หลัง -->>
,
c.cat_color, b.desc_color, b.board_color, b.font_face
ค้นหา -->>
'can_collapse' => $row['can_collapse'
เพิ่มไว้หลัง -->>
,
'cat_color' => $row['cat_color'
ค้นหา -->>
'prev_board' => $prevBoard
เพิ่มไว้ก่อน -->>
'board_color' => $row['board_color'],
'desc_color' => $row['desc_color'],
'font_face' => $row['font_face'],
file $sourcedir/Subs-Categories.php
ค้นหา -->>
// Can a user collapse this category or is it too important?
แก้เป็น -->>
[if (isset($catOptions['cat_color']))
$catUpdates[] = 'cat_color = \'' . $catOptions['cat_color'] . '\'';
// Can a user collapse this category or is it too important?
file $themedir/ManageBoards.template.php
ค้นหา -->>
<a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $category['name'], '</a> <a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $txt['catModify'], '</a>
แก้เป็น -->>
<a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '" style="color: '. $category['cat_color']. ';">', $category['name'], '</a> <a href="' . $scripturl . '?action=admin;area=manageboards;sa=cat;cat=' . $category['id'] . '">', $txt['catModify'], '</a>
ค้นหา -->>
<tr class="windowbg', $alternate ? '' : '2', '">
<td style="padding-left: ', 5 + 30 * $board['child_level'], 'px;', $board['move'] ? 'color: red;' : '', '">', $board['name'], !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' <a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"><img src="' . $settings['images_url'] . '/post/recycled.gif" alt="' . $txt['recycle_board'] . '" border="0" /></a>' : '', '</td>
<td width="10%" align="right">', $context['can_manage_permissions'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=index;pid=' . $board['permission_profile'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . $txt['mboards_permissions'] . '</a>' : '', '</td>
<td width="10%" align="right"><a href="', $scripturl, '?action=admin;area=manageboards;move=', $board['id'], '">', $txt['mboards_move'], '</a></td>
<td width="10%" style="padding-right: 1ex;" align="right"><a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], '">', $txt['mboards_modify'], '</a></td>
แก้เป็น -->>
<tr class="windowbg', $alternate ? '' : '2', '">
<td style="padding-left: ', 5 + 30 * $board['child_level'], 'px;', $board['move'] ? 'color: red;' : '', '"><span style="color: '. $board['bcolor'].';">', $board['name'], '</span>', !empty($modSettings['recycle_board']) && !empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] == $board['id'] ? ' <a href="' . $scripturl . '?action=admin;area=manageboards;sa=settings"><img src="' . $settings['images_url'] . '/post/recycled.gif" alt="' . $txt['recycle_board'] . '" border="0" /></a>' : '', '</td>
<td width="10%" align="right">', $context['can_manage_permissions'] ? '<a href="' . $scripturl . '?action=admin;area=permissions;sa=index;pid=' . $board['permission_profile'] . ';sesc=' . $context['session_id'] . '"><span style="color: '. $board['bcolor'].';">' . $txt['mboards_permissions'] . '</span></a>' : '', '</td>
<td width="10%" align="right"><a href="', $scripturl, '?action=admin;area=manageboards;move=', $board['id'], '"><span style="color: '. $board['bcolor'].';">', $txt['mboards_move'], '</span></a></td>
<td width="10%" style="padding-right: 1ex;" align="right"><a href="', $scripturl, '?action=admin;area=manageboards;sa=board;boardid=', $board['id'], '"><span style="color: '. $board['bcolor'].';">', $txt['mboards_modify'], '</span></a></td>
ค้นหา -->>
<input type="text" name="cat_name" value="', $context['category']['editable_name'], '" size="30" tabindex="1" />
เพิ่มไว้หลัง -->>
<br /><b>', $txt['colorize_color'], '</b> <input type="text" name="cat_color" value="', $context['category']['cat_color'], '" size="11" tabindex="1" />
ค้นหา -->>
<input type="text" name="board_name" value="', $context['board']['name'], '" size="30" />
แก้เป็น -->>
<input type="text" name="board_name" style="color: ', !empty($context['board']['board_color']) ? $context['board']['board_color'] : '', ';" value="', $context['board']['name'], '" size="30" /><br />
<strong>', $txt['colorize_color'], '</strong> <input type="text" name="board_color" style="color: ', !empty($context['board']['board_color']) ? $context['board']['board_color'] : '', ';" value="', !empty($context['board']['board_color']) ? $context['board']['board_color'] : $txt['default_face'], '" size="17" />
<br /><strong>', $txt['colorize_style'], '</strong> <select name="font_face">
<option value="', $context['board']['font_face'], '">', !empty($context['board']['font_face']) ? $context['board']['font_face'] : $txt['default_face'], '</option>
<option value="">', $txt['default_face'], '</option>
<option value="Arial" style="font-family: arial;">', $txt['arial']. '</option>
<option value="Arial Black" style="font-family: arial black;">', $txt['arial_black']. '</option>
<option value="Comic Sans MS" style="font-family: comic sans ms;">', $txt['comic_sans_ms']. '</option>
<option value="Courier New" style="font-family: courier new;">', $txt['courier_new']. '</option>
<option value="Georgia" style="font-family: georgia;">', $txt['georgia']. '</option>
<option value="Times New Roman" style="font-family: times new roman;">', $txt['times_new_roman']. '</option>
<option value="Tahoma" style="font-family: tahoma;">', $txt['tahoma']. '</option>
<option value="Verdana" style="font-family: verdana;">', $txt['verdana']. '</option>
<option value="Trebuchet MS" style="font-family: trebuchet ms;">', $txt['trebuchet_ms']. '</option>
<option value="Impact" style="font-family: impact;">', $txt['impact']. '</option>
</select>
ค้นหา -->>
<textarea name="desc" rows="3" cols="35">', $context['board']['description'], '</textarea>
แก้เป็น -->>
<textarea name="desc" rows="3" cols="35" style="color: ', !empty($context['board']['desc_color']) ? $context['board']['desc_color'] : '', ';">', $context['board']['description'], '</textarea><br />
<b>', $txt['colorize_color'], '</b> <input type="text" name="desc_color" style="color: ', !empty($context['board']['desc_color']) ? $context['board']['desc_color'] : '', ';" value="' . $context['board']['desc_color'] . '" size="11" />
file $themedir/index.template.php
ค้นหา -->>
foreach ($context['linktree'] as $link_num => $tree)
{
แก้เป็น -->>
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num > 0)
echo '<li>', str_repeat('<img src="' . $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />', $link_num - 1), '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /></li>';
echo '<li><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
}
else
ค้นหา -->>
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] .'</span>';
แก้เป็น -->>
$tree_color = isset($tree['color']) ? $tree['color'] : '';
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' . $tree['url'] . '" style="color: '. $tree_color. ';"><span>' . $tree['name'] . '</span></a>' : '<span style="color: '. $tree_color. ';">' . $tree['name'] .'</span>';
ค้นหา -->>
echo ' >';
แก้เป็น -->>
echo $settings['linktree_inline'] ? ' |' : '<br />';
file $themedir/BoardIndex.template.php
ค้นหา -->>
<h4><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
แก้เป็น -->>
<h4><a href="', $board['href'], '" name="b', $board['id'], '" style="color: ', $board['bcolor'], '; font-family: ', $board['font_face'], '; line-height: 1.3;">', $board['name'], '</a>';
ค้นหา -->>
<p>', $board['description'] , '</p>';
แก้เป็น -->>
<p style="color: ', $board['dcolor'], '; font-family: ', $board['font_face'], ';">', $board['description'] , '</p>';
ค้นหา -->>
<td', !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg stats smalltext">
แก้เป็น -->>
<td style="color: ', $board['bcolor'], ';" ', !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg stats smalltext">
ค้นหา -->>
<td', !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg2 smalltext lastpost">';
แก้เป็น -->>
<td style="color: ', $board['bcolor'], ';" ', !empty($board['children']) ? ' rowspan="2"' : '', ' class="windowbg2 smalltext lastpost">';
ค้นหา -->>
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
แก้เป็น -->>
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')" style="color: '.$child['bcolor']. ';">' . $child['name'] . '</a>';
file $themedir/MessageIndex.template.php
ค้นหา -->>
<h4><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
แก้เป็น -->>
<h4><a href="', $board['href'], '" name="b', $board['id'], '" style="color: '. $board['bcolor']. '; font-family: ', $board['font_face'], '; line-height: 1.3;">', $board['name'], '</a>';
ค้นหา -->>
<p>', $board['description'] , '</p>';
แก้เป็น -->>
<p style="color: ', $board['dcolor'], '; font-family: ', $board['font_face'], ';">', $board['description'] , '</p>';
ค้นหา -->>
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
แก้เป็น -->>
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')" style="color: '. $child['bcolor'] .';">' . $child['name'] . '</a>';
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
$txt['colorize_color'] = 'Color';
$txt['colorize_style'] = 'Style';
$txt['default_face'] = 'Default';
$txt['arial'] = 'Arial';
$txt['arial_black'] = 'Arial Black';
$txt['comic_sans_ms'] = 'Comics Sans MS';
$txt['courier_new'] = 'Courier New';
$txt['georgia'] = 'Georgia';
$txt['times_new_roman'] = 'Times New Roman';
$txt['tahoma'] = 'Tahoma';
$txt['verdana'] = 'Verdana';
$txt['trebuchet_ms'] = 'Trebuchet MS';
$txt['impact'] = 'Impact';
สร้างไฟล์: boardcolordb.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/boardcolordb.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_add_column', $smcFunc))
db_extend('packages');
$board_color = array(
'name' => 'board_color',
'type' => 'tinytext',
'null' => false,
'default' => ''
);
$desc_color = array(
'name' => 'font_face',
'type' => 'tinytext',
'null' => false,
'default' => ''
);
$font_face = array(
'name' => 'desc_color',
'type' => 'tinytext',
'null' => false,
'default' => ''
);
$smcFunc['db_add_column']('boards', $board_color);
$smcFunc['db_add_column']('boards', $desc_color);
$smcFunc['db_add_column']('boards', $font_face);
if(SMF == 'SSI')
echo 'Done!';
?>
สร้างไฟล์: catcolordb.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/catcolordb.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_add_column', $smcFunc))
db_extend('packages');
// Add category_color
$cat_color = array(
'name' => 'cat_color',
'type' => 'tinytext',
'null' => false,
'default' => ''
);
$smcFunc['db_add_column']('categories', $cat_color);
if(SMF == 'SSI')
echo 'Done!';
?>
ลิงค์หัวข้อ:
http://dexmore.com/topic/242