首页
留言反馈
网站导航
推荐
毒鸡汤
Search
1
非插件为typecho 文章生成微海报分享
18,821 阅读
2
主题移动端,样式下添加二级分类
15,378 阅读
3
主题 添加author page
14,693 阅读
4
主题添加移动端下边栏
12,711 阅读
5
EMlog添加评论者邮箱等级
9,059 阅读
typecho
dynamic
SuiYu
Emlog
xiuno
登录
/
注册
Search
标签搜索
代码
xiuno
php
css
typecho
评论
模板
say
js
修改教程
标签
珍惜
努力
recommend
善良
样式
调用
微笑
颜色
插件
Vincent
累计撰写
151
篇文章
累计收到
184
条评论
首页
栏目
typecho
dynamic
SuiYu
Emlog
xiuno
页面
留言反馈
网站导航
推荐
毒鸡汤
搜索到
18
篇与
的结果
2021-01-26
emlog底部导航+样式代码
底部html下方的代码扔到正在使用的模板footer.php 位置自己看着来<nav class="m-menubar"> <ul> <li id="menu-item" class="menu-item"><a href="<?php echo BLOG_URL; ?>"><i class="fa fa-home"></i> 首页</a></li> <li id="menu-item" class="menu-item menu-item-has-children"><a><i class="fa fa-paper-plane-o"></i> 文章分类</a> <ul class="sub-menu"> <?php blog_navid();?> </ul> </li> <li class="menu-item menu-item-has-children"> <a href="/" ><i class="fa fa-shopping-bag"></i>在线商城</a> </li> <li class="menu-item menu-item-has-children"> <a><i class="fa fa-weixin"></i>站长微信</a> <div class="sub-menu"> <div class="menuwhact"><img src="<?php echo $Tconfig["weixinimg"];?>"></div> <div class="tanc_ico"> <p class="lianxi_p"><span class="fa fa-weixin"></span><?php echo $Tconfig["weixinname"];?></p> </div> </div> </li> <li class="menu-item menu-item-has-children" > <a><i class="fa fa-userfa fa-user"></i>用户中心</a> <div class="sub-menu"> <div class="m_menubar"> <h4>这里的东西自己想象!</h4> <a href="javascript:;">这里的东西自己想象</a> </div> </div> </li> </ul> </nav>底部php下面代码扔到正在使用模板的module.php<?php //blog:底部导航 function blog_navid(){ global $CACHE; global $Tconfig; $navi_cache = $CACHE->readCache('navi'); foreach($navi_cache as $value): $id=$value["id"]; if ($value['pid'] != 0) { continue; } $newtab = $value['newtab'] == 'y' ? 'target="_blank"' : ''; $value['url'] = $value['isdefault'] == 'y' ? BLOG_URL . $value['url'] : trim($value['url'], '/'); //$current_tab = BLOG_URL . trim(Dispatcher::setPath(), '/') == $value['url'] ? 'active' : ''; ?> <li id="menu-item" class=">menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item" > <a href="<?php echo $value['url']; ?>" <?php echo $newtab;?>> <?php if(empty($Tconfig['arr_navico'][$id])) {echo $value['naviname'];}else {echo "<i class='".$Tconfig['arr_navico'][$id]."'></i> ".$value['naviname']."";} ?> <?php if (!empty($value['children']) || !empty($value['childnavi'])) :?> <?php endif;?> </a> </li> <?php endforeach; ?> <?php if($Tconfig['more']== 1 ){?> <?php echo $Tconfig['more_html'];?> <?php }?> <?php }?>底部jsjs扔到你的全局js文件里面// 手机端登入 $(".m-menubar li.menu-item-has-children").on("click", function() { $(this).toggleClass("active").siblings().removeClass("active") }); $('.m-user').on('click', function(){ jsui.bd.addClass('m-wel-on') $('.m-mask').show() }) $('.m-mask').on('click', function(){ $(this).hide() jsui.bd.removeClass('m-wel-on') }) $('.m-wel-content ul a').on('click', function(){ $('.m-mask').hide() jsui.bd.removeClass('m-wel-on') }) $('.m-icon-nav').on('click', function(){ jsui.bd.addClass('m-nav-show') $('.m-mask').show() jsui.bd.removeClass('search-on') $('.search-show .fa').removeClass('fa-remove') }) $('.m-mask').on('click', function(){ $(this).hide() jsui.bd.removeClass('m-nav-show') })底部csscss代码扔到你的全局css文件里面其实下面的css有多大部分是多余的代码 但是懒得删了 凑合用把/*手机端登入*/ .minicat-btn{text-align:center;padding:15px 0;background:#f6f6f6} .m-menubar{display:none;z-index:9990;position:fixed;bottom:0;left:0;right:0;height:55px;background-color:#fff;box-shadow:0 0 10px rgba(37,45,51,.1)} .m-menubar:before{content:'1';color:transparent;position:absolute;left:0;top:0;width:100%;height:1px;background-color:rgba(0,0,0,.1);display:block;overflow:hidden;-webkit-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)} .m-menubar ul{display:flex;text-align:center;padding:0} .m-menubar .active .sub-menu{visibility:inherit;opacity:1} .m-menubar .sub-menu{position:fixed;top:auto;bottom:55px;left:0;right:0;margin:0;width:100%;background-color:#fff;color:#555;padding:15px;font-size:14px;font-weight:700;height:auto;box-shadow:0 -15px 15px rgba(0,0,0,.2);display:block;visibility:hidden;opacity:0;-webkit-transition:all .25s ease-in;-moz-transition:all .25s ease-in;transition:all .25s ease-in} .m-menubar .sub-menu .menu-item{margin:1%;font-size:12px;padding:5px 15px;background-color:#f6f6f6;color:#888;font-weight:100;width:31.333%;float:left} .m-menubar .menu-item{flex:1;text-align:center;font-size:12px} .m-menubar .menu-item i.fa{display:block;font-size:22px;margin-bottom:3px;margin-top:8px;font-weight:400} .menubar_header,.menubar_usermenu{padding-bottom:10px;text-align:initial;display:-webkit-flex;padding:0;width:100%;flex-wrap:wrap;margin:10px 0} .menubar_usermenu li{display:block;width:23%;font-weight:100;margin:1%;background:#f6f6f6;padding-bottom:8px;font-size:12px} .menubar_top{text-align:left;padding:0 0 0 60px;display:block;width:60%} .menubar_right{text-align:right;display:block;width:40%;font-size:1px;font-weight:100} .mendown{font-size:12px} .menubar_down{display:inline-block;background:#ddebff;margin-left:4px;padding:0 4px;border-radius:5px;color:#5c84bf;margin-bottom:8px} .menubar_right .btn{display:inline-block;margin-bottom:8px} .menubar_top .avatar{-webkit-border-radius:50%;border-radius:50%;width:60px;border:2px solid #f6f9fa;padding:5px;float:left;margin-left:-65px;height:60px} .menubar_top h4{padding-top:13px;margin:0 0 8px;font-size:15px;line-height:1;font-weight:700} .menubar_top h5{margin:0;font-size:13px;line-height:1;color:#999} .menuwhact{padding:10px} .menuwhact img{width:50%} .m-nav-show .m-navbar{left:0} .article-meta .item-bianlan{display:none} .m-navbar ul{padding:0} .m-navbar li{margin-left:0;position:relative;width:100%;float:left} .current-menu-item a{color:#4ba7fd!important} .m-navbar .sub-menu{position:relative;padding:0 15px} .m-navbar .sub-menu li{float:left;width:46%;margin-right:4%;margin-bottom:10px;text-align:center} .m-navbar .fa{width:18px;display:inline-block;text-align:center} .m-navbar li a{display:block;font-size:14px;font-weight:700;color:#4e585a;border-bottom:1px solid rgba(255,255,255,.04);padding:8px 15px} .m-navbar li a:hover,.m-navbar li:hover>a{color:#45b6f7} .m-navbar .sub-menu li a{font-size:12px;padding:8px 15px;background-color:#f6f9fa;color:#888;font-weight:inherit} .m-navbar .sub-menu li a:hover{background-color:#eee} .m-navbar li.menu-item-has-children .faa{content:'';position:absolute;right:15px;top:0;font-size:15px;margin:0;padding:6px 15px;z-index:2;cursor:pointer;display:block;width:auto;color:#585858} @media(max-width:720px){.asb-post-footer{margin-bottom:20px} .m-mask{background-color:rgba(0,0,0,.5)} .m-wel-start{display:block;position:absolute;top:0;right:0;height:48px;padding:23px 20px 0;font-size:14px;line-height:1;-webkit-transition-duration:.6s;transition-duration:.6s;z-index:91;color:#fff;cursor:pointer} .m-navbar-on{position:fixed;top:0;left:0;right:0;bottom:0;overflow:hidden;-webkit-transform:translateX(80%);transform:translateX(80%)} .m-navbar-on .m-mask{opacity:1;visibility:visible} .m-navbar-on .m-navbar-start{left:-80%;color:#4e585a} .m-wel{display:block;position:fixed;top:0;left:100%;bottom:0;width:70%;padding:50px 0 0;z-index:90;font-size:12px;background-color:#fff} .m-wel header{text-align:left;padding:0 30px 0 120px} .m-wel header .avatar{-webkit-border-radius:50%;border-radius:50%;width:50px;border:1px solid #f6f9fa;padding:5px;float:left;margin-left:-65px} .m-wel header h4{padding-top:10px;margin:0 0 8px;font-size:12px;line-height:1;font-weight:700} .m-wel header h5{margin:0;font-size:12px;line-height:1;color:#999} .m-wel footer{text-align:center;position:absolute;bottom:0;right:0;left:0} .m-wel footer a{display:block;line-height:60px;color:#555;background-color:#fbfbfb} .m-wel footer a:hover{background-color:#eceeef;color:#4e585a} .m-wel .m-wel-content{overflow-y:auto;-webkit-overflow-scrolling:touch;position:absolute;top:130px;left:0;bottom:60px;right:0;font-size:14px;text-align:left;padding:0} .m-wel .m-wel-content ul{margin:0;padding:0;list-style:0} .m-wel .m-wel-content ul a{padding:10px 0 10px 65px;line-height:1.4;display:block;color:#999;-webkit-border-radius:2px;border-radius:2px} .m-wel .m-wel-content ul a:hover{background-color:#f6f9fa;color:#4e585a} .m-wel .m-wel-login{text-align:center;margin-top:30%} .m-wel .m-wel-login .avatar{display:block;margin:0 auto 30px;width:50px;-webkit-border-radius:50%;border-radius:50%} .m-wel .m-wel-login a{display:block;margin:0 60px 15px;padding:12px 15px;-webkit-border-radius:2px;border-radius:2px} .m-wel .m-wel-login a.m-wel-login{color:#fff;background-color:#0ae} .m-wel .m-wel-login a.m-wel-login:hover{background-color:#0098d5} .m-wel .m-wel-login a.m-wel-register{background-color:#f6f9fa} .m-wel .m-wel-login a.m-wel-register:hover{background-color:#eceeef} .m-wel-on{position:fixed;top:0;left:0;right:0;bottom:0;overflow:hidden;-webkit-transform:translateX(-80%);transform:translateX(-80%);-webkit-transform:translateX(-70%);transform:translateX(-70%)} .m-menubar{display:block} }
2021年01月26日
1,578 阅读
0 评论
10 点赞
2021-01-26
给emlog主题添加统计栏目代码及教程
给emlog主题添加统计栏目代码及教程最近很多大佬都在问,那个统计代码怎么放,我怎么放了没有用呀,听到这些,我也不想说了,下面直接给你们丢代码,喜欢花里胡哨的站长你们要的东西它来了。……首页调用代码,这里我用的是fee主题,那么直接丢到log_list.php文件里头,当然也有人会问具体丢哪里,因为有很多那种刚玩网站的”大佬”不知道加哪里,然而加了把网站也打不开的那种,只要记住代码丢<?php }?>后面基本会没错,具体放入位置,个人喜欢吧<!--统计栏目--> <div class="tpt-wp cl"> <ul> <li class="tpt-md-4"><div class="tpt-cm"> <i class="layui-icon fa fa-folder-open-o" style="font-size: 20px; color: #e4ad85;vertical-align: middle; margin: 0px 3px;"></i>文章资源 <font color="#03f"><?php echo $sta_cache['lognum']; ?></font> 篇</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="layui-icon fa fa-commenting-o" style="font-size: 20px; color: #27c24c;vertical-align: middle; margin: 0px 3px;"></i>评论回复 <font color="#03f"><?php echo $sta_cache['comnum_all']; ?></font> 次</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="layui-icon fa fa-user-o" style="font-size: 20px; color: #23b7e5;vertical-align: middle; margin: 0px 3px;"></i>网站用户 <font color="#03f"><?php echo count_user_all();?> </font>位</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="layui-icon fa fa-history" style="font-size: 20px; color: #7266ba;vertical-align: middle; margin: 0px 3px;"></i>最后更新 <font color="#ff0000"><?php echo last_post_log();?></font></a ></div> </li> </ul> </div>module.php文件添加以下代码,前台调用,具体你想调用哪些还是个人喜欢。<?php //统计文章总数 function count_log_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE type = 'blog'"); return $data['total']; } //置顶文章数 function count_log_top(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE top = 'y' or sortop = 'y' AND type = 'blog'"); return $data['total']; } //隐藏文章数 function count_log_hide(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE hide = 'y' AND type = 'blog'"); return $data['total']; } //未审核文章数 function count_log_check(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE checked = 'n' AND type = 'blog'"); return $data['total']; } //加密文章数 function count_log_pass(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE password !='' AND type = 'blog'"); return $data['total']; } //统计页面总数 function count_page_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "blog WHERE type = 'page'"); return $data['total']; } //统计评论总数 function count_com_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "comment"); return $data['total']; } //统计友链总数 function count_link_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "link"); return $data['total']; } //统计微语评论总数 function count_treply_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "reply"); return $data['total']; } //统计分类总数 function count_sort_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "sort"); return $data['total']; } //统计子分类数 function count_sort_mod(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "sort WHERE pid != 0"); return $data['total']; } //统计标签总数 function count_tag_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "tag"); return $data['total']; } //统计微语总数 function count_tw_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "twitter"); return $data['total']; } //统计用户总数 function count_user_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "user"); return $data['total']; } //统计管理员总数 function count_user_admin(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "user WHERE role = 'admin'"); return $data['total']; } //统计作者总数 function count_user_writer(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "user WHERE role = 'writer'"); return $data['total']; } //统计附件总数 function count_att_all(){ $db = MySql::getInstance(); $data = $db->once_fetch_array("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "attachment"); return $data['total']; } //最后发表文章时间 function last_post_log(){ $db = MySql::getInstance(); $sql = "SELECT * FROM " . DB_PREFIX . "blog WHERE type='blog' ORDER BY date DESC LIMIT 0,1"; $res = $db->query($sql); $row = $db->fetch_array($res); $date = date('Y-n-j H:i',$row['date']); return $date; }; ?>CSS部分/*统计栏目*/ .new-content {margin-top: 5px;} .tpt-wp{margin:0 auto;width:100%}.tpt-cm{color: #333;text-align: center;background: #FFF;height: 60px;line-height: 60px; border: 1px solid #eaeaea;}.tpt-md-4{float:left}.tpt-md-3{float:left}.tpt-md-2{float:left}.tpt-md-1{width:100%} @media only screen and (max-width:767px){.tpt-md-4{width:50%}.tpt-md-3{width:100%}.tpt-md-2{width:100%}.tpt-ml-3{display:none}.tpt-mr-3{display:none}.tpt-ml-7{width:100%}.tpt-mr-7{width:100%}} @media only screen and (min-width:768px) and (max-width:1023px){.tpt-md-4{width:50%}.tpt-md-3{width:50%}.tpt-md-2{width:50%}.tpt-ml-3{display:none}.tpt-mr-3{display:none}.tpt-ml-7{width:100%}.tpt-mr-7{width:100%}} @media only screen and (min-width:1024px) and (max-width:1199px){.tpt-md-4{width:33.33333333%}.tpt-md-3{width:33.33333333%}.tpt-md-2{width:50%}.tpt-ml-3{float:left;width:30%}.tpt-mr-3{float:right;width:30%}.tpt-ml-7{float:left;width:70%}.tpt-mr-7{float:right;width:70%}} @media only screen and (min-width:1200px){.tpt-md-4{width:25%}.tpt-md-3{width:33.33333333%}.tpt-md-2{width:50%}.tpt-ml-3{float:left;width:30%}.tpt-mr-3{float:right;width:30%}.tpt-ml-7{float:left;width:70%}.tpt-mr-7{float:right;width:70%}.tpt-wp{width:100%;margin:0 auto;}}
2021年01月26日
4,373 阅读
0 评论
9 点赞
2021-01-26
Emlog开启https后侧边栏日历无法正常显示
开启https后侧边栏日历无法正常显示它会一直显示加载中...我们只需要登录FTP找到/include/lib/function.base.php搜索以下代码: return 'http://' . $_SERVER['HTTP_HOST'] . $matches[0];更换为 return '//' . $_SERVER['HTTP_HOST'] . $matches[0];
2021年01月26日
1,811 阅读
0 评论
4 点赞
2021-01-25
Emlog非插件实现3D标签云
1.module找到你的侧边栏标签 修改侧边栏标签如下 <?php //3D标签云 function widget_tag($title){ global $CACHE; $tag_cache = $CACHE->readCache('tags');?> <div class="side"> <h3><i class="fa fa-tags mar-r-4"></i><?php echo $title;?></h3> <div id="tag_cloud_widget"> <div class="tagcloud"> <script type="text/javascript" src="<?php echo TEMPLATE_URL; ?>js/3dtag.js"></script> <?php foreach($tag_cache as $value): ?> <a href="<?php echo Url::tag($value['tagurl']); ?>" title="<?php echo $value['usenum']; ?> 篇文章"><?php echo $value['tagname']; ?></a> <?php endforeach; ?> <div class="clear"></div></div></div></div> <?php }?>2.你的公用模板css放如下css /*3D标签云*/ #tag_cloud_widget{position:relative;width:240px;height:240px;margin:10px auto 10px} #tag_cloud_widget a{position:absolute;color:#fff;text-align:center;text-overflow:ellipsis;white-space:nowrap;top:0;left:0;padding:3px 5px;border:0} #tag_cloud_widget a:hover{background:#d02f53;display:block} #tag_cloud_widget a:nth-child(n){background:#666;border-radius:3px;display:inline-block;line-height:18px;margin:0 10px 15px 0} #tag_cloud_widget a:nth-child(2n){background:#d1a601} #tag_cloud_widget a:nth-child(3n){background:#286c4a} #tag_cloud_widget a:nth-child(5n){background:#518ab2} #tag_cloud_widget a:nth-child(4n){background:#c91d13}3.保存下面js为3dtag.js 放到你的模板js目录里面 var radius = 100; var d = 200; var dtr = Math.PI / 180; var mcList = []; var lasta = 1; var lastb = 1; var distr = true; var tspeed = 11; var size = 200; var mouseX = 0; var mouseY = 10; var howElliptical = 1; var aA = null; var oDiv = null; window.onload = function() { var i = 0; var oTag = null; oDiv = document.getElementById('tag_cloud_widget'); aA = oDiv.getElementsByTagName('a'); for (i = 0; i < aA.length; i++) { oTag = {}; aA[i].onmouseover = (function(obj) { return function() { obj.on = true; this.style.zIndex = 9999; this.style.color = '#fff'; this.style.background = '#0099ff'; this.style.padding = '5px 5px'; this.style.filter = "alpha(opacity=100)"; this.style.opacity = 1 } })(oTag) aA[i].onmouseout = (function(obj) { return function() { obj.on = false; this.style.zIndex = obj.zIndex; this.style.color = '#fff'; this.style.background = '#30899B'; this.style.padding = '5px'; this.style.filter = "alpha(opacity=" + 100 * obj.alpha + ")"; this.style.opacity = obj.alpha; this.style.zIndex = obj.zIndex } })(oTag) oTag.offsetWidth = aA[i].offsetWidth; oTag.offsetHeight = aA[i].offsetHeight; mcList.push(oTag) } sineCosine(0, 0, 0); positionAll(); (function() { update(); setTimeout(arguments.callee, 40) })() }; function update() { var a, b, c = 0; a = (Math.min(Math.max( - mouseY, -size), size) / radius) * tspeed; b = ( - Math.min(Math.max( - mouseX, -size), size) / radius) * tspeed; lasta = a; lastb = b; if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) { return } sineCosine(a, b, c); for (var i = 0; i < mcList.length; i++) { if (mcList[i].on) { continue } var rx1 = mcList[i].cx; var ry1 = mcList[i].cy * ca + mcList[i].cz * ( - sa); var rz1 = mcList[i].cy * sa + mcList[i].cz * ca; var rx2 = rx1 * cb + rz1 * sb; var ry2 = ry1; var rz2 = rx1 * ( - sb) + rz1 * cb; var rx3 = rx2 * cc + ry2 * ( - sc); var ry3 = rx2 * sc + ry2 * cc; var rz3 = rz2; mcList[i].cx = rx3; mcList[i].cy = ry3; mcList[i].cz = rz3; per = d / (d + rz3); mcList[i].x = (howElliptical * rx3 * per) - (howElliptical * 2); mcList[i].y = ry3 * per; mcList[i].scale = per; var alpha = per; alpha = (alpha - 0.6) * (10 / 6); mcList[i].alpha = alpha * alpha * alpha - 0.2; mcList[i].zIndex = Math.ceil(100 - Math.floor(mcList[i].cz)) } doPosition() } function depthSort() { var i = 0; var aTmp = []; for (i = 0; i < aA.length; i++) { aTmp.push(aA[i]) } aTmp.sort(function(vItem1, vItem2) { if (vItem1.cz > vItem2.cz) { return - 1 } else if (vItem1.cz < vItem2.cz) { return 1 } else { return 0 } }); for (i = 0; i < aTmp.length; i++) { aTmp[i].style.zIndex = i } } function positionAll() { var phi = 0; var theta = 0; var max = mcList.length; for (var i = 0; i < max; i++) { if (distr) { phi = Math.acos( - 1 + (2 * (i + 1) - 1) / max); theta = Math.sqrt(max * Math.PI) * phi } else { phi = Math.random() * (Math.PI); theta = Math.random() * (2 * Math.PI) } mcList[i].cx = radius * Math.cos(theta) * Math.sin(phi); mcList[i].cy = radius * Math.sin(theta) * Math.sin(phi); mcList[i].cz = radius * Math.cos(phi); aA[i].style.left = mcList[i].cx + oDiv.offsetWidth / 2 - mcList[i].offsetWidth / 2 + 'px'; aA[i].style.top = mcList[i].cy + oDiv.offsetHeight / 2 - mcList[i].offsetHeight / 2 + 'px' } } function doPosition() { var l = oDiv.offsetWidth / 2; var t = oDiv.offsetHeight / 2; for (var i = 0; i < mcList.length; i++) { if (mcList[i].on) { continue } var aAs = aA[i].style; if (mcList[i].alpha > 0.1) { if (aAs.display != '') aAs.display = '' } else { if (aAs.display != 'none') aAs.display = 'none'; continue } aAs.left = mcList[i].cx + l - mcList[i].offsetWidth / 2 + 'px'; aAs.top = mcList[i].cy + t - mcList[i].offsetHeight / 2 + 'px'; aAs.filter = "alpha(opacity=" + 100 * mcList[i].alpha + ")"; aAs.zIndex = mcList[i].zIndex; aAs.opacity = mcList[i].alpha } } function sineCosine(a, b, c) { sa = Math.sin(a * dtr); ca = Math.cos(a * dtr); sb = Math.sin(b * dtr); cb = Math.cos(b * dtr); sc = Math.sin(c * dtr); cc = Math.cos(c * dtr) }
2021年01月25日
1,708 阅读
0 评论
5 点赞
2021-01-25
EMlog自定义修改浏览量
教程简介这个教程我说下 为什么叫自定义浏览量? 而不像网上大部分的插件 随机等等的 这个教程 我简单说下 默认都是每刷新一次 会直接加一次浏览量的 如果 我们把这个1修改成5的话 那么每刷新一次会直接加5次浏览量的 以此类推 至于修改多少看你们自己的哦教程步伐第一步打开include/model/log_model.php 1可以修改任意打开之后308找到如下代码 1代表每一次浏览一次加一次浏览如果想修改每一次刷新加五次浏览的话吧这个1修改成5即可
2021年01月25日
1,547 阅读
0 评论
5 点赞
2021-01-25
EMlog私密评论仅博客可见
简介这里我说下这个私密评论教程 你评论的私密内容 只能你自己和管理员看见 别人是看不见的 内容 会 显示“私密评论仅博客可见” 教程很详细 希望你能学习到!文章转载蓝优博客module.php增加以下 <?php //私密评论 function comcontent($pl) { $patterns = array ("/@/","/\[blockquote\](.*?)\[\/blockquote\]/","/\[F(([1-4]?[0-9])|50)\]/"); $replace = array ('回复了','<blockquote>$1</blockquote>','<img alt="表情" src="'.TEMPLATE_URL.'img/face/$1.png" />'); $pl=preg_replace($patterns, $replace, $pl); return $pl; } // 判断是否为私密评论 function isPrivateComment($comments){ return(strstr($comments,"[私密评论]")); } // 显示私密评论 function showPrivateComment($comments,$post_email,$current_email){ // 如果是私密评论 是管理员身份或者发布私密者本身才会显示 if(isPrivateComment($comments)){ if($post_email==$current_email or ROLE == ROLE_ADMIN){ return $comments; }else{ return "<font color='red'>##私密评论仅博主可见##</font>"; } }else{ return $comments; } } ?>这段JS放在模板公用JS function addNumber(a) { document.getElementById("comment").value += a }在module.php搜索以下 <?php echo $comment['content']; ?>把下面的代码替换如上 <?php echo showPrivateComment(comcontent($comment['content']),$comment['mail'],$_COOKIE["postermail"]); ?>私密评论按钮 <a href="javascript:addNumber('[私密评论]')"><i class="fa fa-lock"></i></a>
2021年01月25日
1,074 阅读
0 评论
2 点赞
2021-01-25
EMlog鼠标点击爱心特效
代码 <script> !function(e, t, a) { function r() { for (var e = 0; e < s.length; e++) s[e].alpha <= 0 ? (t.body.removeChild(s[e].el), s.splice(e, 1)) : (s[e].y--, s[e].scale += .004, s[e].alpha -= .013, s[e].el.style.cssText = "left:" + s[e].x + "px;top:" + s[e].y + "px;opacity:" + s[e].alpha + ";transform:scale(" + s[e].scale + "," + s[e].scale + ") rotate(45deg);background:" + s[e].color + ";z-index:99999"); requestAnimationFrame(r) } function n() { var t = "function" == typeof e.onclick && e.onclick; e.onclick = function(e) { t && t(), o(e) } } function o(e) { var a = t.createElement("div"); a.className = "heart", s.push({ el: a, x: e.clientX - 5, y: e.clientY - 5, scale: 1, alpha: 1, color: c() }), t.body.appendChild(a) } function i(e) { var a = t.createElement("style"); a.type = "text/css"; try { a.appendChild(t.createTextNode(e)) } catch(t) { a.styleSheet.cssText = e } t.getElementsByTagName("head")[0].appendChild(a) } function c() { return "rgb(" + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + "," + ~~ (255 * Math.random()) + ")" } var s = []; e.requestAnimationFrame = e.requestAnimationFrame || e.webkitRequestAnimationFrame || e.mozRequestAnimationFrame || e.oRequestAnimationFrame || e.msRequestAnimationFrame || function(e) { setTimeout(e, 1e3 / 60) }, i(".heart{width: 10px;height: 10px;position: fixed;background: #f00;transform: rotate(45deg);-webkit-transform: rotate(45deg);-moz-transform: rotate(45deg);}.heart:after,.heart:before{content: '';width: inherit;height: inherit;background: inherit;border-radius: 50%;-webkit-border-radius: 50%;-moz-border-radius: 50%;position: fixed;}.heart:after{top: -5px;}.heart:before{left: -5px;}"), n(), r() } (window, document); </script>
2021年01月25日
1,299 阅读
0 评论
6 点赞
2021-01-25
EMlog文章访问密码美化
教程简介原生态的文章加密访问页面是不是看腻了 也感觉很丑了啊 此页面由孟坤博客美化了文章加密页面替换教程01. 页面路径 include/model/log_model.php02. 将原生页面代码修改成美化页面代码哦03. 也就是修改405~431行代码哦原生代码 if ($pwd !== addslashes($logPwd)) { echo <<<EOT <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>emlog message</title> <style type="text/css"> <!-- body{background-color:#F7F7F7;font-family: Arial;font-size: 12px;line-height:150%;} .main{background-color:#FFFFFF;margin-top:20px;font-size: 12px;color: #666666;width:580px;margin:10px 200px;padding:10px;list-style:none;border:#DFDFDF 1px solid;} --> </style> </head> <body> <div class="main"> <form action="" method="post"> 请输入该文章的访问密码<br> <input type="password" name="logpwd" /><input type="submit" value="进入.." /> <br /><br /><a href="$url">«返回首页</a> </form> </div> </body> </html> EOT; if ($cookiePwd) { setcookie('em_logpwd_' . $logid, ' ', time() - 31536000); }修改如下 if ($pwd !== addslashes($logPwd)) { ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="renderer" content="webkit"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> <title>该文章已被加密</title> </head> <body> <div class="main"> <img class="alert" alt="文章已被加密" src="https://www.tx7.co/content/templates/FLY/img/mima.png"> <form action="" method="post" class="mk-side-form"> <h2 class="pw-tip">该文章已被加密</h2> <input type="password" name="logpwd" placeholder="请输入访问密码查看" required><button type="submit">提交</button> <?php if($postPwd): ?> <p id="pw-error">Oops!密码不对哦~</p> <script>setTimeout(function() {document.getElementById("pw-error").style.display = "none"}, 2000);</script> <?php endif; ?> </form> <a href="<?php echo $url; ?>" class="return-home" title="点击回到网站首页">- 返回首页 - </a> </div> <style type="text/css"> *{font-family:"Microsoft Yahei",微软雅黑,"Helvetica Neue",Helvetica,"Hiragino Sans GB","WenQuanYi Micro Hei",sans-serif;box-sizing:border-box;margin:0px;padding:0px;font-size:14px;-webkit-transition:.2s;-moz-transition:.2s;-ms-transition:.2s;-o-transition:.2s;transition:.2s} html,body{width:100%;height:100%} body{background-color:#F4F6F9;color:#768093} input,button{font-size:1em;border-radius:3px;-webkit-appearance:none} input{width:100%;padding:5px;box-sizing:border-box;border:1px solid #e5e9ef;background-color:#f4f5f7;resize:vertical} input:focus{background-color:#fff;outline:none} button{border:0;background:#6abd09;color:#fff;cursor:pointer;opacity:1;user-select:none} button:hover,button:focus{opacity:.9} button:active{opacity:1} .main{width:100%;max-width:500px;height:300px;padding:30px;background-color:#fff;border-radius:2px;box-shadow:0 10px 60px 0 rgba(29,29,31,0.09);transition:all .12s ease-out;position:absolute;left:0;top:0;bottom:0;right:0;margin:auto;text-align:center} .alert{width:80px} .mk-side-form{margin-bottom:28px} .mk-side-form input{float:left;padding:2px 10px;width:77%;height:37px;border:1px solid #ebebeb;border-right-color:transparent;border-radius:2px 0 0 2px;line-height:37px} .mk-side-form button{position:relative;overflow:visible;width:23%;height:37px;border-radius:0 2px 2px 0;text-transform:uppercase} .pw-tip{font-weight:normal;font-size:26px;text-align:center;margin:25px auto} #pw-error {color: red;margin-top: 15px;margin-bottom: -20px;} .return-home{text-decoration:none;color:#b1b1b1;font-size:16px} .return-home:hover{color:#1E9FFF;letter-spacing:5px} </style> </body> </html> <?php if ($cookiePwd) { setcookie('em_logpwd_' . $logid, ' ', time() - 31536000); }
2021年01月25日
1,303 阅读
0 评论
5 点赞
2021-01-25
EMlog增加复制提醒弹窗代码
教程说明给EMlog主题增加复制弹窗 试试复制试试哦~ 很简单教程 别看了 动手吧header.php文件前调用以下代码 <link rel="stylesheet" href="<?php echo TEMPLATE_URL; ?>css/sweetalert.css" type='text/css' /> <script src="<?php echo TEMPLATE_URL; ?>js/sweetalert.min.js"></script>header.php文件底部添加以下代码 <script>document.body.oncopy = function() {swal("复制成功!", "若要转载请务必保留原文链接,申明来源,谢谢合作!","success");};</script>
2021年01月25日
1,259 阅读
0 评论
3 点赞
1
2