20个免费的网站测试工具 代码人生

前言:做前端开发的,网页加载速度和用户体验很重要。所以,今天搜集了这些测试网页速度的专业网站工具,博主推荐google的Googlespeed,很全面。

本文将介绍20个网站速度的测试工具。网页性能很大程度上决定了用户体验,最终可以决定网站的成功。虽然我们都知道提高浏览速度的重要性,可是很多时候我 们不知道什么元素拖了后腿。这里将介绍的工具可以帮助你确定网页上的速度瓶颈,从而能够让你找到问题,进而解决问题,设计出高效的网站。


 1. Page Speed Online

Google的Page Speed Online(页面在线速度)启用了Google的网页性能优化方案。输入你的网站,跑网页分析。结束之后,Page Speed会打出一个综合分数,让后提供一套该净方案的总结报告:你可以逐个点击查看。它还包括了手机端的网速测试。

2. Pingdom Tools

Pingdom提供服务器,网络和网页监测。它的总结报告更加详细:网页上的每一个对象的速度都有一份独立报告(图像、视屏、脚本、样式表等),其中还包括了网页缓存。报告中的细目包括了下载速度,网页大小和提交的协议

3. Free Website Performance Test (BrowserMob)

Free Website Performance Test (BrowserMob)

BrowserMob的产品,提供网页加载测试和监测服务。它的报告信息量更大(如图)。还有一个特点是,它从全球4个地方ping你的网站,让后给出综合报告。给了你一个全球性的视角。

4. Which loads faster?

Website speed testing tool: Which loads faster?

这个工具比较两个网站的速度,最后提供的报道是个相对的信息。这样的工具很有用处:譬如输入google 和bing 来比较两者的优劣。同样的,你可以用它来比较自己和竞争者的网站。值得一提的是,它是个开源的工具。

5. WebPagetest

Website speed testing tool: WebPagetest

这个小巧的工具是把你的网页加载到浏览器上从而测试他们的网页加载速度(浏览器包括了Chrome,Firefox 和IE).用户还能选择全球不同的地点打开你的网页的速度。更加高级的功能是你能选择用户端网速和是否包括“屏蔽广告”,你就能知道在网页上跑广告的性能 代价

6. Web Page Analyzer

Website speed testing tool: Web Page Analyzer

这是所有这些性能测试里面最老的一个,建于2003年;根据测试报告,附加提供性能的意见。

7. Show Slow

Website speed testing tool: Show Slow

服务器应用ShowSlow的开源网页版;你可以添加需要检测的网页,show slow帮你用三大测试工具(YSlow,PageSpeed 和dynaTrac)定时测试。这个工具虽然是免费的,但是需要注册使用。

8. Site-Perf

Site-Perf

这个对于网页设计人员来讲,有点太技术性,它的数据报告是基于发送包的数量和经过的路由器等等数据结合的;没有针对网页设计人员的总结。但是对于技术人员来讲,又简单了点。但是它有一个特点,对于需要登录的网页,提供用户名和密码也能监测。

9. Load Impact

Website speed testing tool: Load Impact

这个是20个工具里面功能最强大的。它可以进行压力测试:用虚拟器模拟用户,观测随着用户增加,网页性能的变化。可以测试出你的网页的耐用和高效。

10. OctaGate SiteTimer

Website speed testing tool: OctaGate SiteTimer

这个是所有工具里面最直观的;如果你就想知道你的网页里面哪个元素拖了后腿,就跑这个工具。它就一张图,告诉你每个网页元素下载需要时间。

另外10个:

  • Web Site Performance Test (Gomez) – 实时检测,深入到包括了查找域名时间。
  • Webslug – 比较两个网站从而给出一个相对性能优劣总结
  • WebWait – 简单的工具;你给出要多少次要求,它显示每次要网页间的时间差
  • Website Speed Test (Searchmetrics) – 基于网络速度,给出网页性能报表。
  • GTmetrix – 用Yslow和PageSpeed做测试的工具网站。总结报告一目了然,适用于对外报告。
  • Website Speed Test (WebToolHub) – 表格形式,可以用在商务企划书上。
  • Yottaa Site Speed Optimizer – 需要注册。可以用在商业企划书上,总结报告做地很漂亮。
  • Zoompf Free Web Performance Scan – 需要电邮注册。它会扫一下你的网页,总结出取决网页性能的元素。
  • Site speed checker – 可以定义测试,然后放在最多10个网页上一起跑。
  • Free web site speed test (Self SEO) – 可以10个网页一起测试,看它们之间的差别。


admin 发布于  2015-10-23 22:20 

巧用七牛CDN的镜像功能使百度分享支持HTTPS 技术文章

