PDA

View Full Version : Help! Redirect to showthread from private.php


fairydust
02-18-2009, 01:04 PM
I am trying to write a mod to redirect to a particular thread i.e. showthread.php after I send a private message so using the private_insertpm_complete hook.

This does not work:

$vbulletin->url = 'showthread.php?t=2' . $vbulletin->session->vars['sessionurl'];
eval(print_standard_redirect('This is my message', false, true));


Yet I can view the thread when I manually paste the Url into the address bar of my website.

However

This redirect does work


$vbulletin->url = 'index.php' . $vbulletin->session->vars['sessionurl'];
eval(print_standard_redirect('This is my message', false, true));


Any suggestions as to why it does not redirect to the showthread.php URL??

Marco van Herwaarden
02-18-2009, 02:05 PM
Try using the session URL as the first parameter in the URL.

fairydust
02-18-2009, 02:30 PM
I changed:

$vbulletin->url = 'showthread.php?t=2' . $vbulletin->session->vars['sessionurl'];
eval(print_standard_redirect('This is my message', false, true));

to


$vbulletin->url = $vbulletin->session->vars['sessionurl']."showthread.php?t=2";
eval(print_standard_redirect('This is my message', false, true));

It still did not work, it takes ages redirecting and then I just get can IE error page: Internet explorer cannot display the page.

However the URL is correct: http://localhost/testvb/showthread.php?t=2

When I refresh the page manually the page appears.

Dismounted
02-19-2009, 04:24 AM
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . 't=2';

fairydust
02-19-2009, 09:06 AM
Still does not work. On the redirecting page, if I manually click "Click here if your browser does not automatically" it brings me to the correct page.

It just does not redirect me automatically to the showthread page

Any other suggestions would be appreciated.

fairydust
02-21-2009, 10:56 AM
Anyone any suggested solutions?

Lynne
02-21-2009, 03:23 PM
Have you looked at the page source of the page that says "Click here if your browser does not automatically" to see what is in the head for redirecting?