 | [Solved] I got better Redirection MOD |  |
Posted: 05/17/2007 3:00 AM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 9:39 PM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
Hello Nightrider,
As you remember I have removed the redirection MOD because i need that SEO MOD in my forum. Now all users say me to have that redirection feature back because they don't want to see that Click Here To View Your Message.
I got a MOD which is far better that previous redirection MOD. It just needed 1 modification in posting.php which i did manually in Test board because EM was unable to detect this MOD. I have added the codes in posting.php and what this MOD do is redirects it to the main topic. So is it possible to do some code changes and make it redirect to 1st post of the author of that topic instead of that topic. Just a little modification in the coding I hope so needed. Here is the MOD. The good thing about this MOD is it works in IE without any 404 ERROR message
| Code:
|
##############################################################
# Title: Redirect to Topic
# Author: Thoul thoul@users.sourceforge.net http://darkmods.sourceforge.net
# Description: After posting, editing, or deleting a message, the user is
# redirected to the topic's first post without a confirmation message.
# Version: 2.1.1
# Installation Level: Easy
# Installation Time: 2 Minutes
# Files To Edit: posting.php
# Included Files: n/a
##############################################################
# Author's Notes:
# This MOD is a way of bypassing the message displayed when a message is
# successfully posted, edited, or deleted. It will instead redirect the user back
# to the topic's first post without waiting. If the topic was deleted as a result
# of deleting the post (e.g., it was the only post in the topic), then the user is
# sent to the forum instead.
#
# If you are redirecting users to pages outside of your phpBB directories (aka
# folders), be sure to read the file function_change.txt also. It contains other
# modifications and instructions that you will need to read.
##############################################################
# BEFORE ADDING THIS TO YOUR FORUM, YOU SHOULD BACK UP ALL RELATED FILES.
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
'META' => $return_meta)
);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// MOD: Redirect to Topic
//
if ( $mode == 'delete' && $post_data['first_post'] && $post_data['last_post'] )
{
// URL for redirection after deleting an entire topic
$redirect = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id";
// If the above URL points to a location outside the phpBB directories
// move the slashes on the next line to the start of the following line:
//redirect(append_sid($redirect, true), true);
redirect(append_sid($redirect, true));
}
elseif ( $mode == 'reply' || $mode == 'editpost' || $mode == 'newtopic' || $mode == 'delete' )
{
// URL for redirection after posting, deleting, or editing a post
$redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
// If the above URL points to a location outside the phpBB directories
// move the slashes on the next line to the start of the following line:
//redirect(append_sid($redirect, true), true);
redirect(append_sid($redirect, true));
}
//
// MOD: -END-
//
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# End
|
|
|
|
 |
 |
| Back to Top |
|
|
 | Re: I got better Redirection MOD |  |
Posted: 05/17/2007 3:30 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 1:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
You can try this. I don't know if it will work or not, but I'm guessing that it will:
OPEN
posting.php
FIND
| Code:
|
|
$redirect = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id";
|
REPLACE WITH
| Code:
|
|
$redirect = "viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id";
|
Save and upload back to your phpBB forum folder. Be sure to create a good backup of the file before you overwrite it with this modified version, just in case...
Make sure you adjust the code that you added from this MOD. There seems to be another instance of this line of code in 2.0.22...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] I got better Redirection MOD |  |
Posted: 05/17/2007 4:40 AM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 9:39 PM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
I did and it redirects to my own post i mean the last post. If it can be redirected to 1st post will be better
You can check the codes in posting.php or try posting in Test board  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: I got better Redirection MOD |  |
Posted: 05/17/2007 1:35 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 1:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
You want it to redirect to the first post rather than the last? What happens if you have a 15 page topic? Do you really want to keep going back to the first page and first post after submitting a message? That could get pretty annoying having to click on the last page each time in order to see the new message...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: [Solved] I got better Redirection MOD |  |
Posted: 05/17/2007 1:44 PM |
|
|
|
|
|
| Citation |
| Posts |
1017 |
| Word Cnt. |
64,643 |
| BDay |
Apr 18 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Apr 01, 2007
Local time: 9:39 PM
Location: UNITED ARAB EMIRATES
|

|
|
|
|
 |
oOPs. Hehehe. Yeah. Good point brother. Than what i will do is install the MOD with the original script and without any changes  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: I got better Redirection MOD |  |
Posted: 05/17/2007 2:14 PM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 1:39 PM
Location: St Pete, FL
|

|
|
|
|
 |
Ok, sounds good to me...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|