Die Auswahlbox ist von
www.blogpotato.de
Ich weiß nämlich grad gar nicht, in welcher Datei (welchen Dateien?) ich den Switchfall einbauen müsste.
PHP-Code:
xt:C Template Switcher für 3.04 SP2.1:
Alle Änderungen erfolgen auf eigene Gefahr und wie immer gilt: Backup nicht vergessen!
[template] steht für den Namen des Templates
/**
* Template Switcher
**/
/*-----------------------------------------------------------------------------------------------*/
includes/application_top.php
/*-----------------------------------------------------------------------------------------------*/
Suchen nach:
while ($configuration = xtc_db_fetch_array($configuration_query)) {
define($configuration['cfgKey'], $configuration['cfgValue']);
}
Ersetzen durch:
while ($configuration = xtc_db_fetch_array($configuration_query)) {
// modified
// msslovi0 2006-11-30
// Template-Switcher
// continued after session is started
if($configuration['cfgKey']=="CURRENT_TEMPLATE") {
$template = $configuration['cfgValue'];
} else {
define($configuration['cfgKey'], $configuration['cfgValue']);
}
// end msslovi0
}
Suchen nach:
// check the Agent
Danach einfügen:
// modified
// msslovi0 2006-11-30
// Template-Switcher, part II
if(isset($_GET["tpl"])) {
$_SESSION["tpl"] = $_GET["tpl"];
}
if(isset($_SESSION["tpl"]) && file_exists(DIR_FS_CATALOG."templates/".$_SESSION["tpl"])) {
define("CURRENT_TEMPLATE", $_SESSION["tpl"]);
} else {
define("CURRENT_TEMPLATE", $template);
}
// end msslovi0
/*-----------------------------------------------------------------------------------------------*/
includes/header.php
/*-----------------------------------------------------------------------------------------------*/
Suchen nach:
$smarty->assign('store_name',TITLE);
Danach einfügen:
// modified
// msslovi0 2006-11-30
// Template-Switcher, part III
$handle = opendir(DIR_FS_CATALOG."templates/");
$t_array = array();
while (false !== ($file = readdir($handle))) {
if(!preg_match("/^\./", $file)) {
$t_array[] = $file;
}
}
sort($t_array);
for($i=0;$i<sizeof($t_array);$i++) {
$tpls[] = array("id" => $t_array[$i], 'text' => $t_array[$i]);
}
$parameters = xtc_get_all_get_params(array ('tpl', 'x', 'y'));
parse_str(urldecode($parameters), $para);
$hidden = "";
for(reset($para); $k = key($para); next($para)) {
$hidden .= sprintf("<input type='hidden' name='%s' value='%s' />", $k, $para[$k]);
}
$t_select = xtc_draw_pull_down_menu('tpl', $tpls, CURRENT_TEMPLATE, 'onchange="this.form.submit()"');
$smarty->assign('TEMPLATE_SWITCHER', sprintf("%s%s <noscript>%s</noscript>%s</form>", xtc_draw_form('template-switcher', $PHP_SELF, 'get'), $t_select, xtc_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE), $hidden));
// end msslovi0
/*-----------------------------------------------------------------------------------------------*/
templates/[template]/index.html
/*-----------------------------------------------------------------------------------------------*/
{$TEMPLATE_SWITCHER} einbauen