How to make a template-changer

Hello everybody!!!

It seems so, that may oxid-users want to use a template-changer. Look at: http://www.meinfan.de

Because of easter i`ll give you a possibility to do this:

1: At the end of index.php (Please adapt the source: Shopurl, quantity of templates and the names of folders(basic…))

?>
<?php 
if ($_GET['s']==1) { echo ('<link rel="stylesheet" type="text/css" href="http://Shopurl/popupoff.css">'); } 
else { echo ('<link rel="stylesheet" type="text/css" href="http://Shopurl/popupon.css">'); } 
?> 
<div id="popup">
<div id="close"><a href="?s=1">X</a></div>
<form action="<?php echo basename($PHP_SELF); ?>">
<select name="wert"onchange="this.form.submit()">
<option>Templatechoice</option>
<option>basic</option>
<option>basic1</option>
<option>basic2</option>
<option>basic3</option>
<option>basic4</option>
</select>
</form>
</div>
  1. Create popupoff.css
#popup {display: none;}
  1. Create popupon.css
#close a {
background-color: #000000;
color: #ffffff;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
width: 16px;
font-weight: bold;
position: absolute;
top: 2px;
right: 2px;
text-decoration: none;
border: 1px solid #ffffff;
text-align: center;
font-size: 14px;
}
#popup {
background: #990000;
width: 180px;
height:60px;
position: absolute;
top: 75px;
right: 60px;
border: 2px solid #d4d0c8;
}
  1. config.inc.php:

a. Search:

<?php

Replace with:

<?php $templateex = $_GET['wert'];

b. Search:

$this->sTheme = 'basic';

Replace with:

if ( $templateex == '' ) { 
             $this->sTheme = 'basic';
        } else {
                    $this->sTheme = $templateex;
                }

  1. core/oxsession.php

Search:

return $sUrl;

Replace with:

//  return $sUrl; //ORIGINAL
		
		$templateex = $_GET['wert'];
		if ( $templateex == '' ) { 
             return $sUrl;
        } else {
                    return $sUrl . '?wert=' . $templateex;
        }
    }

Ready.

If you think, that`s good and want to support me too, you can do this with a little donation for my social project.

PayPal: Templatechanger Offer

Greeting, thanks & HAPPY EASTER!

Cutty