Page 1 of 1

New Topic Redirection Question

Posted: Wed Jun 25, 2008 5:24 pm
by Ashz0r
I have a forum that anyone can post into but I've set it so only admins/mods can see the posts so that the poster can keep their post anoynomous.

My only problem is when they post it redirects them to the message they have just posted and asks them to re-login as an admin.

Is there a way to change the redirection so it takes them to the forum index page instead?

Also is it possible to change the confirmation page so there is not a link to view the message?

I'm not fussed if it effects all posts because the only place they can post is into that one forum.

Cheers,
Ashz0r

Re: New Topic Redirection Question

Posted: Wed Jun 25, 2008 10:38 pm
by ric323
You can't do this in normal phpBB.
I was tossing up whether to move this topi to "MOD Reqests" or "MOD Writers Discussion".
I assume you've already made a change yourself to get this far, so I've moved it into the latter.

Re: New Topic Redirection Question

Posted: Wed Jun 25, 2008 11:34 pm
by Ashz0r
Thanks I wasn't sure where to put my question :)

Also wondering if the confirmation page just before it redirects you does that have a .tpl file in the template? because i've changed my postingbody.tpl alot to suit the way I wanted it but when it quickly flashed to the confirmation page with "your message has been received click here to see your message or click here to return to forum" none of my changes are there its got the default way the template looked before I made my changes.

Re: New Topic Redirection Question

Posted: Thu Jun 26, 2008 1:23 am
by A_Jelly_Doughnut
The redirect box is confirm_body.tpl if memory serves -- haven't worked with phpBB2 in a while :)

The redirect is handled by a snippet that looks something like this in posting.php (again, if memory serves)

Code: Select all

$template->assign_vars(array(
    'META' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx ... ),
);
You'd change the viewtopic.php to viewforum.php or index.php

Re: New Topic Redirection Question

Posted: Thu Jun 26, 2008 4:19 am
by Brf
I am thinking that one would be message_body.tpl.

Re: New Topic Redirection Question

Posted: Thu Jun 26, 2008 4:03 pm
by Ashz0r
Ah it was message_body.tpl for the confirmation page, I can edit that bit to look how I want now but im still stuck with it auto redirecting:

I found this in posting.php when searching for the bit your wrote above.

Code: Select all

$template->assign_vars(array(
			'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
		);
		$message .=  '<br /><br />' . sprintf($lang['Click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');
		message_die(GENERAL_MESSAGE, $message);
	}
	else
	{
		redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
	}
}
else if ( $submit || $confirm )
{
	//
	// Submit post/vote (newtopic, edit, reply, etc.)
	//
	$return_message = '';
	$return_meta = '';
So I changed every

Code: Select all

"viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"
to

Code: Select all

""index.$phpEx?" 
Didn't change the redirection after changing any of them.

Also on the bit that says:

Code: Select all

 $template->assign_vars(array(
			'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">')
Im guessing if I change the content="3 to content ="15 the redirect should take longer to happen? yet when I do this it doesn't slow it down at all? so possibably this isn't the correct redirect?

Out of trial and error I tried changing

Code: Select all

'S_POST_ACTION' => append_sid("posting.$phpEx"),
in the template array to

Code: Select all

'S_POST_ACTION' => append_sid("index.$phpEx"),
it took you straight back to the index page skipping the confirmation page completely when you pressed post but it didn't post the actualy topic lol :( .

Re: New Topic Redirection Question

Posted: Thu Jun 26, 2008 9:35 pm
by Ashz0r
I worked it out..

The Meta Refresh in Posting.php is only for polls.

To change the redirection for posting a new topic it is located in: Includes/functions_post.php

Line: 325

Code: Select all

$meta = '<meta http-equiv="refresh" content="8;url=' . append_sid("index.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">'; 
Changed that to:

Code: Select all

$meta = '<meta http-equiv="refresh" content="8;url=' . append_sid("index.$phpEx?") . '">'; 
Now it takes me to index.php instead of the topic ^^ yay lol

Thanks for the help guys, wouldn't of been able to of worked it out on my own.. (didn't even know how a meta refresh worked untill now)

Cheers,
Ashz0r