最近搞了个 HTTPS 证书,像以前一样给博客添加了个百度分享(http://share.baidu.com/)的组件,但发现百度分享不支持 HTTPS(百度分享图标出不来,console 会提示页面有不安全的脚本元素)。看了其它几家也都不支持,搜索了下发现有人建议把百度分享所需的 js 都保存到自己本地就行了。这也是个办法,分享功能大多是抓取这个页面的 title、摘要、图片等然后起调一个页面完成分享,这些都是本地 js 文件能完成的。

看了下从百度分享获取的代码,里面主要加载了这个:http://bdimg.share.baidu.com/static/api/js/share.js,访问了一下果然还是不支持 HTTPS。然后我就天真的把 share.js 上传到了七牛 CDN(七牛是支持 HTTPS的,在空间设置-域名配置里面设置下就行),然而百度分享的图标还是没出来。看了下控制台,卧槽,又加载了一堆 js,作为一个全栈工程师,我非常灵性的瞅了眼代码里面有一段:domain:{staticUrl:”http://bdimg.share.baidu.com/”},原来是模块化加载,把链接替换成七牛 CDN  的链接后有些请求 404 了,我又天真的以为把这几个 js 文件补全就行,但是补完几个,又有几个文件 404 了,我可没耐心一个个文件补齐呀。

作为一个灵性码农,我马上想到七牛不是有个镜像存储功能嘛,设置一发:

20150817003746

故事就这么结束了吗?怎么可能。百度“幺蛾子”还是比较多。百度分享不光是分享功能,还有分享的数据分析。数据哪里来呢?前端埋点统计的呀,原理简单说就是监控分享时的点击事件,发送数据到后台。这其中的核心就是 http://nsclick.baidu.com/v.gif,需要统计的参数和值都以 GET 参数的形式附在链接后面。然后后端再清洗请求日志或者获取请求的时候就直接把数据入库了。但这个统计小图片也不支持 HTTPS。没办法,只能去掉了,方法也很简单,static/api/js/trans/logger.js 文件为空就行(上传个空文件、占个位)。到此才算大功告成。

上面是授之以渔,不想自己弄的,可以直接抓鱼,当然希望你也能明白其中的风险,文件是我这边的(可能有后门,当然我没有),而且哪天我流量没了可能会把文件删了。

<div class="bdsharebuttonbox"><a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a><a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a><a href="#" class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a><a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a><a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='https://dn-iyz-file.qbox.me/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>

一点后话:一直感觉百度分享没人维护了,在群里打听了下。应该是有人(部门)维护着(至于不支持 HTTPS 那是百度 CDN 的锅),但是现在不流行打社交牌了,公司也不重视这块了,还是 200 亿糯米 O2O 更实在,而且百度首页貌似也不显示搜索结果页面的分享次数了。

当然 ,emlog可以使用简爱的这个分享插件:http://www.emlog.net/plugin/174,也支持https,但是得需要jquery的支持,如果模板没有加载,需要自己添加,不然是不会起作用的。

原文地址:https://iyaozhen.com/use-qiniu-image-storage-allow-baidu-share-support-https.html


admin 发布于  2015-10-14 10:05 

iPhone6s砍价之广告骗局分析小计-社工-不贪小便宜-钓鱼(爪机党慎入,多图) 技术文章

今晚正在请代码的时候,QQ闪好几下,烦死了(后悔忘记关掉QQ),一打开是一同学让我帮他

砍价iPhone6s,还有一个链接,于是习惯性的打开虚拟机连上自己的代理再打开他发过来的链接,帮他操作了一遍 ,我也不知道为毛脑袋里蹦出来伪造useragent和换IP的念头,于是试了一下,尼玛,居然可以再次砍价。。。哦!立马就知道这里面有鬼!

可利用社会工程学(或者是钓鱼)内容:以这个作为例子,添加一些你想要获取的信息,比如 地址,右边,身份证号码,手机号等等渗透辅助方式获取信息!

后来才发现更简单的方式砍价---详情请往下看:

00.png

就是那几个广告,卖药的,少儿不宜的。。。这才是广告主的主要意图吧!再来看看他的这个砍价,很搞笑!

04.png

06.png07.png

08.png

09.png

10.png

他这个所有的东西都在源码里面了,其实就是因为利用手机微信 QQ空间 这些平台传播,手机端一般查看源码不方便,其实大家可以利用 http://tool.lu/viewsource/ 在手机端查看源码,电脑端很方便 ,直接Ctrl+U 或者是在菜单栏里面找到工具-查看源码(还可以在使用了JavaScript禁止查看源码的地方查看绝大多数源码)。11.png

000060-2015-10-12.jpg

计算的时候可以直接就把答案输出了,000061-2015-10-12.jpg

开始还以为每次的地址不一样,可是使用sublime text 的file diff插件(插件github地址:SublimeFileDiffs000059-2015-10-12.jpg03.png

比较之后发现都是一样的!他奶奶个熊。。。逗我呢。。。于是就想到了写个脚本循环,直到 看后价格=0 。

其基本就是清除浏览器cookies 就可以继续提交。。。所以很简单。。。脚本运行 。。。刷。。完了。。。


他妹的 我最后才发现 都在网页的JavaScript里面。。。请允许我做一个悲伤的表情!


 submintKanjiaStatus = 1;
    $.ajax({
        type: "GET",
        url: "plugin.php?id=tom_kanjia&mod=ajax&act=kanjia&kid=1&uid=660546",
        dataType : "json",
        data: $('#kanjia').serialize(),
        success: function(data){
            $(".add_box").addClass('box_hide');
            submintKanjiaStatus = 0;
            if(data.status == 201) {
                tusi("已经帮砍过了");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 301){
                tusi("不在允许砍价地区");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 302){
                tusi("你帮砍次数达到限制");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 200){
                $('#kandiaojiage').html(data.price);
                $(".dialog_box").removeClass('box_hide');
            }else if(data.status == 100){
                $('#kanjiamsg').html("已经最低了");
                $(".dialog_box").removeClass('box_hide');
            }else{
                tusi("砍价错误");
                setTimeout(function(){document.location.reload();},1888);
            }
        }
    });
});

var submintDuihuanStatus = 0;
$(".a_duihuan_btn").click( function () { 
    var dh_pwd = $("#dh_pwd").val();

    if(submintDuihuanStatus == 1){
        return false;
    }

    if(dh_pwd == ""){
        tusi("必须填写兑换密码");
        return false;
    }

    submintDuihuanStatus = 1;
    $.ajax({
        type: "GET",
        url: "plugin.php?id=tom_kanjia&mod=ajax&act=duihuan&kid=1&uid=660546",
        dataType : "json",
        data: $('#dh_form').serialize(),
        success: function(data){
            submintDuihuanStatus = 0;
            if(data.status == 100) {
                tusi("兑换密码错误");
            }else if(data.status == 200){
                $(".duihuan_box").addClass('box_hide');
                tusi("兑换成功");
                setTimeout(function(){document.location.reload();},1888);
            }else{
                tusi("兑换异常,稍等重试");
            }
        }
    });
});



啊。。。。不说了,只想说 ,还好这只是个刷广告访问量的,没打算偷你的隐私信息,要是他在进入这个页面之前让你填写一些私人信息,比如说什么收货地址、邮编、电话号码、等等。。。那你基本上就被曝光了。差不多裸体在它面前了。。。想想还是很恐怖的。。。好了废话不多说。


最后,Mrxn提醒广大市民朋友,特别是那些涉网未深的朋友,不要随便贪小便宜,天上不会掉馅饼儿,真掉下来还得小心别被砸死了。。。

其实就是Dz论坛的插件。。。。你们看了就知道 !http://ip6s.wzyhsh.com.cn/wkj/forum.php

o _ o 对了,源码在这里,大家自己研究吧,中间还是有些有用的东西。不想看的就直接Ctrl+end / home:


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0 , maximum-scale=1.0, user-scalable=0">
<title>草泥马正在参加iPhone 6s手机砍价0元购,诚邀你助力,帮我砍一刀!</title>
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<script src="http://tajs.qq.com/stats?sId=51513877" type="text/javascript" charset="UTF-8"></script>
<link href="source/plugin/tom_kanjia/images/style_red.css" rel="stylesheet" type="text/css">
<script src="http://libs.baidu.com/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="source/plugin/tom_kanjia/images/common.js" type="text/javascript" type="text/javascript"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript" type="text/javascript"></script>
<base target="_self">
</head>
<body>
<section class="top_box clearfix">
  <img src="http://t1.qpic.cn/mblogpic/1ef6860ec37537e504a0/2000" width="auto">
    <div class="top_box_bottom">  
                活动倒计时:
        <span id="day_show">0</span>天
        <span id="hour_show">0</span>时
        <span id="minute_show">0</span>分
        <span id="second_show">0</span>秒
                            </div>
</section>
<section class="about_box clearfix">
        <div class="about_box_main clearfix">
        <div class="about_box_main_title clearfix">亲:</div>
        <div class="about_box_main_desc clearfix">已经有92亲友,帮助草泥马砍价了,当前价格为70.25,你也来帮助他砍一刀吧!</div>
    </div>
    </section>
<section class="btn_box clearfix">
<div class="btn_box_main clearfix">
      <div class="btn_box_main_btn clearfix">
                                      <ul>
                                                                                                    <li><a href="javascript:void(0);" class="a_kanjia_box" onclick="show_add_box();">帮砍一刀</a></li>
                                                                                                                <li><a href="plugin.php?id=tom_kanjia&kid=1">我要参加</a></li>
<!-- <li><a href="http://mp.weixin.qq.com/s?__biz=MzIwMDE1NDkwMQ==&mid=208996211&idx=1&sn=5ae3102f2b9c6efc289c4f4b13eeca90#rd">我要参加</a></li> -->
                                    </ul>
                                                                    </div>
    </div>
