Not Solved [How To?] Add Forum to Custom Page
#5
Not Solved
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;

$plugins->run_hooks('index_start');

// Load global language phrases
$lang->load('index');

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

 $forumsread = array();
 if(isset($mybb->cookies['mybb']['forumread']))
 {
 $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
 }
}
else
{
 // 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 f.active != 0
 ORDER BY pid, disporder
 ");
}
while($forum = $db->fetch_array($query))
{
 if($mybb->user['uid'] == 0)
 {
 if(!empty($forumsread[$forum['fid']]))
 {
 $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'];

$plugins->run_hooks('index_end');

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

<br class=\"clear\" />
";
Reply


Messages In This Thread
Add Forum to Custom Page - by AndrewSP - 2016-06-20, 06:40 PM
RE: Add Forum to Custom Page - by .m. - 2016-06-20, 07:09 PM
RE: Add Forum to Custom Page - by AndrewSP - 2016-06-20, 07:21 PM
RE: Add Forum to Custom Page - by Hugop - 2016-06-22, 12:56 AM
RE: Add Forum to Custom Page - by MrBrechreiz - 2016-06-23, 10:08 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)