destoon代码从头到尾捋一遍 - 岩_生 - 博客园

mikel阅读(977)

来源: destoon代码从头到尾捋一遍 – 岩_生 – 博客园

destoon® B2B网站管理系统(以下简称destoon)由西安嘉客信息科技有限责任公司独立研发并推出,对其拥有完全知识产权,中国国家版权局计算机软件著作权登记号:2009SR037570。
系统使用当前流行的PHP语言开发,以MySQL为数据库,采用B/S架构,MVC模式开发。融入了模型化、模板、缓存、AJAX、SEO等前沿技术。与同类产品相比,系统功能更加强大、使用更加简单、运行更加稳定、安全性更强,效率更高,用户体验更好。系统开源发布,便于二次开发、功能整合、个性修改。
代码首先包含common.inc.php文件
在common.inc.php文件中,首先定义常量。
define('IN_DESTOON', true);
define('IN_ADMIN', defined('DT_ADMIN') ? true : false);
define('DT_ROOT', str_replace("\\", '/', dirname(__FILE__)));
if(defined('DT_REWRITE')) include DT_ROOT.'/include/rewrite.inc.php';//是否定义了url伪静态?
$CFG = array();//网站整体配置信息
require DT_ROOT.'/config.inc.php';//-----------------网站配置文件
define('DT_PATH', $CFG['url']);
define('DT_DOMAIN', $CFG['cookie_domain'] ? substr($CFG['cookie_domain'], 1) : '');
define('DT_WIN', strpos(strtoupper(PHP_OS), 'WIN') !== false ? true: false);
define('DT_CHMOD', ($CFG['file_mod'] && !DT_WIN) ? $CFG['file_mod'] : 0);
define('DT_URL', $CFG['url']);//Fox 3.x
define('DT_LANG', $CFG['language']);
define('DT_KEY', $CFG['authkey']);
define('DT_CHARSET', $CFG['charset']);
define('DT_CACHE', $CFG['cache_dir'] ? $CFG['cache_dir'] : DT_ROOT.'/file/cache');
define('DT_SKIN', DT_PATH.'skin/'.$CFG['skin'].'/');
define('SKIN_PATH', DT_PATH.'skin/'.$CFG['skin'].'/');//For 2.x
define('VIP', $CFG['com_vip']);
define('errmsg', 'Invalid Request');
随后加载网站基本功能
$L = array();
include DT_ROOT.'/lang/'.DT_LANG.'/lang.inc.php';//语言信息
require DT_ROOT.'/version.inc.php';
require DT_ROOT.'/include/global.func.php';//--------全局函数
require DT_ROOT.'/include/tag.func.php';//-----------标签函数
require DT_ROOT.'/api/im.func.php';//----------------聊天工具
require DT_ROOT.'/api/extend.func.php';//------------自己写的扩展函数
if(!$MQG && $_POST) $_POST = daddslashes($_POST);
if(!$MQG && $_GET) $_GET = daddslashes($_GET);
if(function_exists('date_default_timezone_set')) date_default_timezone_set($CFG['timezone']);
$DT_PRE = $CFG['tb_pre'];
$DT_QST = $_SERVER['QUERY_STRING'];//----------------querystring
$DT_TIME = time() + $CFG['timediff'];//--------------当前时间
$DT_IP = get_env('ip');
$DT_URL = get_env('url');
$DT_REF = get_env('referer');
$DT_BOT = is_robot();
链接数据库,建立缓存。
header("Content-Type:text/html;charset=".DT_CHARSET);
require DT_ROOT.'/include/db_'.$CFG['database'].'.class.php';//加载数据库类
require DT_ROOT.'/include/cache_'.$CFG['cache'].'.class.php';//加载缓存类
if($_POST) extract($_POST, EXTR_SKIP);//解析post请求的数据
if($_GET) extract($_GET, EXTR_SKIP);//解析get请求的数据
$db_class = 'db_'.$CFG['database'];
$db = new $db_class;
$db->halt = (DT_DEBUG || IN_ADMIN) ? 1 : 0;
$db->pre = $CFG['tb_pre'];
$db->connect($CFG['db_host'], $CFG['db_user'], $CFG['db_pass'], $CFG['db_name'], $CFG['db_expires'], $CFG['db_charset'], $CFG['pconnect']);
$dc = new dcache();
$dc->pre = $CFG['cache_pre'];
加载模块的基本配置
$DT = $MOD = $EXT = $CSS = $DTMP = $CAT = $ARE = $AREA = array();
$CACHE = cache_read('module.php');
if(!$CACHE) {
//没有缓存模块,就读取缓存模块。
require_once DT_ROOT.'/admin/global.func.php';
require_once DT_ROOT.'/include/post.func.php';
require_once DT_ROOT.'/include/cache.func.php';
    cache_all();
$CACHE = cache_read('module.php');
}
$DT = $CACHE['dt'];
$MODULE = $CACHE['module'];
$EXT = cache_read('module-3.php');
加载模块,读取模块信息,引入模块文件
if(!isset($moduleid)) {
$moduleid = 1;
$module = 'destoon';
} else if($moduleid == 1) {
$module = 'destoon';
} else {
$moduleid = intval($moduleid);
isset($MODULE[$moduleid]) or dheader(DT_PATH);
$module = $MODULE[$moduleid]['module'];
$MOD = $moduleid == 3 ? $EXT : cache_read('module-'.$moduleid.'.php');
include DT_ROOT.'/lang/'.DT_LANG.'/'.$module.'.inc.php';
}
$forward = isset($forward) ? urldecode($forward) : $DT_REF;//------------来源页面
$action = isset($action) ? trim($action) : '';//-------------动作指令
//判断用户登录
$destoon_auth = get_cookie('auth');
if($destoon_auth) {
$_dauth = explode("\t", decrypt($destoon_auth, md5(DT_KEY.$_SERVER['HTTP_USER_AGENT'])));
//print_r($_dauth);SELECT userid,username,groupid,admin FROM destoon_member
$_userid = isset($_dauth[0]) ? intval($_dauth[0]) : 0;
$_username = isset($_dauth[1]) ? trim($_dauth[1]) : '';
$_groupid = isset($_dauth[2]) ? intval($_dauth[2]) : 3;
$_admin = isset($_dauth[4]) ? intval($_dauth[4]) : 0;
if($_userid && !defined('DT_NONUSER')) {
$_password = isset($_dauth[3]) ? trim($_dauth[3]) : '';
$user = $db->get_one("SELECT username,passport,company,truename,password,groupid,email,message,chat,sound,online,sms,credit,money,loginip,admin,aid,edittime,trade FROM {$DT_PRE}member WHERE userid=$_userid");
if($user && $user['password'] == $_password) {
if($user['groupid'] == 2) dalert(lang('message->common_forbidden'));//禁止用户访问的组别
extract($user, EXTR_PREFIX_ALL, '');
if($user['loginip'] != $DT_IP && ($DT['ip_login'] == 2 || ($DT['ip_login'] == 1 && IN_ADMIN))) {
//单点登录,判断ip
$_userid = 0; set_cookie('auth', '');
dalert(lang('message->common_login', array($user['loginip'])), DT_PATH);
}
} else {
//登录失败
$_userid = 0;
if($db->linked && !isset($swfupload) && strpos($_SERVER['HTTP_USER_AGENT'], 'Flash') === false) set_cookie('auth', '');
}
unset($destoon_auth, $user, $_dauth, $_password);
}
}