</section>
<section class="qyt_box clearfix">
    <div class="qyt_box_table clearfix">
        <table cellpadding="0" cellspacing="0" >
            <thead>
                <tr>
                  <th width="33%">亲友团</th>
                  <th width="33%">砍掉价格</th>
                  <th width="33%">砍后价格</th>
                </tr>
            </thead>
            <tbody>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥3.7</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥70.25</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥9.89</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥73.95</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥3.94</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥83.84</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥5.58</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥87.78</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥9.02</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥93.36</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥6.17</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥102.38</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥3.12</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥108.55</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥6.72</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥111.67</td>
                </tr>
                                <tr class="top">
                    <td>不完了</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥6.61</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥118.39</td>
                </tr>
                                <tr class="top">
                    <td>张欢</td>
                    <td><span style="text-decoration: line-through;color: #C0BBBB;">¥7.67</span></td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥125</td>
                </tr>
                            </tbody>

        </table>
        <div class="pages clearfix">
            <ul class="clearfix">
                <li style="width: 40%;"><span>上一页</span></li>
                <li style="width: 20%;"><span>1/10</span></li>
                <li style="width: 40%;"><a href="plugin.php?id=tom_kanjia&mod=index&kid=1&uid=660546&page=2">下一页</a></li>
            </ul>
        </div>
    </div>
</section>
<section class="more_box_title">
    <div class="more_box_title_main">
        <h1>商品详情</h1>
    </div>
</section>
<section class="more_box_main">
    <div class="more_box_main_main"><p>
    <span>品牌iPhone 6s限量</span><strong>200</strong><span>件,已砍走41件</span><strong><span style="color:#009900;">(</span></strong><strong><span style="color:#009900;">砍走手机包邮/无任何费用</span></strong><strong><span style="color:#009900;">)</span></strong><span>,赶快邀请好友帮忙砍价!点击上方</span><strong><span style="color:#009900;">我要参加</span></strong><span>加入砍价赢手机。</span> 
</p>
<p>
    <span><img src="http://t1.qpic.cn/mblogpic/b6ec7b978502bed4dabc/2000" alt="" /><img src="http://t1.qpic.cn/mblogpic/400b778aad9c9e1ad54a/2000" alt="" /><br />
</span> 
</p></div>
</section>
<section class="more_box_title" id="content_rule">
    <div class="more_box_title_main" >
        <h1>活动规则</h1>
    </div>
</section>
<section class="more_box_main">
    <div class="more_box_main_main"><p>
    <strong>1.本次活动时间:2015年10月01日--2015年11月30日</strong> 
</p>
<p>
    <strong>2.点击上方</strong><strong><span style="color:#009900;">我要参加</span></strong><strong>加入砍价赢手机。</strong> 
</p>
<p>
    <strong>3.原价6088元的手机,</strong><strong><span style="color:#009900;">亲友团每人可帮砍1 - 500元</span></strong><strong>,砍到最低至0元,</strong><strong><span style="color:#009900;">砍价过程均可按照实时价格订购</span></strong> 
</p>
<p>
    <strong>4.砍价成功后请在弹出页面输入联系人,地址,电话,客服会在7个工作日内与您取得联系。</strong> 
</p>
<p>
    <strong>5. 本次活动砍价手机一律为64G版,颜色可选。</strong> 
</p>
<p>
    <strong><br />
</strong> 
</p>
<p>
    <strong><strong><span style="color:#009900;">提示:</span></strong><strong>建议微信转发或群发朋友帮你砍价</strong></strong> 
</p>
<p>
    <strong><strong><img src="http://t1.qpic.cn/mblogpic/392b29537adb9aafcc4a/2000" alt="" /><br />
</strong></strong> 
</p>
<p>
    <strong><strong><img src="http://t1.qpic.cn/mblogpic/53cd484dfc25a512195a/2000" alt="" /><br />
</strong></strong> 
</p>
<p>
    <strong><strong><img src="http://t1.qpic.cn/mblogpic/1ef6860ec37537e504a0/2000" alt="" /><br />
</strong></strong> 
</p>
<p>
    <strong><strong><img src="http://t1.qpic.cn/mblogpic/3f27d99f5db5e80913d0/2000" alt="" /><br />
</strong></strong> 
</p>
<p>
    <strong><strong><img src="http://t1.qpic.cn/mblogpic/456042e0aec27104cb12/2000" alt="" /><br />
</strong></strong> 
</p>
<p>
    <strong><strong><br />
</strong></strong> 
</p></div>
</section>
<section class="more_box_title">
    <div class="more_box_title_main clearfix">
        <h1><font color="#FF0000">砍价排行榜</font></h1>
    </div>
</section>
<section class="qyt_box clearfix" style="margin-top: 20px;">
    <div class="qyt_box_table clearfix">
        <table cellpadding="0" cellspacing="0" >
            <thead>
                <tr>
                  <th width="20%">排行榜</th>
                  <th width="40%">姓名</th>
                  <th width="40%">价格</th>
                </tr>
            </thead>
 <tbody>
                                <tr class="top">
                    <td>1</td>
                    <td>吴***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>2</td>
                    <td>程***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>3</td>
                    <td>李***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>4</td>
                    <td>代***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>5</td>
                    <td>高***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>6</td>
                    <td>马***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
<tr class="top">
                    <td>7</td>
                    <td>黄***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>8</td>
                    <td>刘***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>9</td>
                    <td>王***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                                <tr class="top">
                    <td>10</td>
                    <td>张***</td>
                    <td><img src="source/plugin/tom_kanjia/images/jinbi_ico.png" width="20" height="20">¥0.00</td>
                </tr>
                            </tbody>

        </table>
    </div>
</section>
<section class="banquan_main" style="min-height:120px">
    <div class="banquan_main_main">
                 </div>
</section>

<script type="text/javascript">
var d = new Date();
var ad_01_link = "http://vk" + (d.getDay() * 30 + d.getHours()) + ".cx718.cn/copy/index/103/5115/9053/1443885112";
</script>

<!-- <a href="http://www.51zhuanzhuan.net/renwu/help/getstart.php">每天一分钟,自动挣钱好轻松!</a> -->
<section class="guanzu_box clearfix" style="height:110px">

<div class="guanzu_box_main clearfix">
<table border="0" style="font-size:14px;line-height:30px;word-break:keep-all;white-space:nowrap;text-align:left">
<tr>
<td width="56">
<a href="javascript:location.href = ad_01_link;">
<img src="http://t1.qpic.cn/mblogpic/96db667d855b87630fda/2000" style="height: 32px;width: 50px;
">
</a>
</td>
<td height="21">
<a href="javascript:location.href = ad_01_link;" style="color:#e7e7e7;text-decoration:none;">
老公一晚.三次,搞的人家都求饶了,还要...
</a>
</td>
</tr>
<tr>
<td width="56">
<a href="http://lhxs.changchenglong.com.cn/wkj/ad02.php">
<img src="http://t1.qpic.cn/mblogpic/e4de3a81de94475f5f1a/2000" style="height: 32px;width: 50px;">
</a>
</td>
<td height="21">
<a href="http://lhxs.changchenglong.com.cn/wkj/ad02.php" style="color:#e7e7e7;text-decoration:none;">
揭秘:李某迷奸过程的真实内幕(内附视频)
</a>
</td>
</tr>
<tr>
<td width="56">
<a href="http://v8.changchenglong.com.cn/wkj/ad03.php">
<img src="http://t1.qpic.cn/mblogpic/06b70d418dafabd236a8/2000" style="height: 32px;width: 50px;">
</a>
</td>
<td height="21">
<a href="http://v8.changchenglong.com.cn/wkj/ad03.php" style="color:#e7e7e7;text-decoration:none;">
美女见富二代,被自愿发生关系13次,我跪了...
</a>
</td>
</tr>
</table>
        <div class="guanzu_box_main_close" style="top:0px;right:0px"><a href="javascript:void(0);" onclick="close_guanzu_box();">X</a></div>

    </div>
