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

Two forum same database and differenti style

Post by io2 » Wed Dec 05, 2018 7:45 pm

It's possible to have 2 forum installations with same database, so same topics and users, but differenti style?

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 » Wed Dec 05, 2018 8:09 pm

io2 wrote:
Wed Dec 05, 2018 7:45 pm
It's possible to have 2 forum installations with same database, so same topics and users, but differenti style?
That's not really necessary I think.
Let's say you have 2 urls to the same board. Not being an expert on the matter (far from it), it should be possible to force a style for a particular url, by overriding the user_style. I'm not sure specifically where this should happen but session.php is the first place I'ld look.

This is actually a custom coding question I think.
A bug is a feature that hasn't made it to the manual (yet)

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 » Wed Dec 05, 2018 8:21 pm

It would be in user.php but you can pass the style in with a ?style=x parameter unless the override_user_style is set.

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

Re: Two forum same database and differenti style

Post by io2 » Wed Dec 05, 2018 9:04 pm

Brf wrote:
Wed Dec 05, 2018 8:21 pm
It would be in user.php but you can pass the style in with a ?style=x parameter unless the override_user_style is set.
I need all forum for load inside android app.

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 » Wed Dec 05, 2018 9:13 pm

I have no clue why that would matter.

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

Re: Two forum same database and differenti style

Post by io2 » Wed Dec 05, 2018 9:23 pm

Brf wrote:
Wed Dec 05, 2018 9:13 pm
I have no clue why that would matter.
?style is for single url. I need for all urla.

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 » Wed Dec 05, 2018 9:28 pm

io2 wrote:
Wed Dec 05, 2018 9:04 pm
I need all forum for load inside android app.
I still don't quite understand.
You want 1 board which will only be loaded via an android app (which you are developing), and which uses 1 database for 2 urls?
And the 2 urls should have the same style, but a different colouring scheme? What happens when the board is accessed from a Windows PC, or a Mac?
Please give some more specifics, e.g. the need/use for this?
io2 wrote:
Wed Dec 05, 2018 9:23 pm
?style is for single url. I need for all urla.
?style=x >>> the ?style asks for a parameter, the x is the parameter, so on url1 x could be prosilver, and on url2 x could be prosilverX (which would be prosilver with a different colour scheme). You could even use a completely different style for each url.
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 » Wed Dec 05, 2018 9:41 pm

warmweer wrote:
Wed Dec 05, 2018 9:28 pm
io2 wrote:
Wed Dec 05, 2018 9:04 pm
I need all forum for load inside android app.
I still don't quite understand.
You want 1 board which will only be loaded via an android app (which you are developing), and which uses 1 database for 2 urls?
And the 2 urls should have the same style, but a different colouring scheme? What happens when the board is accessed from a Windows PC, or a Mac?
Please give some more specifics, e.g. the need/use for this?
io2 wrote:
Wed Dec 05, 2018 9:23 pm
?style is for single url. I need for all urla.
?style=x >>> the ?style asks for a parameter, the x is the parameter, so on url1 x could be prosilver, and on url2 x could be prosilverX (which would be prosilver with a different colour scheme). You could even use a completely different style for each url.
Url2 Will be accessible only from app. No desktop users.
I want change style or colours for url2.

User avatar
david63
Jr. Extension Validator
Posts: 15048
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Two forum same database and differenti style

Post by david63 » Wed Dec 05, 2018 9:44 pm

But surely the url will be same no matter how the board is accessed or have I missed something?

My suggestion would be to install two styles make one (probably the non Android app one) the default style but do not allow users to override the style. Then test whether the board is being accesses via the Android app and switch the default styles.

Not sure why there needs to be two different styles as phpBB styles are responsive and will work on any device.
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

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

Re: Two forum same database and differenti style

Post by io2 » Wed Dec 05, 2018 9:48 pm

david63 wrote:
Wed Dec 05, 2018 9:44 pm
But surely the url will be same no matter how the board is accessed or have I missed something?

My suggestion would be to install two styles make one (probably the non Android app one) the default style but do not allow users to override the style. Then test whether the board is being accesses via the Android app and switch the default styles.

Not sure why there needs to be two different styles as phpBB styles are responsive and will work on any device.
How do i switch?

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 » Wed Dec 05, 2018 10:07 pm

io2 wrote:
Wed Dec 05, 2018 9:41 pm
Url2 Will be accessible only from app. No desktop users.
I want change style or colours for url2.
I think you're going to need a some complicated code in your .htaccess to determine the user-agent and prevent switching between the mobile version and the desktop version
see https://stackoverflow.com/questions/368 ... g-htaccess
There are other solutions
https://bluescreenofjeff.com/2016-04-05 ... d_rewrite/

Frankly speaking I don't think it's worth the trouble and useragents can be spoofed quite easily anyway.
A bug is a feature that hasn't made it to the manual (yet)

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 » Wed Dec 05, 2018 10:10 pm

I remember someone wrote some custom code in that same spot in user.php that checks for the agent and switches the 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 » Wed Dec 05, 2018 10:35 pm

warmweer wrote:
Wed Dec 05, 2018 10:07 pm
io2 wrote:
Wed Dec 05, 2018 9:41 pm
Url2 Will be accessible only from app. No desktop users.
I want change style or colours for url2.
I think you're going to need a some complicated code in your .htaccess to determine the user-agent and prevent switching between the mobile version and the desktop version
see https://stackoverflow.com/questions/368 ... g-htaccess
There are other solutions
https://bluescreenofjeff.com/2016-04-05 ... d_rewrite/

Frankly speaking I don't think it's worth the trouble and useragents can be spoofed quite easily anyway.
Can i make a global redirect?
Last edited by io2 on Wed Dec 05, 2018 10:39 pm, edited 1 time in total.

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

Re: Two forum same database and differenti style

Post by io2 » Wed Dec 05, 2018 10:38 pm

Brf wrote:
Wed Dec 05, 2018 10:10 pm
I remember someone wrote some custom code in that same spot in user.php that checks for the agent and switches the style.
Can You help me for to find it?

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 » 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).
A bug is a feature that hasn't made it to the manual (yet)

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: bonelifer and 2 guests