本插件费用请参考 /aboutfee
共3个文件
ecpss.jpg 放置在 images\
ecpss.php 放置 includes\modules\payment
ecpss_lang.php 放置 languages\zh_cn\payment\
QQ 733905 联系购买
本插件费用请参考 /aboutfee
共3个文件
ecpss.jpg 放置在 images\
ecpss.php 放置 includes\modules\payment
ecpss_lang.php 放置 languages\zh_cn\payment\
QQ 733905 联系购买
Centos 6.5 系统 的sqlite 3 的情况下可能出现此问题
解决方法比较蹊跷,首先定位为sqlite 3的方法是
gdb /path/to/php
>run curl_test.php
出现一堆错误,其中显示出sqlite
Starting program: /a/apps/php-5.2.17/bin/php curl_test.php
[Thread debugging using libthread_db enabled]
Program received signal SIGSEGV, Segmentation fault.
0x00007fffeb461e9c in sqlite3_file_control () from /usr/lib64/libsqlite3.so.0
Missing separate debuginfos, use: debuginfo-install zadmin-2.0.1-0.x86_64
if(!stristr($_SERVER['HTTP_ACCEPT'],"text/html")) exit("Powered Prohibited Mirror");
http://www.wdlinux.cn/bbs/viewthread.php?tid=3657&highlight=https
上面问题不一定是解决 rpm 安装的wdcp 的php问题,
还可能是 /php-curl-https-sqlite3.html
参考自 http://blog.csdn.net/fableboy/article/details/18973483
使用数组提供post数据时,CURL组件大概是为了兼容@filename这种上传文件的写法,默认把content_type设为了multipart/form-data。虽然对于大多数web服务器并没有影响,但是还是有少部分服务器不兼容。
本文得出的结论是,在没有需要上传文件的情况下,尽量对post提交的数据进行http_build_query,然后发送出去,能实现更好的兼容性,更小的请求数据包。
下载V5的alipay.php 放置到public\plug\payment\ 里面,即可到V6后台管理支付方式里面设置相应的支付宝参数
可以利用read_static_cache和write_static_cache 来缓存一些不经常变化的数据来缓存
$data_attr = read_static_cache(‘all_attr_list_’.md5($_SERVER[‘REQUEST_URI’]));
if ($data_attr === false)
{
// 获得$all_attr_list的sql逻辑
write_static_cache(‘all_attr_list_’.md5($_SERVER[‘REQUEST_URI’]), $all_attr_list);
}else{
// 来自缓存的数据
$all_attr_list = $data_attr;
}
这样可以在 temp/static_cache/下生成缓存数据
在记事狗微博的 api/uc.php 里面当记事狗本身用户不存在,而在uc里面存在的时候,当登录后自动注册到记事狗,需要修改代码实现。图中红线部分是重要的,必须的。
在api/uc.php 的 onsynlogin 同步登录函数里面的部分代码如下
代码如下
include_once(ROOT_PATH . 'uc_client/client.php'); if($data = uc_get_user($get["username"])) { list($uid, $uname, $email) = $data; $this->db->query("REPLACE INTO `{$this->tablepre}members` (`uid`,`ucuid`,`username`,`nickname`,`email`,`role_id`) values ('$uid','$uid','$uid','$uname','$email','2')"); $query = $this->db->query("SELECT `uid`, `password` FROM `{$this->tablepre}members` WHERE `ucuid`='$uid'"); $UserFields = $this->db->fetch_array($query); $auth = authcode("{$UserFields['password']}\t{$UserFields['uid']}","ENCODE",'',1209600); jsg_setcookie('sid', '', -311040000); jsg_setcookie('auth',$auth,311040000); }
source/function/function_core.php
的函数 hookscript
在
foreach($funcs as $hookkey => $hookfuncs) {
foreach($hookfuncs as $hookfunc) {
//起始时间
$a = time()
……
//结束时间
$b = time()-$a;
echo “==========”.$b.print_r($hookfuncs,true);
}
}
通过查看===== 标记后面$b值,如果$b过大,就查看$hookfuncs 是什么造成的,从而查出哪个插件,解决方法就是了可以临时跳过那个插件
if($hookfunc[0]==”cloudsearch”) continue;
上面的cloudsearch 就是 $hookfuncs[0] 查出来的
//PS 上面的方法不一定好使,可以用下面的
测试方法 用你的测试访问两次某个地址
可以通过改变某个参数, user-agent 等来对比生成的 zjpro.txt 文件的不一致性,从而确定哪一个plungin的问题!!!!
比如
curl -v -A “百度spider的UA” http://URI
curl -v -A “正常IE的UA” http://URI
对比生成的两次zjpro.txt 文件
============1======================
wget dl2.admin5.com/php/curl-7.37.1.tar.gz
tar zxvf curl-7.37.1.tar.gz
cd curl-7.37.1
./configure –prefix=/usr/local/curl
make && make install
cd ..
rm -rf curl-7.37.1*
============2======================
cd /a/apps/
wget dl2.admin5.com/php/php-5.2.17-have.tar.gz
rm -rf php-5.2.17
tar zxvf php-5.2.17-have.tar.gz
rm -rf php-5.2.17-have.tar.gz
===========3(镜像1.0)==============
cd /root
wget dl2.admin5.com/php/openssl-1.0.1h.tar.gz
tar zxvf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./config –prefix=/usr/local/ssl shared zlib
make && make install
mv /usr/bin/openssl /usr/bin/openssl.old
mv /usr/include/openssl /usr/include/openssl.old
ln -s /usr/local/ssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/ssl/include/openssl /usr/include/openssl
echo “/usr/local/ssl/lib” >> /etc/ld.so.conf
ldconfig -v
cd ..
rm -rf openssl-1.0.1h*
===========4=======================
killall -9 php-cgi
killall -9 php-cgi
service php-fpm start
service zadmin start
apache 用 php_apache2.X.dll 调用php时候用的是 ts 的php版本
比如 LoadModule php5_module “……/php5apache2_2.dll”
就用的 ts版本的php 线程安全版
反之 用 scriptalias 调用 php.exe 或者 php-cgi.exe 的就用nts版本的php
在dede\makehtml_list_action.php 的文件行 101 处
//$lv->CountRecord();
有这样一处注释掉的代码,似乎DEDECMS的程序猿同学欲言又止
这一个计算某个栏目类有多少分页的代码居然不运行,从而导致后面一行
if($lv->TypeLink->TypeInfos[‘ispart’]==0 && $lv->TypeLink->TypeInfos[‘isdefault’]!=-1) $ntotalpage = $lv->TotalPage;
else $ntotalpage = 1;
导致这里面的 $ntotalpage 根本得不到值 (NULL),
因为 $lv->TotalPage 是在$lv->CountRecord 函数里面赋值
所以感觉特别奇怪。
从而想到,取消此处注释,让栏目生成HTML 分批进行
//如果栏目的文档太多,分多批次更新 if($ntotalpage <= $maxpagesize || $lv->TypeLink->TypeInfos['ispart']!=0 || $lv->TypeLink->TypeInfos['isdefault']==-1) { $reurl = $lv->MakeHtml('', '', $isremote); $finishType = TRUE; } else { // 让代码进入此执行才是分批生成html $reurl = $lv->MakeHtml($mkpage, $maxpagesize, $isremote); $finishType = FALSE; $mkpage = $mkpage + $maxpagesize; if( $mkpage >= ($ntotalpage+1) ) $finishType = TRUE; }
一个串行化后的字符串,在64位的linux系统下正常反串行化,而在32位系统下无法做到
发现一个问题就是 串行化的 i 类型数据过大,导致在32位系统下超出了整形的最大值.
在category.php 行 272处查找
$attr_list = $db->getAll($sql); 字样然后下面增加如下代码 从phpsir_filter_code_start 到 phpsir_filter_code_end 中间部分
$attr_list = $db->getAll($sql); //phpsir_filter_code_start $phpsir_tmp=$attr_list[0]; $phpsir_sql= "select attr_values from " . $ecs->table('attribute') . " WHERE attr_id = '$phpsir_tmp[attr_id]' "; $phpsir_attribute = $db->getOne($phpsir_sql); $phpsir_ga = explode("\n",$phpsir_attribute); $phpsir_new_attr_list = array(); foreach($attr_list as $kk=>$vv) { foreach($phpsir_ga as $kkk => $vvv){ if(trim($vv['attr_value']) == trim($vvv)) { $phpsir_new_attr_list[$kkk] = $vv; } } } ksort($phpsir_new_attr_list); $attr_list = $phpsir_new_attr_list; //phpsir_filter_code_end
前台显示例子如下
代码在上面,或者如下图
发现safedog 可能会的fastcgi 方式的php造成影响,建议关闭 safedog
今天碰到一个奇怪案例,某程序的图形验证码始终验证为错
经过调试发现他的验证码生成程序在生成cookie时候,使用了 domain的概念,
而且测试地址是直接通过ip来测试的,导致domain部分成为了ip地址的后两位,
问题就清晰了,直接绑定域名,通过域名来测试程序就通过了。。。。
http://bbs.ecshop.com/viewthread.php?tid=159368
原始问题如上,截屏如下
解决问题是看 includes\lib_order.php 的函数 get_total_bonus
原来代码是如下的
/* 按订单发的红包 */
$sql = “SELECT FLOOR(‘$amount’ / min_amount) * type_money ” .
“FROM ” . $GLOBALS[‘ecs’]->table(‘bonus_type’) .
” WHERE send_type = ‘” . SEND_BY_ORDER . “‘ ” .
” AND send_start_date <= ‘$today’ ” .
“AND send_end_date >= ‘$today’ ” .
“AND min_amount > 0 “;
很显然,凡是比较最低订单金额大的订单,都会导致商的个数的红包,我们其实只要发的是最大的红包那个就可以了,所以我们修改如下
/* 按订单发的红包 */
$sql = “SELECT FLOOR(‘$amount’ / min_amount) * type_money ” .
“FROM ” . $GLOBALS[‘ecs’]->table(‘bonus_type’) .
” WHERE send_type = ‘” . SEND_BY_ORDER . “‘ ” .
” AND send_start_date <= ‘$today’ ” .
“AND send_end_date >= ‘$today’ ” .
“AND min_amount > 0 and min_amount <= ‘$amount’ order by min_amount desc limit 1 “; 注意上面这行的条件增加了
and min_amount <= ‘$amount’ order by min_amount desc limit 1
就是说最接近订单额度的红包发放条件,取一个即可
在shopex的4.8.5 的 core/model_v5/member/mdl.account.php
文件里面记录了shopex用户的密码是如何存储到数据库的,在
encrypt_passwd_enhanced 函数里面是这样写的
public function encrypt_passwd_enhanced( $pwd, $uname, $regtime )
{
if ( !$pwd || !$uname || !$regtime )
{
return false;
}
$pwd = md5( md5( trim( $pwd ) ).strtolower( $uname ).$regtime );
return “s”.substr( $pwd, 0, 31 );
}
下图中的红圈部分就是加密代码,那么如果在转移到ecshop 时候,因为ecshop只是做了md5(password) 的密码检查,显然登录会失败,那么再加一种这样的检查,就可以登录了,hoho。。。。
在ecshop 的 includes\modules\integrates\ecshop.php 的行 check_user 函数里面有
if ($row[‘password’] != $this->compile_password(array(‘password’=>$password,’ec_salt’=>$ec_salt)))
我们只需要再加一个
$pwd = md5( md5( trim( $pwd ) ).strtolower( $uname ).$regtime );
$shopex_pass = “s”.substr( $pwd, 0, 31 );
判断改成这样
if ($row[‘password’] != $this->compile_password(array(‘password’=>$password,’ec_salt’=>$ec_salt)) || $row[‘password’] != $shopex_pass )
就可以了
discuz 在用 302 转换地址的时候,用的dheader 函数
为了定位到哪端302出现问题,可以在要修改的文件里面把
dheader 函数全局替换为 echo __LINE__;die();dheader
我们在 http://blazdesign.com/5-free-wordpress-contact-form-plugins-to-consider/
测试下第一个 CONTACT FORM 7
下载地址 http://wordpress.org/plugins/contact-form-7/
下载后上传到 wp-contents/plugins/
照例后台plugins 激活(activate) 此插件
点击插件下的settings 功能
点击add new 添加一个新表单
添加后点击save , 得到 一个字符串 ,写到你的帖子(posts)里面就可以了
帝友p2p系统的短信通道似乎是代码内置的
可以通过修改文件达到更好短信通道到 短信宝
修改文件名
modules/approve/approve.class.php
参考 http://www.phpernote.com/php-function/376.html
调用方法
$sc=new SysCrypt('http://www.phpsir.com'); $text='QQ733905'; $test1=$sc->encrypt($text); echo '原文:',$text; echo ' '; echo '密文:',$test1; echo " "; echo '解密:',$sc->decrypt($test1);