Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
[Solved] I got better Redirection MOD
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
[Solved] I got better Redirection MOD
PostPosted: 05/17/2007 3:00 AM Reply with quote
Citation
abdulbasit
Citation
Posts 1017
Word Cnt. 64,643
BDay Apr 18
Sign Aries
Sex Sex:Male
Joined: Apr 01, 2007
Local time: 11:12 AM
Location: UNITED ARAB EMIRATES
unitedACa.gif
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 Wink

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
View user's profile Find all posts by abdulbasit Send private message [ Hidden ] Visit poster's website Yahoo Messenger MSN Messenger
Re: I got better Redirection MOD
PostPosted: 05/17/2007 3:30 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:12 AM
Location: St Pete, FL
peace.gif
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...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: [Solved] I got better Redirection MOD
PostPosted: 05/17/2007 4:40 AM Reply with quote
Citation
abdulbasit
Citation
Posts 1017
Word Cnt. 64,643
BDay Apr 18
Sign Aries
Sex Sex:Male
Joined: Apr 01, 2007
Local time: 11:12 AM
Location: UNITED ARAB EMIRATES
unitedACa.gif
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 Wink

You can check the codes in posting.php or try posting in Test board Smile
Back to Top
View user's profile Find all posts by abdulbasit Send private message [ Hidden ] Visit poster's website Yahoo Messenger MSN Messenger
Re: I got better Redirection MOD
PostPosted: 05/17/2007 1:35 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:12 AM
Location: St Pete, FL
peace.gif
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...

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: [Solved] I got better Redirection MOD
PostPosted: 05/17/2007 1:44 PM Reply with quote
Citation
abdulbasit
Citation
Posts 1017
Word Cnt. 64,643
BDay Apr 18
Sign Aries
Sex Sex:Male
Joined: Apr 01, 2007
Local time: 11:12 AM
Location: UNITED ARAB EMIRATES
unitedACa.gif
oOPs. Hehehe. Yeah. Good point brother. Than what i will do is install the MOD with the original script and without any changes Wink  Dancing
Back to Top
View user's profile Find all posts by abdulbasit Send private message [ Hidden ] Visit poster's website Yahoo Messenger MSN Messenger
Re: I got better Redirection MOD
PostPosted: 05/17/2007 2:14 PM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 3:12 AM
Location: St Pete, FL
peace.gif
Ok, sounds good to me...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.0651s (PHP: 73% - SQL: 27%) - SQL queries: 46 - GZIP disabled - Debug on