Ejemplo n.º 1
0
function construct_subforum_bit($parentid, $cancontainthreads, $output = '', $depthmark = '--', $depth = 0)
{
    global $vbulletin, $stylevar, $vbphrase;
    global $lastpostinfo, $lastpostarray;
    static $splitter;
    if ($cancontainthreads) {
        $canpost = 'post';
    } else {
        $canpost = 'nopost';
    }
    // get the splitter template
    if (!isset($splitter["{$canpost}"])) {
        eval('$splitter[$canpost] = "' . fetch_template("forumhome_subforumseparator_{$canpost}") . '";');
    }
    if (!isset($vbulletin->iforumcache["{$parentid}"])) {
        return $output;
    }
    foreach ($vbulletin->iforumcache["{$parentid}"] as $forumid) {
        $forum = $vbulletin->forumcache["{$forumid}"];
        $forumperms = $vbulletin->userinfo['forumpermissions']["{$forumid}"];
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) and ($vbulletin->forumcache["{$forumid}"]['showprivate'] == 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and !$vbulletin->options['showprivateforums'])) {
            // no permission to view current forum
            continue;
        }
        if (!$forum['displayorder'] or !($forum['options'] & $vbulletin->bf_misc_forumoptions['active'])) {
            // forum not active
            continue;
        } else {
            // get on/off status
            $lastpostinfo = $vbulletin->forumcache["{$lastpostarray[$forumid]}"];
            $forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
            $show['newposticon'] = $forum['statusicon'] ? true : false;
            ($hook = vBulletinHook::fetch_hook('forumbit_subforumbit')) ? eval($hook) : false;
            eval('$subforum = "' . fetch_template("forumhome_subforumbit_{$canpost}") . '";');
            if (!empty($output)) {
                $subforum = $splitter["{$canpost}"] . $subforum;
            }
            if ($depth < $vbulletin->options['subforumdepth']) {
                $output .= construct_subforum_bit($forumid, $cancontainthreads, $subforum, $depthmark . '--', $depth + 1);
            }
            ($hook = vBulletinHook::fetch_hook('forumbit_subforumbit2')) ? eval($hook) : false;
        }
    }
    return $output;
}
Ejemplo n.º 2
0
function construct_subforum_bit($parentid, $depth = 1, &$list = array())
{
    global $vbulletin, $vbphrase;
    global $lastpostinfo, $lastpostarray;
    if (!isset($vbulletin->iforumcache["{$parentid}"])) {
        return $output;
    }
    foreach ($vbulletin->iforumcache["{$parentid}"] as $forumid) {
        $forum = $vbulletin->forumcache["{$forumid}"];
        $forumperms = $vbulletin->userinfo['forumpermissions']["{$forumid}"];
        if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) and ($vbulletin->forumcache["{$forumid}"]['showprivate'] == 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and !$vbulletin->options['showprivateforums'])) {
            // no permission to view current forum
            continue;
        }
        if (!$forum['displayorder'] or !($forum['options'] & $vbulletin->bf_misc_forumoptions['active'])) {
            // forum not active
            continue;
        } else {
            // get on/off status
            $lastpostinfo = $vbulletin->forumcache["{$lastpostarray[$forumid]}"];
            $forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
            $show['newposticon'] = $forum['statusicon'] ? true : false;
            ($hook = vBulletinHook::fetch_hook('forumbit_subforumbit')) ? eval($hook) : false;
            $forum['comma'] = $vbphrase['comma_space'];
            $cancontainthreads = $forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'];
            $forum['canpost'] = $cancontainthreads ? true : false;
            $list[] = $forum;
            if ($depth < $vbulletin->options['subforumdepth']) {
                construct_subforum_bit($forumid, $depth + 1, $list);
            }
            ($hook = vBulletinHook::fetch_hook('forumbit_subforumbit2')) ? eval($hook) : false;
        }
    }
    return $list;
}
Ejemplo n.º 3
0
function construct_subforum_bit($parentid, $cancontainthreads, $output = '', $depthmark = '--', $depth = 0)
{
	global $vbulletin, $vbphrase;
	global $lastpostinfo, $lastpostarray;
	static $splitter;

	if ($cancontainthreads)
	{
		$canpost = 'post';
	}
	else
	{
		$canpost = 'nopost';
	}

	// get the splitter template
	if (!isset($splitter["$canpost"]))
	{
		$splitter["$canpost"] = vB_Template::create("forumhome_subforumseparator_$canpost")->render();
	}

	if (!isset($vbulletin->iforumcache["$parentid"]))
	{
		return $output;
	}

	foreach($vbulletin->iforumcache["$parentid"] AS $forumid)
	{
		$forum = $vbulletin->forumcache["$forumid"];
		$forumperms = $vbulletin->userinfo['forumpermissions']["$forumid"];
		if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$forumid"]['showprivate'] == 1 OR (!$vbulletin->forumcache["$forumid"]['showprivate'] AND !$vbulletin->options['showprivateforums'])))
		{ // no permission to view current forum
			continue;
		}

		if (!$forum['displayorder'] OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['active']))
		{
			// forum not active
			continue;
		}
		else
		{ // get on/off status
			$lastpostinfo = $vbulletin->forumcache["$lastpostarray[$forumid]"];
			$forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
			$show['newposticon'] = ($forum['statusicon'] ? true : false);

			($hook = vBulletinHook::fetch_hook('forumbit_subforumbit')) ? eval($hook) : false;
			$templater = vB_Template::create("forumhome_subforumbit_$canpost");
				$templater->register('forum', $forum);
				//make the first child from the one we are displaying + 1
				$templater->register('depth', $depth+1);
			$subforum = $templater->render();

			if (!empty($output))
			{
				$subforum = $splitter["$canpost"] . $subforum;
			}
			if ($depth < $vbulletin->options['subforumdepth'])
			{
				$output .= construct_subforum_bit($forumid, $cancontainthreads, $subforum, $depthmark . '--', $depth + 1);
			}

			($hook = vBulletinHook::fetch_hook('forumbit_subforumbit2')) ? eval($hook) : false;
		}
	}

	return $output;

}