vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Redirect user back to the homepage after submitting post? (https://vborg.vbsupport.ru/showthread.php?t=195686)

peolit 11-07-2008 04:25 PM

Redirect user back to the homepage after submitting post?
 
Hi there...
I'm trying to make it so that when a user hits the 'post reply'or 'submit new thread' buttons, they wil automatically be redirected back the the forum index.

I hope that makes sense...can anyone help me?
Thanks

UKBusinessLive 11-07-2008 05:15 PM

If it is a form you're using, you can use

PHP Code:

<input type="hidden" name="redirect" value="http://www.yoursite.com"

When someone clicks on "Continue" or "Submit" button, it will redirect to the page you specify in the "value" key. You can also use php variables with this.

peolit 11-07-2008 05:19 PM

Thanks for the advice!

I need it to submit the users post (just like when I hit 'submit reply' to post this reply) and then send the user back to the index page...

Will that work?

UKBusinessLive 11-07-2008 05:29 PM

Should do, not sure which template you'll have to edit tho' , so perhaps one of the more advanced coders could shed some light on this.

Could end up being a useful hack ;)

peolit 11-07-2008 05:38 PM

Thanks UK
Here is the button I am working with in the newreply template:

<input type="submit" class="button" name="sbutton" id="{$editorid}_save" value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />

Right now when a user hits it to post a reply, they get the $vbphrase"postthanks_moderate" in a splash screen and then the user is automatically redirected back to the thread.

I need them redirected back to the index instead of the thread after they submit thier post, and I can't seem to figure this out :confused:

noppid 11-07-2008 05:53 PM

Let's talk newreply, you figure out newpost.

on hook newreply_post_complete

set $vbulletin->url to the url of the index.

execute...
eval(print_standard_redirect('redirect_postthanks' , true, true));

peolit 11-07-2008 06:17 PM

This looks awesome, noppid, but I can't get it to work- probably because I'm not typing in the right place. Sorry.

Where exactly do I put all that in?
thanks for the help.

noppid 11-07-2008 06:21 PM

I didn't test it, but that is where I would start...

Hook:
PHP Code:

$vbulletin->url 'index.php?' $vbulletin->session->vars['sessionurl'];
eval(
print_standard_redirect('redirect_postthanks'truetrue)); 


peolit 11-07-2008 06:37 PM

I'm in the newreply template- is that where I should be typing or do I need to be elsewhere? I added that code after the submit button code, like this:

<input type="submit" class="button" name="sbutton" id="{$editorid}_save" value="$vbphrase[submit_reply]" accesskey="s" tabindex="1" />


$vbulletin->url = 'index.php?' . $vbulletin->session->vars['sessionurl'];
eval(print_standard_redirect('redirect_postthanks' , true, true));

and it didn't do anything differently...

Thanks for your patience with my inexperience!

noppid 11-07-2008 06:53 PM

Quote:

Originally Posted by noppid (Post 1661400)
Let's talk newreply, you figure out newpost.

on hook newreply_post_complete

set $vbulletin->url to the url of the index.

execute...
eval(print_standard_redirect('redirect_postthanks' , true, true));

You need to add it to a new plug in on hook newreply_post_complete, not into a template.


All times are GMT. The time now is 09:16 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01128 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete