Topic: How can use hook in_forum_loop_start ?
Hello,
Sorry for my English pitiful! (Thanks Google)
But I try to use that hook to add a feature at the top of each category on the main page and I faced a strange result.
So I have been testing directly in the source code, and I am more and more perplexed.
Test beginning at line 109 in index.php
while ($cur_forum = $db->fetch_assoc($result))
{
($hook = get_hook('in_forum_loop_start')) ? eval($hook) : null;
echo '<p>test 1</p>';
$pun_page['item_mods'] = '';
++$pun_page['item_count'];
echo '<p>test 2</p>';
if ($cur_forum['cid'] != $pun_page['cur_category']) // A new category since last iteration?
{
echo '<p>test 3</p>';
if ($pun_page['cur_category'] != 0)
{
?>
</tbody>
</table>
</div>
<?php
}
echo '<p>test 4</p>';
And the result in html source code.
<h1><span>Dev Beta</span></h1>
<p>test 1</p><p>test 2</p><p>test 3</p><p>test 4</p> <div class="main-head">
<h2><span>truc</span></h2>
</div>
<div id="category1" class="main-content category">
<table cellspacing="0" summary="Listing of forums in the category truc.">
<thead>
<tr>
<th class="tcl" scope="col">Forum</th>
<th class="tc2" scope="col">Topics</th>
<th class="tc3" scope="col">Posts</th>
<th class="tcr" scope="col">Last post</th>
</tr>
</thead>
<tbody class="statused">
<tr id="forum3" class="odd normal">
<td class="tcl"><span class="status normal" title="Forum"><img src="http://localhost/punbb13/style/Oxygen/status.png" alt="Forum" /></span> <h3><a href="http://localhost/punbb13/viewforum.php?id=3"><span>test</span></a></h3></td>
<td class="tc2">0</td>
<td class="tc3">0</td>
<td class="tcr">Never</td>
</tr>
<p>test 1</p><p>test 2</p><p>test 3</p> </tbody>
</table>
</div>
<p>test 4</p> <div class="main-head">
<h2><span>tyu</span></h2>
</div>
<div id="category2" class="main-content category">
<table cellspacing="0" summary="Listing of forums in the category tyu.">
<thead>
<tr>
<th class="tcl" scope="col">Forum</th>
<th class="tc2" scope="col">Topics</th>
<th class="tc3" scope="col">Posts</th>
<th class="tcr" scope="col">Last post</th>
</tr>
</thead>
<tbody class="statused">
<tr id="forum4" class="odd normal">
<td class="tcl"><span class="status normal" title="Forum"><img src="http://localhost/punbb13/style/Oxygen/status.png" alt="Forum" /></span> <h3><a href="http://localhost/punbb13/viewforum.php?id=4"><span>azerty</span></a></h3></td>
<td class="tc2">0</td>
<td class="tc3">0</td>
<td class="tcr">Never</td>
</tr>
</tbody>
</table>
</div>
What do you think? I missed a step?
Thx.