Jump to content
  • 0

How do i select bootstrap as theme from URL?


Question

Posted (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

Edited by arvinraj

4 answers to this question

Recommended Posts

  • 0
Posted

Why are your players browsing your website through your patcher?

 

On the flip-side, it'd be a nice feature to have.

  • 0
Posted (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 by Cynical89
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...