MyBB Community Forums

Full Version: Add Forum to Custom Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I created a custom .php page for my site and wanted to add my forum onto the page.  However, when I place the param {$forums} to the html template, nothing shows up.  Is there something that I am missing? 

Thank you.
variables do not function globally. {$forums} works on index template - not at other places.
Is there a way to make the {$forums} variable work globally?
I am not sure what you are trying to do, but I recommend you to turn the forum into the page than adding it inside a page.

If you disagree, maybe this link is going to help you to turn your page part of MyBB:
Please try this

$templatelist = "forumbit_depth1_cat,forumbit_depth2_cat,forumbit_depth2_forum,forumbit_depth1_forum_lastpost,forumbit_depth2_forum_lastpost";

require_once MYBB_ROOT.'inc/functions_forumlist.php';
require_once MYBB_ROOT.'inc/class_parser.php';
$parser = new postParser;


// Load global language phrases

if($mybb->user['uid'] == 0)
 // Build a forum cache.
 $query = $db->simple_select('forums', '*', 'active!=0', array('order_by' => 'pid, disporder'));

 $forumsread = array();
 $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
 // Build a forum cache.
 $query = $db->query("
 SELECT f.*, fr.dateline AS lastread
 FROM ".TABLE_PREFIX."forums f
 LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid = f.fid AND fr.uid = '{$mybb->user['uid']}')
 WHERE != 0
 ORDER BY pid, disporder
while($forum = $db->fetch_array($query))
 if($mybb->user['uid'] == 0)
 $forum['lastread'] = $forumsread[$forum['fid']];
 $fcache[$forum['pid']][$forum['disporder']][$forum['fid']] = $forum;
$forumpermissions = forum_permissions();

$permissioncache['-1'] = '1';
$bgcolor = 'trow1';

// Decide if we're showing first-level subforums on the index page.
$showdepth = 2;
if($mybb->settings['subforumsindex'] != 0)
 $showdepth = 3;

$forum_list = build_forumbits();
$forums = $forum_list['forum_list'];


echo "
<script type=\"text/javascript\">
 lang.no_new_posts = \"{$lang->no_new_posts}\";
 lang.click_mark_read = \"{$lang->click_mark_read}\";
// -->
<br class=\"clear\" />

<br class=\"clear\" />