MyBB Community Forums

Full Version: unable to add php to template
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have the template conditionals plugin installed. This is the content of a php file that works if you go to it. I want to add this output to one of my templates. When i add this code to where i want it within the template...i jsut get a blank page. So i think i am doing it wrong? 

<?php
$tlimit = 50; // How many titles you want
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY `tid` DESC LIMIT $tlimit");
while($fetch = $db->fetch_array($query)){
echo =  '<a href="./showthread.php?tid='.$fetch['tid'].'">'.$fetch['subject'].'</a><br />' . "\n";
}
?>
I dont mind editing core files either.
I would like to add this output to the moderation_inline_moveposts template
echo =  

This is not how you echo, you don't need the =
<?php
$tlimit = 50; // How many titles you want
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."threads ORDER BY `tid` DESC LIMIT $tlimit");
while($fetch = $db->fetch_array($query)){
echo '<a href="./showthread.php?tid='.$fetch['tid'].'">'.$fetch['subject'].'</a><br />' . "\n";
}
?>
whoops that was leftover from trying things....and i forgot to remove it...the original post code was suposse to be