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.
Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: Instant Post Redirect

Post by Ather »

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);
any way to make it with the UCP switch? :)

Here is a sample one

Code: Select all

//-- mod : Instant Post Redirect ------------------------------------------------------------
//-- add
            if ($user->data['user_ipr'])
            {
                redirect($redirect_url);
            }
//-- fin mod : Instant Post Redirect --------------------------------------------------------  
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets

User avatar
Hippie459MN
Registered User
Posts: 937
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Instant Post Redirect

Post by Hippie459MN »

PPCW2 wrote:
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);
any way to make it with the UCP switch? :)

Here is a sample one

Code: Select all

//-- mod : Instant Post Redirect ------------------------------------------------------------
//-- add
            if ($user->data['user_ipr'])
            {
                redirect($redirect_url);
            }
//-- fin mod : Instant Post Redirect --------------------------------------------------------   
Why not just look in the contrib folder at the install instuctions for adding an option to the UCP. Super easy and then the user can have the choice.

Ather
Registered User
Posts: 1032
Joined: Fri May 08, 2009 9:42 am
Location: Kingdom of Bahrain
Name: Ather Akber

Re: Instant Post Redirect

Post by Ather »

i know that, and i have done it already, thats where i got the code..but what i want is to make a UCP switch for this code, which was mentioned in this thread

Code: Select all

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

   $url = redirect($url, true);
 
if switch is Enabled, it will change to

Code: Select all

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

       $url = redirect($url, false);
 
CPL Syed Ather Akbar
Regional Command Southwest
Camp Leatherneck, Afghanistan

My Mods/Snippets

User avatar
Jorup16
Registered User
Posts: 386
Joined: Sun Dec 14, 2008 5:13 am
Location: Zacapa, Guatemala
Name: Jorge
Contact:

Re: Instant Post Redirect

Post by Jorup16 »

I have modified the file posting.php but me the mod does not work.
I use the version phpBB3.0.6

:cry:

User avatar
Jorup16
Registered User
Posts: 386
Joined: Sun Dec 14, 2008 5:13 am
Location: Zacapa, Guatemala
Name: Jorge
Contact:

Re: Instant Post Redirect

Post by Jorup16 »

Jorup16 wrote:I have modified the file posting.php but me the mod does not work.
I use the version phpBB3.0.6

:cry:

:cry:

iftitaj
Registered User
Posts: 638
Joined: Tue Jan 15, 2008 6:21 am
Location: Karachi, Pakistan

Re: Instant Post Redirect

Post by iftitaj »

Jorup16 wrote:I have modified the file posting.php but me the mod does not work.
I use the version phpBB3.0.6

:cry:
Have you purged your cache from ACP?

User avatar
Jorup16
Registered User
Posts: 386
Joined: Sun Dec 14, 2008 5:13 am
Location: Zacapa, Guatemala
Name: Jorge
Contact:

Re: Instant Post Redirect

Post by Jorup16 »

iftitaj wrote:
Jorup16 wrote:I have modified the file posting.php but me the mod does not work.
I use the version phpBB3.0.6

:cry:
Have you purged your cache from ACP?
Yes :(

User avatar
Hippie459MN
Registered User
Posts: 937
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: Instant Post Redirect

Post by Hippie459MN »

I use it on 3.0.6 and works perfect here. :D

iftitaj
Registered User
Posts: 638
Joined: Tue Jan 15, 2008 6:21 am
Location: Karachi, Pakistan

Re: Instant Post Redirect

Post by iftitaj »

Jorup16 wrote:
iftitaj wrote:
Jorup16 wrote:I have modified the file posting.php but me the mod does not work.
I use the version phpBB3.0.6

:cry:
Have you purged your cache from ACP?
Yes :(
Pls re-check your edits and be sure to save files without BOM (use notepad++). Thats all I can recommend/advice. My knowledge ends here. :(

TEF
Registered User
Posts: 298
Joined: Sat Jul 05, 2008 2:15 pm

Re: Instant Post Redirect

Post by TEF »

I just added this to my forum and as it's redirecting instantly I receive this error at the top of my forum.

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 2264: Missing argument 2 for meta_refresh(), called in /posting.php on line 1034 and defined

Warning: Cannot modify header information - headers already sent by (output started at /home/anthonya/public_html/includes/functions.php:3228) in /home/anthonya/public_html/includes/functions.php on line 3806

Warning: Cannot modify header information - headers already sent by (output started at /home/anthonya/public_html/includes/functions.php:3228) in /home/anthonya/public_html/includes/functions.php on line 3808

Warning: Cannot modify header information - headers already sent by (output started at /home/anthonya/public_html/includes/functions.php:3228) in /home/anthonya/public_html/includes/functions.php on line 3809

Warning: Cannot modify header information - headers already sent by (output started at /home/anthonya/public_html/includes/functions.php:3228) in /home/anthonya/public_html/includes/functions.php on line 3810


Then it redirects normally. Any ideas what I need to change to fix this ? Thanks

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Instant Post Redirect

Post by Oyabun1 »

The "headers already sent" errors are often caused by extraneous characters in the file. Make sure you use a proper text editor, like notepad++, not Windows notepad, and it's best to always encode the files as UTF-8 without BOM.

If you are using a proper text editor then recheck your edits, in particular, make sure there is nothing before the <?php at the start of the file.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

User avatar
Contributor
Registered User
Posts: 10
Joined: Thu Feb 25, 2010 4:31 am

Re: Instant Post Redirect

Post by Contributor »

So what this mod does is it redirects users to the post instead of giving them a "post submitted successfuly" message?

Will it work with any layout?

thanks,
Jack
Last edited by Contributor on Sat Feb 27, 2010 12:55 am, edited 1 time in total.
Can't or don't know how to install a MOD? PM me.

Time is our best and worst enemy

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 »

Yes and yes.
Igor Wiedler | area51 | GitHub | trashbin | Formerly known as evil less than three

User avatar
GravityDK
Registered User
Posts: 38
Joined: Mon Feb 22, 2010 7:11 am
Contact:

Re: Instant Post Redirect

Post by GravityDK »

Implemented in phpbb SEO 3.07-PL1, works fine. Thank you.

Knocking Live
Registered User
Posts: 7
Joined: Tue Apr 13, 2010 6:35 pm

Re: Instant Post Redirect

Post by Knocking Live »

Installed onto 3.0.7-PL1. After posting, I recieve the following error instead of being redirected:

Code: Select all

SQL ERROR [ mysqli ]

Unknown column 'NOTIFY_MOD_NONE' in 'where clause' [1054]

SQL

SELECT u.user_id, u.user_type, u.username, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type, u.notify_moderator FROM phpbb_users u, phpbb_moderator_cache mc WHERE mc.forum_id = '24' AND u.user_id = mc.user_id AND u.user_id <> '1, 156, 229, 244, 248, 276, 277, 278, 305, 310, 311' AND u.notify_moderator > NOTIFY_MOD_NONE

BACKTRACE

FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()

FILE: includes/functions_notify_moderators.php
LINE: 350
CALL: dbal_mysqli->sql_query()

FILE: includes/functions_posting.php
LINE: 2616
CALL: notify_moderators()

FILE: posting.php
LINE: 1122
CALL: submit_post()
I believe it might be a conflict with the Notify Moderator MOD. Any thoughts on fixing the issue?

Locked

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