帝国cms 7.0在支付宝异步通知处理方面不够完善,甚至可以说是不负责的,
经修改4个文件可以解决异步通知的问题.
完整代码请联系我QQ 733905
curl -v -e “http://www.not-allow-domain.com” http://yourdomain.com/aaa.jpg
测试的时候必须输入http:// 这样的完整url才好
dedecms的相关文章的函数 lib_likearticle 里面是根据 keyword1 or keyword2 or … 这样的规律用一个sql解决的,并且用 order by id desc 来排序,可能导致第一个关键字的文章不在前面,下面的补丁就是解决这个问题。
思路是: 先根据第一个关键字搜索结果后,显示出来,如果数量不够 $row 指定的,那么就用关键字2继续查找,依次类推,直到搜索到 $row 数量。
修改的文件是 include\taglib\likearticle.lib.php 下面的连接是txt格式,请自行修改后缀为 .php
背景:dedecms启用会员机制后,对于会员发的文章有审核功能,但是没有退回给客户再次修改,需要增加退回功能,连接地址如下,dedecms_archives_tuihui
修改文件共3个
dede\templets\content_list.htm
dede\js\list.js
dede\archives_do.php
在你用win远程桌面安装tw后,启动的tw里面因为你这是在一个远程里面开启的tw,
如果tw启用了多用户的方式,那么在你win控制台的那个tw的id和你在远程桌面里面看到id是不一样的,所以,打开tw的目录,找到一个log文件,
比如 TeamViewer12_Logfile.log,找找里面的 ID: 开头的
ID: XXXXXXXX ,
那个可能和你原来看到的只相差一点点,试试用这个ID连接,你会有不一样的感受
可能是cmos掉电保存设置,导致硬盘设置回归了ide,改回ahci 就可以了
AHCI (Serial ATA Advanced Host Controller Interface)
串行ATA高级主控接口/高级主机控制器接口)
苹果cms maccms 8 有关伪静态方面列表页和详情页的自定义url
列表页的是 vod-type-id-{id}-pg-{pg} 表示的是分类id的第pg页,可以考虑根据不同的分类设置为 ,比如 type-id = 1 的是 /movie/pg-{pg}.html
比如 /movie/pg-1.html
如果 type-id=2 设置为 /tv/pg-{pg}.html,比如
/tv/pg-1.html,
我们通过修改 inc/common/template.php 的AppTpl类的getLink函数 ,在
$str = $jstart . MAC_PATH . $str . $strpg . $ext. $jend;$str = $jstart . MAC_PATH . $str . $strpg . $ext. $jend;
return str_replace(array(‘//’,’/index’.$rgext),array(‘/’,’/’),$str);
修改为
$str = $jstart . MAC_PATH . $str . $strpg . $ext. $jend;$str = $jstart . MAC_PATH . $str . $strpg . $ext. $jend;
$new_str = str_replace(array(‘//’,’/index’.$rgext),array(‘/’,’/’),$str);
// 这里增加伪静态的自定义代码比如
$new_str = preg_replace(“/vod\-type\-id\-1\-/”,”movie/”,$newstr);
// 这样是 吧 vod-type-id-1-pg-1.html 修改为 movie/pg-1.html
return $newstr;
=============================================================
同时需要修改 伪静态配置文件 .htaccess 或者 nginx的rewrite文件
RewriteRule ^movie/pg-(\d+)$ index.php\?m=vod-type-id-1-pg-$1
nginx的
rewrite ^/movie/pg-(.*)$ /index.php?m=vod-type-id-1-pg-$1 break;
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-server-5.6.33-2.el6.x86_64.rpm
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-client-5.6.33-2.el6.x86_64.rpm
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-common-5.6.33-2.el6.x86_64.rpm
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-devel-5.6.33-2.el6.x86_64.rpm
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-libs-5.6.33-2.el6.x86_64.rpm
http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-libs-compat-5.6.33-2.el6.x86_64.rpm
dedecms后台设置关键字,文章里面会根据关键字自动增加连接
现在根据关键字的rank倒排序,建议比较长的排在前面,比如
你好样的 比 你好 有更大的rank,因为dedecms是根据rank做了倒排序的替换关键字,
如果希望不出现嵌套的连接,那么就需要做一些代码的变化 include\arc.archives.class.php
代码增加了行 1260-1269
// zjpro add 2017-08-22 QQ 733905
foreach($GLOBALS[‘replaced’] as $kk=>$vv)
{
if(strpos($kk, $word) !== FALSE)
{
$GLOBALS[‘replaced’][$word] = 1;
break;
}
}
// end zjpro QQ 733905
linux 检查 /etc/resolve.cof
win 查下网卡配置里面的dns
测试方式就是在服务器 打开 http://openapi.qzone.qq.com/oauth/qzoneoauth_request_token
看看速度,如果缓慢基本可以判定就是这个因素
问题背景:
在一个 kw.txt 里面用 “–”分割的 地址和关键字,形如
https://www.google.com–谷歌
https://www.github.com–git
现在模板里面随机调用5个这样的连接
{dede:rndkw runphp=’yes’}
@me = rndkw();
{/dede:rndkw}
在 \include\helpers\extend.helper.php 增加如下
if ( ! function_exists('rndkw')) { function rndkw($str) { $kw=file(getcwd() . DIRECTORY_SEPARATOR ."kw.txt"); shuffle($kw); $s=""; for($i=0;$i<5;$i++) { list($ah,$aw) = explode("--",$kw[$i]); $s .= ""; } return $s; } }
记住:帝国cms的配置时候,php.ini 开启 short_open_tag = On
问题背景:
dedecms 发布文章,特别是图片的时候一般会分很多页,模板里面可能设置了随机推荐的其他图片,但是同一个文章的每个分页的这个随机推荐是一样的,如何改为不同?
问题解决:
模板里面一般是这类随机
{dede:arclist row=10 orderby=rand}
<li><a href=”[field:arcurl/]”>[field:title/]</a></li>
{/dede:arclist}
造成每个页面的随机都一样的原因就是 这个模板片段是只在处理一个文章的时候分析一次模板,如果每个分页再生成前再次分析下模板,理论上就再次扫描了一次,从而再次随机运行了一次代码。
方案:
include\arc.archives.class.php 的 MakeHtml 函数
在大概 410行,增加 $this->ParseTempletsFirst();
include\arc.archives.class.php 行大约260 的 ParAddTable() 函数内
原始是 $tmpv = cn_substr($v,50);
想长点的话 $tmpv = cn_substr($v,100);
include\arc.archives.class.php 里面 GetPageTitlesST 函数,在页面调用是
{dede:pagetitle style=’XXXX’ /}
那么就可以根据style来修改GetPageTitlesST 函数,使之能适用多种情况,比如
{dede:pagetitle style=’subtile_title’ /}
就需要走增加
if($styleName==’subtile_title’)
{
return $this->SplitTitles[$pageNo-1] . “_” . $this->Fields[“title”] ;
}else{
return $this->Fields[“title”] ;
}
发文章的时候用
#p#第几页的标题#e#
PS:
可能UTF8的,这个函数有点问题,
最后的 #没能去掉,可以考虑用 sub_str($string,0,-1)消掉
https://dev.mysql.com/doc/refman/5.7/en/information-schema.html
利用 information_schema 可以做很多事,这个库存储了mysql的元数据!
比如:
1)查询存在哪些 表是 innodb 的
2)查询 innodb 表的大小
3)查询某字段的定义
例子
SELECT table_schema,table_name, table_rows,
ROUND((data_length+index_length)/1024/1024) AS total_mb,
ROUND(data_length/1024/1024) AS data_mb,
ROUND(index_length/1024/1024) AS index_mb
FROM INFORMATION_SCHEMA.TABLES WHERE engine=’InnoDB’
ORDER BY total_mb desc;
如果你确信代码没啥毛病的话,就看看你服务器的时间是不是和当前真实时间相差过大!
和本文一样的内容 是 这里
vc09 = Visual Studio 2008
vc10 = Visual Studio 2010
vc11 = Visual Studio 2012 2012
vc12 = Visual Studio 2013 2013
vc14 = Visual Studio 2015 2015
vc15 = Visual Studio 2017
VC11, VC14 & VC15
More recent versions of PHP are built with VC11, VC14 or VC15 (Visual Studio 2012, 2015 or 2017 compiler respectively) and include improvements in performance and stability.
– The VC11 builds require to have the Visual C++ Redistributable for Visual Studio 2012 x86 or x64 installed
– The VC14 builds require to have the Visual C++ Redistributable for Visual Studio 2015 x86 or x64 installed
– The VC15 builds require to have the Visual C++ Redistributable for Visual Studio 2017 x64 or x86 installed
TS and NTS
TS refers to multithread capable builds. NTS refers to single thread only builds. Use case for TS binaries involves interaction with a multithreaded SAPI and PHP loaded as a module into a web server. For NTS binaries the widespread use case is interaction with a web server through the FastCGI protocol, utilizing no multithreading (but also for example CLI).
首先,nginx 单ip多域名的ssl配置,参考地址是
https://www.zjpro.com/single-ip-mass-https.html
另外,利用 脚本可以比较方便的使用 lets-encrypt 提供的免费ssl,
https://github.com/xdtianyu/scripts/tree/master/lets-encrypt
一个配置文件的例子 letsencrypt.conf-myssl
ACCOUNT_KEY=”letsencrypt-account.key”
DOMAIN_KEY=”/www/ssl/myssldomain.com.key”
DOMAIN_DIR=” /www/myssldomain”
DOMAINS=”DNS:myssldomain.com,DNS:www.myssldomain.com”
方法就是配置 conf文件,然后运行就好了,
letsencrypt.sh letsencrypt.conf-myssl
上面脚本就能自动帮你做注册和生成key的动作。后面只需要修改nginx的配置文件即可
nginx的配置文件,这样写
server
{
listen 80;
listen 443;
if ($scheme = http) {return 301 https://$server_name$request_uri;}
server_name www.myssldomain.com myssldomain.com;
root /www/myssldomain/;
index index.php index.html;
include php.conf;
ssl on;
ssl_certificate “/www/ssl/myssldomain.chained.crt”;
### 注意这里,最好用chained.crt 容易被多数浏览器支持
ssl_certificate_key “/www/ssl/myssldomain.com.key”;
}
下载apache的源文件 http://archive.apache.org/dist/httpd/
解压后进入 modules/ssl 运行下面语句
/www/wdlinux/apache/bin/apxs -a -i -DHAVE_OPENSSL=1 -I/usr/include/openssl -L/usr/lib64/openssl -c *.c -lcrypto -lssl -ldl
下面的3行不一定对。一般来说编辑 conf/extra/httpd-ssl.conf 里面启用 https比较好
下面3行仅供参考:
SSLCertficateChainFile /www/wdlinux/apache/conf/1_root_bundle.crt
SSLCertificateFile /www/wdlinux/apache/conf/2_www.域名.com.crt
SSLCertificateKeyFile /www/wdlinux/apache/conf/3_www.域名.com.key
PS:
http 80 转向到 https 443
.htaccess里面
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://www.yourname.com%{REQUEST_URI} [L,R=301]
</IfModule>
当ntpdate 失效的时候,还有google
date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" 国内用百度 date -s "$(wget -qSO- --max-redirect=0 baidu.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
症状: dede:list 标签出现混淆,一些分类的文章没有显示,原因是删除文章的时候只删除了dede_archives 表,而dede_arctiny表没做相应的删除行,你会发现有些文章id在dede_arctiny表里依然存在,而dedecms原本为了加快速度的dede_arctiny表反而导致了错误。
select id from dede_arctiny where not exists(select * from dede_archives where dede_arctiny.id=dede_archives.id);
这个语句就可以看出来存在于dede_arctiny表里的多余数据,但是并不保证缺失数据
删除dede_arctiny里面的无效数据的sql语句为
delete from dede_arctiny where not exists(select * from dede_archives where dede_arctiny.id=dede_archives.id);
================================================================
下面是我们写的查缺补漏的全部重新生成最新鲜数据dede_arciny表的方法:
dedecms 织梦的dede_arctiny表的重整
truncate table `dede_arctiny`;
insert into `dede_arctiny`(`id`,`typeid`,`typeid2`,`arcrank`,`channel`,`senddate`,`sortrank`,`mid`) select `id`,`typeid`,`typeid2`,`arcrank`,`channel`,`senddate`,`sortrank`,`mid` from `dede_archives` where `arcrank` > -1 order by `id` asc ;
1) echo __LINE__.”\r\n”;die();用于命令行
2) echo __LINE__.”<br/>”; 用于网页
3) echo __LINE__.”\r\n”; return “”; 用于跳过剩下的部分
4) php文件最下面的 ?> 不要写