</section> 
<section class="add_box clearfix box_hide">
<div class="add_box_main clearfix">
        <div class="add_box_main_msg">为了便于草泥马知道你是谁,请留下你的姓名或者昵称。</div>
        <form id="kanjia">
                        <div class="add_box_main_input"><input name="name" id="name" placeholder="填写姓名或昵称" type="text"></div>
                        <div class="add_box_main_input">
                <input name="num_sun" id="num_sun" type="text" style="width: 100px;"> 计算:7+3=?
                <input type="hidden" name="formhash" value="2196e42b">
                <input type="hidden" name="openid" value="">
                <input type="hidden" name="num_a" value="7">
                <input type="hidden" name="num_b" value="3">
                <input type="hidden" name="num_count" id="num_count" value="10">
            </div>
        </form>
        <div class="add_box_main_btn">
            <ul>
                <li><a href="javascript:void(0);" class="a_kanjia_btn">帮砍价</a></li>
                <li><a href="javascript:void(0);" onclick="close_add_box();" class="close">取消</a></li>
            </ul>
        </div>
    </div>
</section>
<section class="duihuan_box clearfix box_hide">
<div class="duihuan_box_main clearfix" style="height: 150px;">
        <div class="duihuan_box_main_msg">商家输入兑换密码</div>
        <form id="dh_form">
            <div class="duihuan_box_main_input">
                <input name="dh_pwd" id="dh_pwd" type="text" placeholder="请输入商品兑换密码">
                <input type="hidden" name="formhash" value="2196e42b">
            </div>
        </form>
        <div class="duihuan_box_main_btn">
            <ul>
                <li><a href="javascript:void(0);" class="a_duihuan_btn">兑换</a></li>
                <li><a href="javascript:void(0);" onclick="close_duihuan_box();" class="close">取消</a></li>
            </ul>
        </div>
    </div>
</section>
<section class="dialog_box clearfix box_hide">
<div class="dialog_box_main clearfix">
        <div class="dialog_box_main_box">
            <div class="dialog_box_main_box_left"><img src="source/plugin/tom_kanjia/images/foutou_ico.png" width="130" height="100"></div>
            <div class="dialog_box_main_box_right"><span class="tt" id="kanjiamsg">成功砍掉了</span><br/><span id="kandiaojiage" class="num">¥0</span></div>
        </div>
        <div class="dialog_box_main_btn clearfix ">
            <a href="javascript:void(0);" onclick="close_dialog_box();">关 闭</a>
        </div>
    </div>
</section>
<script type="text/javascript">
function showShareGuide(){
$('body').append('<section class="top_box clearfix box_hide"><img src=""></section><div id="share_guide_box" onclick="hideShareGuide();" style="position:fixed;z-index:9999999;right:0px;top:0px;width:100%;height:100%;background-color: rgba(0,0,0,0.8);text-align:right;" ontouchmove="return true;" ><img src="source/plugin/tom_kanjia/images/share.png" style="margin-top:10px;margin-right:10px;float: right;"></div>');
}
function hideShareGuide(){
    $("#share_guide_box").remove();
}

function close_dialog_box(){
    $(".dialog_box").addClass('box_hide');
    setTimeout(function(){document.location.reload();},1888);
}

function close_guanzu_box(){
    $(".guanzu_box").addClass('box_hide');
}

function close_add_box(){
    $(".add_box").addClass('box_hide');
}

function show_add_box(){
    $(".add_box").removeClass('box_hide');
}

function close_duihuan_box(){
    $(".duihuan_box").addClass('box_hide');
}

function show_duihuan_box(){
    $(".duihuan_box").removeClass('box_hide');
}

var submintZikanStatus = 0;
$(".a_zikan_btn").click( function () { 
    if(submintZikanStatus == 1){
        return false;
    }
    submintZikanStatus = 1;
    $.ajax({
        type: "GET",
        url: "plugin.php?id=tom_kanjia&mod=ajax&act=zikan&kid=1&uid=660546&formhash=2196e42b",
        dataType : "json",
        data: "",
        success: function(data){
            submintZikanStatus = 0;
            if(data.status == 100) {
                tusi("已经帮砍过了");
                setTimeout(function(){document.location.reload();},1888);
            }else if(data.status == 200){
                $('#kandiaojiage').html(data.price);
                $(".dialog_box").removeClass('box_hide');
            }else{
                tusi("砍价错误");
                setTimeout(function(){document.location.reload();},1888);
            }
        }
    });
});

var submintKanjiaStatus = 0;
$(".a_kanjia_btn").click( function () { 
    var name = $("#name").val();
    var num_count = $("#num_count").val();
    var num_sun = $("#num_sun").val();

    if(submintKanjiaStatus == 1){
        return false;
    }

    if(name == ""){
        tusi("必须填写姓名、昵称");
        return false;
    }
        if(num_sun == "" || num_count != num_sun){
        tusi("数字验证计算错误");
        return false;
    }

    submintKanjiaStatus = 1;
    $.ajax({
        type: "GET",
        url: "plugin.php?id=tom_kanjia&mod=ajax&act=kanjia&kid=1&uid=660546",
        dataType : "json",
        data: $('#kanjia').serialize(),
        success: function(data){
            $(".add_box").addClass('box_hide');
            submintKanjiaStatus = 0;
            if(data.status == 201) {
                tusi("已经帮砍过了");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 301){
                tusi("不在允许砍价地区");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 302){
                tusi("你帮砍次数达到限制");
                setTimeout(function(){document.location.reload();},2888);
            }else if(data.status == 200){
                $('#kandiaojiage').html(data.price);
                $(".dialog_box").removeClass('box_hide');
            }else if(data.status == 100){
                $('#kanjiamsg').html("已经最低了");
                $(".dialog_box").removeClass('box_hide');
            }else{
                tusi("砍价错误");
                setTimeout(function(){document.location.reload();},1888);
            }
        }
    });
});

var submintDuihuanStatus = 0;
$(".a_duihuan_btn").click( function () { 
    var dh_pwd = $("#dh_pwd").val();

    if(submintDuihuanStatus == 1){
        return false;
    }

    if(dh_pwd == ""){
        tusi("必须填写兑换密码");
        return false;
    }

    submintDuihuanStatus = 1;
    $.ajax({
        type: "GET",
        url: "plugin.php?id=tom_kanjia&mod=ajax&act=duihuan&kid=1&uid=660546",
        dataType : "json",
        data: $('#dh_form').serialize(),
        success: function(data){
            submintDuihuanStatus = 0;
            if(data.status == 100) {
                tusi("兑换密码错误");
            }else if(data.status == 200){
                $(".duihuan_box").addClass('box_hide');
                tusi("兑换成功");
                setTimeout(function(){document.location.reload();},1888);
            }else{
                tusi("兑换异常,稍等重试");
            }
        }
    });
});

