Alright I'm creating a forum as I've said in other posts for help and I"m having a bit of trouble with the templates itself now :p
Here is my PHP code.
These are my templates.Code:$getCategories = $db->dbQuery("SELECT * FROM `" . DB_PREFIX . "forum_categories` ORDER BY `sort` DESC"); while ($categories = $db->dbFetch($getCategories)) { $getForums = $db->dbQuery("SELECT * FROM `" . DB_PREFIX . "forum_forums` WHERE `cid` = '$categories->id';"); while ($forums = $db->dbFetch($getForums)) { $forum[] = $forums; $forumTopics = $db->dbCount($db->dbQuery("SELECT * FROM `" . DB_PREFIX . "forum_threads` WHERE `fid` = '$forums->id';")); $forumReplies = $db->dbCount($db->dbQuery("SELECT * FROM `" . DB_PREFIX . "forum_replies` WHERE `fid` = '$forums->id';")); if ($forums->last_post_id == 0) { $latestPostInfo[$forums->id] = "No New Posts!"; } else { $latestPostInfo[$forums->id] = $db->dbFetch($db->dbQuery("SELECT * FROM `" . DB_PREFIX . "forum_threads` WHERE `id` = '$forums->last_post_id';")); $latestPosterInfo[$forums->id] = $db->dbFetch($db->dbQuery("SELECT * FROM `".DB_PREFIX."users` WHERE `id` = '$latestPostInfo->poster';")); } } $category[] = $categories; }
forums_display.tpl
category_header.tplCode:{section name=forums loop=$forum} <tr> <td class="rows" style="width: 75px;" valign="middle" align="center">Icon</td> <td class="rows" style="width: 300px;"><div class="forum_text" style="padding-bottom: 5px;"><a href="#">{$forum[forums]->name}</a><br /> {$forum[forums]->description}</div></td> <td class="rows" style="width: 125px;">{$topics}</td> <td class="rows" style="width: 125px;" colspan="2">{$replies}</td> <td class="rows" style="width: 300px;"> {if $LatestInfo[$smarty.section.forums.iteration] == 0} No new posts! {else} <strong>In</strong>: <a href="#">{$LatestInfo[$smarty.section.forums.iteration]->title}</a><br /> <strong>By</strong>: <a href="#">{$latestPosterInfo[$smarty.section.forums.iteration]->username}</a> {/if} </td> </tr> {/section}
I have assigned a forum to both categories that I Have but I'm having troubles getting them to show up right.Code:<!--Start Category--> <table class="forum" width="901" cellpadding="0" cellspacing="0"> {section name=cats loop=$category} <tr> <td class="category" colspan="9"><div class="cat_title">{$category[cats]->name}</div></td> </tr> <tr> <td class="small_title" style="width: 75px;"> </td> <td class="small_title" style="width: 300px;">Forum Name, Forum Description</td> <td class="small_title" style="width: 125px;">Topics</td> <td class="small_title" style="width: 125px;" colspan="2">Replies</td> <td class="small_title" style="width: 300px;">Latest Poster</td> </tr> {/section}
You can see what I mean here: http://nevux.hrwr.org


LinkBack URL
About LinkBacks



Reply With Quote
