Beispiel #1
0
function print_archive_forum_list($parentid = -1, $indent = '')
{
    global $vbulletin;
    $output = '';
    if (empty($vbulletin->iforumcache)) {
        $forums = $vbulletin->db->query_read_slave("\r\n\t\t\tSELECT forumid, title, link, parentid, displayorder, title_clean, description, description_clean,\r\n\t\t\t(options & " . $vbulletin->bf_misc_forumoptions['cancontainthreads'] . ") AS cancontainthreads\r\n\t\t\tFROM " . TABLE_PREFIX . "forum AS forum\r\n\t\t\tWHERE displayorder <> 0 AND\r\n\t\t\tpassword = '' AND\r\n\t\t\t(options & " . $vbulletin->bf_misc_forumoptions['active'] . ")\r\n\t\t\tORDER BY displayorder\r\n\t\t");
        $vbulletin->iforumcache = array();
        while ($forum = $vbulletin->db->fetch_array($forums)) {
            $vbulletin->iforumcache["{$forum['parentid']}"]["{$forum['displayorder']}"]["{$forum['forumid']}"] = $forum;
        }
        unset($forum);
        $vbulletin->db->free_result($forums);
    }
    if (is_array($vbulletin->iforumcache["{$parentid}"])) {
        foreach ($vbulletin->iforumcache["{$parentid}"] as $x) {
            foreach ($x as $forumid => $forum) {
                ($hook = vBulletinHook::fetch_hook('archive_forum')) ? eval($hook) : false;
                if (!($vbulletin->userinfo['forumpermissions']["{$forumid}"] & $vbulletin->bf_ugp_forumpermissions['canview']) and ($vbulletin->forumcache["{$forumid}"]['showprivate'] == 1 or !$vbulletin->forumcache["{$forumid}"]['showprivate'] and !$vbulletin->options['showprivateforums'])) {
                    continue;
                } else {
                    if ($forum['cancontainthreads'] or $forum['link'] !== '') {
                        $forum_link = '<a href="' . $vbulletin->options['bburl'] . '/archive/index.php' . (SLASH_METHOD ? '/' : '?') . "f-{$forumid}.html\">";
                    } else {
                        $forum_link = "<a style=\"font-weight:bold\">";
                    }
                    $output .= "{$indent}\t<li>{$forum_link}{$forum['title_clean']}</a>" . print_archive_forum_list($forumid, "\t{$indent}") . "</li>\n";
                }
            }
        }
        // only add to $output if there were actual forums
        if (!empty($output)) {
            $output = "\n{$indent}<ul>\n" . $output . "{$indent}</ul>\n{$indent}";
        }
    }
    return $output;
}
Beispiel #2
0
function print_archive_forum_list($parentid = -1, $indent = '')
{
	global $vbulletin;

	$output = '';

	if (empty($vbulletin->iforumcache))
	{
		$forums = $vbulletin->db->query_read_slave("
			SELECT forumid, title, link, parentid, displayorder, title_clean, description, description_clean,
			(options & " . $vbulletin->bf_misc_forumoptions['cancontainthreads'] . ") AS cancontainthreads
			FROM " . TABLE_PREFIX . "forum AS forum
			WHERE displayorder <> 0 AND
			password = '' AND
			(options & " . $vbulletin->bf_misc_forumoptions['active'] . ")
			ORDER BY displayorder
		");
		$vbulletin->iforumcache = array();
		while ($forum = $vbulletin->db->fetch_array($forums))
		{
			$vbulletin->iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
		}
		unset($forum);
		$vbulletin->db->free_result($forums);
	}

	if (is_array($vbulletin->iforumcache["$parentid"]))
	{
		foreach($vbulletin->iforumcache["$parentid"] AS $x)
		{
			foreach($x AS $forumid => $forum)
			{
				($hook = vBulletinHook::fetch_hook('archive_forum')) ? eval($hook) : false;

				if (!($vbulletin->userinfo['forumpermissions']["$forumid"] & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$forumid"]['showprivate'] == 1 OR (!$vbulletin->forumcache["$forumid"]['showprivate'] AND !$vbulletin->options['showprivateforums'])))
				{
					continue;
				}
				else
				{
					if ($forum['cancontainthreads'] OR $forum['link'] !== '')
					{
						$forum_link = '<a href="' . $vbulletin->options['bburl'] . '/archive/index.php' .
							(SLASH_METHOD ? '/' : '?') . "f-$forumid.html" . ARCHIVE_SESSION_URL . "\">";
					}
					else
					{
						$forum_link = "<a style=\"font-weight:bold\">";
					}
					$output .= "$indent\t<li>$forum_link$forum[title_clean]</a>" . print_archive_forum_list($forumid, "\t$indent") . "</li>\n";
				}
			}
		}
		// only add to $output if there were actual forums
		if (!empty($output))
		{
			$output = "\n$indent<ul>\n" . $output . "$indent</ul>\n$indent";
		}
	}

	return $output;
}
Beispiel #3
0
            $thread['prefix_plain_html'] = $thread['prefixid'] ? htmlspecialchars($vbphrase["prefix_{$thread['prefixid']}_title_plain"]) : '';
            ($hook = vBulletinHook::fetch_hook('archive_forum_thread')) ? eval($hook) : false;
            if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])) {
                $output .= "\t<li>{$thread['prefix_plain_html']} {$thread['title']}" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
            } else {
                if ($vbulletin->options['archive_threadtype'] or $pda) {
                    $output .= "\t<li>{$thread['prefix_plain_html']} <a href=\"" . $vbulletin->options['bburl'] . '/archive/index.php' . (SLASH_METHOD ? '/' : '?') . "t-{$thread['threadid']}.html\">{$thread['title']}</a>" . iif($pda, " <i>(" . construct_phrase($vbphrase['x_replies'], $thread['replycount']) . ")</i>") . "</li>\n";
                } else {
                    $output .= "\t<li>{$thread['prefix_plain_html']} <a href=\"" . $vbulletin->options['bburl'] . "/showthread.php?t={$thread['threadid']}\">{$thread['title']}</a></li>\n";
                }
            }
        }
        $output .= "</ol>\n</div>\n";
    } else {
        $output .= "<div id=\"content\">\n";
        $output .= print_archive_forum_list($f);
        $output .= "</div>\n";
    }
}
// ********************************************************************************************
// display thread
if ($do == 'thread') {
    if (!$vbulletin->options['archive_threadtype']) {
        // if we are not using the archive threadtype, invisibly redirect to the full thread view
        exec_header_redirect($vbulletin->options['bburl'] . "/showthread.php?" . $vbulletin->session->vars['sessionurl_js'] . "t={$threadinfo['threadid']}");
    }
    if ($vbulletin->options['wordwrap'] != 0) {
        $threadinfo['title'] = fetch_word_wrapped_string($threadinfo['title']);
    }
    $threadinfo['title'] = fetch_censored_text($threadinfo['title']);
    $output .= print_archive_navigation($foruminfo, $threadinfo);