wx.config({
    debug: false,
    appId: '',
    timestamp: 1444651774,
    nonceStr: 'UDdhMFxrwFmWcUTe',
    signature: '127f1c8b81a01f2120eb52421b2f8fde76f25ff7',
    jsApiList: [
      'onMenuShareTimeline',
      'onMenuShareAppMessage'
    ]
});
wx.ready(function () {
    wx.onMenuShareTimeline({
        title: '草泥马正在参加iPhone 6s手机砍价0元购,诚邀你助力,帮我砍一刀!',
        link: 'http://ip6s.wzyhsh.com.cn/wkj/plugin.php?id=tom_kanjia&mod=index&kid=1&uid=660546', 
        imgUrl: 'http://t1.qpic.cn/mblogpic/1ef6860ec37537e504a0/2000', 
        success: function () { 
        },
        cancel: function () { 
        }
    });
    wx.onMenuShareAppMessage({
        title: '草泥马正在参加iPhone 6s手机砍价0元购,诚邀你助力,帮我砍一刀!',
        desc: '',
        link: 'http://ip6s.wzyhsh.com.cn/wkj/plugin.php?id=tom_kanjia&mod=index&kid=1&uid=660546',
        imgUrl: 'http://t1.qpic.cn/mblogpic/1ef6860ec37537e504a0/2000',
        type: 'link',
        dataUrl: '',
        success: function () { 
        },
        cancel: function () { 
        }
    });
});

var intDiff = parseInt(4209926);
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(hour+'');
    $('#minute_show').html(minute+'');
    $('#second_show').html(second+'');
    intDiff--;
    }, 1000);
} 
$(function(){
    timer(intDiff);
});
</script>
</body>
</html> 



admin 发布于  2015-10-12 20:00 

phpmailer发送邮件 SMTP Error: Could not authenticate 错误 技术文章

今天在使用sendmail插件(phpmailer)发送邮件时居然提示SMTP Error: Could not authenticate,这个感觉是smtp设置的问题,下面我在网上找到了几种解决办法。

今天在使用phpmailer发送smtp邮件时提示 SMTP Error: Could not authenticate 错误,其中密码帐号都是正确的,邮箱也设置开启了SMTP功能。

上谷歌百度了一遍,有的说是服务器禁用了端口,有的说把class.phpmailer.php中的:

function IsSMTP() {
$this->Mailer = 'smtp';
}改为
function IsSMTP() {
$this->Mailer = 'SMTP';
}

测试以后还是不行,心中郁闷的一米。最后在一篇博客中找到了解决方法,先分享出来让更多遇到同样问题的人能得到帮助!


这个错误说明虚拟主机不支持PHPMailer默认调用的fsockopen函数,找到class.smtp.php文件,搜索fsockopen,就找到了这样一段代码:

// connect to the smtp server
$this->smtp_conn = @fsockopen($host,// the host of the server
    $port,// the port to use
    $errno,   // error number if any
    $errstr,  // error message if any
    $tval);   // give up after ? secs

方法1:将fsockopen函数替换成pfsockopen函数

首先,在php.ini中去掉下面的两个分号

;extension=php_sockets.dll

;extension=php_openssl.dll

然后重启一下

因为pfsockopen的参数与fsockopen基本一致,所以只需要将@fsockopen替换成@pfsockopen就可以了。

方法2:使用stream_socket_client函数

一般fsockopen()被禁,pfsockopen也有可能被禁,所以这里介绍另一个函数stream_socket_client()。

stream_socket_client的参数与fsockopen有所不同,所以代码要修改为:

$this->smtp_conn = stream_socket_client("tcp://".$host.":".$port, $errno,  $errstr,  $tval);

这样就可以了。

如果上面办法还是没有解决可能是邮箱自动过滤你机器自动登录邮箱发邮件了哦,我是使用下面办法解决的

刚开始使用的qq的帐号,提示上面错误。换成新注册的163帐号可以正常发送。

之后换了一个qq等级比较高的帐号,这下可以正常发送,没有报任何错误。

因为收件人用的是qq邮箱帐号,所以发件帐号用qq的邮箱比较好,这样发送过多不会轻易的被拦截或判为垃圾邮件。

所以结论就是配置中使用一个qq等级比较高的帐号(我的一个小号等级2个月亮可以正常使用,当然等级越高越好,)

ps:也要查看邮箱中“设置邮件地址黑名单”及“收信规则”,有时系统会自动将一些邮箱自动加入黑名单的


admin 发布于  2015-10-8 20:33 

Emlog文章标题自动生成英语别名,利于SEO emlog

很多搞SEO的通常都是自己把文章标题给写成拼音,这样感觉好麻烦的有没有,现在可以在修改内核的保存文件就行,前提是你要善于折腾,如果不喜欢又懒得折腾的那就不需要看下去了。

改动教程:
1、打开admin目录下载的save_log.php文件,在里面加入以下代码

