Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2008, 04:25 PM
peolit peolit is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 11-07-2008, 05:15 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 11-07-2008, 05:19 PM
peolit peolit is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 11-07-2008, 05:29 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 11-07-2008, 05:38 PM
peolit peolit is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 11-07-2008, 05:53 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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));
Reply With Quote
  #7  
Old 11-07-2008, 06:17 PM
peolit peolit is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 11-07-2008, 06:21 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)); 
Reply With Quote
  #9  
Old 11-07-2008, 06:37 PM
peolit peolit is offline
 
Join Date: Sep 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #10  
Old 11-07-2008, 06:53 PM
noppid noppid is offline
 
Join Date: Mar 2003
Location: Florida
Posts: 1,875
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by noppid View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:56 PM.


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.05498 seconds
  • Memory Usage 2,251KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete