插件效果:

TlePageForTypecho分页插件

使用方法:

第一步(可选):配置下方参数;

第二步:将以下代码放到主题目录下post.php中输出内容的位置进行替换(如:parseContent($this)或$this->content());

<?php TlePage_Plugin::parseContent($this); ?>

第三步:在编写的文章中间通过点击编辑器分割线


按钮,插入HR分割线(----------),即为分页分割线。

注意事项:

1、如果文章中含有图片,需要将typecho默认图片添加方式修改为<img src"" />形式的html代码,如有所不便,敬请谅解。

2、如果在禁用ajax分页情况下,想要让标题加上第几页的后缀,可以自行在主题目录下header.php的中加上:</p><pre><code><?php if(@$_GET["page_now"]>1){echo " - 第".@$_GET["page_now"]."页";}?> </code></pre><p>代码即可。</p> <p> <style>.down_link{background: none repeat scroll 0 0 #FFFCEF; border: 1px solid #FFBB76; border-radius: 2px; color: #DB7C22; font-size: 14px; margin-bottom: 10px; padding: 5px 10px;}</style> <div class="down_link"> <p style="position:relative;">登陆后显示隐藏免费下载/购买信息</p> </div> </p> </div> <h2 id="live_room_name"></h2> <div class='toc-tit'></div> <ul class="live_info pa"> <li><span>TlePageForTypecho分页插件</span></li> <li><i class="addr"></i><span><a href="https://joke.tongleer.com/author/1/" rel="author"><font color="#fff">Mr.贰呆</font></a></span></li> <li><i class="num"></i><span><font color="#fff">860</font></span></li> </ul> </div> <div class="live_cont_rg fr"> <div class="host_info"> <div class="host_name"> <span><a href="javascript:;" target="_blank" title="">Mr.贰呆</a></span> <small><a href="https://joke.tongleer.com/anchor.html?uid=1" target="_blank" title="真爱粉打赏进粉丝群"><span style="color:#FFB400;">粉丝群</span></a></small> <i class="sex"></i> <i class="level"></i> </div> <p class="host_code">diamond0422@qq.com</span></p> <p class="host_slogan">http://joke.tongleer.com</p> <a href="https://joke.tongleer.com/author/1/"> <img class="host_portrait" src="https://secure.gravatar.com/avatar/e323a171045f40fede8cafc7cb303d7d?s=50&r=g&d=mm" alt=""> </a> <span class="host_focus_done">打赏</span> <span class="host_focus">网址</span> </div> <script type="text/javascript"> window.TypechoComment = { dom : function (id) { return document.getElementById(id); }, create : function (tag, attr) { var el = document.createElement(tag); for (var key in attr) { el.setAttribute(key, attr[key]); } return el; }, reply : function (cid, coid) { var comment = this.dom(cid), parent = comment.parentNode, response = this.dom('respond-post-336'), input = this.dom('comment-parent'), form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0], textarea = response.getElementsByTagName('textarea')[0]; if (null == input) { input = this.create('input', { 'type' : 'hidden', 'name' : 'parent', 'id' : 'comment-parent' }); form.appendChild(input); } input.setAttribute('value', coid); if (null == this.dom('comment-form-place-holder')) { var holder = this.create('div', { 'id' : 'comment-form-place-holder' }); response.parentNode.insertBefore(holder, response); } comment.appendChild(response); this.dom('cancel-comment-reply-link').style.display = ''; if (null != textarea && 'text' == textarea.name) { textarea.focus(); } $('#comment-form input[name="text"]').attr('style',''); return false; }, cancelReply : function () { var response = this.dom('respond-post-336'), holder = this.dom('comment-form-place-holder'), input = this.dom('comment-parent'); if (null != input) { input.parentNode.removeChild(input); } if (null == holder) { return true; } this.dom('cancel-comment-reply-link').style.display = 'none'; holder.parentNode.insertBefore(response, holder); $('#comment-form input[name="text"]').attr('style','position: absolute;left: 0;bottom: 0;'); return false; } } </script> <div class="comments"> <div id="respond-post-336" class="respond"> <div class="cancel-comment-reply"> <a id="cancel-comment-reply-link" href="https://joke.tongleer.com/336.html#respond-post-336" rel="nofollow" style="display:none" onclick="return TypechoComment.cancelReply();"><i class="iconfont icon-aria-cancel"></i></a> </div> <!-- New Comments begin --> <form method="post" action="https://joke.tongleer.com/336.html/comment" id="comment-form" role="form"> <p class="comment-input"> <input type="text" name="text" placeholder="你要说点什么...回车键发送" style="position: absolute;left: 0;bottom: 0;"> </p> </form> </div> </div> </div> </div> <div id="live_hot" class="list_panel"> <div class="list_panel_hd"> <h3>热门文章</h3> <a href="https://joke.tongleer.com/">更多</a> </div> <div class="list_panel_bd clearfix"> <div class="list_box"> <div class="list_pic"> <a href="https://joke.tongleer.com/249.html"> <img src="http://wx2.sinaimg.cn/large/005V7SQ5ly1g2gfvxz030j30ny075dg8.jpg" alt="Mr.贰呆" alt="WeMediaForTypecho付费阅读插件(支持SPay+payjs免登录支付)" class=""> <p class="num"><span>2018年07月25日 20:52</span></p><span class="tag">15</span> <span class="play_layer"><i></i></span> </a> <div class="list_intro"><p>WeMediaForTypecho付费阅读插件(支持SPay+payjs免登录支付)</p></div> </div> <div class="list_user_info"> <span class="list_user_head" style="background-image: url(https://secure.gravatar.com/avatar/e323a171045f40fede8cafc7cb303d7d?s=30&r=X&d="></span> <span class="list_user_name">Mr.贰呆</span> </div> <div class="list_tag"></div> </div> <div class="list_box"> <div class="list_pic"> <a href="https://joke.tongleer.com/368.html"> <img src="https://ae01.alicdn.com/kf/HTB1w_pCd8WD3KVjSZFsq6AqkpXao.jpg" alt="Mr.贰呆" alt="WechatFansForTypecho微信公众号涨粉插件" class=""> <p class="num"><span>2019年01月23日 23:46</span></p><span class="tag">12</span> <span class="play_layer"><i></i></span> </a> <div class="list_intro"><p>WechatFansForTypecho微信公众号涨粉插件</p></div> </div> <div class="list_user_info"> <span class="list_user_head" style="background-image: url(https://secure.gravatar.com/avatar/e323a171045f40fede8cafc7cb303d7d?s=30&r=X&d="></span> <span class="list_user_name">Mr.贰呆</span> </div> <div class="list_tag"></div> </div> <div class="list_box"> <div class="list_pic"> <a href="https://joke.tongleer.com/405.html"> <img src="http://wx2.sinaimg.cn/large/005V7SQ5ly1g2gfthcwnnj30lq074jrs.jpg" alt="Mr.贰呆" alt="TleBarragerForTypecho评论弹幕插件" class=""> <p class="num"><span>2019年04月23日 00:14</span></p><span class="tag">8</span> <span class="play_layer"><i></i></span> </a> <div class="list_intro"><p>TleBarragerForTypecho评论弹幕插件</p></div> </div> <div class="list_user_info"> <span class="list_user_head" style="background-image: url(https://secure.gravatar.com/avatar/e323a171045f40fede8cafc7cb303d7d?s=30&r=X&d="></span> <span class="list_user_name">Mr.贰呆</span> </div> <div class="list_tag"></div> </div> </div> </div> </div> <script> $(function(){ layui.use('layer', function(){ var $ = layui.jquery, layer = layui.layer; $(".host_focus_done").click(function(){ layer.confirm('<center><font color="#aaa"><div>站长为作者贡献了49篇文章</div><img src="https://ae01.alicdn.com/kf/HTB1lki1dwaH3KVjSZFjq6AFWpXaI.jpg" alt="" width="200"><div>您的鼓励将是站长及作者前行的动力</div><div>谢谢打赏</div></font></center>', { title:"打赏", btn: ['关闭'] },function(index){ layer.close(index); }); }); }); }); </script> </div> <input type="hidden" id="hasLogin" value="" /> <div id="footer"> <!-- 右侧二维码 --> <div class="code_panel"><img class="code_img pa" src="http://joke.tongleer.com/usr/themes/inker/assets/images/code_img.png" alt="扫码关注微信公众号"></div> <div class="footer_menu"> <span><a href="https://joke.tongleer.com/links.html">友情链接</a></span> <span><a href="https://joke.tongleer.com/about.html">关于我</a></span> <span><a href="https://joke.tongleer.com/archive.html">文章归档</a></span> </div> <p> <style> .friendlink{margin:0 auto;width:calc(100% - 100px);} @media screen and (max-width:calc(100% - 100px);) { .friendlink{width: calc(100% - 100px);} } </style> <div class="friendlink"><marquee direction="up" behavior="scroll" scrollamount="1" scrolldelay="10" loop="-1" onMouseOver="this.stop()" onMouseOut="this.start()" width="100%" height="30" style="text-align:center;">友情链接:<a href=javascript:open("https://wpa.qq.com/msgrd?v=3&uin=2293338477&site=qq&menu=yes");><img src="https://q1.qlogo.cn/g?b=qq&nk=2293338477&s=100" width="16" /></a><a href="https://www.tongleer.com" target="_blank" title="共同分享快乐" rel="friend">同乐儿</a> </marquee></div></p> <p> 分类数 12 文章数 63 页面数 4 评论数 53 </p> <p><a href="http://joke.tongleer.com/tools.html" target="_blank">工具集</a>  <a href="http://joke.tongleer.com/anchor.html" target="_blank">主播圈</a>  <a href="http://joke.tongleer.com/dashang.html" target="_blank">全天乞讨</a></p> <!--尊重网站版权是每一个合法公民应尽的义务,请养成保留以下版权信息的习惯。--> <p>Copyright 2019-2020 <a href="https://joke.tongleer.com/">同乐汇</a> Powered by <a href="http://typecho.org/" title="Typecho" target="_blank" rel="nofollow">Typecho</a> Theme By <a id="rightdetail" href="http://www.tongleer.com" target="_blank" title="同乐儿">Tongleer</a> All rights reserved.</p> <p>冀ICP备14012071号</p> <p style="display:none;"></p> </div> <script src="https://joke.tongleer.com/usr/themes/inker/assets/js/ckplayer.js"></script> <script src="https://joke.tongleer.com/usr/themes/inker/assets/js/clipboard.min.js"></script> <script src="https://joke.tongleer.com/usr/themes/inker/assets/js/live.js"></script> <script src="https://joke.tongleer.com/usr/themes/inker/assets/js/gift-show.js"></script> <script src="https://joke.tongleer.com/usr/themes/inker/assets/js/util.js"></script> <div id="QPlayer" style="z-index:2016"> <div id="pContent"> <div id="player"> <span class="cover"></span> <div class="ctrl"> <div class="musicTag marquee"> <strong>Title</strong> <span> - </span> <span class="artist">Artist</span> </div> <div class="progress"> <div class="timer left">0:00</div> <div class="contr"> <div class="rewind icon"></div> <div class="playback icon"></div> <div class="fastforward icon"></div> </div> <div class="right"> <div class="liebiao icon"></div> </div> </div> </div> </div> <div class="ssBtn"> <div class="adf"></div> </div> </div> <ol id="playlist"></ol> </div> <script> var autoplay = 0; var playlist = [ { title: "陪你长大", artist: "火箭少女101段奥娟", cover: "https://y.gtimg.cn/music/photo_new/T002R300x300M000002cSXJi3wXNVN.jpg", mp3: "http://m10.music.126.net/20191101131239/6fa1e971e940d5d36d1188d6713a16e6/ymusic/f8e2/eab3/738a/e83ae4d588a0e608cebce4f7597bd944.mp3", } ]; var isRotate = 1; </script> <script src="https://joke.tongleer.com/usr/plugins/QPlayer/js/jquery-ui.min.js"></script> <script src="https://joke.tongleer.com/usr/plugins/QPlayer/js/jquery.marquee.min.js"></script> <script src="https://joke.tongleer.com/usr/plugins/QPlayer/js/player.js"></script> <div style="position:fixed;bottom:0;right:0;"> <button id="btnChatroom" class="layui-btn layui-btn-normal">聊天室</button> </div> <script src="https://www.tongleer.com/api/web/include/layui/layui.js"></script> <script> layui.use("layer", function(){ var $ = layui.jquery, layer = layui.layer; $("#btnChatroom").click(function(){ layer.open({ type: 2 ,title: "聊天室" ,id: "chatroom" ,area: ["95%", "95%"] ,shade: 0 ,maxmin: true ,offset: "auto" ,content: "https://joke.tongleer.com/usr/plugins/TleChat/chat/chat.php?uid=" ,btn: ["关闭"] ,yes: function(){ layer.closeAll(); } ,zIndex: layer.zIndex ,success: function(layero){ layer.setTop(layero); } }); }); }); </script> <script src="https://cdnjs.cloudflare.com/ajax/libs/layer/2.3/layer.js"></script> <script> var apiUrl = "https://joke.tongleer.com/"; var apiHost = "//webapi.busi.inke.cn"; /beta/gi.test(location.href) && (apiHost = "//betawebapi.busi.inke.cn"); var initData = { api_address: apiUrl + "usr/themes/inker/", api_url: apiHost + "/web/", userInfo: getCookie("INKERUSERINFO") || "", area_code: [{ name: "阿富汗", code: 93 }, { name: "阿尔巴尼亚", code: 355 }, { name: "阿尔及利亚", code: 213 }, { name: "美属萨摩亚", code: 684 }, { name: "安道尔", code: 376 }, { name: "安哥拉", code: 244 }, { name: "安圭拉", code: 1264 }, { name: "南极洲", code: 672 }, { name: "安提瓜和巴布达", code: 1268 }, { name: "阿根廷", code: 54 }, { name: "亚美尼亚", code: 374 }, { name: "阿鲁巴", code: 297 }, { name: "澳大利亚", code: 61 }, { name: "奥地利", code: 43 }, { name: "阿塞拜疆", code: 994 }, { name: "巴林", code: 973 }, { name: "孟加拉国", code: 880 }, { name: "巴巴多斯", code: 1246 }, { name: "白俄罗斯", code: 375 }, { name: "比利时", code: 32 }, { name: "伯利兹", code: 501 }, { name: "贝宁", code: 229 }, { name: "百慕大", code: 1441 }, { name: "不丹", code: 975 }, { name: "玻利维亚", code: 591 }, { name: "波黑", code: 387 }, { name: "博茨瓦纳", code: 267 }, { name: "巴西", code: 55 }, { name: "英属维尔京群岛", code: 1284 }, { name: "文莱", code: 673 }, { name: "保加利亚", code: 359 }, { name: "布基纳法索", code: 226 }, { name: "缅甸", code: 95 }, { name: "布隆迪", code: 257 }, { name: "柬埔寨", code: 855 }, { name: "喀麦隆", code: 237 }, { name: "加拿大", code: 1 }, { name: "佛得角", code: 238 }, { name: "开曼群岛", code: 1345 }, { name: "中非", code: 236 }, { name: "乍得", code: 235 }, { name: "智利", code: 56 }, { name: "中国", code: 86 }, { name: "圣诞岛", code: 61 }, { name: "科科斯(基林)群岛", code: 61 }, { name: "哥伦比亚", code: 57 }, { name: "科摩罗", code: 269 }, { name: "刚果(金)", code: 243 }, { name: "刚果(布)", code: 242 }, { name: "库克群岛", code: 682 }, { name: "哥斯达黎加", code: 506 }, { name: "科特迪瓦", code: 225 }, { name: "克罗地亚", code: 385 }, { name: "古巴", code: 53 }, { name: "塞浦路斯", code: 357 }, { name: "捷克", code: 420 }, { name: "丹麦", code: 45 }, { name: "吉布提", code: 253 }, { name: "多米尼克", code: 1767 }, { name: "多米尼加", code: 1809 }, { name: "厄瓜多尔", code: 593 }, { name: "埃及", code: 20 }, { name: "萨尔瓦多", code: 503 }, { name: "赤道几内亚", code: 240 }, { name: "厄立特里亚", code: 291 }, { name: "爱沙尼亚", code: 372 }, { name: "埃塞俄比亚", code: 251 }, { name: "福克兰群岛(马尔维纳斯)", code: 500 }, { name: "法罗群岛", code: 298 }, { name: "斐济", code: 679 }, { name: "芬兰", code: 358 }, { name: "法国", code: 33 }, { name: "法属圭亚那", code: 594 }, { name: "法属波利尼西亚", code: 689 }, { name: "加蓬", code: 241 }, { name: "格鲁吉亚", code: 995 }, { name: "德国", code: 49 }, { name: "加纳", code: 233 }, { name: "直布罗陀", code: 350 }, { name: "希腊", code: 30 }, { name: "格陵兰", code: 299 }, { name: "格林纳达", code: 1473 }, { name: "瓜德罗普", code: 590 }, { name: "关岛", code: 1671 }, { name: "危地马拉", code: 502 }, { name: "根西岛", code: 1481 }, { name: "几内亚", code: 224 }, { name: "几内亚比绍", code: 245 }, { name: "圭亚那", code: 592 }, { name: "海地", code: 509 }, { name: "梵蒂冈", code: 379 }, { name: "洪都拉斯", code: 504 }, { name: "香港", code: 852 }, { name: "匈牙利", code: 36 }, { name: "冰岛", code: 354 }, { name: "印度", code: 91 }, { name: "印度尼西亚", code: 62 }, { name: "伊朗", code: 98 }, { name: "伊拉克", code: 964 }, { name: "爱尔兰", code: 353 }, { name: "以色列", code: 972 }, { name: "意大利", code: 39 }, { name: "牙买加", code: 1876 }, { name: "日本", code: 81 }, { name: "约旦", code: 962 }, { name: "哈萨克斯坦", code: 73 }, { name: "肯尼亚", code: 254 }, { name: "基里巴斯", code: 686 }, { name: "朝鲜", code: 850 }, { name: "韩国", code: 82 }, { name: "科威特", code: 965 }, { name: "吉尔吉斯斯坦", code: 996 }, { name: "老挝", code: 856 }, { name: "拉脱维亚", code: 371 }, { name: "黎巴嫩", code: 961 }, { name: "莱索托", code: 266 }, { name: "利比里亚", code: 231 }, { name: "利比亚", code: 218 }, { name: "列支敦士登", code: 423 }, { name: "立陶宛", code: 370 }, { name: "卢森堡", code: 352 }, { name: "澳门", code: 853 }, { name: "马达加斯加", code: 261 }, { name: "马拉维", code: 265 }, { name: "马来西亚", code: 60 }, { name: "马尔代夫", code: 960 }, { name: "马里", code: 223 }, { name: "马耳他", code: 356 }, { name: "马绍尔群岛", code: 692 }, { name: "马提尼克", code: 596 }, { name: "毛里塔尼亚", code: 222 }, { name: "毛里求斯", code: 230 }, { name: "马约特", code: 269 }, { name: "墨西哥", code: 52 }, { name: "密克罗尼西亚", code: 691 }, { name: "摩尔多瓦", code: 373 }, { name: "摩纳哥", code: 377 }, { name: "蒙古", code: 976 }, { name: "蒙特塞拉特", code: 1664 }, { name: "摩洛哥", code: 212 }, { name: "莫桑比克", code: 258 }, { name: "纳米尼亚", code: 264 }, { name: "瑙鲁", code: 674 }, { name: "尼泊尔", code: 977 }, { name: "荷兰", code: 31 }, { name: "荷属安的列斯", code: 599 }, { name: "新喀里多尼亚", code: 687 }, { name: "新西兰", code: 64 }, { name: "尼加拉瓜", code: 505 }, { name: "尼日尔", code: 227 }, { name: "尼日利亚", code: 234 }, { name: "纽埃", code: 683 }, { name: "诺福克岛", code: 6723 }, { name: "北马里亚纳", code: 1 }, { name: "挪威", code: 47 }, { name: "阿曼", code: 968 }, { name: "巴基斯坦", code: 92 }, { name: "帕劳", code: 680 }, { name: "巴拿马", code: 507 }, { name: "巴布亚新几内亚", code: 675 }, { name: "巴拉圭", code: 595 }, { name: "秘鲁", code: 51 }, { name: "菲律宾", code: 63 }, { name: "波兰", code: 48 }, { name: "葡萄牙", code: 351 }, { name: "波多黎各", code: 1809 }, { name: "卡塔尔", code: 974 }, { name: "留尼汪", code: 262 }, { name: "罗马尼亚", code: 40 }, { name: "俄罗斯", code: 7 }, { name: "卢旺达", code: 250 }, { name: "圣赫勒拿", code: 290 }, { name: "圣基茨和尼维斯", code: 1869 }, { name: "圣卢西亚", code: 1758 }, { name: "圣皮埃尔和密克隆", code: 508 }, { name: "圣文森特和格林纳丁斯", code: 1784 }, { name: "萨摩亚", code: 685 }, { name: "圣马力诺", code: 378 }, { name: "圣多美和普林西比", code: 239 }, { name: "沙特阿拉伯", code: 966 }, { name: "塞内加尔", code: 221 }, { name: "塞尔维亚和黑山", code: 381 }, { name: "塞舌尔", code: 248 }, { name: "塞拉利", code: 232 }, { name: "新加坡", code: 65 }, { name: "斯洛伐克", code: 421 }, { name: "斯洛文尼亚", code: 386 }, { name: "所罗门群岛", code: 677 }, { name: "索马里", code: 252 }, { name: "南非", code: 27 }, { name: "西班牙", code: 34 }, { name: "斯里兰卡", code: 94 }, { name: "苏丹", code: 249 }, { name: "苏里南", code: 597 }, { name: "斯瓦尔巴岛和扬马延岛", code: 47 }, { name: "斯威士兰", code: 268 }, { name: "瑞典", code: 46 }, { name: "瑞士", code: 41 }, { name: "叙利亚", code: 963 }, { name: "台湾", code: 886 }, { name: "塔吉克斯坦", code: 992 }, { name: "坦桑尼亚", code: 255 }, { name: "泰国", code: 66 }, { name: "巴哈马", code: 1242 }, { name: "冈比亚", code: 220 }, { name: "多哥", code: 228 }, { name: "托克劳", code: 690 }, { name: "汤加", code: 676 }, { name: "特立尼达和多巴哥", code: 1868 }, { name: "突尼斯", code: 216 }, { name: "土耳其", code: 90 }, { name: "土库曼斯坦", code: 993 }, { name: "特克斯和凯科斯群岛", code: 1649 }, { name: "图瓦卢", code: 688 }, { name: "乌干达", code: 256 }, { name: "乌克兰", code: 380 }, { name: "阿拉伯联合酋长国", code: 971 }, { name: "英国", code: 44 }, { name: "美国", code: 1 }, { name: "乌拉圭", code: 598 }, { name: "乌兹别克斯坦", code: 998 }, { name: "瓦努阿图", code: 678 }, { name: "委内瑞拉", code: 58 }, { name: "越南", code: 84 }, { name: "美属维尔京群岛", code: 1340 }, { name: "瓦利斯和富图纳", code: 681 }, { name: "也门", code: 967 }, { name: "赞比亚", code: 260 }, { name: "津巴布韦", code: 263 }] }, $loginRegistBox = $(".header_rg"), $userBox = $(".user_box"), $logoutBtn = $(".logout_btn"); /* if (initData.userInfo) { var user_info = JSON.parse(initData.userInfo); $loginRegistBox.hide(); var name = $.trim(user_info.name); 6 < name.length && (name = name.substr(0, 6) + "..."), $userBox.find("img").attr({ src: user_info.pic, alt: user_info.name }).end().find(".user_name").html(name), $userBox.show() } else $loginRegistBox.show(); */ function renderMaskLayer() { var e = $('<div class="mask_layer"></div>'); e.css({ position: "absolute", top: 0, left: 0, zIndex: 100, width: $("body").width(), height: $("body").height(), backgroundColor: "#000", filter: "alpha(opacity=40)", opacity: .4 }), $("body").append(e) } function renderLoginPanel() { renderMaskLayer(), addBuriedPointHandler("104000"); for (var e = "", n = 0; n < initData.area_code.length; n++) e += '<li data-code="' + initData.area_code[n].code + '">' + initData.area_code[n].name + "</li>"; var a = '<div id="login_panel"><div class="login_panel-lf fl"><h2>登录同乐汇</h2><div class="area_code" style="display:none;"><p><span data-code="86">中国(+86)</span></p><ul>' + e + '</ul></div><form class="login_form" action="https://joke.tongleer.com/index.php/action/login?_=53544564f380a86fd141a0d9ee69de44" method="post"><input type="hidden" name="action" value="submit"><input type="hidden" id="protocolurl" value="https://joke.tongleer.com/336.html"><input type="hidden" name="referer" value="https://joke.tongleer.com" data-current-url="value"><fieldset><legend>登录</legend><div class="login_form_item"><input type="text" name="name" placeholder="请输入手机号码或邮箱"></div><div class="login_form_item login_form_img"><input type="text" name="imgcode" placeholder="请输入图文验证码"><img class="img_code" src=' + initData.api_address + "libs/checkcode.php?r=" + Math.random() + 'alt="图形验证码" /></div><div class="login_form_item login_form_code"><input type="text" name="code" placeholder="请输入验证码"><span class="code_btn">获取验证码</span><span class="code_btn_dis">获取验证码</span></div><div class="login_form_item"><input type="password" name="password" placeholder="请输入密码"></div><div class="login_form_item"><p class="msg"></p></div><div class="login_form_item"><span class="login_btn">登录</span></div></fieldset></form><p class="login_terms"></div><div class="login_panel-rg fr"><div class="download_code"><img src="http://joke.tongleer.com/usr/themes/inker/assets/images/code_img.png" alt="扫码关注微信公众号"><p>扫码关注微信公众号<br /><span onClick=top.open("https://joke.tongleer.com/passport/forgot");>忘记密码</span></p></div><a href="" class="qqlogin"><i></i><span>QQ登录</span></a></div><span class="close_login_panel"></span></div>'; $("body").append(a); var o = $(".close_login_panel"), d = $(".area_code"), c = d.find("p"), i = d.find("ul"), m = $('.login_form input[name="name"]'), pwd = $('.login_form input[name="password"]'), t = $('.login_form input[name="imgcode"]'), l = $('.login_form input[name="code"]'), s = $(".img_code"), r = $(".code_btn"), p = $(".code_btn_dis"), u = $(".login_btn"), h = $(".login_form p.msg"); m.focus(), o.on("click", function() { clearMaskLoginHandler(), addBuriedPointHandler("110003") }), d.on("click", "p", function() { i.show(), i.animate({ height: "270" }, 200), i.on("click", "li", function() { c.find("span").html($(this).html() + "(+" + $(this).data("code") + ")"), c.find("span").data("code", $(this).data("code")), i.css({ height: 0 }), i.hide() }) }).on("mouseleave", function() { i.animate({ height: "0" }, 200, function() { i.hide() }) }), s.on("click", function() { s.attr("src", initData.api_address + "libs/checkcode.php?r=" + Math.random())/*Live_captcha_pc*/ }), t.on("input", function() { 5 == $(this).val().length ? (p.hide(), r.show()) : (p.show(), r.hide()) }), t.on("change", function() { 5 == $(this).val().length ? (p.hide(), r.show()) : (p.show(), r.hide()) }), r.on("click", function() { var n = 60, a = null; (h.html(""), m.val()) ? sendCodeHandler(c.find("span").data("code") + m.val(), t.val(),m.val()).done(function(e) { 0 != e.error_code ? h.html(e.message) : (r.hide(), p.show().html(n + "s"), a = setInterval(function() { 1 < n ? (n--, p.html(n + "s")) : (r.html("重新发送").show(), p.hide(), clearInterval(a)) }, 1e3)) }).fail(function() { h.html("验证码获取错误!") }) : h.html("请输入手机号码或邮箱!") }), u.on("click", function() { return h.html(""), /* m.val() ? l.val() ? void loginRegistHandler(c.find("span").data("code") + m.val(), l.val(),m.val(),pwd.val(),t.val()) : (h.html("请输入验证码!"), !1) : (h.html("请输入手机号码或邮箱!"), !1) */ m.val() ? void loginRegistHandler(c.find("span").data("code") + m.val(), l.val(),m.val(),pwd.val(),t.val()) : (h.html("请输入手机号码或邮箱!"), !1) }), otherLogin().done(function(e) { 0 == e.error_code ? ($(".sinalogin").attr("href", e.data && e.data.wb_url), $(".qqlogin").attr("href", e.data && e.data.qq_url)) : console.log("错误提示:" + e.msg) }).fail(function() { console.log("错误提示:第三方登录接口错误!") }) } function otherLogin() { /*window.location.search*/ return $.ajax({ url: initData.api_address + "ajax/regoauth.php?protocolurl="+$("#protocolurl").val(), dataType: "json" }) } function sendCodeHandler(e, n,m) { var type="phone"; if(m.indexOf("@")!=-1){ type="mail"; } return $.ajax({ url: initData.api_address + "ajax/sendsms.php",/*Live_mobilecode_pc*/ data: { action:type, phone: e, captcha: n, cnphone: m }, xhrFields: { withCredentials: !0 }, dataType: "json" }) } function loginRegistHandler(e, n,m,pwd,t) { /* if($(".login_form input[name='imgcode']").val()!=n){ $(".login_form p.msg").html("请输入正确的验证码") return; } */ var address="ajax/regphone.php"; if(m.indexOf("@")!=-1){ address="ajax/regmail.php"; } $.ajax({ url: initData.api_address + address,/*Live_login_pc*/ data: { phone: e, pwd:pwd, imgcode: t, code: n, cnphone: m }, xhrFields: { withCredentials: !0 }, crossDomain: true, dataType: "json", success: function(e) { if(e.error_code==0){ $.ajax({ url: $(".login_form").attr("action"), type: $(".login_form").attr("method"), data: $(".login_form").serializeArray(), success: function(data) { /*setCookie("INKERUSERINFO",e.data.INKERUSERINFO,0);*/ location.reload(); }, error: function() { $(".login_form p.msg").html("登录错误!"); } }); /* 0 == e.error_code ? (clearMaskLoginHandler(), $loginRegistBox.hide(), e.data && ($userBox.find("img").attr({ src: e.data.portrait, alt: e.data.nick }).end().find(".user_name").html(e.data.nick), $userBox.show())) : $(".login_form p.msg").html(e.message) */ }else{ $(".login_form p.msg").html(e.message); } }, error: function() { $(".login_form p.msg").html("登录/注册错误!") } }) } function loginOutHandler() { clearCookie(); location.href="https://joke.tongleer.com/action/logout?_=53544564f380a86fd141a0d9ee69de44"; } function clearMaskLoginHandler() { $(".mask_layer").remove(), $("#login_panel").remove() } function setCookie(e, n, a) { var o = new Date; o.setDate(o.getDate() + a), document.cookie = e + "=" + encodeURIComponent(n) + ";expires=" + a } function getCookie(e) { for (var n, a = document.cookie.split("; "), o = 0; o < a.length; o++) if ((n = a[o].split("="))[0] == e) return decodeURIComponent(n[1]) } function delCookie(e) { setCookie(e, 1, -1) } function addBuriedPointHandler(e, n) { var a = { source_cc: "TG6001", busi_code: e, is_login: n || 0, click_time: (new Date).getTime() }; /* url = "https://service.busi.inke.cn/web/web_click_report?" + $.param(a), setTimeout(function() { (new Image).src = url }, 0) */ } function alertHandler(e) { renderMaskLayer(); var n = '<div class="alert_box"><p style="text-align: center;">' + e + "</p><span>确认</span></div>"; $("body").append(n), $(".alert_box span").on("click", function() { $(".mask_layer").remove(), $(".alert_box").remove() }) } function flashCheck() { var e, n = { hasFlash: 0, flashVersion: 0 }; if (document.all)(e = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")) && (n.hasFlash = 1, VSwf = e.GetVariable("$version"), n.flashVersion = parseInt(VSwf.split(" ")[1].split(",")[0])); else if (navigator.plugins && 0 < navigator.plugins.length && (e = navigator.plugins["Shockwave Flash"])) { n.hasFlash = 1; for (var a = e.description.split(" "), o = 0; o < a.length; ++o) isNaN(parseInt(a[o])) || (n.flashVersion = parseInt(a[o])) } return n } $loginRegistBox.find(".login").on("click", renderLoginPanel), $loginRegistBox.find(".regist").on("click", renderLoginPanel), $userBox.on("mouseenter", function() { $logoutBtn.show() }).on("mouseleave", function() { $logoutBtn.hide() }), $logoutBtn.on("click", function() { loginOutHandler() }); function clearCookie(){ var keys=document.cookie.match(/[^ =;]+(?=\=)/g); if (keys) { for (var i = keys.length; i--;) document.cookie=keys[i]+'=0;expires=' + new Date( 0).toUTCString() } } </script> <script> function ajaxComment(id,author="",mail="",url=""){ layui.use('layer', function(){ var $ = layui.jquery, layer = layui.layer; var serializeJson = $("#comment-form").serializeArray(); if(!$("#isPage").val()){ serializeJson.push({"name":"author","value":author}); serializeJson.push({"name":"mail","value":mail}); serializeJson.push({"name":"url","value":url}); } $.ajax({ type: $("#comment-form").attr("method"), url: $("#comment-form").attr("action"), data: serializeJson, success: function(t) { if (!$(id, t).length) { layer.msg('评论提交失败!'); return false; } layer.msg('评论提交成功,无需重复提交!'); }, error: function(t) { window.location.reload(); } }); }); } function ajaxCommentForm(){ layui.use('layer', function(){ var $ = layui.jquery, layer = layui.layer; if($("#isPage").val()){ $("#comment-form").submit(function() { ajaxComment("#comments"); return false; }); }else{ $('#comment-form input[name=\"text\"]').keydown(function() { if (event.keyCode == "13") { if($("#hasLogin").val()){ var str='<center>确定要提交评论吗?<br /><small>(评论前需确保已经修改完个人邮箱,否则不会发送邮件回复提醒。)</small></center>'; }else{ var str='<center>发表评论<br /><small>(评论审核后方可显示)</small></center><input placeholder="(必填)昵称" type="text" id="comments_box_author" class="text" value="" required /><input placeholder="(必填)邮箱" type="email" id="comments_box_mail" class="text" value="" required /><input type="url" id="comments_box_url" class="text" placeholder="(选填)网站" value="" /><input type="hidden" id="commentsRequireMail" value="1" /><input type="hidden" id="commentsRequireURL" value="0" />'; } layer.confirm(str, { title:"评论", btn: ['提交','算了'] },function(index){ if($("#comments_box_author").val()==""){ layer.msg("需要填入昵称"); layer.close(index); return; } if($("#commentsRequireMail").val()==1&&$("#comments_box_mail").val()==""){ layer.msg("需要填入邮箱"); layer.close(index); return; } if($("#commentsRequireURL").val()==1&&$("#commentsRequireURL").val()==""){ layer.msg("需要填入网站地址"); layer.close(index); return; } ajaxComment(".comments",$("#comments_box_author").val(),$("#comments_box_mail").val(),$("#comments_box_url").val()); layer.close(index); }); return false; } }); } }); } ajaxCommentForm(); </script> <style> .pjax_loading {position: fixed;top: 45%;left: 45%;display: none;z-index: 999999;width: 124px;height: 124px;background: url('https://joke.tongleer.com/usr/themes/inker/assets/images/pjax_loading.gif') 50% 50% no-repeat;} .pjax_loading1 {position: fixed;top: 0;left: 0;z-index: 999999;display: none;width: 100%;height: 100%;opacity: .2} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.pjax/2.0.1/jquery.pjax.min.js"></script> <script type="text/javascript" language="javascript"> $(function() { $(document).pjax('a[target!=_blank]', '#container', {fragment:'#container', timeout:6000}); $(document).on('submit', 'form[target!=_blank]', function (event) { $.pjax.submit(event, '#container', {fragment:'#container', timeout:6000}); }); $(document).on('pjax:send', function() { $(".pjax_loading,.pjax_loading1").css("display", "block"); }); $(document).on('pjax:complete', function() { $(".pjax_loading,.pjax_loading1").css("display", "none"); ajaxCommentForm(); $(".header_rg").html("刷新后登录"); $.Close(); }); }); </script> <div class="pjax_loading"></div> <div class="pjax_loading1"></div> </body> </html>