0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
พอดีผมลองทำ Board 3 Column ใน SMF 2.0.2 แล้วมันมีปัญหาตรง แทบคาดของหมดหมู่ ครับคือมัน โชว์ แค่ หมวดหมู่ แรกเท่านั้น ส่วนหมวดหมู่ ต่อ ๆ ไป มันเอ๋อ หมดเลยไม่รู้ว่าพลาดอะไร ตรงไหน ไล่โค้ด ละมึนตึ๊บ มือใหม่ SMF (ลองใน 1.1.x ปกติดี) ลิ้งค์เว็บ ผมครับ : http://bbs.anime-i.com
ลองเอาตัวนี้ไปแกะดูhttp://custom.simplemachines.org/themes/index.php?lemma=1839
อ้างจาก: เซียวเหล่งนึ่งฯ ที่ 15, กันยายน 2012, 10:24:54 AMลองเอาตัวนี้ไปแกะดูhttp://custom.simplemachines.org/themes/index.php?lemma=1839พอดีลองแกะ ๆ แงะ ๆ แบบ งง ๆ ดู แล้วครับได้แค่ แก้ไม่ให้มัน เละแบบเดิมแต่ยังแก้ ตรงส่วน แถบคาด หมวดหมู่ ไม่ได้ เลยครับ (มันยังโชว์ แค่เฉพาะหมวดหมู่ แรก หมวดหมู่ต่อๆ ไป มันไม่คาดแถบส้ม ๆ ให้ผม)พอแนะแนวได้ไหม ครับ ผมมือใหม่ อาจจะไม่ค่อยเข้าใจโค้ดเท่าไหร่http://bbs.anime-i.com/
<?php/** * Simple Machines Forum (SMF) * * [แอท]package SMF * [แอท]author Simple Machines * [แอท]copyright 2011 Simple Machines * [แอท]license http://www.simplemachines.org/about/smf/license.php BSD * * [แอท]version 2.0 */function template_main(){ global $context, $settings, $options, $txt, $scripturl, $modSettings; // Show some statistics if stat info is off. if (!$settings['show_stats_index']) echo ' <div id="index_common_stats"> ', $txt['members'], ': ', $context['common_stats']['total_members'], ' &#8226; ', $txt['posts_made'], ': ', $context['common_stats']['total_posts'], ' &#8226; ', $txt['topics'], ': ', $context['common_stats']['total_topics'], ' ', ($settings['show_latest_member'] ? ' ' . $txt['welcome_member'] . ' <strong>' . $context['common_stats']['latest_member']['link'] . '</strong>' . $txt['newest_member'] : '') , ' </div>'; // Show the news fader? (assuming there are things to show...) if ($settings['show_newsfader'] && !empty($context['fader_news_lines'])) { echo ' <div id="newsfader"> <div class="cat_bar"> <h3 class="catbg"> <img id="newsupshrink" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="display: none;" /> ', $txt['news'], ' </h3> </div> <ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>'; foreach ($context['news_lines'] as $news) echo ' <li>', $news, '</li>'; echo ' </ul> </div> <script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script> <script type="text/javascript"><!-- // --><![CDATA[ // Create a news fader object. var oNewsFader = new smf_NewsFader({ sSelf: \'oNewsFader\', sFaderControlId: \'smfFadeScroller\', sItemTemplate: ', JavaScriptEscape('<strong>%1$s</strong>'), ', iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], ' }); // Create the news fader toggle. var smfNewsFadeToggle = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: ', empty($options['collapse_news_fader']) ? 'false' : 'true', ', aSwappableContainers: [ \'smfFadeScroller\' ], aSwapImages: [ { sId: \'newsupshrink\', srcExpanded: smf_images_url + \'/collapse.gif\', altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ', srcCollapsed: smf_images_url + \'/expand.gif\', altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), ' } ], oThemeOptions: { bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ', sOptionName: \'collapse_news_fader\', sSessionVar: ', JavaScriptEscape($context['session_var']), ', sSessionId: ', JavaScriptEscape($context['session_id']), ' }, oCookieOptions: { bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ', sCookieName: \'newsupshrink\' } }); // ]]></script>'; } echo ' <div id="boardindex_table"> <table class="table_list">'; /* Each category in categories is made up of: id, href, link, name, is_collapsed (is it collapsed?), can_collapse (is it okay if it is?), new (is it new?), collapse_href (href to collapse/expand), collapse_image (up/down image), and boards. (see below.) */ foreach ($context['categories'] as $category) { // If theres no parent boards we can see, avoid showing an empty category (unless its collapsed) if (empty($category['boards']) && !$category['is_collapsed']) continue; echo ' <tbody class="header" id="category_', $category['id'], '"> <tr> <td colspan="4"> <div class="cat_bar"> <h3 class="catbg">'; // If this category even can collapse, show a link to collapse it. if ($category['can_collapse']) echo ' <a class="collapse" href="', $category['collapse_href'], '">', $category['collapse_image'], '</a>'; if (!$context['user']['is_guest'] && !empty($category['show_unread'])) echo ''; echo ' ', $category['link'], ' </h3> </div> </td> </tr> </tbody>';// Assuming the category hasn't been collapsed... if (!$category['is_collapsed']) { echo ' <table border="0" width="100%" cellspacing="1" cellpadding="10" class="bordercolor" style="margin-top: 0px;">'; /* 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.) */ $picBoard = array('admin', 'a2', 'a3', 'a4', 'a5', 'a6', 'dorm', 'sevice', 'talk', 'story', 'sara', 'ask', 'gal', 'wall', 'ittech', 'program'); $picBoard2 = array('admin2', 'a2', 'a3', 'a4', 'a5', 'a6', 'dorm2', 'sevice2', 'talk2', 'story2', 'sara2', 'ask2', 'gal2', 'wall2', 'ittech2', 'program2'); $i=1; foreach ($category['boards'] as $board) { if($i%3==1) echo '<tr class="table_list">'; echo ' <td class="windowbg" valign="middle" height="100" width="35%"> <div class="picBoard"> <a href="', $scripturl, '?board=', $board['id'], '.0">'; // If the board is new, show a strong indicator. if ($board['new']) echo '<img src="', $settings['images_url'], '/picBoards/',$picBoard[$pic],'on.png" alt="', $txt[333], '" title="', $txt[333], '" />'; // No new posts at all! The agony!! else echo '<img src="', $settings['images_url'], '/picBoards/',$picBoard2[$pic],'off.png" alt="', $txt[334], '" title="', $txt[334], '" />'; echo '</a> </div> <div class="detailBoard"> <b><a class="boardtitle" href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br /> ', $board['description'],'<br />โพสทั้งหมด : ', $board['posts'],' || หัวข้อทั้งหมด : ', $board['topics']; // Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.) if (!empty($board['moderators'])) echo ' <div style="padding-top: 1px;" class="smalltext"><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></div>'; // Show some basic information about the number of posts, etc. echo '</div> </td>'; if($i%3==0) echo '</tr>'; $i++; $pic++; }//end foreach echo '</tr>'; echo ' </table>'; } } template_info_center();}function template_info_center(){ global $context, $settings, $options, $txt, $scripturl, $modSettings;// Here's where the "Info Center" starts... echo ' <div class="windowbg"><div class="windowbg"> <div class="cat_bar"> <h3 class="catbg"> <img class="icon" id="upshrink_ic" src="', $settings['images_url'], '/collapse.gif" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" /> ', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), ' </h3> </div> <div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>'; // "Users online" - in order of activity. echo ' <div class="title_barIC"> <h4 class="titlebg"> <span class="ie6_header floatleft"> ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img class="icon" src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', ' ', $txt['online_users'], ' </span> </h4> </div> <p class="inline stats"> ', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users']; // Handle hidden users and buddies. $bracketList = array(); if ($context['show_buddies']) $bracketList[] = comma_format($context['num_buddies']) . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']); if (!empty($context['num_spiders'])) $bracketList[] = comma_format($context['num_spiders']) . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']); if (!empty($context['num_users_hidden'])) $bracketList[] = comma_format($context['num_users_hidden']) . ' ' . $txt['hidden']; if (!empty($bracketList)) echo ' (' . implode(', ', $bracketList) . ')'; echo $context['show_who'] ? '</a>' : '', ' </p> <p class="inline smalltext">'; // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link. if (!empty($context['users_online'])) { echo ' ', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']); // Showing membergroups? if (!empty($settings['show_group_key']) && !empty($context['membergroups'])) echo ' <br />[' . implode('] [', $context['membergroups']) . ']'; } echo ' </p> <p class="last smalltext"> ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>. ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ') </p>'; // If they are logged in, but statistical information is off... show a personal message bar. if ($context['user']['is_logged'] && !$settings['show_stats_index']) { echo ' <div class="title_barIC"> <h4 class="titlebg"> <span class="ie6_header floatleft"> ', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img class="icon" src="', $settings['images_url'], '/message_sm.gif" alt="', $txt['personal_message'], '" />', $context['allow_pm'] ? '</a>' : '', ' <span>', $txt['personal_message'], '</span> </span> </h4> </div> <p class="pminfo"> <strong><a href="', $scripturl, '?action=pm">', $txt['personal_message'], '</a></strong> <span class="smalltext"> ', $txt['you_have'], ' ', comma_format($context['user']['messages']), ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], ' </span> </p>'; } echo ' </div> </div></div>'; // Info center collapse object. echo ' <script type="text/javascript"><!-- // --><![CDATA[ var oInfoCenterToggle = new smc_Toggle({ bToggleEnabled: true, bCurrentlyCollapsed: ', empty($options['collapse_header_ic']) ? 'false' : 'true', ', aSwappableContainers: [ \'upshrinkHeaderIC\' ], aSwapImages: [ { sId: \'upshrink_ic\', srcExpanded: smf_images_url + \'/collapse.gif\', altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ', srcCollapsed: smf_images_url + \'/expand.gif\', altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), ' } ], oThemeOptions: { bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ', sOptionName: \'collapse_header_ic\', sSessionVar: ', JavaScriptEscape($context['session_var']), ', sSessionId: ', JavaScriptEscape($context['session_id']), ' }, oCookieOptions: { bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ', sCookieName: \'upshrinkIC\' } }); // ]]></script>';}?>
$picBoard = array('admin', 'a2', 'a3', 'a4', 'a5', 'a6', 'dorm', 'sevice', 'talk', 'story', 'sara', 'ask', 'gal', 'wall', 'ittech', 'program'); $picBoard2 = array('admin2', 'a2', 'a3', 'a4', 'a5', 'a6', 'dorm2', 'sevice2', 'talk2', 'story2', 'sara2', 'ask2', 'gal2', 'wall2', 'ittech2', 'program2');
http://custom.simplemachines.org/mods/index.php?mod=1720
ทำบางหมวดหมู่คงไม่ไหว เพราะต้้องเพิ่มตัวแปรเข้าไปอีก และมีความไม่แน่นอน แคตตาล็อกหมวดหมู่มันเปลี่ยนง่าย แต่โค๊ดนี่ดิ เปลี่ยนแล้วมาหาเปลี่ยนกลับคงมึนน่าดู