Seite 1 von 1
Forum als Linkliste und Cats nebeneinander?!
Verfasst: 03.03.2005 23:49
von Triplex
Hallo zusammen,
hoffe, ihr könnt mir helfen. Suche schon seit einer Woche nach ner Mglichkeit, das Forum auf der Index umzustrukturieren. Dabei möchte ich die Kategorien nebeneinander haben bzw. in 3er oder 4er Gruppen anordnen. Die zugewiesenen Foren sollen als Linkliste untereinander erscheinen.
Cat1........cat2........
forum1.....forum1...
forum2.....forum2...
cat4
forum1
forum2
etc.
Ich bastel die ganze Zeit schon an der index_body.tpl und an der index.php rum, wobei ich glaube, dass die Lösung in der index_box.tpl zu finden ist. Die Foren als Linklist sollte ich selber hinkriegen, aber wie schaffe ich es, dass die Cats wie oben angeordnet werden können und die Forenstruktur darauf bezogen erhalten bleibt?
Vielen Dank.
Verfasst: 19.08.2006 14:25
von beachgirl
index_body.tpl
<table blabla>
<tr><td>
<!-- BEGIN catrow -->
<b><a href="{catrow.U_VIEWCAT}">{catrow.CAT_DESC}</a></b>
<br>
<!-- BEGIN forumrow -->
<li><a href="{catrow.forumrow.U_VIEWFORUM}" title="{catrow.forumrow.FORUM_DESC}">{catrow.forumrow.FORUM_NAME}</a> ({catrow.forumrow.TOPICS}/{catrow.forumrow.POSTS})
<!-- END forumrow -->
<!-- END catrow -->
</tr></td></table>
Ob das End catrow da unten richtig ist, weiß ich im Moment nicht, aber so in etwa sollte das evtl. gehen. Ohne Gewähr!
Wenn's geht, würde ich das auch gern mal sehen.
Verfasst: 29.08.2006 13:35
von Triplex
Hallo beachgirl,
danke für die Antwort. Aber ich habe das Ganze jetzt anders realisiert und umstrukturiert mit der Plus Version.
Um dies zu realisieren müsste in der index.php noch eine Variable gesetzt werden, wenn man z.B. drei Cats nebeneinander haben möchte:
index.php
for($i = 0; $i < $total_categories; $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
//
// Yes, we should, so first dump out the category
// title, then, if appropriate the forum list
//
if (isset($display_categories[$cat_id]) && $display_categories[$cat_id])
{
if ($i = 3)
{
$catumbruch = '</td></tr><tr><td>'; //alternativ nur ein <br>?
}
else
{
unset($catumbruch);
}
$template->assign_block_vars('catrow', array(
'CAT_ID' => $cat_id,
'CAT_DESC' => $category_rows[$i]['cat_title'],
'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id"),
'CATUMBRUCH' => $catumbruch)
);
index_body.tpl
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th>
<th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th>
<th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<tr>
<!-- BEGIN catrow -->
<b><a href="{catrow.U_VIEWCAT}">{catrow.CAT_DESC}</a></b>
<br>
<!-- BEGIN forumrow -->
<li><a href="{catrow.forumrow.U_VIEWFORUM}" title="{catrow.forumrow.FORUM_DESC}">{catrow.forumrow.FORUM_NAME}</a> ({catrow.forumrow.TOPICS}/{catrow.forumrow.POSTS})
<!-- END forumrow -->
{catrow.CATUMBRUCH}
<!-- END catrow -->
</table>
Ausprobiert habe ich das jetzt auch nicht, da ich es ja anders gemacht habe, aber ich denke, so hat man dann auch drei Kategorien nebeneinander.
Schöne Grüße.
P.S: bin ch eigentlich zu blöd um Farben im Code tag zu nutzen??