Home Webboard ArticlesKnowledges  
ข่าวประกาศ:

:: กติกา มารยาท ในการใช้งานเว็บบอร์ด ::
กรุณากรอกอีเมล์จริงในการสมัคร และรับอีเมล์ยืนยันเพื่อใช้งานในบอร์ด

ผู้เขียน หัวข้อ: ทำหน้าตาบอร์ดแนว โซน-มายดอทคอม สวยงาม  (อ่าน 3159 ครั้ง)

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

ออฟไลน์ Zone-My

  • Just Mem
  • ****
  • กระทู้: 60
  • เห็นด้วย&ขอบคุณ: 17
  • เพศ: ชาย
รูปตัวอย่าง


เปิดไฟล์ BoardIndex.template.php
ค้นหา -->
โค๊ด: [Select]
// Assuming the category hasn't been collapsed...
if (!$category['is_collapsed'])
{

echo '
<tbody class="content" id="category_', $category['id'], '_boards">';
/* 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>
<td class="info">
<a class="subject" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

echo '

<p>', $board['description'] , '</p>';

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<p class="moderators">', count($board['moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>
</td>
<td class="lastpost">';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', $board['last_post']['member']['link'] , '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
echo '
</td>
</tr>';

เเก้ไขเป็น
โค๊ด: [Select]
// Assuming the category hasn't been collapsed...
if (!$category['is_collapsed'])
{

echo '
<tbody class="content" id="category_', $category['id'], '_boards">';
/* 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)
{
if(!empty($board['children']) && !empty($modSettings['tidy_child_boards']) && $modSettings['tidy_child_boards'] > 1)
tidyBoards($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'), '">';

                                echo '
                                                         <img src="', $settings['images_url'], '/boardicons/icon' . $board['id'] . '.gif" alt="" title="', $board['name'], '" />';

echo '
</a>
</td>

<td class="info">

<a href="' . $scripturl . '?action=.xml;board=' . $board['id'] . ';type=rss" target="_blank"><img src="' . $settings['images_url'] . '/rss.png" alt="rss" /></a> <a class="subject" href="', $board['href'], '" style="color:'.$board['color_title'].'" name="b', $board['id'], '">', $board['name'], '</a>&nbsp; ';

// Has it outstanding posts for approval?
if ($board['can_approve_posts'] && ($board['unapproved_posts'] || $board['unapproved_topics']))
echo '
<a href="', $scripturl, '?action=moderate;area=postmod;sa=', ($board['unapproved_topics'] > 0 ? 'topics' : 'posts'), ';brd=', $board['id'], ';', $context['session_var'], '=', $context['session_id'], '" title="', sprintf($txt['unapproved_posts'], $board['unapproved_topics'], $board['unapproved_posts']), '" class="moderation_link">(!)</a>';

echo '

<div id="fcat"><p>', $board['description'] , '</p></div>';

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<p class="moderators">', count($board['moderators']) == 1 ? $txt['moderator'] : $txt['moderators'], ': ', implode(', ', $board['link_moderators']), '</p>';

if(!empty($board['tidy_children'])) {
$context['tidy_board'] = $board;
template_tidy_children();
}
// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>
</td>
<td class="lastpost something">';

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
                                if (!$modSettings['disable_avatar'])
echo '
                                <div style="float: left; margin-right: 4px;">', !empty($board['last_post']['member']['avatar']) ? $board['last_post']['member']['avatar'] : '<img src="'. $modSettings['avatar_url']. '/noavatar.gif" alt="" width="'. $modSettings['board_avatar_width']. '" align="middle" border="0" />', '</div>
<p><strong>', $txt['last_post'], '</strong>  ', $txt['by'], ' ', (!empty($board['last_post']['member']['group_image']) && empty($modSettings['disable_image_on_left']) && empty($modSettings['disable_on_last_post_bi']) ?  '<img src="' . $settings['images_url'] . '/group_images/' . $board['last_post']['member']['group_image'] . '" alt="" />' : ''), $board['last_post']['member']['link'] , (!empty($board['last_post']['member']['group_image']) && empty($modSettings['disable_image_on_right']) && empty($modSettings['disable_on_last_post_bi']) ?  '<img src="' . $settings['images_url'] . '/group_images/' . $board['last_post']['member']['group_image'] . '" alt="" />' : ''), '<br />
', $txt['in'], ' ', $board['last_post']['link'], '<br />
', $txt['on'], ' ', $board['last_post']['time'],'
</p>';
echo '
</td>
</tr>';

แก้ไขไฟล์ index.css
เพิ่มโค้ดนี้เข้าไป
โค๊ด: [Select]
#fcat {
width:auto;
background: none repeat scroll 0 0 #f2f7fc;
border: 2px dashed #ccddee;
margin-bottom: 1em;
padding: 0.5em 1em;
}

เสร็จเเล้วสร้างโฟลเดอร์ชื่อว่า
โค๊ด: [Select]
boardiconsไปไว้ใน โฟลเดอร์ images ของเว็บบอร์ด

จากนั้นเอารูปบอร์ดไปใส่ใน โฟลเดอร์ boardicons
ให้ตั้งชื่อเป็น iconตามด้วยเลขไอดีบอร์ด.gif ตัวอย่างชื่อว่า
โค๊ด: [Select]
icon1.gif
หากอยากใช้รูปตระกูล png ก็แก้ในไฟล์ BoardIndex.template.php
ค้นหา
โค๊ด: [Select]
<img src="', $settings['images_url'], '/boardicons/icon' . $board['id'] . '.gifเเก้เป็น
โค๊ด: [Select]
<img src="', $settings['images_url'], '/boardicons/icon' . $board['id'] . '.png
เรียบร้อยนะครับนำไปประยุกต์ใช้ได้เลย

Credit:Zone-My.com


โซนมาย เเหล่งอาณาเขตออนไลน์ของคนไทย
------------------------------------------
zone-my.com :smitten:

 

Sitemap 1 2 3 4 5 6 
Back to top