หมวดไฟฟ้า/อิเล็กทรอนิกส์/คอมพิวเตอร์ => Programming => ห้องคอมพิวเตอร์ => ห้อง SMF 2.0.X => ข้อความที่เริ่มโดย: Auto Man ที่ 18 กุมภาพันธ์ 2559, 13:37:57

หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: Auto Man ที่ 18 กุมภาพันธ์ 2559, 13:37:57
มาจากกระทู้นี้  (http://www.welovethailand.com/webboard/index.php/topic,120.0/%E0%B9%80%E0%B8%9B%E0%B8%A5%E0%B8%B5%E0%B9%88%E0%B8%A2%E0%B8%99-Icon-%E0%B8%AB%E0%B8%99%E0%B9%89%E0%B8%B2%E0%B8%9A%E0%B8%AD%E0%B8%A3%E0%B9%8C%E0%B8%94-Board-Icons-SMF.html)

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: Auto Man ที่ 29 เมษายน 2559, 10:21:26
เป็น Mod ที่ใช้เปลี่ยน icon ของบอร์ดให้เป็นรูปภาพสื่อความหมายของบอร์ดนั้นๆ ใช้ได้หลายเวอร์ชั่น ดูรูปภาพตัวอย่างที่ไฟล์แนบ

Mod Name: cbi v0.5 (Custom Board Icons)
Created By: Bigguy
Latest Version: cbi175
Compatible With: 1.1 RC2, 1.1 RC3, 1.1, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.12, 1.1.14, 2.0 Beta 3 Public, 2.0 Beta 3.1 Public, 2.0 RC1-1, 2.0 RC2, 2.0 RC4, 2.0 RC5, 2.0, 2.0.1, 2.0.2
ดาวน์โหลดได้ที่
http://custom.simplemachines.org/mods/index.php?mod=511

ติดตั้งแล้วให้ไปสร้างโฟล์เดอร์ของบอร์ด
webboard & forum/Themes/defaultธีมที่ใช้ปัจจุบัน/images/icons/1/on.png
1 คือโฟลเดอร์ของบอร์ด ให้เอาเมาท์ไปชี้ที่ icon board จะเห็นพาธไฟล์ของบอร์ด
หรือคลิกเข้าไปที่บอร์ดก็จะเห็น number ของบอร์ด
ตัวอย่าง คลิกที่บอร์ด We Love The King จะได้พาธไฟล์ของบอร์ดดังนี้
http://www.welovethailand.com/webboard/index.php/board,10.0.html
board,10.0.html << เอาเลข 10 ไปสร้างเป็นชื่อของโฟล์เดอร์ แล้วสร้างภาพชื่อ on.png ,off.png ,on2.png
(on2.png คือ บอร์ดย่อย) ใส่ไปในโฟล์เดอร์นั้น
 forum/Themes/default/images/icons/board_id/on.png
 forum/Themes/default/images/icons/board_id/on2.png
 forum/Themes/default/images/icons/board_id/off.png
***board_id*** คือ number ของบอร์ด

ถ้าติดตั้ง mod และใส่โฟล์เดอร์รวมทั้งรูปแล้วไม่มีอะไรเกิดขึ้นให้ไปดูไฟล์ BoardIndex.template.php ที่ธีมปัจจุบันว่ามีโค้ดเติมเข้ามาถูกต้องหรือไม่

ส่วนใหญ่ BoardIndex.template.php จะถูกติดตั้งเฉพาะธีม default

ติดตั้งแบบแมนวล SMF 2.0.2

เปิดไฟล์./Themes/default/BoardIndex.template.php
Find: ค้นหา
โค๊ด: [Select]
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2">
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';

// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>

Replace With: แทนที่ด้วย
โค๊ด: [Select]
/* Each board in each category's boards has:
new (is it new?), id, name, description, moderators (see below), link_moderators (just a list.),
children (see below.), link_children (easier to use.), children_new (are they new?),
topics (# of), posts (# of), link, href, and last_post. (see below.) */
foreach ($category['boards'] as $board)
{
echo '
<tr id="board_', $board['id'], '" class="windowbg2">
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
<a href="', ($board['is_redirect'] || $context['user']['is_guest'] ? $board['href'] : $scripturl . '?action=unread;board=' . $board['id'] . '.0;children'), '">';
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'on.png'))
$board_new_img = '/icons/' . $board['id'];
else
$board_new_img = '';
echo '
<img src="', $settings['images_url'], $board_new_img, '/', $context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
}
// Is it a redirection board?
elseif ($board['is_redirect'])
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'redirect.png'))
$board_redirect_img = '/icons/' . $board['id'];
else
$board_redirect_img = '';
echo '
<img src="', $settings['images_url'], $board_redirect_img, '/', $context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
}
// No new posts at all! The agony!!
else
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'off.png'))
$board_nonew_img = '/icons/' . $board['id'];
else
$board_nonew_img = '';
echo '
<img src="', $settings['images_url'], $board_nonew_img, '/', $context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
}
echo '
</a>
</td>