if($_userid == 0) { $_groupid = 3; $_username = ''; }
if(!IN_ADMIN) {
if($_groupid == 1) include DT_ROOT.'/module/member/admin.inc.php';
if($_userid && !defined('DT_NONUSER')) {
$db->query("REPLACE INTO {$DT_PRE}online (userid,username,ip,moduleid,online,lasttime) VALUES ('$_userid','$_username','$DT_IP','$moduleid','$_online','$DT_TIME')");
} 
else {
if(timetodate($DT_TIME, 'i') == 10) {
$lastime = $DT_TIME - $DT['online'];
$db->query("DELETE FROM {$DT_PRE}online WHERE lasttime<$lastime");
}
}
}
$MG = cache_read('group-'.$_groupid.'.php');//读取用户组别配置
$_areaids = '';
$_areaid = array();
if($DT&#91;'city'&#93;) {
$AREA or $AREA = cache_read('area.php');
if($_aid) {
$_areaids = $AREA&#91;$_aid&#93;&#91;'child'&#93; ? $AREA&#91;$_aid&#93;&#91;'arrchildid'&#93; : $_aid;
$_areaid = explode(',', $_areaids);
}
} else {
$_aid < 1 or dalert('系统未开启分站功能,您的分站管理帐号暂不可用', $MODULE&#91;2&#93;&#91;'linkurl'&#93;.'logout.php');
}
$session = new dsession();
require DT_ROOT.'/admin/global.func.php';
require DT_ROOT.'/include/post.func.php';
require_once DT_ROOT.'/include/cache.func.php';
isset($file) or $file = 'index';
$secretkey = 'admin_'.strtolower(substr($CFG&#91;'authkey'&#93;, -6));
//echo $secretkey;exit;
if($DT&#91;'authadmin'&#93; == 'session') {
$_destoon_admin = isset($_SESSION&#91;$secretkey&#93;) ? intval($_SESSION&#91;$secretkey&#93;) : 0;
} else {
$_destoon_admin = get_cookie($secretkey);
$_destoon_admin = $_destoon_admin ? intval($_destoon_admin) : 0;
}
$_founder = $CFG&#91;'founderid'&#93; == $_userid ? $_userid : 0;
$_catids = $_childs = '';
$_catid = $_child = array();
if($file != 'login') {
if($_groupid != 1 || $_admin < 1 || !$_destoon_admin) msg('', '?file=login&forward='.urlencode($DT_URL));
//判断用户是否已经登录?如果未登录,直接跳转到登录页面。防止用户构造url。
if(!admin_check()) {
admin_log(1);
$db->query("DELETE FROM {$db->pre}admin WHERE userid=$_userid AND url='?".$DT_QST."'");
msg('警告!您无权进行此操作 Error(00)');
}
}
//是否记录日志
if($DT['admin_log'] && $action != 'import') admin_log();
if($DT['admin_online']) admin_online();
$psize = isset($psize) ? intval($psize) : 0;
if($psize > 0 && $psize != $pagesize) {
$pagesize = $psize;
$offset = ($page-1)*$pagesize;
}

if($module == 'destoon') {

(include DT_ROOT.'/admin/'.$file.'.inc.php') or msg();
} else {
echo $file.'|'.$module;
include DT_ROOT.'/module/'.$module.'/common.inc.php';//加载模块下的common文件
(include MD_ROOT.'/admin/'.$file.'.inc.php') or msg();//加载模块文件
}

DESTOON 配置文件config.inc.php参数说明 - 岩_生 - 博客园

mikel阅读(929)

来源: DESTOON 配置文件config.inc.php参数说明 – 岩_生 – 博客园

$CFG['db_host']
数据库服务器,可以包括端口号,一般为localhost

$CFG['db_user']
数据库用户名,一般为root

$CFG['db_pass']
数据库密码

$CFG['db_name']
数据库名称

$CFG['db_charset']
数据库连接字符集

$CFG['database']
数据库类型,默认为mysql

$CFG['pconnect']
是否使用持久连接

$CFG['tb_pre']
数据表前缀,默认为destoon_

$CFG['charset']
网站字符集

$CFG['path']
系统安装路径(相对于网站根路径的) 以 / 结尾

$CFG['url']
网站访问地址,以 / 结尾

$CFG['absurl']
是否启用绝对地址1=启用[如有任一模块绑定二级域名时必须启用] 0=不启用

$CFG['com_domain']
公司库绑定域名

$CFG['com_dir']
泛解析绑定目录 1=company目录 0=网站根目录

$CFG['com_rewrite']
会员顶级域名ReWrite 1=开启 0=关闭

$CFG['com_vip']
VIP会员名称

$CFG['file_mod']
文件或目录可写属性,Windows服务器可以填0

$CFG['cache_dir']
缓存目录 允许和网站不在同一目录或磁盘分区 
目录必须存在且PHP需具备访问和写入权限 例如设置 E:\cache 结尾不要 \

$CFG['db_expires']
数据库查询结果缓存过期时间(秒) 

$CFG['tag_expires']
数据调用标签缓存过期时间(秒) 

$CFG['template_refresh']
模板自动刷新(0=关闭,1=打开,如不再修改模板,请关闭)

$CFG['template_trim']
去除模板换行等多余标记,可以压缩一定网页体积(0=关闭,1=打开)

$CFG['cookie_domain']
cookie 作用域 例如 .destoon.com 如果绑定了二级域名 此项必须设置

$CFG['cookie_path']
cookie 作用路径

$CFG['cookie_pre']
cookie 前缀

$CFG['timezone']
时区设置(>PHP 5.1),Etc/GMT-8 实际表示的是 GMT+8 GMT+8 

$CFG['timediff']
服务器时间校正 单位(秒) 可以为负数

$CFG['template']
默认模板

$CFG['skin']
默认风格

$CFG['language']
默认语言

$CFG['authkey']
网站安全密钥,建议定期在后台修改 推荐字母和数字组合

$CFG['founderid']
创始人ID
创始人相对于其他超级管理员独具以下系统权限
全站设置 管理员管理 模块管理/设置 数据库管理 模板管理 栏目管理 地区管理 在线升级等系统关键操作

$CFG['edittpl']
是否允许在后台编辑模板 (0=关闭,1=打开)

$CFG['executesql']
是否允许在后台运行SQL语句 (0=关闭,1=打开)

destoon运行流程二次开发必看 - 岩_生 - 博客园

mikel阅读(984)

来源: destoon运行流程二次开发必看 – 岩_生 – 博客园

<?php
代码首先包含common.inc.php文件
在common.inc.php文件中,首先定义常量。
define('IN_DESTOON', true);
define('IN_ADMIN', defined('DT_ADMIN') ? true : false);
define('DT_ROOT', str_replace("\", '/', dirname(__FILE__)));
if(defined('DT_REWRITE')) include  DT_ROOT.'/include/rewrite.inc.php';//是否定义了url伪静态?
$CFG = array();//网站整体配置信息
require DT_ROOT.'/config.inc.php';//-----------------网站配置文件
define('DT_PATH', $CFG&#91;'url'&#93;);
define('DT_DOMAIN', $CFG&#91;'cookie_domain'&#93; ? substr($CFG&#91;'cookie_domain'&#93;,  1) : '');
define('DT_WIN', strpos(strtoupper(PHP_OS), 'WIN') !== false ? true:  false);
define('DT_CHMOD', ($CFG&#91;'file_mod'&#93; && !DT_WIN) ? $CFG&#91;'file_mod'&#93;  : 0);
define('DT_URL', $CFG&#91;'url'&#93;);//Fox 3.x
define('DT_LANG', $CFG&#91;'language'&#93;);
define('DT_KEY', $CFG&#91;'authkey'&#93;);
define('DT_CHARSET', $CFG&#91;'charset'&#93;);
define('DT_CACHE', $CFG&#91;'cache_dir'&#93; ? $CFG&#91;'cache_dir'&#93; :  DT_ROOT.'/file/cache');
define('DT_SKIN', DT_PATH.'skin/'.$CFG&#91;'skin'&#93;.'/');
define('SKIN_PATH', DT_PATH.'skin/'.$CFG&#91;'skin'&#93;.'/');//For 2.x
define('VIP', $CFG&#91;'com_vip'&#93;);
define('errmsg', 'Invalid Request');
随后加载网站基本功能
$L = array();
include DT_ROOT.'/lang/'.DT_LANG.'/lang.inc.php';//语言信息
require DT_ROOT.'/version.inc.php';
require DT_ROOT.'/include/global.func.php';//--------全局函数
require DT_ROOT.'/include/tag.func.php';//-----------标签函数
require DT_ROOT.'/api/im.func.php';//----------------聊天工具
require DT_ROOT.'/api/extend.func.php';//------------自己写的扩展函数
if(!$MQG && $_POST) $_POST = daddslashes($_POST);
if(!$MQG && $_GET) $_GET = daddslashes($_GET);
if(function_exists('date_default_timezone_set'))  date_default_timezone_set($CFG&#91;'timezone'&#93;);
$DT_PRE = $CFG&#91;'tb_pre'&#93;;
$DT_QST = $_SERVER&#91;'QUERY_STRING'&#93;;//----------------querystring
$DT_TIME = time() + $CFG&#91;'timediff'&#93;;//--------------当前时间
$DT_IP = get_env('ip');
$DT_URL = get_env('url');
$DT_REF = get_env('referer');
$DT_BOT = is_robot();
链接数据库,建立缓存。
header("Content-Type:text/html;charset=".DT_CHARSET);
require DT_ROOT.'/include/db_'.$CFG&#91;'database'&#93;.'.class.php';//加载数据库类
require  DT_ROOT.'/include/cache_'.$CFG&#91;'cache'&#93;.'.class.php';//加载缓存类
if($_POST) extract($_POST, EXTR_SKIP);//解析post请求的数据
if($_GET) extract($_GET, EXTR_SKIP);//解析get请求的数据
$db_class = 'db_'.$CFG&#91;'database'&#93;;
$db = new $db_class;
$db->halt = (DT_DEBUG || IN_ADMIN) ? 1 : 0;
$db->pre = $CFG['tb_pre'];
$db->connect($CFG['db_host'], $CFG['db_user'], $CFG['db_pass'],  $CFG['db_name'], $CFG['db_expires'], $CFG['db_charset'],  $CFG['pconnect']);
$dc = new dcache();
$dc->pre = $CFG['cache_pre'];
加载模块的基本配置
$DT = $MOD = $EXT = $CSS = $DTMP = $CAT = $ARE = $AREA = array();
$CACHE = cache_read('module.php');
if(!$CACHE) {
//没有缓存模块,就读取缓存模块。
require_once DT_ROOT.'/admin/global.func.php';
require_once DT_ROOT.'/include/post.func.php';
require_once DT_ROOT.'/include/cache.func.php';
cache_all();
$CACHE = cache_read('module.php');
}
$DT = $CACHE['dt'];
$MODULE = $CACHE['module'];
$EXT = cache_read('module-3.php');
加载模块,读取模块信息,引入模块文件
if(!isset($moduleid)) {
$moduleid = 1;
$module = 'destoon';
} else if($moduleid == 1) {
$module = 'destoon';
} else {
$moduleid = intval($moduleid);
isset($MODULE[$moduleid]) or dheader(DT_PATH);
$module = $MODULE[$moduleid]['module'];
$MOD = $moduleid == 3 ? $EXT :  cache_read('module-'.$moduleid.'.php');
include DT_ROOT.'/lang/'.DT_LANG.'/'.$module.'.inc.php';
}
$forward = isset($forward) ? urldecode($forward) :  $DT_REF;//------------来源页面
$action = isset($action) ? trim($action) :  '';//-------------动作指令
//判断用户登录
$destoon_auth = get_cookie('auth');
if($destoon_auth) {
$_dauth = explode("t", decrypt($destoon_auth,  md5(DT_KEY.$_SERVER['HTTP_USER_AGENT'])));
//print_r($_dauth);SELECT userid,username,groupid,admin FROM  destoon_member
$_userid = isset($_dauth[0]) ? intval($_dauth[0]) : 0;
$_username = isset($_dauth[1]) ? trim($_dauth[1]) : '';
$_groupid = isset($_dauth[2]) ? intval($_dauth[2]) : 3;
$_admin = isset($_dauth[4]) ? intval($_dauth[4]) : 0;
if($_userid && !defined('DT_NONUSER')) {
$_password = isset($_dauth[3]) ? trim($_dauth[3]) : '';
$user = $db->get_one("SELECT  username,passport,company,truename,password,groupid,email,message,chat,sound,online,sms,credit,money,loginip,admin,aid,edittime,trade  FROM {$DT_PRE}member WHERE userid=$_userid");
if($user && $user['password'] == $_password) {
if($user['groupid'] == 2)  dalert(lang('message->common_forbidden'));//禁止用户访问的组别
extract($user, EXTR_PREFIX_ALL, '');
if($user['loginip'] != $DT_IP && ($DT['ip_login'] == 2 ||  ($DT['ip_login'] == 1 && IN_ADMIN))) {
//单点登录,判断ip
$_userid = 0; set_cookie('auth', '');
dalert(lang('message->common_login', array($user['loginip'])),  DT_PATH);
}
} else {
//登录失败
$_userid = 0;
if($db->linked && !isset($swfupload) &&  strpos($_SERVER['HTTP_USER_AGENT'], 'Flash') === false) set_cookie('auth',  '');
}
unset($destoon_auth, $user, $_dauth, $_password);
}
}
if($_userid == 0) { $_groupid = 3; $_username = ''; }
if(!IN_ADMIN) {
if($_groupid == 1) include DT_ROOT.'/module/member/admin.inc.php';
if($_userid && !defined('DT_NONUSER')) {
$db->query("REPLACE INTO {$DT_PRE}online  (userid,username,ip,moduleid,online,lasttime) VALUES  ('$_userid','$_username','$DT_IP','$moduleid','$_online','$DT_TIME')");
} 
else {
if(timetodate($DT_TIME, 'i') == 10) {
$lastime = $DT_TIME - $DT['online'];
$db->query("DELETE FROM {$DT_PRE}online WHERE  lasttime<$lastime");
}
}
}
$MG = cache_read('group-'.$_groupid.'.php');//读取用户组别配置
$_areaids = '';
$_areaid = array();
if($DT&#91;'city'&#93;) {
$AREA or $AREA = cache_read('area.php');
if($_aid) {
$_areaids = $AREA&#91;$_aid&#93;&#91;'child'&#93; ? $AREA&#91;$_aid&#93;&#91;'arrchildid'&#93; :  $_aid;
$_areaid = explode(',', $_areaids);
}
} else {
$_aid < 1 or dalert('系统未开启分站功能,您的分站管理帐号暂不可用',  $MODULE&#91;2&#93;&#91;'linkurl'&#93;.'logout.php');
}
$session = new dsession();
require DT_ROOT.'/admin/global.func.php';
require DT_ROOT.'/include/post.func.php';
require_once DT_ROOT.'/include/cache.func.php';
isset($file) or $file = 'index';
$secretkey = 'admin_'.strtolower(substr($CFG&#91;'authkey'&#93;, -6));
//echo $secretkey;exit;
if($DT&#91;'authadmin'&#93; == 'session') {
$_destoon_admin = isset($_SESSION&#91;$secretkey&#93;) ?  intval($_SESSION&#91;$secretkey&#93;) : 0;
} else {
$_destoon_admin = get_cookie($secretkey);
$_destoon_admin = $_destoon_admin ? intval($_destoon_admin) : 0;
}
$_founder = $CFG&#91;'founderid'&#93; == $_userid ? $_userid : 0;
$_catids = $_childs = '';
$_catid = $_child = array();
if($file != 'login') {
if($_groupid != 1 || $_admin < 1 || !$_destoon_admin) msg('',  '?file=login&forward='.urlencode($DT_URL));
//判断用户是否已经登录?如果未登录,直接跳转到登录页面。防止用户构造url。
if(!admin_check()) {
admin_log(1);
$db->query("DELETE FROM { $db->pre}admin WHERE userid=$_userid AND  url='?".$DT_QST."'");
msg('警告!您无权进行此操作 Error(00)');
}
}
//是否记录日志
if($DT['admin_log'] && $action != 'import') admin_log();
if($DT['admin_online']) admin_online();
$psize = isset($psize) ? intval($psize) : 0;
if($psize > 0 && $psize != $pagesize) {
$pagesize = $psize;
$offset = ($page-1)*$pagesize;
}
if($module == 'destoon') {
(include DT_ROOT.'/admin/'.$file.'.inc.php') or msg();
} else {
echo $file.'|'.$module;
include DT_ROOT.'/module/'.$module.'/common.inc.php';//加载模块下的common文件
(include MD_ROOT.'/admin/'.$file.'.inc.php') or msg();//加载模块文件
}

 

destoon经典调用方法汇总

mikel阅读(1217)

本文介绍了destoon框架中一些常用的调用方法,非常基础与实用的destoon调用方法,需要的朋友参考下。

destoon经典调用方法汇总

根目录、模板目录和样式目录:
{DT_PATH}
{DT_SKIN}
导入头脚:
{template ‘header’}
{template ‘footer’}
对应模块首页:
{$MODULE[$moduleid][linkurl]} //注:$moduleid表示对应模块的ID号
对应模块列表页:
{$MODULE[$moduleid][linkurl]}list.php?catid=$catid  //注:$catid表示调用的分类的ID号
发布某模块信息:
{$MODULE[2][linkurl]}my.php?mid=$moduleid&action=add
调用广告:
{ad(27)}  //注:27表示广告位为27的广告
时间函数:
{date(‘Y-m-d’,$t[addtime])} // 注:addtime是添加时间,可以换别的
控制字符数:
{dsubstr($t[company],30)}  //注:company是公司名称字段,可以换别的。30表示字符数为15个
版权信息:
{$DT[copyright]}
客服电话:
{$DT[telephone]}
ICP备案号:
{$DT[icpno]}
本月:
addtime>$today_endtime-30*86400
供应:
(level=1)
{php $tags = tag(“moduleid=5&table=sell&length=30&condition=status=3 and catid=? and level=?&pagesize=10&order=addtime desc&template=null”)}
求购:
(level=1)
{php $tags = tag(“moduleid=6&table=buy&length=30&condition=status=3 and catid=? and level=?&pagesize=10&order=addtime desc&template=null”)}
行情:
(level=1,2,3,4,5)
{php $tags = tag(“moduleid=7&table=quote&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
公司:
{php $tags = tag(“moduleid=4&table=company&condition=groupid>5&pagesize=10&order=fromtime desc&template=null”)}
展会:
(level=1)
{php $tags = tag(“moduleid=8&table=exhibit&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
资讯:
(level=1,2,3,4,5)
{php $tags = tag(“moduleid=21&table=article_21&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
招商:
(level=1)
{php $tags = tag(“moduleid=22&table=info_22&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
品牌:
(level=1)
{php $tags = tag(“moduleid=13&table=brand&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
人才:
{php $tags = tag(“moduleid=9&table=job&length=30&condition=status=3 and catid=?&pagesize=10&order=addtime desc&template=null”)}
{php $tags = tag(“moduleid=9&table=resume&length=30&condition=status=3 and catid=?&pagesize=10&order=addtime desc&template=null”)}
知道:
(level=1)
{php $tags = tag(“moduleid=10&table=know&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
专题:
(level=1,2,3,4,5)
{php $tags = tag(“moduleid=11&table=special&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
图库:
(level=1,2,3,4,5)
{php $tags = tag(“moduleid=12&table=photo&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
视频:
(level=1)
{php $tags = tag(“moduleid=14&table=video&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
下载:
(level=1)
{php $tags = tag(“moduleid=15&table=down&length=30&condition=status=3 and catid=? and thumb<>” and level=?&pagesize=10&order=addtime desc&template=null”)}
论坛:
{php $tags=tag(“table=discuz.cdb_threads&prefix=&condition=status=0 and fid=?&order=dateline desc&pagesize=10&target=_blank&template=null”)}
调用模块内容,资讯模块举例:
{php $tagss = tag(“moduleid=21&table=article_data_21&condition=itemid=”.$t[itemid].”&template=null”)}
调用分类,资讯模块举例:
{php $tagss = tag(“moduleid=21&table=category&condition=moduleid=21 and parentid=?&pagesize=10&order=catid desc&template=null”)}
网站标题:
{$SEO_title}
关键字:
{$head_keywords}
网页描述:
{$head_description}
会员升级:
{$MODULE[2][linkurl]}grade.php
收藏本页:
<script type=”text/javascript“>addFav(‘收藏本页’);</script>
设为首页:
<a href=’#’ onClick=”this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘http://www.jbxue.com’);”>设为首页</a>
WAP浏览:
{extendurl(‘wap’)}
RSS订阅:
{extendurl(‘feed’)}
商务中心:
{$MODULE[2][linkurl]}
发布信息:
{$MODULE[2][linkurl]}{$DT[file_my]}
排名推广:
{extendurl(‘spread’)}
网站地图:
{DT_PATH}sitemap/
友情链接:
{extendurl(‘link’)}index.php?typeid=1
申请友情链接:
{extendurl(‘link’)}{rewrite(‘index.php?action=reg’)}
调用友情链接:
{php $tags = tag(“table=link&length=14&condition=status=3 and typeid=1&pagesize=40&order=addtime desc&template=null”)}
网站留言:
{extendurl(‘guestbook’)}
广告服务:
{extendurl(‘ad’)}
版权隐私、使用协议、联系方式、关于我们
{tag(“table=webpage&condition=item=1&order=listorder desc,itemid desc&template=list-webpage”)}
Copyright.html、agreement.html、contact.html、about.html
地区:
{$AREA[1][areaname]}
投票:
{extendurl(‘vote’)}
登录框模板:
{if $DT[page_login]}{template ‘user’, ‘chip’}{/if}
公告栏:
{extendurl(‘announce’)}
分类模板:
{php $mid=5;}{template ‘catalog’ ‘chip’}
相关评论模板:
{template ‘comment’, ‘chip’}
联系方式模板:
{template ‘contact’, ‘chip’}
留言加盟:
<iframe src=”{$MOD[linkurl]}message.php?itemid={$itemid}” name=”destoon_message” id=”destoon_message” style=”width:99%;height:0px;” scrolling=”no” frameborder=”0″></iframe>
读缓存:

复制代码 代码示例:
{php $CATEGORY = cache_read(‘category-21.php’);}
{$MODULE[21][linkurl]}{$CATEGORY[5][linkurl]}
<meta http-equiv=”x-ua-compatible” content=”ie=7″/>

调用栏目名

复制代码 代码示例:
{php $tags = tag(“moduleid=21&table=article_21&length=32 &condition=status=3 &pagesize=11&order=addtime desc&template=null”)}    {loop $tags $t}    <li><span class=”rq”>{date(‘Y-m-d’,$t[addtime])}</span><span class=”catn”> {php $tagss = tag(“moduleid=21&table=category&condition=moduleid=21 and catid=”.$t[catid].”&template=null”)}     {loop $tagss $tt}     【<a href=”{$tt[linkurl]}” target=”_blank”>{dsubstr($tt[catname],12)}</a>】     {/loop} </span><a href=”{$t[linkurl]}” target=”_blank”>{$t[title]}</a></li>    {/loop}

调用大分类中的所有

复制代码 代码示例:
{php $tags = tag(“moduleid=26&table=category&condition=moduleid=26 and catid=137&template=null”)}
{loop $tags $t}
{php $tagss = tag(“moduleid=26&length=26&condition=status=3 and level=4 and catid IN(“.$t[arrchildid].”)&pagesize=4&order=addtime desc&template=null”)}
{loop $tagss $ts}
<li>?<a href=”{$ts[linkurl]}” target=”_blank”>{$ts[title]}</a></li>
{/loop}
{/loop}

产品图片怎么调用middle.jpg中大的图?
<img src=”{str_replace(‘thumb’, ‘middle’, $t[thumb])}” width=”{$width}” height=”{$height}” alt=”{$t[alt]}”/>

推荐阅读:destoon入门教程与技巧实例

dedecms织梦网站图片集上传图片出现302错误图片提示怎么解决

mikel阅读(720)

dedecms织梦网站图片集上传图片出现302错误图片提示怎么解决

小编今天上传织梦网站模板的时候,在图片集里面选择上传图片的时候,弹出302错误提示,当是真的是郁闷了,试了好几次,开始还以为是图片过大,后面上传个小的图片也不行,于是去百度下,百度上面有人说是浏览器的问题,于是更换了一个浏览器确实OK了,开始使用的360急速浏览器不可以,后面使用谷歌浏览器可以。但是小编是个比较较真的人,还是想让在所有的浏览器上面都可以显示,下面模板之家徐国祥告诉大家解决办法:

一、上传图片提示302错误如下面

二、怎么解决上传图片出现302
我们看上图中浏览器弹出的信息框,就一个302,而且下面的图片全变红了,很大的error错误。遇到这类问题改怎么处理呢?解决办法:
找到include目录下面的userlogin.class.php文件,用代码编辑器将它打开,在第二行session_start();前加上以下代码:
  1. if (isset($_POST[“PHPSESSID”]))
  2. {
  3. session_id($_POST[“PHPSESSID”]);
  4. else if
  5. (isset($_GET[“PHPSESSID”])) {
  6. session_id($_GET[“PHPSESSID”]);
  7. }
保存之后,问题就解决了,织梦模板之家希望帮助大家解决各种织梦建站过程中碰见的问题!

IE/火狐浏览器弹出SPI can't create GMEM lock 解决方法 亲自测试_蜗牛王子_新浪博客

mikel阅读(1129)

IE/火狐浏览器弹出SPI can’t create GMEM lock 解决方法 亲自测试_蜗牛王子_新浪博客,蜗牛王子,

来源: IE/火狐浏览器弹出SPI can’t create GMEM lock 解决方法 亲自测试_蜗牛王子_新浪博客

   本人喜欢使用火狐浏览器,最近几天老弹出SPI can’t create GMEM lock,很烦。故找到了解决办法,网上很多说查杀病毒之类的方法,还有让你进网上邻居设置TCP/IP协议之类的方法,全部是错误的。因为我的IE浏览器和360浏览器都不会弹出这个错误提示,只有火狐会弹出。
   那么,我现在告诉大家真正的解决办法吧:
   点“程序”–“运行”–输入“Netsh winsock reset”,此时会提示Successfully reset the Winsock Catalog,或者是中文提示。此时即已解决该问题。当然,重启一下机器会更好。
   欢迎关注我的博客!每篇文章都是博主个人遇到过的实际问题,解决好了才发布博文的!

componet msinet.ocx

mikel阅读(1144)

MSINET.OCX缺少或者删除都是不行的,那是windows需要的,删了会提示“部件MSINET.OCX或其附件之一不能正确注册:一个文件丢失或无效”

MSINET.OCS组件下载,包括64位版本,win7以上电脑需要管理员权限

如果360提示阻止请放行,或者用我们的MSINET.OCX自己放到系统去.

出错提示有可能是英文的,例如:
component ‘MSINET.OCX’错误是什么意思?有时候我们运行软件会弹出一个报错信息:
‘MSINET.OCX’ or not correctly registered:a file is missing or invalid
或者是:
component ‘MSINET.OCX’ or one of its dependencies not correctly registered:a file is missing or invalid

解决方法: 32位解决办法
下载解压后,将’MSINET.OCX’文件复制到C:\WINDOWS\system32文件夹下即可。
1:运行–msconfig–启动–把“你话可疑的附件”和“msinet.ocx”前面的选项勾掉就好了 。
2:到注册表编辑器: regedit
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run中将键值:
winregsrv %windir%\system\winregsvr.exe清除 (都不知道是不是呀。)
3:运行–输入”msconfig”启动,ctfmon勾上,别的都去掉勾,再确定重启.. (这个办法你一定要试下。)
可以下载这个解压缩后放进系统system32文件夹中,然后再运行命令
regsvr32 msinet.ocx

msinet.ocx win7 64怎么用? 试试把msinet.ocx放到“C:\Windows\SysWOW64”(不含引号)里面
然后运行cmd,输入“regsvr32 c:\windows\syswow64\MSINET.OCX”(不含引号),再按回车键
这样应该能注册成功的了。

或者运行msinet.bat,提示如下就OK了。

destoon模板存放规则及语法参考_DESTOON_新浪博客

mikel阅读(824)

destoon模板存放规则及语法参考_DESTOON_新浪博客,DESTOON,

来源: destoon模板存放规则及语法参考_DESTOON_新浪博客

一、模板存放及调用规则

模板存放于系统 template 目录,template 目录下的一个目录
例如 template/default/ 即为一套模板

模板文件以 .htm 为扩展名,可直接存放于模板目录
例如 template/default/index.htm
也可以存放于模板目录的子目录里
例如 template/default/member/index.htm

在PHP文件里,使用模板语法为
<?php include template(‘index’);?>
或者
<?php include template(‘index’, ‘member’);?>

如果当前默认模板套系为default,则:
<?php include template(‘header’);?>
表示使用 template/default/header.htm 模板文件
<?php include template(‘header’, ‘member’);?>
表示使用 template/default/member/header.htm 模板文件

模板目录下在 these.name.php 是模板别名的配置文件,模板别名可以在后台模板管理修改。

模板解析后的缓存文件保存于cache/tpl/目录,扩展名为 .tpl.php

二、模板语法

1、包含模板 {template ‘header’} 或 {template ‘header’, ‘member’}

{template ‘header’} 被解析为
<?php include template(‘header’);?>
表示使用 template/default/header.htm 模板文件
{template ‘header’, ‘member’}
被解析为 <?php include template(‘header’, ‘member’);?>
表示使用 template/default/header.htm 模板文件

2、变量或常量表示

变量 {$destoon} 被解析为 <?php echo $destoon;?>
常量 {DESTOON} 被解析为 <?php echo DESTOON;?>
对于数组,标准写法应为 例如 {$destoon[‘index’]},可简写为 {$destoon[index]},模板在解析时会自动追加引号。

3、函数 {func_name($par1, $par2)}

{func_name($par1, $par2)} 被解析为
<?php func_name($par1, $par2);?>

4、PHP表达式 {php expression}

{php expression} 被解析为 <?php expression ?>

5、条件语句 {if $a==’b’} do A {/if} 或 {if $a==’b’} do A {else} do B {/if} 或 {if $a==’b’} do A {elseif $b==’c’} do C {else} do B {/if}

{if $a==’b’} do A {/if} 被解析为
<?php if($a==’b’) { do A }?>
{if $a==’b’} do A {else} do B {/if} 被解析为
<?php if($a==’b’) { do A } else { do B } ?>
{if $a==’b’} do A {elseif $b==’c’} do C {else} do B {/if} 被解析为
<?php if($a==’b’) { do A } else if($b==’c’) { do C } else { do B } ?>

6、LOOP循环 {loop $var $v}…{loop} 或
{loop $var $k $v}…{loop}

{loop $var $v}…{loop} 被解析为
<?php if(is_array($var)) { foreach($var as $v) { … } }?>
{loop $var $k $v}…{loop} 被解析为
<?php if(is_array($var)) { foreach($var as $k=>$v) { … } }?>

三、特殊用法

1、变量或表达式可以用HTML注释,例如 <!–{$destoon}–> 仍被解析为 <?php echo $destoon; ?> (可自动过滤此类注释)
2、可直接在模板里书写PHP代码,直接书写PHP代码与 DESTOON 模板语法是兼容的。

css样式表中的样式覆盖顺序(转) - 一路前行 - 博客园

mikel阅读(1164)

来源: css样式表中的样式覆盖顺序(转) – 一路前行 – 博客园

有时候在写CSS的过程中,某些限制总是不起作用,这就涉及了CSS样式覆盖的问题,如下

 

Css代码 
  1. #navigator {
  2.     height: 100%;
  3.     width: 200;
  4.     position: absolute;
  5.     left: 0;
  6.     border: solid 2 #EEE;
  7. }
  8. .current_block {
  9.     border: solid 2 #AE0;
  10. }

 

查找一些教材中(w3schools等),只说css的顺序是“元素上的style” > “文件头上的style元素” >“外部样式文件”,但对于样式文件中的多个相同样式的优先级怎样排列,没有详细说明。经过测试和继续搜索,得知优先级如下排列:

 

1. 样式表的元素选择器选择越精确,则其中的样式优先级越高:

id选择器指定的样式 > 类选择器指定的样式 > 元素类型选择器指定的样式

所以上例中,#navigator的样式优先级大于.current_block的优先级,及时.current_block是最新添加的,也不起作用。

 

2. 对于相同类型选择器制定的样式,在样式表文件中,越靠后的优先级越高

注意,这里是样式表文件中越靠后的优先级越高,而不是在元素class出现的顺序。比如.class2 在样式表中出现在.class1之后:

Css代码 
  1. .class1 {
  2.     color: black;
  3. }
  4. .class2 {
  5.     color: red;
  6. }

 

而某个元素指定class时采用 class=”class2 class1″这种方式指定,此时虽然class1在元素中指定时排在class2的后面,但因为在样式表文件中class1处于class2前面,此时仍然是class2的优先级更高,color的属性为red,而非black。

 

3. 如果要让某个样式的优先级变高,可以使用!important来指定:

Css代码 
  1. .class1 {
  2.     color: black !important;
  3. }
  4. .class2 {
  5.     color: red;
  6. }

此时class将使用black,而非red。

 

对于一开始遇到的问题,有两种解决方案:

1. 将border从#navigator中拿出来,放到一个class .block中,而.block放到.current_block之前:

 

Css代码 
  1. #navigator {
  2.     height: 100%;
  3.     width: 200;
  4.     position: absolute;
  5.     left: 0;
  6. }
  7. .block {
  8.     border: solid 2 #EEE;
  9. }
  10. .current_block {
  11.     border: solid 2 #AE0;
  12. }

需要莫仁为#navigator元素指定class=”block”

 

2. 使用!important:

 

Css代码 
  1. #navigator {
  2.     height: 100%;
  3.     width: 200;
  4.     position: absolute;
  5.     left: 0;
  6.     border: solid 2 #EEE;
  7. }
  8. .current_block {
  9.     border: solid 2 #AE0 !important;
  10. }

此时无需作任何其他改动即可生效。可见第二种方案更简单一些。
转自:http://spartan1.iteye.com/blog/1526735

jQuery倒计时

mikel阅读(2291)

网页上的常用的倒计时

来源: jQuery倒计时

实现代码

引用

<script type="text/javascript" src="js/jquery.min.js"></script>

js

<script type="text/javascript">
var intDiff = parseInt(60);//倒计时总秒数量
function timer(intDiff){
    window.setInterval(function(){
    var day=0,
        hour=0,
        minute=0,
        second=0;//时间默认值        
    if(intDiff > 0){
        day = Math.floor(intDiff / (60 * 60 * 24));
        hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
        minute = Math.floor(intDiff / 60- (day * 24 * 60- (hour * 60);
        second = Math.floor(intDiff) - (day * 24 * 60 * 60- (hour * 60 * 60- (minute * 60);
    }
    if (minute <= 9) minute = '0' + minute;
    if (second <= 9) second = '0' + second;
    $('#day_show').html(day+"天");
    $('#hour_show').html('<s id="h"></s>'+hour+'时');
    $('#minute_show').html('<s></s>'+minute+'分');
    $('#second_show').html('<s></s>'+second+'秒');
    intDiff--;
    }, 1000);
} 
$(function(){
    timer(intDiff);
});    
</script>

html

<h1>网页上的倒计时</h1>
<div class="time-item">
    <span id="day_show">0天</span>
    <strong id="hour_show">0时</strong>
    <strong id="minute_show">0分</strong>
    <strong id="second_show">0秒</strong>
</div>

css

h1 {
    font-family:"微软雅黑";
    font-size:40px;
    margin:20px 0;
    border-bottom:solid 1px #ccc;
    padding-bottom:20px;
    letter-spacing:2px;
}
.time-item strong {
    background:#C71C60;
    color:#fff;
    line-height:49px;
    font-size:36px;
    font-family:Arial;
    padding:0 10px;
    margin-right:10px;
    border-radius:5px;
    box-shadow:1px 1px 3px rgba(0,0,0,0.2);
}
#day_show {
    float:left;
    line-height:49px;
    color:#c71c60;
    font-size:32px;
    margin:0 10px;
    font-family:Arial,Helvetica,sans-serif;
}
.item-title .unit {
    background:none;
    line-height:49px;
    font-size:24px;
    padding:0 10px;
    float:left;
}