Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: svpernaut on April 02, 2010, 10:30:12 AM

Title: Question
Post by: svpernaut on April 02, 2010, 10:30:12 AM
I want a thread post to be redirected to a url of my choice. Is this possible?
Title: Re: Question
Post by: Arantor on April 02, 2010, 10:35:34 AM
Not out of the box, no.

It *is* possible however. More details needed about what you're trying to do and how you expect it to work.
Title: Re: Question
Post by: svpernaut on April 02, 2010, 10:40:15 AM
so I post a sticky topic that says.
recruiting application, they click on that and it redirects them to the form that I made and they fill it out from there.
Title: Re: Question
Post by: Arantor on April 02, 2010, 10:43:15 AM
Are you likely to want to do this with another thread in the future?
Title: Re: Question
Post by: svpernaut on April 02, 2010, 10:46:24 AM
yeah, right now I just have a thread that says read here first. Then it just has a link in it for them to click on
Title: Re: Question
Post by: Arantor on April 02, 2010, 10:47:18 AM
That's not what I asked.

Are you going to want to do something like this with ANOTHER thread in the future?
Title: Re: Question
Post by: svpernaut on April 02, 2010, 10:49:29 AM
yes there will only be 2
Title: Re: Question
Post by: Arantor on April 02, 2010, 10:50:25 AM
You need to make those two topics, then tell me what the topic id numbers are and where they're supposed to go and I'll give you the code to edit into Sources/Display.php to manage the redirect.
Title: Re: Question
Post by: svpernaut on April 02, 2010, 10:55:50 AM
http://headshotdistrict.com/index.php?topic=14.0
Goes in: http://headshotdistrict.com/index.php?board=6.0

http://headshotdistrict.com/index.php?topic=15.0
Goes in: http://headshotdistrict.com/index.php?board=8.0
Title: Re: Question
Post by: Arantor on April 02, 2010, 10:56:42 AM
*headdesk*

No... if you click on the http://headshotdistrict.com/index.php?topic=14.0 link, where's it supposed to redirect to?
Title: Re: Question
Post by: svpernaut on April 02, 2010, 11:04:11 AM
http://headshotdistrict.com/index.php?topic=14.0
Redirect to: http://headshotdistrict.com/index.php?action=form;id=3

http://headshotdistrict.com/index.php?topic=15.0
Goes in: http://headshotdistrict.com/index.php?action=form;id=1
Title: Re: Question
Post by: Arantor on April 02, 2010, 11:06:36 AM
Sources/Display.php

Code (find) Select
function Display()
{
global $scripturl, $txt, $modSettings, $context, $settings;
global $options, $sourcedir, $user_info, $board_info, $topic, $board;
global $attachments, $messages_request, $topicinfo, $language, $smcFunc;

// What are you gonna display if these are empty?!
if (empty($topic))
fatal_lang_error('no_board', false);


Code (after the above, add this) Select
// Topic redirections
if ($topic == 14)
redirectexit('action=form;id=3');
elseif($topic == 15)
redirectexit('action=form;id=1');
Title: Re: Question
Post by: svpernaut on April 02, 2010, 11:49:50 AM
Thanks a bunch! that did exactly what I wanted to do!