arvinraj Posted July 31, 2016 Posted July 31, 2016 (edited) Hey guys, I have FluxCP installed with the default and bootstrap theme. For ordinary web viewing, I'd like default theme to be selected. However, for my patcher file, I'd like users to view the site from the bootstrap theme due to the window size limitation. Is there a way i can direct the URL to select the bootstrap theme from within the patcher? E.G http://mysite/?module=news&preferred_theme_name=bootstrap Edited July 31, 2016 by arvinraj
0 Akkarin Posted July 31, 2016 Posted July 31, 2016 Why are your players browsing your website through your patcher? On the flip-side, it'd be a nice feature to have.
0 Hijirikawa Posted August 3, 2016 Posted August 3, 2016 Any ideas if that would be do-able on patcher? It really is a good idea.
0 arvinraj Posted August 6, 2016 Author Posted August 6, 2016 (edited) bump Edited August 6, 2016 by arvinraj
0 Cynical89 Posted August 22, 2016 Posted August 22, 2016 (edited) Using JavaScript you can get the window dimensions and then render the theme via php based on the dimensions of the window. So if the patcher is viewing the website in a 400px x 400px screen you can do something like the following. set this near the top of the index.php if(!isset($_GET('r')) { echo "<script language=\"JavaScript\"> <!-- document.location=\"$PHP_SELF?r=1&width=\"+screen.width+\"&Height=\"+screen.height; //--> </script>"; } else { if(isset($_GET['width']) && isset($_GET['Height'])) { $width = $_GET['width']; $height = $_GET['Height']; } } then set this down where you set the session info in the index.php if($width == 400 && $height == 400) { Flux::config('ThemeName', array('bootstrap')); } Again, this assumes the patcher window is 400px x 400 px. Also note my php is a little rusty, so this may not be 100% but it should put you on the right track Edited August 22, 2016 by Cynical89
Question
arvinraj
Hey guys,
I have FluxCP installed with the default and bootstrap theme. For ordinary web viewing, I'd like default theme to be selected.
However, for my patcher file, I'd like users to view the site from the bootstrap theme due to the window size limitation.
Is there a way i can direct the URL to select the bootstrap theme from within the patcher?
E.G
4 answers to this question
Recommended Posts