Tüm kategorileri ve bölüm adlarını almak için ben şu kodları kullanıyordum.
<?php
global $sourcedir, $context, $modSettings, $scripturl;
echo'<style type="text/css">
ul.sitemap
{
margin-left: 25px;
padding: 0;
list-style: none;
}
ul.sitemap li
{
background:transparent url(http://www.rockayseri.net/rk/Themes/rockayseri/images/profil/arrow.gif) no-repeat scroll 5px 9px;
padding: 4px 0 4px 30px;
}
ul.sitemap li ul li
{
padding: 4px 0 4px 30px;
}</style>';
// Retrieve the categories and boards.
require_once($sourcedir . '/Subs-BoardIndex.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$context['categories'] = getBoardIndex($boardIndexOptions);
echo '
<ul class="sitemap">';
foreach ($context['categories'] as $category)
{
echo '
<li>', $category['link'];
echo '
<ul>';
foreach ($category['boards'] as $board)
{
echo '
<li><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a>';
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="http://demo.rockayseri.net/' . $child['href'] . '" title="' . $child['posts'] . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '<ul><li style="font-size:10px;">', $txt['parent_boards'], ' : ', implode(', ', $children), '</li></ul>';
}
echo'</li>';
}
echo '
</ul>
</li>';
}
echo '
</ul>';
?>
Yapmak istediğiniz bunun gibi birşey mi?