I am trying to change the page a user is sent to after replying to a thread.
With help from members Merk and Andreas I have located the bit of the newreply.php file which I need to change, in particular this bit:
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]#post$newpost[postid]";
which is half way ish down this bit of code:
PHP Code:
if (strtolower($vbulletin->userinfo['lang_charset']) == 'iso-8859-1')
{
$vbulletin->userinfo['lang_charset'] = 'windows-1252';
}
$db->close();
@header('Content-Type: text/html' . iif($vbulletin->userinfo['lang_charset'] != '', '; charset=' . $vbulletin->userinfo['lang_charset']));
echo "<!-- postbit ok --><!-- time " . TIMENOW . " -->" . process_replacement_vars($postbits);
// #############################################################################
// #############################################################################
// #############################################################################
}
else
{
if ($newpost['visible'] OR can_moderate($foruminfo['forumid'], 'canmoderateposts'))
{
if ($threadview < $threadinfo['lastpost'])
{
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]&posted=1#post$newpost[postid]";
}
else
{
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "p=$newpost[postid]#post$newpost[postid]";
}
$forceredirect = false;
}
else
{
$forceredirect = true;
$vbulletin->url = 'forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$foruminfo[forumid]";
}
($hook = vBulletinHook::fetch_hook('newreply_post_complete')) ? eval($hook) : false;
eval(print_standard_redirect('redirect_postthanks', true, $forceredirect));
}
} // end if
}
As you can see the hook is located towards the bottom and I created a plug-in for that location and simply entered:
$vbulletin->url = 'my own url';
in the php code bit and it works fine.
However I am worried about the other bits of code in the original file above the hook location, so am wondering whether I need to add any of that in my plug-in? Or will what I have done only effect the line I want it to?
Sorry if its obvious!