2006-07-14, 09:44 PM
Hi,
Just upgraded my forum from IPB 1.2 to MyBB (via the PHPBB converter then the PHPBB > MyBB) and I have a question.
Basically, I want to display the top 3 latest posts on the very top of every forum page, I know this will be in the header template, and I have tried adapting the latest posts on front page thing but this doesnt seem to work, and I also tried writing my own SQL query, but that wouldn't work.
Ill post it here but its probably terrible(I put this all in the header template):
I also converted the RSS feed into a page and tried to use php include, but that wont work either (on both MyBB and IPB i couldn't get includes to work).
Can anyone help? Thanks in advance!
Just upgraded my forum from IPB 1.2 to MyBB (via the PHPBB converter then the PHPBB > MyBB) and I have a question.
Basically, I want to display the top 3 latest posts on the very top of every forum page, I know this will be in the header template, and I have tried adapting the latest posts on front page thing but this doesnt seem to work, and I also tried writing my own SQL query, but that wouldn't work.
Ill post it here but its probably terrible(I put this all in the header template):
PHP Code:
<?php
$query=("SELECT parent.tid, parent.subject FROM mybb_posts AS parent, mybb_threads AS child WHERE parent.tid = child.tid ORDER BY child.pid DESC LIMIT 3");
$result = mysql_query($query);
$row_comments = mysql_fetch_assoc($result); ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php do { ?>
��<tr>
����<td><a href="URL/forum/showthread.php?tid=<?php echo $row_comments[tid]; ?>"><?php echo $row_comments[subject]; ?></a></td>
��</tr>
�� <?php } while ($row_comments == mysql_fetch_assoc($result)); ?>
</table>
I also converted the RSS feed into a page and tried to use php include, but that wont work either (on both MyBB and IPB i couldn't get includes to work).
Can anyone help? Thanks in advance!