ผู้เขียน หัวข้อ: วิธีเปลี่ยน Icon หน้าบอร์ด Board Icons SMF 2.0.2  (อ่าน 4064 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ Admin

  • Administrator
  • *****
  • กระทู้: 1415
  • Level:
    0%
  • Thank : 61
  • เพศ: ชาย
    • ดูรายละเอียด
    • สะกิดข่าว
วิธีเปลี่ยน Icon หน้าบอร์ด Board Icons SMF 2.0.2
« เมื่อ: ตุลาคม 13, 2012, 11:36:24 pm »
เปลี่ยน Icon หน้าบอร์ด Board Icons SMF

เป็น 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
ดาวน์โหลดได้ที่
โค๊ด: [Select]
http://custom.simplemachines.org/mods/index.php?mod=511
ติดตั้งแล้วให้ไำปสร้างโฟล์เดอร์ของบอร์ด
webboard & forum/Themes/defaultธีมที่ใช้ปัจจุบัน/images/icons/

แล้วสร้าง Folder ตามเลขของบอร์ด เช่น

โค๊ด: [Select]
http://www.system-4x.com/board/index.php/board,10.0.html
ให้สร้าง Folder ชื่อว่า 10 แล้วข้างใน Folder ให้หาไฟล์รูปมา ตั้งชื่อว่า on.png , on2.png , off.png

เมื่อทำเสร็จทั้งหมดก็จะได้

- board/Themes/defaultธีมที่ใช้ปัจจุบัน/images/icons/10/on.png
- board/Themes/defaultธีมที่ใช้ปัจจุบัน/images/icons/10/on2.png
- board/Themes/defaultธีมที่ใช้ปัจจุบัน/images/icons/10/off.png

นี่คือ 1 บอร์ด ถ้าตั้งการหลายๆบอร์ดก็ทำหลายๆ Folder

ถ้าติดตั้ง 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>';
            
« แก้ไขครั้งสุดท้าย: ตุลาคม 13, 2012, 11:40:46 pm โดย Admin »

 
แชร์บทความ...
โค้ดแบบ forum
(BBCode)
โค้ดแบบ site/blog
(HTML)