作者:dadait
发布时间:January 10, 2012
分类:学习
1 Comment
最近发现dedecms中的文章在选择幅栏目后,在其对应的幅栏目列表中可以显示该文章,但在arclist 标签中却无法显示该文章,网上找了很多,解决办法都一样,但写法却写错了,导致arclist标签在使用了flag属性时会失效的问题。修正后的写法如下。
打开/include/taglib/arclist.lib.php,我目前用的最新版 5.7 SP1,代码约位于295-296行。查找以下两行代码。
if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')';
else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')';将其替换成以下代码。
if($CrossID=='') $orwheres[] = ' (arc.typeid IN ('.GetSonIds($typeid).') OR arc.typeid2 IN ('.GetSonIds($typeid).')) ';
else $orwheres[] = ' (arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.') OR arc.typeid2 IN ('.GetSonIds($typeid).','.$CrossID.')) ';OK,这样就改完了,保存后如果你是生成静态的,请生成相关的。如果是动态的,请更新系统缓存。然后就可以看到效果了。
作者:dadait
发布时间:December 1, 2011
分类:学习
No Comments
工作中,你可能经常会遇到使用HTTP状态,但又要现去问度娘,谷爹神马的。很多找的还不全。现在分享出一份HTTPD状态码,摘自Lighttpd 1.4.28源码中。大家可以收藏或者COPY下来备用。
static keyvalue http_status[] = {
{ 100, "Continue" },
{ 101, "Switching Protocols" },
{ 102, "Processing" }, /** WebDAV */
{ 200, "OK" },
{ 201, "Created" },
{ 202, "Accepted" },
{ 203, "Non-Authoritative Information" },
{ 204, "No Content" },
{ 205, "Reset Content" },
{ 206, "Partial Content" },
{ 207, "Multi-status" }, /** WebDAV */
{ 300, "Multiple Choices" },
{ 301, "Moved Permanently" },
{ 302, "Found" },
{ 303, "See Other" },
{ 304, "Not Modified" },
{ 305, "Use Proxy" },
{ 306, "(Unused)" },
{ 307, "Temporary Redirect" },
{ 400, "Bad Request" },
{ 401, "Unauthorized" },
{ 402, "Payment Required" },
{ 403, "Forbidden" },
{ 404, "Not Found" },
{ 405, "Method Not Allowed" },
{ 406, "Not Acceptable" },
{ 407, "Proxy Authentication Required" },
{ 408, "Request Timeout" },
{ 409, "Conflict" },
{ 410, "Gone" },
{ 411, "Length Required" },
{ 412, "Precondition Failed" },
{ 413, "Request Entity Too Large" },
{ 414, "Request-URI Too Long" },
{ 415, "Unsupported Media Type" },
{ 416, "Requested Range Not Satisfiable" },
{ 417, "Expectation Failed" },
{ 422, "Unprocessable Entity" }, /** WebDAV */
{ 423, "Locked" }, /** WebDAV */
{ 424, "Failed Dependency" }, /** WebDAV */
{ 426, "Upgrade Required" }, /** TLS */
{ 500, "Internal Server Error" },
{ 501, "Not Implemented" },
{ 502, "Bad Gateway" },
{ 503, "Service Not Available" },
{ 504, "Gateway Timeout" },
{ 505, "HTTP Version Not Supported" },
{ 507, "Insufficient Storage" }, /** WebDAV */
{ -1, NULL }
};
作者:dadait
发布时间:November 17, 2011
分类:学习
No Comments
工作需要,在CCTV的网站里分析出了CCTV各频道及卫视频道的XML节目列表,分享出来供大家使用。其中URL中有日期部分动态的,大家自己写段脚本动态生成一下URL就行了。
CCTV-1 综合频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv1.xml
CCTV-2 经济频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv2.xml
CCTV-3 综艺频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv3.xml
CCTV-4 亚洲 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv4.xml
CCTV-5 体育频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv5.xml
CCTV-6 电影频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv6.xml
CCTV-7 军事农业频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv7.xml
CCTV-8 电视剧频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv8.xml
CCTV-9 记录频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv9d.xml
CCTV-10 科教频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv10.xml
CCTV-11 戏曲频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv11.xml
CCTV-12 社会与法 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv12.xml
CCTV-13 新闻频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctv13.xml
CCTV 少儿频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctvchildren.xml
CCTV 音乐频道 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/cctvmusic.xml
北京卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/btv1.xml
天津卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/tianjin.xml
河北卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hebei.xml
山西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanxi1.xml
内蒙古卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/neimenggu.xml
辽宁卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/liaoning.xml
吉林卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jilin.xml
黑龙江卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/heilongjiang.xml
东方卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanghai.xml
江苏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jiangsu.xml
浙江卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/zhejiang.xml
安徽卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/anhui.xml
东南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/dongnan.xml
江西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/jiangxi.xml
山东卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shandong.xml
河南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/henan.xml
湖北卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hubei.xml
湖南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/hunan.xml
广东卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guangdong.xml
广西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guangxi.xml
旅游卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/luyou.xml
重庆卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/chongqing.xml
四川卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/sichuan.xml
贵州卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/guizhou.xml
云南卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/yunnan.xml
西藏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/xizang.xml
陕西卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/shanxi2.xml
甘肃卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/gansu.xml
青海卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/qinghai.xml
宁夏卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/ningxia.xml
新疆卫视 : http://cctv.cntv.cn/nettv/2011jiemudan/xmldata/2011/11/17/xinjiang.xml
作者:dadait
发布时间:October 27, 2011
分类:学习
No Comments
安装前准备,在确定你已经安装了以下支持 gcc、libevent-devel
如果没有安装请先执行以下命令
yum install gcc libevent libevent-devel
在一切准备就绪后开始安装
wget http://memcached.org/latest
tar -zxvf memcached-1.x.x.tar.gz
cd memcached-1.x.x
./configure
make && make test
sudo make install
如果想支持SASL,请
./configure --enable-sasl