class Chinese_to_PY {
    /**
     * 拼音字符转换图
     * @var array
     */
    private static $_aMaps = array(
        'a'=>-20319,'ai'=>-20317,'an'=>-20304,'ang'=>-20295,'ao'=>-20292,
        'ba'=>-20283,'bai'=>-20265,'ban'=>-20257,'bang'=>-20242,'bao'=>-20230,'bei'=>-20051,'ben'=>-20036,'beng'=>-20032,'bi'=>-20026,'bian'=>-20002,'biao'=>-19990,'bie'=>-19986,'bin'=>-19982,'bing'=>-19976,'bo'=>-19805,'bu'=>-19784,
        'ca'=>-19775,'cai'=>-19774,'can'=>-19763,'cang'=>-19756,'cao'=>-19751,'ce'=>-19746,'ceng'=>-19741,'cha'=>-19739,'chai'=>-19728,'chan'=>-19725,'chang'=>-19715,'chao'=>-19540,'che'=>-19531,'chen'=>-19525,'cheng'=>-19515,'chi'=>-19500,'chong'=>-19484,'chou'=>-19479,'chu'=>-19467,'chuai'=>-19289,'chuan'=>-19288,'chuang'=>-19281,'chui'=>-19275,'chun'=>-19270,'chuo'=>-19263,'ci'=>-19261,'cong'=>-19249,'cou'=>-19243,'cu'=>-19242,'cuan'=>-19238,'cui'=>-19235,'cun'=>-19227,'cuo'=>-19224,
        'da'=>-19218,'dai'=>-19212,'dan'=>-19038,'dang'=>-19023,'dao'=>-19018,'de'=>-19006,'deng'=>-19003,'di'=>-18996,'dian'=>-18977,'diao'=>-18961,'die'=>-18952,'ding'=>-18783,'diu'=>-18774,'dong'=>-18773,'dou'=>-18763,'du'=>-18756,'duan'=>-18741,'dui'=>-18735,'dun'=>-18731,'duo'=>-18722,
        'e'=>-18710,'en'=>-18697,'er'=>-18696,
        'fa'=>-18526,'fan'=>-18518,'fang'=>-18501,'fei'=>-18490,'fen'=>-18478,'feng'=>-18463,'fo'=>-18448,'fou'=>-18447,'fu'=>-18446,
        'ga'=>-18239,'gai'=>-18237,'gan'=>-18231,'gang'=>-18220,'gao'=>-18211,'ge'=>-18201,'gei'=>-18184,'gen'=>-18183,'geng'=>-18181,'gong'=>-18012,'gou'=>-17997,'gu'=>-17988,'gua'=>-17970,'guai'=>-17964,'guan'=>-17961,'guang'=>-17950,'gui'=>-17947,'gun'=>-17931,'guo'=>-17928,
        'ha'=>-17922,'hai'=>-17759,'han'=>-17752,'hang'=>-17733,'hao'=>-17730,'he'=>-17721,'hei'=>-17703,'hen'=>-17701,'heng'=>-17697,'hong'=>-17692,'hou'=>-17683,'hu'=>-17676,'hua'=>-17496,'huai'=>-17487,'huan'=>-17482,'huang'=>-17468,'hui'=>-17454,'hun'=>-17433,'huo'=>-17427,
        'ji'=>-17417,'jia'=>-17202,'jian'=>-17185,'jiang'=>-16983,'jiao'=>-16970,'jie'=>-16942,'jin'=>-16915,'jing'=>-16733,'jiong'=>-16708,'jiu'=>-16706,'ju'=>-16689,'juan'=>-16664,'jue'=>-16657,'jun'=>-16647,
        'ka'=>-16474,'kai'=>-16470,'kan'=>-16465,'kang'=>-16459,'kao'=>-16452,'ke'=>-16448,'ken'=>-16433,'keng'=>-16429,'kong'=>-16427,'kou'=>-16423,'ku'=>-16419,'kua'=>-16412,'kuai'=>-16407,'kuan'=>-16403,'kuang'=>-16401,'kui'=>-16393,'kun'=>-16220,'kuo'=>-16216,
        'la'=>-16212,'lai'=>-16205,'lan'=>-16202,'lang'=>-16187,'lao'=>-16180,'le'=>-16171,'lei'=>-16169,'leng'=>-16158,'li'=>-16155,'lia'=>-15959,'lian'=>-15958,'liang'=>-15944,'liao'=>-15933,'lie'=>-15920,'lin'=>-15915,'ling'=>-15903,'liu'=>-15889,'long'=>-15878,'lou'=>-15707,'lu'=>-15701,'lv'=>-15681,'luan'=>-15667,'lue'=>-15661,'lun'=>-15659,'luo'=>-15652,
        'ma'=>-15640,'mai'=>-15631,'man'=>-15625,'mang'=>-15454,'mao'=>-15448,'me'=>-15436,'mei'=>-15435,'men'=>-15419,'meng'=>-15416,'mi'=>-15408,'mian'=>-15394,'miao'=>-15385,'mie'=>-15377,'min'=>-15375,'ming'=>-15369,'miu'=>-15363,'mo'=>-15362,'mou'=>-15183,'mu'=>-15180,
        'na'=>-15165,'nai'=>-15158,'nan'=>-15153,'nang'=>-15150,'nao'=>-15149,'ne'=>-15144,'nei'=>-15143,'nen'=>-15141,'neng'=>-15140,'ni'=>-15139,'nian'=>-15128,'niang'=>-15121,'niao'=>-15119,'nie'=>-15117,'nin'=>-15110,'ning'=>-15109,'niu'=>-14941,'nong'=>-14937,'nu'=>-14933,'nv'=>-14930,'nuan'=>-14929,'nue'=>-14928,'nuo'=>-14926,
        'o'=>-14922,'ou'=>-14921,
        'pa'=>-14914,'pai'=>-14908,'pan'=>-14902,'pang'=>-14894,'pao'=>-14889,'pei'=>-14882,'pen'=>-14873,'peng'=>-14871,'pi'=>-14857,'pian'=>-14678,'piao'=>-14674,'pie'=>-14670,'pin'=>-14668,'ping'=>-14663,'po'=>-14654,'pu'=>-14645,
        'qi'=>-14630,'qia'=>-14594,'qian'=>-14429,'qiang'=>-14407,'qiao'=>-14399,'qie'=>-14384,'qin'=>-14379,'qing'=>-14368,'qiong'=>-14355,'qiu'=>-14353,'qu'=>-14345,'quan'=>-14170,'que'=>-14159,'qun'=>-14151,
        'ran'=>-14149,'rang'=>-14145,'rao'=>-14140,'re'=>-14137,'ren'=>-14135,'reng'=>-14125,'ri'=>-14123,'rong'=>-14122,'rou'=>-14112,'ru'=>-14109,'ruan'=>-14099,'rui'=>-14097,'run'=>-14094,'ruo'=>-14092,
        'sa'=>-14090,'sai'=>-14087,'san'=>-14083,'sang'=>-13917,'sao'=>-13914,'se'=>-13910,'sen'=>-13907,'seng'=>-13906,'sha'=>-13905,'shai'=>-13896,'shan'=>-13894,'shang'=>-13878,'shao'=>-13870,'she'=>-13859,'shen'=>-13847,'sheng'=>-13831,'shi'=>-13658,'shou'=>-13611,'shu'=>-13601,'shua'=>-13406,'shuai'=>-13404,'shuan'=>-13400,'shuang'=>-13398,'shui'=>-13395,'shun'=>-13391,'shuo'=>-13387,'si'=>-13383,'song'=>-13367,'sou'=>-13359,'su'=>-13356,'suan'=>-13343,'sui'=>-13340,'sun'=>-13329,'suo'=>-13326,
        'ta'=>-13318,'tai'=>-13147,'tan'=>-13138,'tang'=>-13120,'tao'=>-13107,'te'=>-13096,'teng'=>-13095,'ti'=>-13091,'tian'=>-13076,'tiao'=>-13068,'tie'=>-13063,'ting'=>-13060,'tong'=>-12888,'tou'=>-12875,'tu'=>-12871,'tuan'=>-12860,'tui'=>-12858,'tun'=>-12852,'tuo'=>-12849,
        'wa'=>-12838,'wai'=>-12831,'wan'=>-12829,'wang'=>-12812,'wei'=>-12802,'wen'=>-12607,'weng'=>-12597,'wo'=>-12594,'wu'=>-12585,
        'xi'=>-12556,'xia'=>-12359,'xian'=>-12346,'xiang'=>-12320,'xiao'=>-12300,'xie'=>-12120,'xin'=>-12099,'xing'=>-12089,'xiong'=>-12074,'xiu'=>-12067,'xu'=>-12058,'xuan'=>-12039,'xue'=>-11867,'xun'=>-11861,
        'ya'=>-11847,'yan'=>-11831,'yang'=>-11798,'yao'=>-11781,'ye'=>-11604,'yi'=>-11589,'yin'=>-11536,'ying'=>-11358,'yo'=>-11340,'yong'=>-11339,'you'=>-11324,'yu'=>-11303,'yuan'=>-11097,'yue'=>-11077,'yun'=>-11067,
        'za'=>-11055,'zai'=>-11052,'zan'=>-11045,'zang'=>-11041,'zao'=>-11038,'ze'=>-11024,'zei'=>-11020,'zen'=>-11019,'zeng'=>-11018,'zha'=>-11014,'zhai'=>-10838,'zhan'=>-10832,'zhang'=>-10815,'zhao'=>-10800,'zhe'=>-10790,'zhen'=>-10780,'zheng'=>-10764,'zhi'=>-10587,'zhong'=>-10544,'zhou'=>-10533,'zhu'=>-10519,'zhua'=>-10331,'zhuai'=>-10329,'zhuan'=>-10328,'zhuang'=>-10322,'zhui'=>-10315,'zhun'=>-10309,'zhuo'=>-10307,'zi'=>-10296,'zong'=>-10281,'zou'=>-10274,'zu'=>-10270,'zuan'=>-10262,'zui'=>-10260,'zun'=>-10256,'zuo'=>-10254
    );

