當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ECS類代碼示例

本文整理匯總了PHP中ECS的典型用法代碼示例。如果您正苦於以下問題:PHP ECS類的具體用法?PHP ECS怎麽用?PHP ECS使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ECS類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addTongji

function addTongji($domain, $ip)
{
    global $db, $db_host, $db_user, $db_pass, $db_name, $prefix;
    $ecs = new ECS($db_name, $prefix);
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
    list($dom, $domainname, $ext) = explode('.', $domain);
    $domainname .= '.' . $ext;
    $namemd5 = md5($domainname);
    $userip = $ip;
    try {
        $sql = 'INSERT INTO ' . $ecs->table('userinfo') . ' (`domain_name`, `name_md5`, `addtime`, `userip`, `userpv`) VALUES ("' . $domainname . '","' . $namemd5 . '",' . time() . ',"' . $userip . '",0) ON DUPLICATE KEY UPDATE userpv=userpv+1';
        $db->query($sql);
        return '1';
    } catch (Exception $e) {
        return '0';
    }
}
開發者ID:seanguo166,項目名稱:yinoos,代碼行數:17,代碼來源:record.php

示例2: addslashes_deep

{
    if (!empty($_GET))
    {
        $_GET  = addslashes_deep($_GET);
    }
    if (!empty($_POST))
    {
        $_POST = addslashes_deep($_POST);
    }

    $_COOKIE   = addslashes_deep($_COOKIE);
    $_REQUEST  = addslashes_deep($_REQUEST);
}

/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());


/* 初始化數據庫類 */
require(ROOT_PATH . 'includes/cls_mysql.php');
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;

/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');

/* 載入係統參數 */
$_CFG = load_config();
開發者ID:noikiy,項目名稱:mdwp,代碼行數:31,代碼來源:init.php

示例3: clear_all_files

clear_all_files();
/* 鍔犺澆鏁版嵁搴撻厤緗?枃浠 */
if (file_exists(ROOT_PATH . 'data/config.php')) {
    include ROOT_PATH . 'data/config.php';
} elseif (file_exists(ROOT_PATH . 'includes/config.php')) {
    if (!rename(ROOT_PATH . 'includes/config.php', ROOT_PATH . 'data/config.php')) {
        die('Can\'t move config.php, please move it from includes/ to data/ manually!');
    }
    include ROOT_PATH . 'data/config.php';
} else {
    die('Can\'t find config.php!');
}
require ROOT_PATH . 'includes/cls_ecshop.php';
require ROOT_PATH . 'includes/cls_mysql.php';
/* 鍒涘緩 ECSHOP 瀵矽薄 */
$ecs = new ECS($db_name, $prefix);
/* 鐗堟湰瀛楃?闆嗗彉閲
$ec_version_charset = 'gbk';
*/
$mysql_charset = $ecshop_charset = '';
/* 鑷?姩鑾峰彇鏁版嵁琛ㄧ殑瀛楃?闆 */
$tmp_link = @mysql_connect($db_host, $db_user, $db_pass);
if (!$tmp_link) {
    die("Can't pConnect MySQL Server({$db_host})!");
} else {
    mysql_select_db($db_name);
    $query = mysql_query(" SHOW CREATE TABLE " . $ecs->table('users'), $tmp_link) or die(mysql_error());
    $tablestruct = mysql_fetch_row($query);
    preg_match("/CHARSET=(\\w+)/", $tablestruct[1], $m);
    if (strpos($m[1], 'utf') === 0) {
        $mysql_charset = str_replace('utf', 'utf-', $m[1]);
開發者ID:cjjmem,項目名稱:lywj,代碼行數:31,代碼來源:init.php

示例4: addslashes_deep

require ROOT_PATH . 'includes/lib_base.php';
require ROOT_PATH . 'includes/lib_common.php';
require ROOT_PATH . 'includes/lib_time.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
$data_dir = $ecs->data_dir();
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess_name = defined("SESS_NAME") ? SESS_NAME : 'ECS_ID';
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), $sess_name);
/* 載入係統參數 */
$_CFG = load_config();
/* 初始化用戶插件 */
$user =& init_users();
if ((DEBUG_MODE & 1) == 1) {
    error_reporting(E_ALL);
開發者ID:dw250100785,項目名稱:ECShop-1,代碼行數:31,代碼來源:init.php

示例5: addslashes_deep

require ROOT_PATH . 'include/lib_insert.php';
require ROOT_PATH . 'include/lib_goods.php';
require ROOT_PATH . 'include/lib_article.php';
/* 對用戶傳入的變量進行轉義操作。 */
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'include/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');
/* 載入係統參數 */
$_CFG = load_config();
$_CFG['URL_HTTP_HOST'] = $config['site_url'];
/* 載入語言文件 */
require ROOT_PATH . 'lang/' . $_CFG['lang'] . '/common.php';
if ($_CFG['shop_closed'] == 1) {
開發者ID:seanguo166,項目名稱:microdistribution,代碼行數:31,代碼來源:init.php

示例6: addslashes_deep

require ROOT_PATH . 'includes/lib_goods.php';
require ROOT_PATH . 'includes/lib_article.php';
require ROOT_PATH . 'includes/lib_ecmoban.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建  對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');
/* 載入係統參數 */
$_CFG = load_config();
/* 當前網站地址 */
$present_url = agency_url();
#####   配置信息(放至所有配置網站一些信息)   #####################
$_CFG['o2o_img_url'] = 'http://' . $present_url;
開發者ID:dlpc,項目名稱:ecshop,代碼行數:31,代碼來源:init.php

