CMS SLAED

22.06.2008 - Блок смены темы оформления

Разместил: SLAED CMSКатегория: Блоки
Размер файла: 2.46 KBДата: 22.06.2008
Версия: 1.0Скачали: 114

Блок смены темы оформления
Модифицирует функционал смены темы оформления системы, что в свою очередь даёт возможность смены оформления проекта для всех посетителей непосредственно в блоке, там, где он активирован.

Данный блок весьма удобен для проектов, которые занимаются разработкой или продажей тем.


Установка

1. Разархивируйте все файлы из скачанного архива.
2. Импортируйте все файлы из папки html/ в Вашу директорию сайта.
3. Войдите в меню администратора и добавьте блок "block-theme.php" в отделе "Блоки и баннеры".

Найдите и о ткройте файл: function/function.php

Найдите функцию:

PHP - Код
function get_theme() {
global
$user, $conf;
if (!
defined("ADMIN_FILE") && is_user()) {
$utheme = $user[5];
if (
file_exists("templates/$utheme") && $utheme != "") {
$theme = $utheme;
} else {
$theme = $conf['theme'];
}
} elseif (!
defined("ADMIN_FILE")) {
$theme = $conf['theme'];
} elseif (
defined("ADMIN_FILE")) {
$theme = "admin";
}
return
$theme;
}


Замените на новую функцию:

PHP - Код
function get_theme() {
global
$user, $conf;
if (!
defined("ADMIN_FILE") && is_user()) {
if (isset(
$_POST['user_theme'])) {
$utheme = $_POST['user_theme'];
setcookie("user_theme", $utheme);
} elseif (isset(
$_COOKIE['user_theme'])) {
$utheme = $_COOKIE['user_theme'];
} else {
$utheme = $user[5];
}
if (
file_exists("templates/$utheme") && $utheme != "") {
$theme = $utheme;
} else {
$theme = $conf['theme'];
}
} elseif (!
defined("ADMIN_FILE") && !is_user()) {
if (isset(
$_POST['user_theme'])) {
$theme = $_POST['user_theme'];
setcookie("user_theme", $theme);
} elseif (isset(
$_COOKIE['user_theme'])) {
$theme = $_COOKIE['user_theme'];
} else {
$theme = $conf['theme'];
}
} elseif (
defined("ADMIN_FILE")) {
$theme = "admin";
}
return
$theme;
}

Опубликовано на сайте: http://www.slaed.net
Прямая ссылка: http://www.slaed.net/index.php?name=files&op=view&id=855