FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Redirect to Post -Saving Server Bandwidth !!





apeX-FXR
Just a suggestion we can save some of the server bandwidth
We need to avoid this


For your convinience i have even posted the MOD below Smile

Let me know hows my suggestion

Code:
##############################################################
# Title: Redirect to Post
# Author: Thoul  thoul@users.sourceforge.net  http://darkmods.sourceforge.net
# Description: After posting, editing, or deleting a message, the user is
# redirected to their post or the topic.
# Version: 2.2.0
# Installation Level: Easy
# Installation Time: 2 Minutes
# Files To Edit: posting.php, privmsg.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 their post without waiting. If the post was deleted, then the user is sent to
# the first post of the topic. If the entire 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.
#
# This MOD also includes redirection after sending a private message. If you only
# want one type of redirection (either after posting or after sending a PM, but not
# both), then just apply the changes for the one appropriate file as directed in
# this MOD.
#
# 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 Post (normal post)
//

   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 == 'delete' )
   {
      // URL for redirection after deleting 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));
   }
   elseif ( $mode == 'reply' || $mode == 'editpost' || $mode == 'newtopic' )
   {
      // URL for redirection after posting or editing a post
      $redirect = "viewtopic.$phpEx?" . POST_POST_URL . "=$post_id";
      $post_append = "#$post_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) . $post_append, true);
      redirect(append_sid($redirect, true) . $post_append);
   }

//
// MOD: -END-
//

#
#-----[ OPEN ]------------------------------------------
#
privmsg.php

#
#-----[ FIND ]------------------------------------------
#

      $template->assign_vars(array(
         'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">')
      );

      $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

      message_die(GENERAL_MESSAGE, $msg);

#
#-----[ REPLACE WITH ]------------------------------------------
#

/*  Original phpBB code - commented out for Redirection Suite MOD
      $template->assign_vars(array(
         'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("privmsg.$phpEx?folder=inbox") . '">')
      );

      $msg = $lang['Message_sent'] . '<br /><br />' . sprintf($lang['Click_return_inbox'], '<a href="' . append_sid("privmsg.$phpEx?folder=inbox") . '">', '</a> ') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>');

      message_die(GENERAL_MESSAGE, $msg);
*/

//
// MOD: Redirect to Post (private messages)
//
      // URL to redirect to after sending private message
      $pm_redirect_url = "privmsg.$phpEx?folder=inbox";

      // 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($pm_redirect_url, true), true);
      redirect(append_sid($pm_redirect_url, true));
//
// MOD: -END-
//

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# End
tidruG
Actually, I use that sometimes to go back to the forum view instead of going back to a post.

It's not a bad suggestion, I suppose, because I'd say that at least 75% of the people just wait and go back to their post... however, it's not like no one uses that page Wink
Helios
I always use that page :\
S3nd K3ys
I never use that page. I hate that page. I use Firefox with tabs so there's absolutely NO need for it on my computer. In fact, I think there's a greasemonkey script or perhaps an extension that will get rid of that page locally.

/me searches...
Bondings
I like to choose between the 2 options. Besides, it redirects after a few seconds. I can maybe make it a bit faster.
mOrpheuS
Apart from being useful by presenting two options to the user, the intermediate pages are used out of necessity.
Because there are certain browsers which do not support auto redirects.
And there are settings within popular browsers which disable auto-redirects.

That's the reason why we come across many a intermediate pages which say something to the tune of "Click here if your browser doesn't redirect you automatically ..."

Heck even IPB and vBulletin use intermediate redirect pages. Wink
babumuchhala
Well that intermediate redirect page has only one use for me currently and thats just to check how much i have earned for that post.

If I were able to see how much I earned per post on the post itself (I have seen this on a punBB based forum) then that page is redundent to me too.

mOrpheuS wrote:
Because there are certain browsers which do not support auto redirects.
I did like to know which browsers dont support it. Because all the browsers I have used till date (Opera, Firefox, IE, Konqurer) do support it. Rolling Eyes
mOrpheuS
babumuchhala wrote:
I did like to know which browsers dont support it. Because all the browsers I have used till date (Opera, Firefox, IE, Konqurer) do support it. Rolling Eyes

None of the modern browsers, apparently.
But it's always good to support as many as we can.
http://webtips.dan.info/refresh.html
alkady
I just leave that thing guide the way almost 75% of the time. But removing it will save me a few minutes of my life everyday I suppose. LOL
Panthrowzay
*hoplessly* If bondings like it who are we to argue its nice that he loves input thou.
Related topics
Reply to topic    Frihost Forum Index -> General -> Suggestions

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.