Log in

View Full Version : Custom redirect from non-VB quick reply


kkiely
08-20-2005, 02:12 AM
OK, this is what I have. I have a particular thread which shows up on a non-BV page. I also have a quick reply box set up on the same non-VB page which is set to reply to that particular thread. When I reply to the thread it redirects me to the last post in the thread (which it is supposed to do). But I want it to redirect back to the non-VB page I was on. I tried to code it like this:

On the quick reply form on the non-VB page I created this bold line:

<input type=hidden name=fromquickreply value=1 />
<input type=hidden name=s value=$session[sessionhash] />
<input type=hidden name=do value=postreply />
<input type=hidden name=nonvb value=1>
<input type=hidden name=t value=36896 id=qr_threadid />
<input type=hidden name=p value=$qrpostid id=qr_postid />
<input type=hidden name=parseurl value=1 />
<input type=hidden name=clickedelm value= />
<input type=submit class=button value=Submit Comment accesskey=s title=(Alt + S) name=sbutton tabindex=2 onclick=this.form.clickedelm.value=this.value />
<input type=submit class=button value=Preview accesskey=x title=(Alt + X) name=preview tabindex=3 id=qr_preview onclick=this.form.clickedelm.value = this.value />

then made the newreply.php changed to this:

if ($newpost['visible'] && $nonvb=1)
{
$url = "http://www.mysite.com/nonvbpage.php";
}
else
{
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]&amp;goto=postid";
// what was the line above supposed to do? I have changed it to the line below instead. - KD
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]#post$newpost[postid]";
}

eval(print_standard_redirect('redirect_postthanks' ));

When I test it by posting from my non-VB page it redirects me back to the non-VB page like it should. But when I try reply to a post from the forum - ANY post - it also redirects me back to the non-VB page. I don't know much about coding so I'm sure I must be doing something wrong.

=========================================

REQUEST #2: How do I set the redirect page to a variable? Something like this:

[CODE]if ($newpost['visible'] && $nonvb=1)
{
$url = "http://www.mysite.com/$nonvbpage.php";
}
else
{
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]&amp;goto=postid";
// what was the line above supposed to do? I have changed it to the line below instead. - KD
$url = "showthread.php?$session[sessionurl]p=$newpost[postid]#post$newpost[postid]";
}


and then putting a line like this:

<input type=hidden name=fromquickreply value=1 />
<input type=hidden name=s value=$session[sessionhash] />
<input type=hidden name=do value=postreply />
<input type=hidden name=nonvb value=1>
<input type=hidden name=$nonvpage value=http://www.mysite.com/pageichoose.php>
<input type=hidden name=t value=36896 id=qr_threadid />
<input type=hidden name=p value=$qrpostid id=qr_postid />
<input type=hidden name=parseurl value=1 />
<input type=hidden name=clickedelm value= />
<input type=submit class=button value=Submit Comment accesskey=s title=(Alt + S) name=sbutton tabindex=2 onclick=this.form.clickedelm.value=this.value />
<input type=submit class=button value=Preview accesskey=x title=(Alt + X) name=preview tabindex=3 id=qr_preview onclick=this.form.clickedelm.value = this.value />

Paprika
08-20-2005, 06:16 PM
For request one, the first thing I'd try would be to remove ' $newpost['visible'] && '

See if that does what you need. Not totally sure here but I'm a bit tired too and don't really know.