MyBB Community Forums

Full Version: Switching Themes based on URL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not sure if this belongs here or support, but this seemed more specific.  feel free to move if support is more appropriate.
I just set up mybb to replace an ancient and dilapidated phpbb installation.
Most things are working fine aside for login issues with some themes but I would like to know if there is a way to force a particular theme based on the incoming domain name (like a virtual host), I have a few groups and I'd like them to have different themes based on which domain the user is accessing the board via.

I'm not shy about php coding and do IT and unix admin for a living so you can get technical. if there's an easy way great, if not code snippets or a general direction to look in would be awesome.  

Thanks in advance!  Smile
(2019-05-04, 09:49 PM)chrisregenye Wrote: [ -> ]Not sure if this belongs here or support, but this seemed more specific.  feel free to move if support is more appropriate.
I just set up mybb to replace an ancient and dilapidated phpbb installation.
Most things are working fine aside for login issues with some themes but I would like to know if there is a way to force a particular theme based on the incoming domain name (like a virtual host), I have a few groups and I'd like them to have different themes based on which domain the user is accessing the board via.

I'm not shy about php coding and do IT and unix admin for a living so you can get technical. if there's an easy way great, if not code snippets or a general direction to look in would be awesome.  

Thanks in advance!  Smile

View the screenshots for assistance. 

[Image: 05db5a65e5c1475e5b100c663bef2c5a.png]

Be certain to SAVE Theme Properties after completing your adjustments in the 2nd screenshot.

[Image: 9ac61852a4d362d381bbf5f9ecbd3777.png]
Thanks for the reply!

This isn't exactly what I was looking for though.
Probably didn't explain correctly, here goes try two with more relevant info.

There was a game several years ago called city of heroes, later they had an expansion called city of villians.  I ran a group of players for these games and registered two domains for the group, one for the hero side and one for the villian side.  The board membership is the same for both (in fact the mybb install is the same for both, the document roots for both virtual hosts point to the same location.)

This worked nicely when the board was phpbb based, I just had a common index.php file that preloaded a .css based on  the incoming url before sending them to phpbb/index.php.
But mybb themes are more complicated with many css files and even if I preload all of them I'm not sure the board will accept them vs whatever is set as "default".

So to clarify, the users of both styles are the same and in the same groups according to their rank, only the site url is different and I'd like to pick a theme based on that variable to give the user.
(2019-05-05, 12:21 PM)chrisregenye Wrote: [ -> ]Thanks for the reply!

This isn't exactly what I was looking for though.
Probably didn't explain correctly, here goes try two with more relevant info.

There was a game several years ago called city of heroes, later they had an expansion called city of villians.  I ran a group of players for these games and registered two domains for the group, one for the hero side and one for the villian side.  The board membership is the same for both (in fact the mybb install is the same for both, the document roots for both virtual hosts point to the same location.)

This worked nicely when the board was phpbb based, I just had a common index.php file that preloaded a .css based on  the incoming url before sending them to phpbb/index.php.
But mybb themes are more complicated with many css files and even if I preload all of them I'm not sure the board will accept them vs whatever is set as "default".

So to clarify, the users of both styles are the same and in the same groups according to their rank, only the site url is different and I'd like to pick a theme based on that variable to give the user.

Well, that's a different kind of situation and it's beyond my level of expertise.

I'm sure one of the experts on MyBB.com will be able to provide some assistance on this.
Yeah, I understand it's not common and it's unusual enough that I thought I'd pose it to the experts to see if I could save some time in coming up with a solution. Thanks again though for taking the time to try and help me out, believe me it's appreciated!
(2019-05-06, 10:55 AM)chrisregenye Wrote: [ -> ]Yeah, I understand it's not common and it's unusual enough that I thought I'd pose it to the experts to see if I could save some time in coming up with a solution. Thanks again though for taking the time to try and help me out, believe me it's appreciated!

At WallBB, we allow users to see demo by clicking URL and theme changes.
https://wallbb.co.uk/product/go-dark-myb...-friendly/
Theme change link - https://wallbb.co.uk/forums/go-dark-mybb...-friendly/

If you want this plugin, I can attach it here Smile
(2019-05-07, 06:29 AM)WallBB Wrote: [ -> ]
(2019-05-06, 10:55 AM)chrisregenye Wrote: [ -> ]Yeah, I understand it's not common and it's unusual enough that I thought I'd pose it to the experts to see if I could save some time in coming up with a solution. Thanks again though for taking the time to try and help me out, believe me it's appreciated!

At WallBB, we allow users to see demo by clicking URL and theme changes.
https://wallbb.co.uk/product/go-dark-myb...-friendly/
Theme change link - https://wallbb.co.uk/forums/go-dark-mybb...-friendly/

If you want this plugin, I can attach it here Smile

Sorry for the delayed response, was dealing with cable modem issues.
If you could attach it, that would be much appreciated if you don't mind! Big Grin