    /**
     * 将中文编码成拼音
     * @param string $chinese 要转换为拼音的字符串
     * @param string $sRetFormat 返回格式 [first:每个字的首字母|all:全拼音|one:字符串字母]
     * @return string
     */
    public static function getPY($chinese, $sRetFormat='first'){
        $sGBK = iconv('UTF-8', 'GBK', $chinese);
        $sUTF8 = iconv('GBK', 'UTF-8', $sGBK);
        if($sUTF8 != $chinese) $sGBK = $chinese;
        $aBuf = array();
        for ($i=0, $iLoop=strlen($sGBK); $i<$iLoop; $i++) {
            $iChr = ord($sGBK{$i});
            if ($iChr>160)
                $iChr = ($iChr<<8) + ord($sGBK{++$i}) - 65536;
            if ('first' == $sRetFormat || 'one' == $sRetFormat)
                //$aBuf[] = substr(self::zh2py($iChr),0,1);
                $aBuf[] = self::zh2py($iChr);
            else
                $aBuf[] = self::zh2py($iChr);

        }
        if ('first' === $sRetFormat)
            return implode('', $aBuf);
        elseif('one' == $sRetFormat)
            return $aBuf[0];
        else
            return implode(' ', $aBuf);
    }

    /**
     * 中文转换到拼音(每次处理一个字符)
     * @param number $iWORD 待处理字符双字节
     * @return string 拼音
     */
    private static function zh2py($iWORD) {
        if($iWORD>0 && $iWORD<160 ) {
            return chr($iWORD);
        } elseif ($iWORD<-20319||$iWORD>-10247) {
            return '';
        } else {
            foreach (self::$_aMaps as $py => $code) {
                if($code > $iWORD) break;
                $result = $py;
            }
            return $result;
        }
    }
}


最后将此文件下的:

$alias = isset($_POST['alias']) ? addslashes(trim($_POST['alias'])) : '';
修改成:
$al=htmlspecialchars($_POST['alias']);
if(empty($al)){
    $alias = preg_replace('/ /', '-', Chinese_to_PY::getPY($title,'all'));
}else{
    $alias = '';
}
保存,即可实现效果!

但是感觉标题太长了。。。正在研究缩短,或者是取货首字母,或前两个字母。。。000036-2015-09-22.jpg

此文并非博主原创,是在博友独狼哪里看到的,原文地址:http://www.xlonewolf.net/course/32.html



admin 发布于  2015-9-22 19:43 

emlog开启评论审核之后,评论结束自动跳转回原文 emlog

emlog开启评论审核之后,评论结束就会跳转到这个界面:

000032-2015-09-22.jpg

不会自动跳转回原文,感觉不太好,于是呢,在论坛问了一下,最终修改方法如下,在此小计,希望可以帮到那些需要的童鞋:

找到 \include\lib\function.base.php 865行的 emMsg()函数,把 

$isAutoGo = false 修改成  $isAutoGo = true


000034-2015-09-22.jpg

其实,函数里面有说明的,boolean $isAutoGo 是否自动返回 true false 。之后评论完就会自动跳转到原文了(注意看左上角的旋转的圆圈):

000035-2015-09-22.jpg

随便吐槽,谁这么无奈,跑我这里刷广告。。。专门针对的。。。不过 我只需要一键,就删除了所有广告,所以,慎重!!!000033-2015-09-22.jpg


admin 发布于  2015-9-22 19:25 

插件冲突导致emlog的rss输出出错 emlog

先来看一下插件冲突导致rss输出出错的样子吧:

2015-08-29 22_52_00.png

估计很多的朋友都有过这种情况吧,rss.php输出出错,我也是,一开始以为是数据库表出错了,还使用工具箱修复,结果发现,还是不可以的。于是就把所有的插件都停用了,然后,慢慢测试,发现下面几个插件在激活状态都会导致rss.php输出出错:

1.奇遇的防垃圾评论插件 地址:http://www.emlog.net/plugin/10 希望奇遇可以修复

2.二今的代码演示插件,地址:http://www.emlog.net/plugin/166 希望而今可以修复

3.vibbow的索引通知插件 地址:http://www.emlog.net/plugin/9 希望可以修复

这些都是自己在最新版的emlog5.31上测试发现的,以为这些插件能够使用,但是版本上没有更新,所以兼容性不是很好。当然了,作者有时间最好修复一下,仅此小计一下,方便那些对于rss.php出错但是不知道什么原因的童鞋有点帮助,禁用这些插件就OK了,这些插件其实挺好的,只是没有升级更新。

禁用这些插件之后,rss输出就OK了:

2015-08-29 22_52_30.png


admin 发布于  2015-8-29 21:52 

为Wampserver My Projects自动添加localhost前缀 技术文章

我们安装好wampserver最新版之后,在菜单里面就会有My Project选项:

01.png

我们在wamp的默认www目录(根据你自己的安装路径)下面创建两个文件夹,emlog531和JavaScriptStudy,重启wampserver就可以在My Project里发现了。

但是我们默认打开其中的任意一个都会发现在浏览器里面的路径是这个样子的:

2015-08-26 09_23_53.png

根本就不能打开。。。。

我们打开localhost,在下面的 Your Projects 里面会发现打开项目依然不能访问,下图是我修改之后的,路径自动加上了localhost,就可以正常访问了,

2015-08-26 09_27_44.png

2015-08-26 09_25_32.png

而且修改之后我们直接在wamp的托盘菜单里面的菜单里面的My Projects项目可以直接在浏览器打开并正常访问,具体的修改反方法如下:

1>打开 \wamp\www\index.php

修改如下这行代码:


$suppress_localhost = true; 修改成 :$suppress_localhost = false;


2015-08-26 09_24_36.png

2>打开 \wamp\scripts\refresh.php

修改如下这行代码:


 Parameters: "http://'.$projectContents[$i].'/";  修改成 :  Parameters: "http://localhost/'.$projectContents[$i].'/";  其实就是在 http://后添加 localhost/


2015-08-26 10_09_13.png

完成上面两部之后就可以重新启动wampserver看效果了。一般就成功了。如果还是不行,那就参考这篇文章:



自定义wamp_server的网站根目录

相关文章推荐:

修改WampServer的默认浏览器小计--mrxn's Blog

修改wamp中的MySQL默认密码

在 WampServer 上手工安装 PHP 的多个版本


admin 发布于  2015-8-26 08:18 

WebStorm-PHPStorm-RubyMine-Pycharm-最新通用破解注册机 破解软件

WebStorm jetbrains公司旗下一款JavaScript 开发工具。被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。但是他是收费的!下面是注册成功的截图:

01.png

今天,Mrxn教你如何破解她!想上就上!哈哈,别邪恶、、、

最新版是10.0.4的,官网下载链接:http://download-cf.jetbrains.com/webstorm/WebStorm-10.0.4.exe 下载后,安装完毕,(如果安装不会,就别往下看了,免得你头晕眼花-_-|);运行我下面提供的注册机,直接打开,输入你想要注册的名字,点击Generate,OK,再点击copy,然后粘贴到你的注册框里面久OK。

