Two forum same database and differenti style

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 12:32 pm

warmweer wrote:
Wed Dec 05, 2018 10:44 pm
io2 wrote:
Wed Dec 05, 2018 10:35 pm
Can i a global redirect?
No idea what a global redirect is. Google (very quick search as it's getting late) tells me it's something to do with Drupal but I can't see the relevance to this topic (unless you're embedding phpBB in Drupal).
global redirect i say for all urls of forum.

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 2:00 pm

Witch php variable contain active template and in witch file is assigned?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51428
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Two forum same database and differenti style

Post by Brf » Thu Dec 06, 2018 2:44 pm

Brf wrote:
Wed Dec 05, 2018 10:10 pm
in user.php ... switches the style.
Look for the request for "style"

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 4:25 pm

Brf wrote:
Thu Dec 06, 2018 2:44 pm
Brf wrote:
Wed Dec 05, 2018 10:10 pm
in user.php ... switches the style.
Look for the request for "style"
i don't find user.php. i use PHPbb 3.2

User avatar
warmweer
Registered User
Posts: 1437
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Two forum same database and differenti style

Post by warmweer » Thu Dec 06, 2018 4:31 pm

io2 wrote:
Thu Dec 06, 2018 4:25 pm
i don't find user.php. i use PHPbb 3.2
I use phpBB3.2 and I do find that file. Perhaps you only looked in the base root of your phpBB, try the subdirectory phpbb.
A bug is a feature that hasn't made it to the manual (yet)

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 4:56 pm

warmweer wrote:
Thu Dec 06, 2018 4:31 pm
io2 wrote:
Thu Dec 06, 2018 4:25 pm
i don't find user.php. i use PHPbb 3.2
I use phpBB3.2 and I do find that file. Perhaps you only looked in the base root of your phpBB, try the subdirectory phpbb.
maybe functions_user.php?

User avatar
warmweer
Registered User
Posts: 1437
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Two forum same database and differenti style

Post by warmweer » Thu Dec 06, 2018 5:00 pm

io2 wrote:
Thu Dec 06, 2018 4:56 pm
warmweer wrote:
Thu Dec 06, 2018 4:31 pm
io2 wrote:
Thu Dec 06, 2018 4:25 pm
i don't find user.php. i use PHPbb 3.2
I use phpBB3.2 and I do find that file. Perhaps you only looked in the base root of your phpBB, try the subdirectory phpbb.
maybe functions_user.php?
user.php is part of the phpBB3.2 package. If you don't have it then phpBB wouldn't even work.
A bug is a feature that hasn't made it to the manual (yet)

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 5:08 pm

warmweer wrote:
Thu Dec 06, 2018 5:00 pm
io2 wrote:
Thu Dec 06, 2018 4:56 pm
warmweer wrote:
Thu Dec 06, 2018 4:31 pm
io2 wrote:
Thu Dec 06, 2018 4:25 pm
i don't find user.php. i use PHPbb 3.2
I use phpBB3.2 and I do find that file. Perhaps you only looked in the base root of your phpBB, try the subdirectory phpbb.
maybe functions_user.php?
user.php is part of the phpBB3.2 package. If you don't have it then phpBB wouldn't even work.
https://gyazo.com/0948044f3d58ed408a0df90590b1a8b1
the forum work perfectly

User avatar
GanstaZ
Jr. Extension Validator
Posts: 635
Joined: Wed Oct 11, 2017 10:29 pm
Location: Zverse

Re: Two forum same database and differenti style

Post by GanstaZ » Thu Dec 06, 2018 5:09 pm

You can find that file in phpbb_root/phpbb/user.php
"When answer lies in the question,.. question becomes redundant!"

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 5:14 pm

GanstaZ wrote:
Thu Dec 06, 2018 5:09 pm
You can find that file in phpbb_root/phpbb/user.php
thanks

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 5:40 pm

i tried:

Code: Select all

$useragent = $_SERVER['HTTP_USER_AGENT'];
$parola = "xxxxxx";
if (strstr ($useragent,$parola)) 
{
	$style_id = 21;
}
but i have this error:

General Error
Illegal use of $_SERVER. You must use the request class to access input data. Found in /home/cu1nynjd/public_html/forum/phpbb/user.php on line 263. This error message was generated by deactivated_super_global.

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 67
CALL: trigger_error()

FILE: [ROOT]/phpbb/request/deactivated_super_global.php
LINE: 87
CALL: phpbb\request\deactivated_super_global->error()

FILE: [ROOT]/phpbb/user.php
LINE: 263
CALL: phpbb\request\deactivated_super_global->offsetGet()

FILE: [ROOT]/index.php
LINE: 29
CALL: phpbb\user->setup()

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 5:58 pm

i fix error:

Code: Select all

$request->enable_super_globals();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$parola = "xxxxxx";
if (strstr ($useragent,$parola)) 
{
	$style_id = 21;
}
$request->disable_super_globals(); 
work perfectly. Thank you to all for help. :)

User avatar
warmweer
Registered User
Posts: 1437
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Two forum same database and differenti style

Post by warmweer » Thu Dec 06, 2018 6:20 pm

io2 wrote:
Thu Dec 06, 2018 5:58 pm
i fix error:

Code: Select all

$request->enable_super_globals();
$useragent = $_SERVER['HTTP_USER_AGENT'];
$parola = "xxxxxx";
if (strstr ($useragent,$parola)) 
{
	$style_id = 21;
}
$request->disable_super_globals(); 
but don't switch style
a) the advice was not to use $_SERVER and yet you continue to (and I doubt enabling super_globals is a good idea, even temporarily)
b) all you've done in your code is to set $style_id. If you want to switch style you will have to initiate that (and which data is used? cache?)
A bug is a feature that hasn't made it to the manual (yet)

io2
Registered User
Posts: 29
Joined: Sun Dec 06, 2015 8:22 pm

Re: Two forum same database and differenti style

Post by io2 » Thu Dec 06, 2018 9:24 pm

The one mode for to know app (no mobile browser) is a custom user agent.

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: canonknipser and 3 guests