MyBB Community Forums

Full Version: [Resolved]I think I'm stupid, new page not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm making a page where it shows threads from a certain section and I was going to add my own filtering.
Of course I started out with a basic page:
<?php
define('IN_MYBB', 1); 
define('THIS_SCRIPT', 'plugins.php');
require_once "./global.php";

$allplugins = $db->query("SELECT * FROM mybb_threads WHERE fid='8'");
$plugincontent='<table border="0" cellspacing="1px" cellpadding="8px" class="tborder">
<tr>
<td class="thead" width="15%"><strong>Categories</strong></td>
<td class="thead"><strong>Plugins</strong></td>
</tr>
<tr>
<td class="trow1">(categories here)</td><td class="trow1">';

$a=0;
while ($row = $db->fetch_array($allplugins)){
    if($a==0){$a=1;}																				//First for horizontal rule
    else{
        $plugincontent.="<hr>";
    }
    $plugincontent.='<a href="/mybbtest/showthread.php?tid='.$row['tid'].'">';						//Thread ID
    $plugincontent.=$row['subject']."</a>";															//Thread Title
    $plugincontent.="<br>By <a href='/mybbtest/member.php?action=profile&uid='".$row['uid']."'>";	//User ID
    $plugincontent.=$row['username']."</a>";														//User Name

} 
$plugincontent+='</td>
</tr>
</table>';


add_breadcrumb("Plugins", "plugins.php");
eval("\$pluginspage = \"".$templates->get("plugintmp")."\";"); 
output_page($pluginspage); 
?>
that's supposed to display every thread from that section.
The template for it is:
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	lang.no_new_posts = "{$lang->no_new_posts}";
	lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
{$plugincontent}
{$boardstats}


<br style="clear: both" />
{$footer}
</body>
</html>
However, when I navigate to that page, the only thing where the {$plugincontent} should be is a 0 (even in raw html).

Knowing me I'm doing something stupid, what's wrong?

EDIT: Yep, I have a += for the $plugincontent at the very end.
What's wrong with the MyBB database methods? http://wiki.mybb.com/index.php/Database_Methods

That might help a little bit at least as then you'll know all the database stuff is correct.
(2011-07-10, 06:50 PM)euantor Wrote: [ -> ]What's wrong with the MyBB database methods? http://wiki.mybb.com/index.php/Database_Methods

That might help a little bit at least as then you'll know all the database stuff is correct.

It was throwing an error.
Let me try it again and see what happens

EDIT:
Oh, I wasn't using their fetch_array, that's why I was getting an error.
But I still have the same result, updating OP

EDIT2: Aahaha, I was right.
I accidentally had += for the last addition to the $plugincontent
Ah, how did I not see that? Glad you got it sorted Smile