Template switching question

I'm trying to build a php function that will switch to a specific site template if a condition is met.  Anybody know how to do this?

 

For example:

 

if ($condition->isBlaBlaBla()) {
// code to switch template
}

 

If a user is browsing my site, and a specific condition is met, say browsing my site with firefox, i want to change the template automatically. Not for everybody...just for that one user.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 17 Apr 2011

I ♥ Beer

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 17 Apr 2011

I don't know how to go about this with PHP, but I do know you can do this with JavaScript in the header of the template.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 17 Apr 2011

 

I don't know how to go about this with PHP, but I do know you can do this with JavaScript in the header of the template.

It has to be a php function in my application.  I guess I need to read up on setting browser cookies.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 18 Apr 2011

This is making my head hurt.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 18 Apr 2011

setcookie('skin', 'TemplateName');

Then to make it happen you need to reload the current page, or redirect to another one.


https://www.deanbassett.com
Quote · 18 Apr 2011

 

setcookie('skin', 'TemplateName');

Then to make it happen you need to reload the current page, or redirect to another one.


That's what I was looking for.  I need to put the function in header.inc.php, so I already see that I'll have to first test if the cookie is already set, and only call setcookie('skin', 'TemplateName'); if it isn't.  Since this needs to happen on every entry page, I don't want to reload the page every time the user navigates to a new one.  Unfortunately, I know nothing about working with cookies :(

What I'm doing, is working on a one column mobile skin, and want to switch to the skin automatically when the site is being accessed by a mobile device.

My opinions expressed on this site, in no way represent those of Boonex or Boonex employees.
Quote · 18 Apr 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.