Home Webboard ArticlesKnowledges  

ผู้เขียน หัวข้อ: แสดงบร์อดย่อยแบบเลื่อนลง  (อ่าน 4646 ครั้ง)

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

ออฟไลน์ 1

  • Just
  • **
  • กระทู้: 94
  • เห็นด้วย&ขอบคุณ: 15
แสดงบร์อดย่อยแบบเลื่อนลง
« เมื่อ: 01, เมษายน 2009, 03:28:06 PM »
ภาพตัวอย่าง 

mod http://custom.simplemachines.org/mods/index.php?mod=1691

Themes/default/BoardIndex.template.php

ค้นหา
โค๊ด: [Select]
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
</td>
</tr>';
}

วางทับที่ค้นหา
โค๊ด: [Select]
// Show the Child Boards as drop-down menu
if (!empty($board['children']))
{
echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<form action="', $scripturl, '" method="get" accept-charset="', $context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto"><strong>', $txt['parent_boards'], '</strong></label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' . $txt[251] . '</option>';

// Populate the dropdown with child boards
foreach ($board['children'] as $child)
{
if ($child['new'])
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , ' (' , $txt[302] , ')</option>';
else
echo '
<option value="?board=', $child['id'], '.0">' , $child['name'] , '</option>';
}

echo '
</select>&nbsp;
</form>
</td>
</tr>';
}





 

Sitemap 1 2 3 4 5 6 7 8 9 10 
Back to top