Esempio n. 1
0
 function getInstance()
 {
     //		if (!isset(self::$instance[get_class()])) {
     if (!isset(self::$instance)) {
         self::$instance = new Templets();
     }
     return self::$instance;
 }
Esempio n. 2
0
 function getNoBuilt()
 {
     global $_GET;
     $built = $temp = array();
     //		$_this = & Templets::getInstance();
     $_this = Templets::getInstance();
     $installed = $_this->getInstalled();
     foreach ($installed as $key => $val) {
         $temp[] = $val['directory'];
     }
     if (isset($_GET['type']) && $_GET['type'] == "system") {
         $dir = PHPB2B_ROOT . $this->system_skin_dir . '/';
         $this->theme_dir = $this->system_skin_dir;
         $type = "system";
         $css_dir = "";
         //			$css_dir = "css".DS;
     } else {
         $dir = PHPB2B_ROOT . $this->skin_dir . '/';
         $this->theme_dir = $this->skin_dir;
         $type = "user";
         $css_dir = "";
     }
     if (is_dir($dir)) {
         $template_dir = dir($dir);
         while ($entry = $template_dir->read()) {
             $tpldir = realpath($dir . '/' . $entry);
             if (!in_array($entry, array('.', '..', '.svn')) && !in_array($this->theme_dir . "/" . $entry . "/", $temp) && is_dir($tpldir)) {
                 $data = $this->getSkinData($tpldir . DS . $css_dir . "style.css");
                 if (!empty($data)) {
                     $screenshot = false;
                     foreach (array('png', 'gif', 'jpg', 'jpeg') as $ext) {
                         if (file_exists($tpldir . DS . "screenshot." . $ext)) {
                             $screenshot = URL . $this->theme_dir . '/' . $entry . "/screenshot." . $ext;
                             break;
                         }
                     }
                     extract($data);
                     $built[] = array('entry' => $entry, 'label' => $entry, 'name' => $Name, 'title' => $Name, 'type' => $type, 'style' => $Style, 'background' => $Style, 'available' => 0, 'directory' => $this->theme_dir . '/' . $entry . '/', 'author' => $Author, 'picture' => $screenshot);
                 }
             }
         }
     }
     return $built;
 }