เปิดไฟล์ ./Themes/default/MessageIndex.template.php
Find: ค้นหา
โค๊ด: [Select]
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
// Is it a redirection board?
elseif ($board['is_redirect'])
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
// No new posts at all! The agony!!
else
echo '
<img src="', $settings['images_url'], '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';

echo '
</a>
</td>
<td class="info">
<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

Replace With: แทนที่ทั้งหมด
โค๊ด: [Select]
// If the board or children is new, show an indicator.
if ($board['new'] || $board['children_new'])
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'on.png'))
$board_new_img = '/icons/' . $board['id'];
else
$board_new_img = '';
echo '
<img src="', $settings['images_url'], $board_new_img, '/' .$context['theme_variant_url'], 'on', $board['new'] ? '' : '2', '.png" alt="', $txt['new_posts'], '" title="', $txt['new_posts'], '" />';
}
// Is it a redirection board?
elseif ($board['is_redirect'])
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'redirect.png'))
$board_redirect_img = '/icons/' . $board['id'];
else
$board_redirect_img = '';
echo '
<img src="', $settings['images_url'], $board_redirect_img, '/' .$context['theme_variant_url'], 'redirect.png" alt="*" title="*" />';
}
// No new posts at all! The agony!!
else
{
if (file_exists($settings['theme_dir'] . '/images/icons/' . $board['id'] . '/' . $context['theme_variant_url'] . 'off.png'))
$board_nonew_img = '/icons/' . $board['id'];
else
$board_nonew_img = '';
echo '
<img src="', $settings['images_url'], $board_nonew_img, '/' .$context['theme_variant_url'], 'off.png" alt="', $txt['old_posts'], '" title="', $txt['old_posts'], '" />';
}
echo '
</a>
</td>
<td class="info">
<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

นำมาถ่ายทอดอีกที โดย ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ

ขอบคุณเจ้าของบทความต้นฉบับ และเพื่อนสมาชิกเว็บ www.auto-nkp.com ทุกท่านครับ
หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: Auto Man ที่ 29 เมษายน 2559, 10:25:47
   แต่รู้สึกว่าเว็บ www.auto-nkp.com ไม่ได้ใช้มอด หรือวิธีการนี้ ใช้วิธีแมนวล
แต่ใช้มอดตัวนี้น่าจะสะดวกกว่า ไปดาวน์ได้ที่เว็บ...หรือที่ไฟล์แนบ
http://custom.simplemachines.org/mods/index.php?mod=511

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
 (http://upic.me/show/58388966)
หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: Auto Man ที่ 03 พฤษภาคม 2559, 10:13:37
หลังการปรับแต่ง มาดูหน้าตาของเว็บ www.auto-nkp.com

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
 (http://upic.me/show/58404950)

จะเห็นว่าไอค่อนหรือรูปภาพ หน้าบอร์ดได้ถูกเปลี่ยนไปแล้ว สวยงามมากทีเดียว รวมถึง
สีของฟอนต์ในแต่ละบอร์ด สามารถปรับได้ จะมีเพียงเมื่อเข้าสู่บอร์ดย่อยแล้ว ไม่สามารถแสดงสีได้
เหมือนในหน้าแรก  ไม่รู้เป็นปัญหาที่จุดไหนเหมือนกัน

อย่างเช่น ในบอร์ดย่อย เทคโนโลยี่ระดับสูง ไม่ได้สีเหมือนที่กำหนดในหน้าแรก

ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
 (http://upic.me/show/58404955)
หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: Auto Man ที่ 03 พฤษภาคม 2559, 10:14:57
   อาจจะเป็นปัญหากับ smf 2.0.11 ก็ได้

สรุป  ทำได้ขนาดนี้ถือว่าเยี่ยมครับ
หัวข้อ: เปลี่ยน Icon หน้าบอร์ด Board Icons SMF
เริ่มหัวข้อโดย: cyber ที่ 04 กันยายน 2559, 17:28:21
สุดยอดครับ  -OO- -OO- -OO-