New Topic Redirection Question

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
Ashz0r
Registered User
Posts: 13
Joined: Tue Jun 24, 2008 1:00 pm

New Topic Redirection Question

Post 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
User avatar
ric323
Former Team Member
Posts: 22910
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: New Topic Redirection Question

Post 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.
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions
Ashz0r
Registered User
Posts: 13
Joined: Tue Jun 24, 2008 1:00 pm

Re: New Topic Redirection Question

Post 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.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: New Topic Redirection Question

Post 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
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53398
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: New Topic Redirection Question

Post by Brf »

I am thinking that one would be message_body.tpl.
Ashz0r
Registered User
Posts: 13
Joined: Tue Jun 24, 2008 1:00 pm

Re: New Topic Redirection Question

Post 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 :( .
Ashz0r
Registered User
Posts: 13
Joined: Tue Jun 24, 2008 1:00 pm

Re: New Topic Redirection Question

Post 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
Post Reply

Return to “[2.0.x] MOD Writers Discussion”