Esempio n. 3
0
        }
    }
}
$tid = getset("sitetemplets")->value;
$sql = "select * from yiqi_templets where status = 'ok' order by tid";
$templetslist = $yiqi_db->get_results(CheckSql($sql));
$count = count($templetslist);
$action = $_POST['action'];
if ($action == "update") {
    $tempid = $_POST["tid"];
    $tempid = isset($tempid) && is_numeric($tempid) ? $tempid : 0;
    if ($tempid == 0 || !is_numeric($tempid)) {
        exit;
    }
    require_once '../include/templets.class.php';
    $tempinfo = new Templets();
    $tempinfo->compile_dir = YIQIROOT . '/cache/compile/';
    $tempinfo->clear_compiled_tpl();
    upset("sitetemplets", $tempid);
    ShowMsg("网站模板设置成功");
} else {
    if ($action == "delete") {
        $tempid = $_POST["tid"];
        $tempid = isset($tempid) && is_numeric($tempid) ? $tempid : 0;
        if ($tempid == 0 || !is_numeric($tempid)) {
            exit;
        }
        $sql = "delete from yiqi_templets where tid = '{$tid}' limit 1";
        if ($yiqi_db->query(CheckSql($sql)) == 1) {
            ShowMsg("指定模板删除成功");
        }
Esempio n. 4
0
<?php

/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "room.share.php";
uses("templet");
check_permission("space");
$templet = new Templets();
if (!$company->Validate($companyinfo)) {
    flash("pls_complete_company_info", "company.php", 0);
}
if (isset($_POST['updateSpaceName']) && !empty($_POST['data']['space_name'])) {
    $space_name = trim($_POST['data']['space_name']);
    $i18n = new L10n();
    $space_name = $i18n->translateSpaceName($space_name);
    $result = $member->updateSpaceName(array("id" => $the_memberid), $space_name);
    if ($result) {
        $member->clearCache($the_memberid);
        $member->updateMemberCaches($the_memberid);
        flash("success");
    }
}
if (isset($_POST['save']) && !empty($_POST['data']['member']['styleid'])) {
    $templet_id = intval($_POST['data']['member']['styleid']);
    $pdb->Execute("UPDATE {$tb_prefix}members SET templet_id=" . $templet_id . " WHERE id=" . $the_memberid);
    $member->clearCache($the_memberid);
Esempio n. 5
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('CURSCRIPT', 'templet');
require "../libraries/common.inc.php";
uses("templet", "typeoption", "setting");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
include CACHE_PATH . "cache_membergroup.php";
include CACHE_PATH . "cache_type.php";
$cache = new Caches();
$setting = new Settings();
$templet = new Templets();
$typeoption = new Typeoption();
$templet_controller = new Templet();
$conditions = null;
$tpl_file = "templet";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data']['templet']['title'])) {
    $vals = array();
    $vals = $_POST['data']['templet'];
    if (!in_array(0, $_POST['data']['require_membertype']) && !empty($_POST['data']['require_membertype'])) {
        $res = "[" . implode("][", $_POST['data']['require_membertype']) . "]";
        $vals['require_membertype'] = $res;
    } elseif (!empty($_POST['data']['require_membertype'])) {
        $vals['require_membertype'] = 0;
    }
    if (!in_array(0, $_POST['data']['require_membergroups']) && !empty($_POST['data']['require_membergroups'])) {
Esempio n. 6
0
/**
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
define('CURSCRIPT', 'templet');
require "../libraries/common.inc.php";
uses("templet", "typeoption", "setting");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
$G['membergroup'] = cache_read("membergroup");
require CACHE_COMMON_PATH . "cache_type.php";
$cache = new Caches();
$setting = new Settings();
$templet = new Templets();
$typeoption = new Typeoption();
$templet_controller = new Templet();
$conditions = null;
$tpl_file = "templet";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['save']) && !empty($_POST['data']['templet']['title'])) {
    $vals = array();
    $vals = $_POST['data']['templet'];
    if (isset($_POST['data']['require_membertype']) && !in_array(0, $_POST['data']['require_membertype']) && !empty($_POST['data']['require_membertype'])) {
        $res = "[" . implode("][", $_POST['data']['require_membertype']) . "]";
        $vals['require_membertype'] = $res;
    } elseif (!empty($_POST['data']['require_membertype'])) {
        $vals['require_membertype'] = 0;
    }
    if (isset($_POST['data']['require_membergroups']) && !in_array(0, $_POST['data']['require_membergroups']) && !empty($_POST['data']['require_membergroups'])) {
Esempio n. 7
0
<?php

require_once 'templets.class.php';
require_once 'templets.func.php';
require_once 'article.class.php';
require_once 'product.class.php';
require_once 'link.class.php';
require_once 'category.class.php';
require_once 'navigate.class.php';
require_once 'cache.class.php';
require_once 'meta.class.php';
$tempinfo = new Templets();
$templets = $tempinfo->GetDefaultTemplets();
if ($templets == null) {
    $templets->directory = "default";
}
$tempinfo->template_dir = YIQIROOT . '/templets/' . $templets->directory . '/';
$tempinfo->assign("templets", $templets);
$tempinfo->compile_dir = YIQIROOT . '/cache/compile/';
$sql = "select * from yiqi_settings";
$settinglist = $yiqi_db->get_results(CheckSql($sql));
if (count($settinglist) > 0) {
    foreach ($settinglist as $settinginfo) {
        $tempinfo->assign($settinginfo->varname, $settinginfo->value);
    }
}
$categorydata = new Category();
$categorylist = $categorydata->GetSubCategory(0, "product");
$tempinfo->assign("categorylist", $categorylist);
$tempinfo->register_function("formaturl", "formaturl");
$tempinfo->register_function("readrss", "readrss");