|
|
Registered User Currently Offline
|
Posts: 28
Join Date: Apr 2005
|
Thats what i done to begin with and it just lost me.
In board.php I found:
Code:
$forums_html = array();
$c_index = $f_lookup_by_parent[0];
$cell_iterator = 0;
$template_cat = get_template('forumcat');
$template_forum = get_template('forumcell');
while (isset($f_rows[$c_index]) && ($f_rows[$c_index][1] == 0))
{
$c_id = $f_rows[$c_index][0];
if (!forum_visible($user_id, $c_id))
{
++$c_index;
continue;
}
$forum_link = get_forum_link($c_id, $f_rows[$c_index][3]);
$forum_desc = (strlen($f_rows[$c_index][4]) != 0) ? ' - '.$f_rows[$c_index][4] : null;
array_push($forums_html, eval($template_cat));
if (isset($f_lookup_by_parent[$c_id]))
{
$f_index = $f_lookup_by_parent[$c_id];
while (isset($f_rows[$f_index]) && ($f_rows[$f_index][1] == $c_id))
{
list($f_id, , , $f_name, $forum_desc, $num_topics, $num_replies, $lastpost_time, $lastposter) = $f_rows[$f_index];
if (!forum_visible($user_id, $f_id))
{
++$f_index;
continue;
}
$forum_link = get_forum_link($f_id, $f_name, 'forumlink');
$subforums = '';
$moderated_by = ($showmoderators == 0) ? null : get_forum_moderators($f_id);
if ($num_topics == 0)
$lastpost = $lang['no_posts_yet'];
else
$lastpost = $lastposter.'<br>'.format_datetime($lastpost_time, $user_timezone);
$num_subforums = 0;
if (isset($f_lookup_by_parent[$f_id]))
{
$subf_index = $f_lookup_by_parent[$f_id];
$subforums = "<div class=subforums>» {$lang['sub_forums']}: ";
while (true)
{
$subf_id = $f_rows[$subf_index][0];
if ($f_visible = forum_visible($user_id, $subf_id))
{
$subforums .= get_forum_link($subf_id, $f_rows[$subf_index][3], 'forumlink');
++$num_subforums;
}
if (isset($f_rows[++$subf_index]) && ($f_rows[$subf_index][1] == $f_id))
{
if ($num_subforums > 0 && $f_visible)
$subforums .= ',  ';
}
else
break;
}
}
if ($num_subforums == 0)
$subforums = null;
else
$subforums .= '</div>';
array_push($forums_html, eval($template_forum));
++$f_index;
$cell_iterator = 1 - $cell_iterator;
}
}
++$c_index; //next main category
}
$forums_html = implode('',$forums_html);
print eval(get_template('mainforumtable'));
unset($template_cat);
unset($template_forum);
unset($forums_html);
I think that this is the code which is associated with lisiting the categories and forums but when looking through that it loses and confuses me...
Which is why im looking for a simpler method of doing it... and to learn the logic behind it and how it works...
Im able to do it fine in the way which was said a few posts away but dont understand how you are doing it...
|