示例7: addslashes_deep

    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 對路徑進行安全處理 */
if (strpos(PHP_SELF, '.php/') !== false) {
    ecs_header("Location:" . substr(PHP_SELF, 0, strpos(PHP_SELF, '.php/') + 4) . "\n");
    exit;
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 創建錯誤處理對象 */
$err = new ecs_error('message.htm');
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ECSCP_ID');
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = '';
} elseif (($_REQUEST['act'] == 'login' || $_REQUEST['act'] == 'logout' || $_REQUEST['act'] == 'signin') && strpos(PHP_SELF, '/privilege.php') === false) {
開發者ID:BGCX261,項目名稱:zishashop-svn-to-git,代碼行數:31,代碼來源:init.php

示例8: addslashes_deep

require ROOT_PATH . 'includes/lib_goods.php';
require ROOT_PATH . 'includes/lib_article.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
//$db_name = 'mescake';
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');
/* 載入係統參數 */
$_CFG = load_config();
/* 載入語言文件 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/common.php';
if ($_CFG['shop_closed'] == 1) {
    /* 商店關閉了,輸出關閉的消息 */
開發者ID:fromzyy2ann,項目名稱:mescake,代碼行數:31,代碼來源:init.php

示例9: addslashes_deep

require ROOT_PATH . 'includes/lib_goods.php';
require ROOT_PATH . 'includes/lib_article.php';
require ROOT_PATH . 'themes/xm2013/init.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');
/* 載入係統參數 */
$_CFG = load_config();
/* 載入語言文件 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/common.php';
if ($_CFG['shop_closed'] == 1) {
    /* 商店關閉了,輸出關閉的消息 */
開發者ID:nanhuacrab,項目名稱:ecshop,代碼行數:31,代碼來源:init.php

示例10: define

}
define('ROOT_PATH', str_replace('json/includes/init.php', '', str_replace('\\', '/', __FILE__)));
if (defined('DEBUG_MODE') == false) {
    define('DEBUG_MODE', 0);
}
if (PHP_VERSION >= '5.1' && !empty($timezone)) {
    date_default_timezone_set($timezone);
}
if (isset($_SERVER['PHP_SELF'])) {
    define('PHP_SELF', $_SERVER['PHP_SELF']);
} else {
    define('PHP_SELF', $_SERVER['SCRIPT_NAME']);
}
require '../includes/inc_constant.php';
require '../includes/cls_ecshop.php';
require '../includes/cls_error.php';
require '../includes/lib_time.php';
require '../includes/lib_base.php';
require '../includes/lib_common.php';
require './includes/lib_main.php';
require './includes/cls_exchange.php';
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require '../includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 載入係統參數 */
$_CFG = load_config();
開發者ID:firsteam,項目名稱:falcons,代碼行數:31,代碼來源:init.php

示例11: ecs_header

        $class_code = $_COOKIE['ECSCP']['class_code'];
    } else {
        ecs_header("Location: ../login.php\n");
        exit;
    }
} else {
    $class_code = $_SESSION["class_code"];
}
if ($school_code == 'super' || $class_code == 'super') {
    clearstatcache();
    ecs_header("Location: ../login.php\n");
    exit;
}
$db_name = $school_code . "_school";
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/*重新連接數據庫*/
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 初始化 action */
if (!isset($_REQUEST['act'])) {
    $_REQUEST['act'] = 'list';
}
/* 載入係統參數 */
$_CFG = load_config();
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/common.php';
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/log_action.php';
if (file_exists(ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF))) {
    include ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF);
開發者ID:dalinhuang,項目名稱:hteacher,代碼行數:31,代碼來源:init.php

示例12: addslashes_deep

require ROOT_PATH . 'includes/inc_constant.php';
require ROOT_PATH . 'includes/cls_error.php';
require ROOT_PATH . 'includes/lib_insert.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', '/' . $ecs->data_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db_host = $db_user = $db_pass = $db_name = NULL;
$yhcwebsite = "http://weixin.dream-gardens.com.cn/";
$yhctestdb = new cls_mysql("112.124.110.58", "root", "dream@sh123data", "yhctest");
/* 創建錯誤處理對象 */
$err = new ecs_error('message.dwt');
/* 載入係統參數 */
$_CFG = load_config();
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ecsid');
define('SESS_ID', $sess->get_session_id());
開發者ID:naliduo,項目名稱:ecshop,代碼行數:31,代碼來源:init.php

