Default 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(<option>basic</option>...))

PHP Code:
?>
<?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>
2. Create popupoff.css

HTML Code:
#popup {display: none;}
3. Create popupon.css

HTML Code:
#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;
}
4. config.inc.php:

a. Search:

PHP Code:
<?php
Replace with:

PHP Code:
<?php $templateex $_GET['wert'];
b. Search:

PHP Code:
$this->sTheme 'basic'
Replace with:

PHP Code:
if ( $templateex == '' ) { 
             
$this->sTheme 'basic';
        } else {
                    
$this->sTheme $templateex;
                } 
5. core/oxsession.php

Search:

PHP Code:
return $sUrl
Replace with:

PHP Code:
//  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
Reply With Quote