Instant Post Redirect

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
User avatar
GurlzLubme
Registered User
Posts: 880
Joined: Wed Sep 01, 2004 11:21 am
Location: New York

Re: Instant Post Redirect

Post by GurlzLubme »

Great mod evil! The meta-redirects really annoy me, and I would like to eliminate all that i can.

I'm encountering something strange though. i cant seem to overwrite my ucp_pm_compose.php file. I would do the changes as u stated, save it, and when I try to upload it, it gives me a warning that I'm about to overwrite a file that is dated NEWER than the one i just upload. It's really strange, but the current ucp_pm_compose file in my directory is dated a 11/9/07 11:50 pm, when it's only 8:50 pm! Very strange!

More requests: skip meta redirect in Admin ACP log in, and sign out. thank you!
1,000,000 Thank Yous to everyone who's been helping me on phpbb.com!
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

The following will replace all meta redirects with "real" ones.

Open:
includes/functions.php
Find:

Code: Select all

/**
* Meta refresh assignment
*/
function meta_refresh($time, $url)
{
	global $template;

	$url = redirect($url, true);
Replace with:

Code: Select all

/**
* Meta refresh assignment
*/
function meta_refresh($time, $url)
{
	global $template;

	$url = redirect($url, false);
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
GurlzLubme
Registered User
Posts: 880
Joined: Wed Sep 01, 2004 11:21 am
Location: New York

Re: Instant Post Redirect

Post by GurlzLubme »

eviL<3 wrote:The following will replace all meta redirects with "real" ones.

Open:
includes/functions.php
Find:

Code: Select all

/**
* Meta refresh assignment
*/
function meta_refresh($time, $url)
{
	global $template;

	$url = redirect($url, true);
Replace with:

Code: Select all

/**
* Meta refresh assignment
*/
function meta_refresh($time, $url)
{
	global $template;

	$url = redirect($url, false);

Wonderful!! This is exactly what I wanted! Everything seems to work fine so far. Does this mean I should remove your "add" suggestions to previous posts (i.e. ucp_pm_compose, etc...)?

Also, is it normal that I can't update/overwrite my ucp_pm_compose.php because the file is always "newer" than the current time somehow?
1,000,000 Thank Yous to everyone who's been helping me on phpbb.com!
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

GurlzLubme wrote:Wonderful!! This is exactly what I wanted! Everything seems to work fine so far. Does this mean I should remove your "add" suggestions to previous posts (i.e. ucp_pm_compose, etc...)?
Yeah, should also work with the edit i just posted :)
GurlzLubme wrote:Also, is it normal that I can't update/overwrite my ucp_pm_compose.php because the file is always "newer" than the current time somehow?
No :P
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
siadam
Registered User
Posts: 66
Joined: Tue Sep 04, 2007 3:02 pm

Re: Instant Post Redirect

Post by siadam »

nevermind.
8-)
Geoserv
Registered User
Posts: 33
Joined: Thu Jun 15, 2006 10:48 am

Re: Instant Post Redirect

Post by Geoserv »

I can't seem to get it to work for me.

In posting.php the line of code that we are suppose to locate:

Code: Select all

meta_refresh(3, $redirect_url);
exists multiple times, roughly where is the one we need to change?

Geoserv
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

First one after the previous finds.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
Geoserv
Registered User
Posts: 33
Joined: Thu Jun 15, 2006 10:48 am

Re: Instant Post Redirect

Post by Geoserv »

This is what I have:

Code: Select all

$meta_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
		[b]meta_refresh(3, $meta_url);
//-- mod : Instant Post Redirect ------------------------------------------------------------
//-- add
				redirect($redirect_url);
//-- fin mod : Instant Post Redirect --------------------------------------------------------
[/b]
		$message = $user->lang['TOPIC_BUMPED'] . '<br /><br />' . sprintf($user->lang['VIEW_MESSAGE'], '<a href="' . $meta_url . '">', '</a>');
		$message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) . '">', '</a>');
I must have it in the wrong place because it still doesn't work for me. This is the first instance of

Code: Select all

meta_refresh(3, $meta_url);
that I come to.

Geoserv.
User avatar
stewaia
Registered User
Posts: 113
Joined: Tue Nov 06, 2007 7:42 pm

Re: Instant Post Redirect

Post by stewaia »

Great Mod! Props for coming up with it!
-Alex
The Stock Talk.net - Stock Picks, Analysis, and Discussion

"The eyes are the groin of the head." -Dwight Schrute
azzurri
Registered User
Posts: 910
Joined: Fri Jul 21, 2006 7:48 pm

Re: Instant Post Redirect

Post by azzurri »

Im sorry to say this but this hack is useless to people with IE and thats a great deal of people. Since the user is not redirected to the last post you still get this useless delay that this hack was supposed to fix. I think its a bit weird that it cant be done since I had a hack like this for phpbb2 and it worked like a charm.
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

Well you know which company is to blame... :? I'll see if i can hack together a really awful fix... ;)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

To be included in the next version.

Open: posting.php.
Find:

Code: Select all

				redirect($redirect_url);
Before, add:

Code: Select all

				// ipr_p
				if (strpos($redirect_url, '#') !== false)
				{
					$redirect_url = substr_replace($redirect_url, "&ipr_p={$data['post_id']}#", strrpos($redirect_url, '#'));
				}
Open: viewtopic.php
Find:

Code: Select all

	trigger_error('NO_TOPIC');
}
After, add:

Code: Select all

// ipr_p
if (isset($_GET['ipr_p']))
{
	$ipr_p = request_var('ipr_p', 0);
	redirect("{$phpbb_root_path}viewtopic.$phpEx?p=$ipr_p#p$ipr_p");
}
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three
azzurri
Registered User
Posts: 910
Joined: Fri Jul 21, 2006 7:48 pm

Re: Instant Post Redirect

Post by azzurri »

eviL<3 that worked as great as it ever could. Hail to intelligent people like you! :lol:
User avatar
GurlzLubme
Registered User
Posts: 880
Joined: Wed Sep 01, 2004 11:21 am
Location: New York

Re: Instant Post Redirect

Post by GurlzLubme »

Sorry to be nitpicky. You showed me how to code it so that it removes ALL meta redirects (which is great!).

However, I'd still like to keep the meta direct for after a user uploads an avatar (or profile edits in general), to let them know it was added (edited) successfully. How may I isolate this?
1,000,000 Thank Yous to everyone who's been helping me on phpbb.com!
User avatar
igorw
Former Team Member
Posts: 8024
Joined: Fri Dec 16, 2005 12:23 pm
Location: {postrow.POSTER_FROM}
Name: Igor Wiedler

Re: Instant Post Redirect

Post by igorw »

You could replace this code in includes/functions.php:

Code: Select all

function meta_refresh($time, $url)
{
	global $template;

	$url = redirect($url, true);
With:

Code: Select all

function meta_refresh($time, $url, $redirect_return = false)
{
	global $template;

	$url = redirect($url, $redirect_return);
And in includes/ucp/ucp_profile.php:

Code: Select all

						if (avatar_process_user($error))
						{
							meta_refresh(3, $this->u_action);
With:

Code: Select all

						if (avatar_process_user($error))
						{
							meta_refresh(3, $this->u_action, true);
You can do the same for other meta_refresh() calls in the file as well :)
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

Return to “[3.0.x] MOD Database Releases”