示例13: define

}
define('PHP_SELF', $php_self);
// 通用包含文件
require ROOT_PATH . 'data/config.php';
require ROOT_PATH . 'includes/lib_common.php';
require ROOT_PATH . 'includes/cls_mysql.php';
/* 兼容ECShopV2.5.1版本載入庫文件 */
if (!function_exists('addslashes_deep')) {
    require ROOT_PATH . 'includes/lib_base.php';
}
/* 兼容ECShopV2.5.1版本 */
if (!defined('EC_CHARSET')) {
    define('EC_CHARSET', 'utf-8');
}
/* 初始化包含文件 */
require ROOT_PATH . 'includes/inc_constant.php';
require ROOT_PATH . 'includes/cls_ecshop.php';
require ROOT_PATH . 'includes/lib_time.php';
require ROOT_PATH . 'includes/lib_main.php';
require ROOT_PATH . 'includes/lib_insert.php';
require ROOT_PATH . 'includes/lib_goods.php';
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
/* 初始化數據庫類 */
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 載入係統參數 */
$_CFG = load_config();
$data = array('service_phone' => $_CFG['service_phone'], 'site_url' => dirname($GLOBALS['ecs']->url()), 'goods_url' => dirname($GLOBALS['ecs']->url()) . '/goods.php?id=', 'shop_closed' => $_CFG['shop_closed'], 'close_comment' => $_CFG['close_comment'], 'shop_reg_closed' => $_CFG['shop_reg_closed'], 'shop_desc' => $_CFG['shop_desc'], 'currency_format' => $_CFG['currency_format'], "time_format" => $_CFG['time_format']);
GZ_Api::outPut(array('data' => $data));
開發者ID:dx8719,項目名稱:ECMobile_Universal,代碼行數:31,代碼來源:config.php

示例14: get_spt_code

/**
 * 獲得spt代碼
 *
 * @access  public
 * @return  string   spt代碼
 */
function get_spt_code()
{
    include(ROOT_PATH . 'data/config.php');
    include_once(ROOT_PATH . 'includes/cls_ecshop.php');
    include_once(ROOT_PATH . 'includes/cls_mysql.php');
    $db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
    $ecs = new ECS($db_name, $prefix);
    $hash_code = $db->getOne("SELECT value FROM " . $ecs->table('shop_config') . " WHERE code='hash_code'");
    $spt = '<script type="text/javascript" src="http://api.ecshop.com/record.php?';
    $spt .= "url=" .urlencode($ecs->url()). "&mod=install&version=" .VERSION. "&hash_code=" . $hash_code . "&charset=" .EC_CHARSET. "&language=" . $GLOBALS['installer_lang'] . "\"></script>";

    return $spt;
}
開發者ID:noikiy,項目名稱:mdwp,代碼行數:19,代碼來源:lib_auto_installer.php

示例15: addslashes_deep

require ROOT_PATH . 'includes/lib_insert.php';
require ROOT_PATH . 'includes/lib_article.php';
require ROOT_PATH . 'includes/lib_new_common.php';
/* 對用戶傳入的變量進行轉義操作。*/
if (!get_magic_quotes_gpc()) {
    if (!empty($_GET)) {
        $_GET = addslashes_deep($_GET);
    }
    if (!empty($_POST)) {
        $_POST = addslashes_deep($_POST);
    }
    $_COOKIE = addslashes_deep($_COOKIE);
    $_REQUEST = addslashes_deep($_REQUEST);
}
/* 創建 ECSHOP 對象 */
$ecs = new ECS($db_name, $prefix);
define('DATA_DIR', $ecs->data_dir());
define('IMAGE_DIR', $ecs->image_dir());
/* 初始化數據庫類 */
require ROOT_PATH . 'includes/cls_mysql.php';
$db = new cls_mysql($db_host, $db_user, $db_pass, $db_name);
$db->set_disable_cache_tables(array($ecs->table('sessions'), $ecs->table('sessions_data'), $ecs->table('cart')));
$db_host = $db_user = $db_pass = $db_name = NULL;
/* 載入係統參數 */
$_CFG = array("lang" => "zh_cn", "template" => "default", "hash_code" => "feb0af8dda696ecc1a9ba790973096a8", "captcha" => "0");
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if ((DEBUG_MODE & 1) == 1) {
    error_reporting(E_ALL);
} else {
開發者ID:dalinhuang,項目名稱:hteacher,代碼行數:31,代碼來源:sinit.php


注:本文中的ECS類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。