Just a question...

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Just a question...

Post by Netframe » Fri Jun 10, 2011 4:43 am

Hey!

I'm trying to edit my forum to redirect banned users to my sites custom ban page... is there a way I can do this?'

Like, as soon as they log in, it'll take them to my own custom ban page...


Thanks.

User avatar
AmigoJack
Registered User
Posts: 5602
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Just a question...

Post by AmigoJack » Fri Jun 10, 2011 7:43 am

Open /includes/session.php and find:

Code: Select all

            trigger_error($message);
        }

        return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned; 
Replace with:

Code: Select all

            //trigger_error($message);
            redirect( "{$phpbb_root_path}yourcustomsite.$phpEx" );
        }

        return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned; 
Untested. Beware that with this no additional info will be printed (board contact, ban reason).
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21321
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Just a question...

Post by Mick » Fri Jun 10, 2011 7:44 am

The banned message is created in /includes/session.php and uses trigger_error which calls message_body.html.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Just a question...

Post by Netframe » Fri Jun 10, 2011 10:33 am

AmigoJack wrote:Open /includes/session.php and find:

Code: Select all

            trigger_error($message);
        }

        return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned; 
Replace with:

Code: Select all

            //trigger_error($message);
            redirect( "{$phpbb_root_path}yourcustomsite.$phpEx" );
        }

        return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned; 
Untested. Beware that with this no additional info will be printed (board contact, ban reason).

Okay, so I add my url to

Code: Select all

            //trigger_error($message);
            redirect( "{$phpbb_root_path}yourcustomsite.$phpEx" );
        }

        return ($banned && $ban_row['ban_give_reason']) ? $ban_row['ban_give_reason'] : $banned;  
?

How do I put it in to the redirect?

Code: Select all

redirect( "{$phpbb_root_path}http://mysite.com/ban.html.$phpEx" ); 
?

How do I do it?

User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Just a question...

Post by Netframe » Fri Jun 10, 2011 8:34 pm

I'm not sure if I can bump topics...

I'm sorry if I am not allowed.

User avatar
Boardtalk.net
Registered User
Posts: 1203
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: Just a question...

Post by Boardtalk.net » Fri Jun 10, 2011 8:54 pm

If you made your custom ban page using this article:
Add a New Custom Page to phpBB
and called your page ban

you will have to change to this;

Code: Select all

redirect( "{$phpbb_root_path}ban.$phpEx" );

User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Just a question...

Post by Netframe » Sat Jun 11, 2011 4:42 am

Boardtalk.net wrote:If you made your custom ban page using this article:
Add a New Custom Page to phpBB
and called your page ban

you will have to change to this;

Code: Select all

redirect( "{$phpbb_root_path}ban.$phpEx" );
Thanks,

my page is written in html, will this have any affect on the board calling on it? Or should I re-write it in php?

User avatar
Mick
Support Team Member
Support Team Member
Posts: 21321
Joined: Fri Aug 29, 2008 9:49 am
Location: Watching cricket - definitely

Re: Just a question...

Post by Mick » Sat Jun 11, 2011 5:16 am

If you follow the article you have two files, an HTML file (with your code in it) in your /template folder and a php file in your board root. Do that first and test it by browsing to the php file in the root of your board. Once you have that working as you want try the redirect.
"The more connected we get the more alone we become" - Kyle Broflovski

User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Just a question...

Post by Netframe » Sat Jun 11, 2011 5:28 am

Thank you guys so much! I did it :)

User avatar
Netframe
Registered User
Posts: 64
Joined: Fri Jun 10, 2011 4:39 am

Re: Just a question...

Post by Netframe » Sun Nov 08, 2015 4:11 pm

I know I'm bumping a really old topic, however, after a few years of a break from web development, I just got back into this game with a couple of friends. Once again I'm trying to redirect the ban message to a custom page, however, the sessions.php, I can't seem to locate in the includes folder. Was this code merged into another file?

Thanks

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69239
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Just a question...

Post by KevC » Sun Nov 08, 2015 4:22 pm

In 3.1.x the session.php file in now in the folder called /phpbb

Probably better to start a new topic next time.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Locked

Return to “[3.0.x] Support Forum”