combs |
05-06-2009 12:40 PM |
Change Links of a Directory Problem
So I installed this Mod: https://vborg.vbsupport.ru/showthread.php?t=204120 It's the Bloglike Homepage.
I Love it. Except it is my homepage at bbwforums.net and my forum is at bbwforums.net/forum . So when you go to the links, they are all linking to pages without the /forum which is annoying because that's not where the forum should be.
I just wanna change it to change all the links on the right, and in the login, and in the nav to go to /forum instead.
here is the Index page code.
Code:
<?php
//###############################################
//////////////////////////// Blog-Like homepage ////////////////////////
//////----------------------------- by ProvB --------------------\\\\\\\\\\
/////------------------------ ------ http://www.provb.org ---------------------\\\\\\\\\\\\
///////////////////////////////////////////////////////////////////////
//###############################################
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'provb_blhome');
define('CSRF_PROTECTION', true);
define('CSRF_SKIP_LIST', '');
// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array('provb_blhome');
// get special data templates from the datastore
$specialtemplates = array(
);
// pre-cache templates used by all actions
$globaltemplates = array(
'provb_blhome',
'provb_blhome_attachbit',
'provb_blhome_featured_post',
'provb_blhome_latest_memberbit',
'provb_blhome_latest_threadbit',
'provb_blhome_navforum',
'provb_blhome_navforumbit_level1_nopost',
'provb_blhome_navforumbit_level1_post',
'provb_blhome_navforumbit_level2_post',
'provb_blhome_navforumbit_level2_nopost',
'provb_blhome_navforumbit_level3_post',
'forumhome_subforumbit_post',
'forumhome_subforumbit_nopost',
'forumhome_subforumseparator_post',
'forumhome_subforumseparator_nopost',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// Random Stuff
require_once(DIR . '/includes/class_bbcode.php');
$bbcode_parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
// ######################### REQUIRE BACK-END ############################
if (empty($_REQUEST['do']))
{
$_REQUEST['do'] = 'main';
}
$blhome_file = explode('/', $_SERVER['SCRIPT_NAME']);
$blhome_file = str_replace('.php', '', $blhome_file[1]);
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if ($_REQUEST['do'] == 'main'){
if($vbulletin->options['provb_blhome_forumside_mode']){
$vbulletin->input->clean_array_gpc('r', array(
'f' => TYPE_UINT
));
$forumid = $vbulletin->GPC['f'];
} else {
$forumid = 0;
}
// Excluded forums?
$provb_blhome_excluded_forums = $vbulletin->options['provb_blhome_excluded_forums'];
if(!$provb_blhome_excluded_forums){ $provb_blhome_excluded_forums = 0; }
$provb_blhome_excluded_forums = explode(",", $provb_blhome_excluded_forums);
// Get Latest Threads
$provb_blhome_latest_threads_get = $vbulletin->db->query_read("SELECT post.postid, thread.firstpostid, thread.threadid, thread.title, thread.views, thread.replycount, thread.postusername, thread.postuserid, thread.dateline
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "post AS post ON(post.postid = thread.firstpostid)
WHERE thread.forumid NOT IN ('" . implode("','",$provb_blhome_excluded_forums) . "') AND thread.visible = '1'
ORDER BY thread.dateline DESC
LIMIT " . $vbulletin->options['provb_blhome_recthreads'] . "
");
// Process Latest Threads
while($thread = $vbulletin->db->fetch_array($provb_blhome_latest_threads_get)){
eval('$provb_blhome_latest_threads .= "'.fetch_template('provb_blhome_latest_threadbit').' ";');
}
// Fitler criteria
if(!$forumid){
$provb_blhome_featuredposts_apostrophies = "'" . str_replace(',', '\',\'', $vbulletin->options['provb_blhome_featuredposts']) . "'";
$featured_post_criteria = "post.postid IN (" . $vbulletin->options['provb_blhome_featuredposts'] . ") ORDER BY FIELD(post.postid," . $provb_blhome_featuredposts_apostrophies . ")";
} else {
if(!$vbulletin->options['provb_blhome_featuredpost_mode']){
$certainposts = "AND post.postid = thread.firstpostid";
}
$featured_post_criteria = "thread.forumid = '$forumid' AND thread.forumid NOT IN ('" . implode("','",$provb_blhome_excluded_forums) . "') AND thread.visible = '1' $certainposts
ORDER BY post.dateline DESC
LIMIT " . $vbulletin->options['provb_blhome_forumside_max'] . "";
}
if($vbulletin->options['provb_blhome_featuredposts']){
// Get Featured Post
$provb_blhome_featured_post_get = $vbulletin->db->query_read("SELECT forum.description_clean AS forumdesc_clean, forum.title AS forum_title, forum.forumid, post.userid, post.threadid, post.postid, user.avatarrevision, post.title, post.pagetext, post.dateline, user.username, user.joindate " . iif($vbulletin->options['avatarenabled'], ',avatar.avatarpath, NOT ISNULL(customavatar.userid) AS hascustomavatar, customavatar.dateline AS avatardateline,customavatar.width_thumb AS avwidth,customavatar.height_thumb AS avheight') . "
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON(thread.threadid = post.threadid)
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON(forum.forumid = thread.forumid)
" . iif($vbulletin->options['avatarenabled'], "LEFT JOIN " . TABLE_PREFIX . "avatar AS avatar ON(avatar.avatarid = user.avatarid)
LEFT JOIN " . TABLE_PREFIX . "customavatar AS customavatar ON(customavatar.userid = user.userid)") . "
WHERE " . $featured_post_criteria . "
");
// Process Featured Post
while($post = $vbulletin->db->fetch_array($provb_blhome_featured_post_get)){
$post[date] = vbdate($vbulletin->options['dateformat'], $post[dateline]);
$post['avatarurl'] = $vbulletin->options['bburl'] . '/';
// get avatar
if ($post['avatarid'])
{
$post['avatarurl'] = $post['avatarpath'];
}
else
{
if ($post['hascustomavatar'] AND $vbulletin->options['avatarenabled'])
{
if ($vbulletin->options['usefileavatar'])
{
$post['avatarurl'] .= $vbulletin->options['avatarurl'] . '/avatar' . $post['userid'] . '_' . $post['avatarrevision'] . '.gif';
}
else
{
$post['avatarurl'] .= 'image.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $post['userid'] . '&dateline=' . $post['avatardateline'];
}
if ($post['avwidth'] AND $post['avheight'])
{
$post['avwidth'] = 'width="' . $post['avwidth'] . '"';
$post['avheight'] = 'height="' . $post['avheight'] . '"';
}
else
{
$post['avwidth'] = '';
$post['avheight'] = '';
}
}
else
{
$post['avatarurl'] .= 'images/misc/provb_blhome_noav.gif';
}
}
$post[message] = $parser->do_parse($post[pagetext], $do_html, $do_smilies, 1, 1, 1, $cachable);
exec_switch_bg();
$forum_title = $post[forum_title];
$totalfeatured++;
eval('$provb_blhome_featured_post .= "'.fetch_template('provb_blhome_featured_post').' ";');
}
}
// Get Forums List
require_once(DIR . '/forum/includes/functions_forumlist.php');
if (empty($vbulletin->forumcache)){
cache_ordered_forums(0, 1);
}
foreach($vbulletin->forumcache AS $provb_blhome_navforum){
// Set $forum
$forum = $provb_blhome_navforum;
$provb_blhome_navforumid = $forum[forumid];
$forumdepth = $forum['depth'] + 1;
if($forumdepth < 3){
$provb_blhome_navforum_perms = $vbulletin->userinfo['forumpermissions']["$provb_blhome_navforumid"];
if (!($provb_blhome_navforum_perms & $vbulletin->bf_ugp_forumpermissions['canview']) AND ($vbulletin->forumcache["$provb_blhome_navforumid"]['showprivate'] == 1 OR (!$vbulletin->forumcache["$provb_blhome_navforumid"]['showprivate'] AND !$vbulletin->options['showprivateforums'])))
{ // no permission to view current forum
$provb_blhome_excluded_forums[] = "$provb_blhome_navforumid";
continue;
}
if(!($provb_blhome_navforum_perms & $vbulletin->bf_ugp_forumpermissions['canviewthreads'])){
$provb_blhome_excluded_forums[] = "$provb_blhome_navforumid";
}
if (!$forum['displayorder'] OR !($forum['options'] & $vbulletin->bf_misc_forumoptions['active']) OR in_array($forum['forumid'], $provb_blhome_excluded_forums))
{
// forum not active
$provb_blhome_excluded_forums[] = "$provb_blhome_navforumid";
continue;
}
if (($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads']))
{ // get appropriate suffix for template name
$cancontainthreads = 1;
$tempext = '_post';
}
else
{
$tempext = '_nopost';
}
$show['forumdescription'] = ($forum['description'] != '' ? true : false);
if($forum['depth']){
$forum_subforums = construct_subforum_bit($provb_blhome_navforumid, ($forum['options'] & $vbulletin->bf_misc_forumoptions['cancontainthreads'] ) );
}
if(!empty($forum_subforums)){ $show['this_subforums'] = 1; } else { $show['this_subforums'] = 0; }
global $provb_blhome_navforumbit;
eval('$provb_blhome_navforumbit .= "' . fetch_template("provb_blhome_navforumbit_level$forumdepth$tempext") . '";');
}
}
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template("provb_blhome") . '");');
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 11:07, Thu Sep 4th 2008
|| # CVS: $RCSfile$ - $Revision: 26941 $
|| ####################################################################
\*======================================================================*/
?>
Do you see anything I can do? The ony thing I can think of would be to move the entire forum back to the main directory, but I don't wanna do this as i've already switched it like 5 times.
|