EDIT: Now I would like to do this in vB 3.6 (last post).
I would like to have a bit of code in the showthread.php file and showthread template to accomplish the following task: I'd like to have different information shown in the header depending on what forumid is being viewed. I've currently accomplished this in vB 3.x using <if> conditionals in the showthread tempalte, but this is making the showthread template VERY long and I've seen a few random errors since I've implemented it that I think may be attributable to the length of the showthread template.
What I'd rather do is have the query pull the results of the DB depending on what forumid is being shown and pass them into the template using a variable. I'm not sure how to write the query and such. I will only have two fields in the table,
forumid and
content. I'd like it such that if the forumid being viewed on the showthread.php page is equal to one that is in the table it shows that defined content. If there is no match, I'd like it such that the query returned some default row from the table.
If you're curious as to what I'm really trying to do, have a look at my forums. On this page, you can see the header information (which is inserted by the showthread template) has information on books for the 70-292 exam:
http://www.mcseworld.com/forums/showthread.php?t=12495
On this one, it has information on books for the 70-296 exam:
http://www.mcseworld.com/forums/showthread.php?t=12522
And so forth. Like I mentioned previously, this is currently being done by a rather large chunk of HTML with conditionals in the showthread template. Here is an example of that for one of the forums:
PHP Code:
<!-- 70-292 -->
<if condition="$foruminfo['forumid']==114">
<div align="center">
<center>
<table class="tborder" cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%" style="border-collapse: collapse" bordercolor="#111111">
<tbody>
<tr>
<td class="thead" colspan="5" width="100%" align="left" valign="top">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_poparticles')"><img id="collapseimg_forumhome_poparticles" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_poparticles].gif" alt="" border="0" /></a>MCSE
World Recommended Reading</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_poparticles" style="$vbcollapse[collapseobj_forumhome_poparticles]">
<tr>
<td class="alt1Active" width="100%" align="left" valign="top" colspan="5">
<span class="smallfont"><b>Exam 70-292: Managing and Maintaining a
Microsoft Windows Server 2003 Environment for an MCSA Certified on
Windows 2000. </b></span></td>
</tr>
<tr>
<td class="alt1Active" width="20%" align="center" valign="top">
<a href="http://www.mcseworld.com/a/1932266569" target="_blank">
<IMG SRC="http://images.amazon.com/images/P/1932266569.01.MZZZZZZZ.jpg" width="111" height="140" border="0"></a></td>
<td class="alt1Active" width="20%" align="center" valign="top">
<a href="http://www.mcseworld.com/a/0789729466" target="_blank">
<img border="0" src="http://images.amazon.com/images/P/0789729466.01.MZZZZZZZ.jpg" width="93" height="140"></a></td>
<td class="alt1Active" width="20%" align="center" valign="top">
<a href="http://www.mcseworld.com/a/0782142672" target="_blank">
<img border="0" src="http://images.amazon.com/images/P/0782142672.01.MZZZZZZZ.jpg" width="116" height="140"></a></td>
<td class="alt1Active" width="20%" align="center" valign="top">
<a href="http://www.mcseworld.com/a/0735619719" target="_blank">
<img border="0" src="http://a1055.g.akamai.net/f/1055/1401/5h/images.barnesandnoble.com/images/7040000/7042064.gif" width="100" height="132"></a></td>
<td class="alt1Active" width="20%" align="center" valign="top">
<a href="http://www.mcseworld.com/a/1932266615" target="_blank">
<img border="0" src="http://images.amazon.com/images/P/1932266615.01.MZZZZZZZ.jpg" width="111" height="140"></a></td>
</tr>
<tr>
<td class="alt1Active" width="100%" align="center" valign="top" colspan="5"><div class="smallfont">
<b>Please help support MCSE World by purchasing your study materials
through these links to Amazon.com.</b></div></td>
</tr>
</tbody>
</table>
</center>
</div>
<br>
</if>
<!-- 70-292 -->
If pulling the information from the database, I'd obviously just have to code the table itself and the rest of the data would be in the DB and passed via the output variable of the SQL query.
Thanks in advance.