Chris Blount
12-06-2005, 05:18 PM
Sorry if this is a stupid question (and yes, I did do a search) but I have been having a heck of a time trying to add a forum jump on my VBAdvanced portal. I tried placing $forumjump in various places in the main template with no success. Am I missing a step?
Thanks for the help.
Drago912
12-07-2005, 11:39 AM
place this code in your navbar template:
<td class="vbmenu_control"><a href="YOUR SITE URL/forum/index.php?$session[sessionurl]">Forum</a></td>
This will add a forum link at the top in your navbar.
Chris Blount
12-07-2005, 12:31 PM
place this code in your navbar template:
<td class="vbmenu_control"><a href="YOUR SITE URL/forum/index.php?$session[sessionurl]">Forum</a></td>
This will add a forum link at the top in your navbar.Hi Drago,
Thanks for the response but that's not what I'm asking. I would like to place an actual forum jump on the portal. It's the dropdown list that shows all forums and gives the user the ability to select which forum to go to directly. I tried the forum list module but we have too many forums to use that.
Drago912
12-07-2005, 12:33 PM
oh crap....sorry bout that I misread your post.........IM not sure how to do that....sorry.
Brian
12-07-2005, 02:40 PM
Look in your includes/vba_cmps_inlcude_bottom.php file for this code:
eval('print_output("' . fetch_template('adv_portal') . '");');
Add this right above it:
construct_forum_jump();
And then you should be able to add the variable $forumjump somewhere in your adv_portal template.
Chris Blount
12-11-2005, 09:18 AM
Look in your includes/vba_cmps_inlcude_bottom.php file for this code:
eval('print_output("' . fetch_template('adv_portal') . '");');
Add this right above it:
construct_forum_jump();
And then you should be able to add the variable $forumjump somewhere in your adv_portal template.Hi Brian,
Thanks for the help. That didn't seem to work. Any ideas?
CheapyD
03-15-2006, 10:30 AM
I'm looking for this too...
G3MM4
04-20-2006, 02:33 AM
Yes, I'm looking for this as well, if anyone can provide a solution.
Zachery
04-20-2006, 06:47 AM
Did anyone try brians suggestion?
G3MM4
04-20-2006, 08:41 AM
Someone did, and they said it didn't work. Will try it on mine anyway to see for myself.
G3MM4
04-20-2006, 08:52 AM
Nope. It doesn't work for some reason. I followed Brian's suggestion (for some reason the code he put didn't match but I did a partial Find and Replace search).
Here's my file content, hopefully I put the code in the right place:
<?php
// ++=========================================================================++
// || vBadvanced CMPS v2.1.0 (vB 3.5) - 4315
// || © 2003-2004 vBadvanced.com & PlurPlanet, LLC - All Rights Reserved
// || This file may not be redistributed in whole or significant part.
// || http://vbadvanced.com
// || Downloaded 20:56, Thu Apr 13th 2006
// ||
// ++ ========================================================================++
error_reporting(E_ALL & ~E_NOTICE);
// ######################## Construct Replacement Array #######################
if (!function_exists('construct_replacement_array'))
{
function construct_replacement_array($optreplace, $replacearray)
{
global $vbulletin;
if (!$replacearray)
{
$replacearray = array();
}
if (!empty($optreplace))
{
foreach ($optreplace AS $filename)
{
if (trim($filename))
{
$replacearray['find'][] = '"' . $filename;
$replacearray['replace'][] = '"' . $vbulletin->options['bburl'] . '/' . $filename;
}
}
}
return array_merge($optreplace, $replacearray);
}
}
$style['css'] = str_replace('"clientscript', '"' . $vbulletin->options['bburl'] . '/clientscript', $style['css']);
$vbulletin->templatecache['headinclude'] = str_replace(
array(
'"clientscript',
'url(images/',
'name="generator" content="',
'"external.php'
),
array(
'"' . $vbulletin->options['bburl'] . '/clientscript',
'url(' . $vbulletin->options['bburl'] . '/images/',
'name="generator" content="vBadvanced, ',
'"' . $vbulletin->options['bburl'] . '/external.php'
),
$vbulletin->templatecache['headinclude']
);
// $navbar replacement
if (THIS_SCRIPT == 'adv_index')
{
$navreplacearray = explode("\r\n", $vba_options['global_navbar_replace']);
$navreplace['find'] = array(
'"clientscript',
'\'misc.php',
'>" . $GLOBALS[\'vbulletin\']->options[\'bbtitle\'] . "',
'$GLOBALS[\'vbulletin\']->options[\'forumhome\'] . ".php'
);
$navreplace['replace'] = array(
'"' . $vbulletin->options['bburl'] . '/clientscript',
'\'' . $vbulletin->options['bburl'] . '/misc.php',
'>" . $GLOBALS[\'vbulletin\']->options[\'hometitle\'] . "',
'$vba_options[\'portal_homeurl\'] . "'
);
$navreplace = construct_replacement_array($navreplacearray, $navreplace);
$vbulletin->templatecache['navbar'] = str_replace($navreplace['find'], $navreplace['replace'], $vbulletin->templatecache['navbar']);
$vbphrase['private_messages_nav'] = str_replace('"private.php', '"' . $vbulletin->options['bburl'] . '/private.php', $vbphrase['private_messages_nav']);
}
// $footer replacement
$footerreplacearray = explode("\r\n", $vba_options['global_footer_replace']);
if ($vba_options['portal_replaceadmin'])
{
$footerreplace['find'] = array('$admincpdir/index.php');
$footerreplace['replace'] = array('$admincpdir/vba_cmps_admin.php');
}
$footerreplace = construct_replacement_array($footerreplacearray, $footerreplace);
$vbulletin->config['Misc']['admincpdir'] = $vbulletin->options['bburl'] . '/' . $vbulletin->config['Misc']['admincpdir'];
$vbulletin->config['Misc']['modcpdir'] = $vbulletin->options['bburl'] . '/' . $vbulletin->config['Misc']['modcpdir'];
if ($vbulletin->options['contactuslink'] == 'sendmessage.php')
{
$vbulletin->options['contactuslink'] = $vbulletin->options['bburl'] . '/sendmessage.php';
}
$vbulletin->templatecache['pm_popup_script'] = str_replace('$pmpopupurl', $vbulletin->options['bburl'] . '/$pmpopupurl', $vbulletin->templatecache['pm_popup_script']);
$vbulletin->templatecache['footer'] = $vbulletin->templatecache['adv_portal_footer'] . str_replace($footerreplace['find'], $footerreplace['replace'], $vbulletin->templatecache['footer']) . '<' . '!' . '-- ' . 'P' . 'ow' . chr(101) . 'r' . chr(101) . chr(100) . ' ' . 'b' . trim($xmsquar) . 'y v' . chr(98) . 'a' . chr(100) . 'v' . '' . 'a' . '' . 'nc' . chr(101) . chr(100) . ' -->';
// $header replacement
$headerreplacearray = explode("\r\n", $vba_options['global_header_replace']);
$headerreplace['find'] = array();
$headerreplace['replace'] = array();
$headerreplace = construct_replacement_array($headerreplacearray, $headerreplace);
$vbulletin->templatecache['header'] = str_replace($headerreplace['find'], $headerreplace['replace'], $vbulletin->templatecache['header']);
// Make sure the page exists and we have permission to view it
if (!$allowview OR !$pages['pageid'])
{
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
eval('$spacer_open = "' . fetch_template('spacer_open') . '";');
eval('$spacer_close = "' . fetch_template('spacer_close') . '";');
eval('$gobutton = "' . fetch_template('gobutton') . '";');
if (!$pages['pageid'])
{
eval(standard_error(fetch_error('invalid_page_specified')));
}
else
{
print_no_permission();
}
}
$pages['advanced'] = unserialize($pages['advanced']);
$pagecache = unserialize($vbulletin->adv_portal_page);
// ########################### Strip Body Tag #################################
function strip_body_tags($content)
{
global $header, $navbar, $footer, $headinclude;
$bodytag = strpos($content, '<body');
if ($bodytag)
{
$bodycut = strpos($content, '>', $bodytag);
$content = substr($content, $bodycut + 1);
}
return str_replace(array($header, $navbar, $footer, $headinclude, '</body>', '</html>') , '', $content);
}
// ###################### Function to Print The Page Out ######################
function print_portal_output(&$cmpsoutput, $nonindex = false, $frompout = false)
{
global $pages, $stylevar, $headinclude, $header, $footer, $vbulletin, $vbphrase, $stylevar, $show, $pmbox, $vba_options, $vba_style, $navbar, $cusid, $_REQUEST, $gobutton, $pagetitle, $pagecache, $db;
if ($vba_options['portal_outputglobals'])
{
foreach (explode("\r\n", $vba_options['portal_outputglobals']) AS $glob)
{
global ${$glob};
}
}
if (!$pagetitle AND $pages['name'] != 'home')
{
$pagetitle = $pages['title'];
}
if ($nonindex)
{
$cmpsoutput["$cusid"]['content'] = strip_body_tags($nonindex);
}
if (!empty($cmpsoutput))
{
function order_mods($a, $b)
{
return ($a['displayorder'] < $b['displayorder']) ? -1 : 1;
}
usort($cmpsoutput, 'order_mods');
$show['right_column'] = false;
$show['left_column'] = false;
$show['center_column'] = false;
// Sort out the sides.
foreach ($cmpsoutput AS $key => $blocks)
{
switch ($blocks['column'])
{
case 1:
$home['centerblocks'] .= $blocks['content'];
$show['center_column'] = true;
break;
case 0:
$home['leftblocks'] .= $blocks['content'];
$show['left_column'] = true;
break;
case 2:
$home['rightblocks'] .= $blocks['content'];
$show['right_column'] = true;
break;
}
}
}
if ($vba_style['portal_shownavbar'] AND empty($navbar))
{
if ($pages['name'] != 'home')
{
if ($pages['parentlist'])
{
foreach (array_reverse(explode(',', $pages['parentlist'])) AS $key => $parent)
{
if ($parent != $pages['pageid'])
{
$navpagename = $pagecache["$parent"]['name'];
$navbits["$vba_options[portal_homeurl]?$vba_options[portal_pagevar]=$navpagename"] = $pagecache["$parent"]['title'];
}
}
}
$navbits[''] = $pagetitle;
}
if ($navbits)
{
$navbits = construct_navbits($navbits);
}
eval('$navbar = "' . fetch_template('navbar') . '";');
}
construct_forum_jump();
eval('print_output("' . fetch_template('adv_portal') . '");');
}
$iconcache = unserialize($vbulletin->iconcache);
$attachmentcache = unserialize($vbulletin->attachmentcache);
include_once('./includes/class_bbcode.php');
include_once('./includes/functions_forumdisplay.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$bbcode_parser->tag_list['no_option']['thread']['html'] = str_replace('"showthread.php', '"' . $vbulletin->options['bburl'] . '/showthread.php', $bbcode_parser->tag_list['no_option']['thread']['html']);
$bbcode_parser->tag_list['no_option']['post']['html'] = str_replace('"showthread.php', '"' . $vbulletin->options['bburl'] . '/showthread.php', $bbcode_parser->tag_list['no_option']['thread']['html']);
$bbcode_parser->tag_list['option']['thread']['html'] = str_replace('"showthread.php', '"' . $vbulletin->options['bburl'] . '/showthread.php', $bbcode_parser->tag_list['option']['thread']['html']);
$bbcode_parser->tag_list['option']['post']['html'] = str_replace('"showthread.php', '"' . $vbulletin->options['bburl'] . '/showthread.php', $bbcode_parser->tag_list['option']['thread']['html']);
// Get Advanced Page Options
if (!empty($pages['advanced']))
{
foreach ($pages['advanced'] AS $sgroup => $sgvalue)
{
foreach ($sgvalue AS $vname => $valu)
{
if ($sgroup == 'adv_portal_main')
{
$vba_options["$vname"] = $valu;
}
else if ($sgroup == 'adv_portal_style')
{
$vba_style["$vname"] = $valu;
}
else
{
$cmps_options["$sgroup"]["$vname"] = $valu;
}
}
}
}
// ######################### Forum Permissions #########################
require_once('./includes/functions_forumlist.php');
cache_moderators();
$adv_forumperms = array();
foreach ($vbulletin->forumcache AS $fid => $finfo)
{
$frmperms["$finfo[forumid]"] = fetch_permissions($finfo['forumid']);
if (!($frmperms["$finfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($frmperms["$finfo[forumid]"] & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND $finfo['forumid'])
{
$adv_forumperms[] = $finfo['forumid'];
}
}
if (!empty($adv_forumperms))
{
$forumperms_query = 'AND thread.forumid NOT IN(' . implode(',', $adv_forumperms) .')';
}
unset($forum, $fperms);
$donenewsids = array();
// Get tachied / ignored users
require_once('./includes/functions_bigthree.php');
$ignusers = fetch_coventry();
if ($vbulletin->userinfo['ignorelist'])
{
$ignusers = array_merge($ignusers, explode(' ', $vbulletin->userinfo['ignorelist']));
}
if (!empty($ignusers))
{
$ignusers = implode(',', $ignusers);
}
// Process Active Modules
if (!empty($modules))
{
foreach ($modules AS $modid => $mods)
{
$home["$mods[modid]"]['displayorder'] = $mods['displayorder'];
$home["$mods[modid]"]['column'] = $mods['modcol'];
if ($debug AND $_REQUEST['explain'])
{
$sttime = explode(' ', microtime());
}
if ($stylevar['oldcellpadding'])
{
$stylevar['cellpadding'] = $stylevar['oldcellpadding'];
$stylevar['oldcellpadding'] = '';
}
$mod_options = $cmps_options["adv_portal_$mods[identifier]"];
$bgclass = exec_switch_bg();
$getbgrow = $bgclass;
$mods['collapse'] = $mods['modid'];
$show['tablerow'] = false;
if ($mods['link'])
{
eval('$mods[\'link\'] = "' . addslashes($mods['link']) . '";');
}
switch ($mods['inctype'])
{
case 'php_file':
if ($mods['cleanoutput'])
{
ob_start();
require('./modules/' . $mods['filename']);
$home["$mods[modid]"]['content'] = ob_get_contents();
ob_end_clean();
}
else
{
require('./modules/' . $mods['filename']);
}
break;
case 'template':
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_' . $mods['filename']) . '";');
break;
case 'bb_code':
$home["$mods[modid]"]['content'] = $mods['code_parsed'];
$show['tablerow'] = true;
break;
// Custom page content
case 'custom':
$cusid = $mods['modid'];
$mods['useshell'] = $pages['useshell'];
$mods['title'] = $pages['custom_title'];
$mods['colspan'] = $pages['colspan'];
switch ($pages['type'])
{
// PHP File page
case 'php_file':
ob_start();
require($pages['template']);
$home["$mods[modid]"]['content'] = ob_get_contents();
ob_end_clean();
break;
// HTML File Page
case 'html_file':
if ($handle = fopen($pages['template'], 'r'))
{
$home["$mods[modid]"]['content'] = strip_body_tags(fread($handle, filesize($pages['template'])));
fclose($handle);
}
break;
// Template page
case 'template':
if ($pages['template'])
{
eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template($pages['template']) . '";');
$home["$mods[modid]"]['content'] = strip_body_tags($home["$mods[modid]"]['content']);
}
break;
// BB code page
case 'bb_code':
$home["$mods[modid]"]['content'] = $bbcode_parser->do_parse($pages['template'], $cmps_options['custompage']['allow_html'], $cmps_options['custompage']['allow_smilies'], 1, $cmps_options['custompage']['allow_image_code'], 1);
break;
}
$show['tablerow'] = true;
break;
}
if ($home["$mods[modid]"]['content'])
{
if ($mods['useshell'] AND !$mods['noshell'])
{
if ($mods['formcode'])
{
eval('$mods[\'formcode\'] = "' . addslashes($mods['formcode']) . '";');
}
$modcollapse = $vbcollapse["collapseobj_module_" . $mods['collapse'] . ""];
$modimgcollapse = $vbcollapse["collapseimg_module_" . $mods['collapse'] . ""];
$modulehtml = $home["$mods[modid]"]['content'];
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_module_shell') . '";');
}
}
if ($debug AND $_REQUEST['explain'])
{
$finishtime = explode(' ', microtime());
echo "\r\n\r\n<b>Processed Module: " . $mods['title'] . '</b><br />Time Before: ' . $sttime[0] . '<br />Time After:' . $finishtime[0] . '<br />Time Taken: ' . ($finishtime[0] - $sttime[0]) . "\r\n\r\n";
}
}
}
unset($modules, $forumperms, $mods);
?>
chrisj8221
07-24-2006, 10:41 PM
I know this is an older post - but did anyone ever come up with a solution?
utw-Mephisto
07-25-2006, 01:38 AM
I wish .. I was also looking for a forumjump ..
Maybe I'll ask on vb.com how to move it .. once I know this we might be able to get it on vba too ..
utw-Mephisto
07-25-2006, 07:36 AM
ok, found it ..
I installed this plugin :
http://www.vbulletin.org/forum/showthread.php?t=118994
And changed the hook to global_start
The you can use $forumstart anywhere on the forum, also in the portal ..
chrisj8221
07-27-2006, 09:23 PM
thanks - will try that tonight!
chris
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.