02.png

如第一图:点击左下角的Register,然后打开注册机,输入你想要注册的名字,点击Generate,OK,再点击copy然后粘贴到你的注册框里面久OK。

03.png

最后,一个小技巧:代码自动换行设置:view - Active Editor - Use Soft Wraps 如图所示:

04.png 


WebStorm系列破解注册机大小:200KB | 来源:百度网盘
已经过安全软件检测无毒,请您放心下载。

admin 发布于  2015-8-22 15:01 

css样式设置小技巧汇总 PHP

水平居中设置-行内元素


如果被设置元素为文本图片行内元素时,水平居中是通过给父元素设置 text-align:center 来实现的。如下代码:

html代码:

<body>
  <div class="txtCenter">我是文本,哈哈,我想要在父容器中水平居中显示。</div>
</body>

css代码:

<style>
  div.txtCenter{ text-align:center; }
</style>

水平居中设置-定宽块状元素

当被设置元素为块状元素时用 text-align:center 就不起作用了,这时也分两种情况:定宽块状元素和不定宽块状元素。这一小节我们先来讲一讲定宽块状元素。

满足定宽块状两个条件的元素是可以通过设置左右margin”值为“auto”来实现居中的。我们来看个例子就是设置 div 这个块状元素水平居中:

html代码:

<body>
  <div>我是定宽块状元素,哈哈,我要水平居中显示。</div>
</body>

css代码:

<style>
div{
    border:1px solid red;/*为了显示居中效果明显为 div 设置了边框*/

    width:500px;/*定宽*/ margin:20px auto;/* margin-left 与 margin-right 设置为 auto */ }

</style>

也可以写成:

margin-left:auto;
margin-right:auto;

注意:元素的“上下 margin” 是可以随意设置的。

水平居中总结-不定宽块状元素方法(一)

在实际工作中我们会遇到需要为“不定宽度的块状元素”设置居中,比如网页上的分页导航,因为分页的数量是不确定的,所以我们不能通过设置宽度来限制它的弹性。

不定宽度的块状元素有三种方法居中(这三种方法目前使用的都比多):

  1. 加入 table 标签
  2. 设置 display;inline 方法
  3. 设置 position:relative 和 left:50%;

这一小节我们来讲一下第一种方法:

第一步:为需要设置的居中的元素外面加入一个 table 标签 ( 包括 <tbody>、<tr>、<td> )。

第二步:为这个 table 设置“左右 margin 居中”(这个和定宽块状元素的方法一样)。

举例如下:

html代码:

<div> <table> <tbody>
    <tr><td> <ul>
        <li><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
    </ul>  </td></tr>
  </tbody>
</table> </div>

css代码:

<style> table{
    margin:0 auto;
} ul{list-style:none;margin:0;padding:0;}
li{float:left;display:inline;margin-right:8px;}
</style>

水平居中总结-不定宽块状元素方法(二)

第二种方法:改变块级元素的 dispaly 为 inline 类型,然后使用 text-align:center 来实现居中效果。如下例子:

html代码:

<body>
<div class="container">
    <ul>
        <li><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
    </ul>
</div>
</body>

css代码:

<style>
.container{ text-align:center; }
.container ul{
    list-style:none;
    margin:0;
    padding:0; display:inline; }
.container li{
    margin-right:8px;
    display:inline;
}
</style>

这种方法相比第一种方法的优势是不用增加无语义标签,简化了标签的嵌套深度,但也存在着一些问题:它将块状元素的 display 类型改为 inline,变成了行内元素,所以少了一些功能,比如设定长度值。

水平居中总结-不定宽块状元素方法(三)

方法三:通过给父元素设置 float,然后给父元素设置 position:relative 和 left:50%,子元素设置 position:relative 和 left:-50% 来实现水平居中。

代码如下:

<body>
<div class="container">
    <ul>
        <li><a href="#">1</a></li>
        <li><a href="#">2</a></li>
        <li><a href="#">3</a></li>
    </ul>
</div>
</body>

css代码:

<style>
.container{  float:left;
    position:relative;
    left:50% }

.container ul{
    list-style:none;
    margin:0;
    padding:0;  position:relative;
    left:-50%; }
.container li{float:left;display:inline;margin-right:8px;}
</style>

这种方法可以保留块状元素仍以 display:block 的形式显示,优点不添加无语议表标签,不增加嵌套深度,但它的缺点是设置了 position:relative,带来了一定的副作用。

这三种方法使用得都非常广泛,各有优缺点,具体选用哪种方法,可以视具体情况而定。

垂直居中-父元素高度确定的单行文本

父元素高度确定的单行文本的竖直居中的方法是通过设置父元素的 heightline-height 高度一致来实现的。如下代码:

<div class="container">
    hi,Mrxn!
</div>

css代码:

<style>
.container{ height:100px;
    line-height:100px; background:#999;
}
</style>

垂直居中-父元素高度确定的多行文本(方法一)

父元素高度确定的多行文本图片块状元素的竖直居中的方法有两种:

方法一:使用插入 table (包括tbody、tr、td)标签,同时设置 vertical-align:middle。

说到竖直居中,css 中有一个用于竖直居中的属性 vertical-align,但这个样式只有在父元素为 td 或 th 时,才会生效。所以又要插入 table 标签了。下面看一下例子:

html代码:

<body> <table><tbody><tr><td class="wrap"> <div>
    <p>看我是否可以居中。</p>
    <p>看我是否可以居中。</p>
    <p>看我是否可以居中。</p>
    <p>看我是否可以居中。</p>
    <p>看我是否可以居中。</p>
</div> </td></tr></tbody></table> </body>

css代码:

table td{height:500px;background:#ccc}

因为 td 标签默认情况下就默认设置了 vertical-align 为 middle,所以我们不需要显式地设置了。

垂直居中-父元素高度确定的多行文本(方法二)

在 chrome、firefox 及 IE8 以上的浏览器下可以设置块级元素的 display 为 table-cell,激活 vertical-align 属性,但注意 IE6、7 并不支持这个样式。

html代码:

<div class="container">
    <div>
        <p>看我是否可以居中。</p>
        <p>看我是否可以居中。</p>
        <p>看我是否可以居中。</p>
        <p>看我是否可以居中。</p>
        <p>看我是否可以居中。</p>
    </div>
</div>

css代码:

<style>
.container{
    height:300px;
    background:#ccc;  display:table-cell;/*IE8以上及Chrome、Firefox*/ vertical-align:middle;/*IE8以上及Chrome、Firefox*/
}
</style>

这种方法的好处是不用添加多余的无意义的标签,但缺点也很明显,它的兼容性不是很好,不兼容 IE6、7。

隐性改变display类型

有一个有趣的现象就是当为元素(不论之前是什么类型元素,display:none 除外)设置以下 2 个句之一:

  1. position : absolute
  2. float : left 或 float:right

元素会自动变为以 display:inline-block 的方式显示,当然就可以设置元素的 width 和 height 了且默认宽度不占满父元素。

如下面的代码,小伙伴们都知道 a 标签是行内元素,所以设置它的 width 是 没有效果的,但是设置为 position:absolute 以后,就可以了。

<div class="container">
    <a href="#" title="">请单击这里</a>
</div>

css代码

<style>
.container a{ position:absolute; width:200px;
    background:#ccc;
}
</style>



admin 发布于  2015-8-19 19:09