添加登录编辑:当前模板文件module.php添加一下代码
<?php //blog:编辑 function editflg($logid,$author){ $editflg = ROLE == ROLE_ADMIN || $author == UID ? '<a href="'.BLOG_URL.'admin/write_log.php?action=edit&gid='.$logid.'" target="_blank">编辑</a>' : ''; echo $editflg; } ?>在echo_log.php里面添加调用代码
<?php editflg($logid,$author); ?>emlog常用归档页面代码
<style type="text/css"> .archives ul{overflow:hidden;padding:0px !important;} .archives-title{border-bottom:1px #eee solid;position:relative;padding-bottom:4px;margin-bottom:10px} .archives li a{color:#222222;padding:8px 0;display:block;} .archives li{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;list-style:none !important} .archives li a:hover .atitle:after{background:#cc0000} .archives li a span{display:inline-block;width:130px;font-size:12px;text-indent:20px} .archives li a .atitle{display:inline-block;padding:0 15px;position:relative;white-space:nowrap;width:calc(100% - 180px);} .archives li a .atitle:after{position:absolute;left:-6px;background:#ccc;height:8px;width:8px;border-radius:6px;top:8px;content:""} .archives li a .atitle:before{position:absolute;left:-8px;background:#fff;height:12px;width:12px;border-radius:6px;top:6px;content:"";box-shadow:inset 0px 0px 2px #00cc00;} .archives{position:relative;padding:10px 0} .archives:before{height:100%;width:4px;background:#eee;position:absolute;left:126px;content:"";top:0;} .archives h4{position:relative;margin:20px 0;cursor:pointer;font-size:14px !important;font-weight:bold !important;width:120px} .archives h4:hover:after{background:#cc0000} .archives h4:before{position:absolute;left:119px;background:#fff;height:18px;width:18px;border-radius:9px;top:3px;content:"";box-shadow:inset 0px 0px 4px #00cc00;} .archives h4:after{position:absolute;left:122px;background:#ccc;height:12px;width:12px;border-radius:6px;top:6px;content:""} </style> <script type="text/javascript"> $(function(){ $('.archives').find('ul').hide(); $('.archives').find('ul:first').show(); $('.archives h4').click(function(){ $(this).next('ul').slideToggle("fast"); }) }) </script> <div class="entry"> <?php function displayRecord(){ global $CACHE; $record_cache = $CACHE->readCache('record'); $output = ''; foreach($record_cache as $value){ $output .= '<h4>'.$value['record'].'</h4>'.displayRecordItem($value['date']); } $output = '<div class="archives">'.$output.'</div>'; return $output; } function displayRecordItem($record){ if (preg_match("/^([\d]{4})([\d]{2})$/", $record, $match)) { $days = getMonthDayNum($match[2], $match[1]); $record_stime = emStrtotime($record . '01'); $record_etime = $record_stime + 3600 * 24 * $days; } else { $record_stime = emStrtotime($record); $record_etime = $record_stime + 3600 * 24; } $sql = "and date>=$record_stime and date<$record_etime order by top desc ,date desc"; $result = archiver_db($sql); return $result; } function archiver_db($condition = ''){ $DB = Database::getInstance(); $sql = "SELECT gid, title, date, views FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' $condition"; $result = $DB->query($sql); $output = ''; while ($row = $DB->fetch_array($result)) { $log_url = Url::log($row['gid']); if($row['views']>1000){$output .= '<li class="goodwork"><a title="热门文章" href="'.$log_url.'"><span>'.date('m月d日',$row['date']).'</span><div class="atitle">'.$row['title'].'</div></a></li>';} else{$output .= '<li><a href="'.$log_url.'"><span>'.date('m月d日',$row['date']).'</span><div class="atitle">'.$row['title'].'</div></a></li>';} } $output = empty($output) ? '<li>暂无文章</li>' : $output; $output = '<ul>'.$output.'</ul>'; return $output; } echo displayRecord(); ?> </div>
如图:
页面跳转代码新建一个go.php文件粘贴以下代码即可
<?php if(strlen($_SERVER['REQUEST_URI']) > 384 || strpos($_SERVER['REQUEST_URI'], "eval(") || strpos($_SERVER['REQUEST_URI'], "base64")) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过QUERY_STRING取得完整的传入数据,然后取得url=之后的所有值,兼容性更好 $t_url = htmlspecialchars(preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"])); //数据处理 if(!empty($t_url)) { //判断取值是否加密 if ($t_url == base64_encode(base64_decode($t_url))) { $t_url = base64_decode($t_url); } //对取值进行网址校验和判断 preg_match('/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i',$t_url,$matches); if($matches){ $url=$t_url; $title='链接加载中,请稍候查看'; } else { preg_match('/\./i',$t_url,$matche); if($matche){ $url='http://'.$t_url; $title='链接加载中,请稍候查看'; } else { $url = 'http://'.$_SERVER['HTTP_HOST']; $title='参数错误,正在返回首页'; } } } else { $title = '参数缺失,正在返回首页'; $url = 'http://'.$_SERVER['HTTP_HOST']; } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width"> <meta name="robots" content="noindex, nofollow" /> <noscript><meta http-equiv="refresh" content="1;url='<?php echo $url;?>';"></noscript> <meta charset="UTF-8"> <!--[if IE 8]> <style> .ie8 .alert-circle,.ie8 .alert-footer{display:none}.ie8 .alert-box{padding-top:75px}.ie8 .alert-sec-text{top:45px} </style> <![endif]--> <title><?php echo $title;?></title> <style> body,html{height:100%;}html{font-size:10px;-webkit-tap-highlight-color:transparent;}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;}*,:after,:before{box-sizing:border-box;}body{background-color:#f3f3f3;}a,body{color:#333;text-decoration:none;}body{padding-top:56px!important;min-width:768px;font-size:17px;font-family:-apple-system,SF UI Text,Arial,PingFang SC,Hiragino Sans GB,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif;}body{margin:0;}#content{position:relative;margin:0 auto;padding:0 15px 15px;width:1200px;max-width:100%;}.wrap{position:absolute;top:88px;left:50%;padding:40px 0;width:620px;border-radius:6px;background-color:#fff;box-shadow:.5rem .875rem 2.375rem rgba(39,44,49,.06),.0625rem .1875rem .5rem rgba(39,44,49,.03);text-align:center;transform:translateX(-50%);}.title{color:#2f2f2f;text-shadow:.0625rem .0625rem .0625rem rgba(0,0,0,.2);font-size:22px;}.tips{margin-top:8px;color:#888;font-size:16px;}.content{display:flex;margin:12px auto 0;padding:10px;width:460px;border:1px solid #ddd;border-radius:4px;zoom:1;-webkit-box-align:center;align-items:center;}.content .symbol{width:40px;height:40px;border-radius:2px;background:#bcc6d8;text-align:center;font-size:20px;line-height:40px;flex-shrink:0;}.content .symbol i{color:#f3f3f3;margin-top: 10px;display: inline-block;}.content .link{overflow:hidden;margin-left:10px;color:#3194d0;text-overflow:ellipsis;white-space:nowrap;font-size:14px;}.contact{margin-top:24px;text-align:center;font-size:0;}.Jump{display:inline-block;margin:5px;width:100px;height:45px;border:1px solid #03a9f4;border-radius:22px;background-color:#03a9f4;color:#fff;font-size:16px;line-height:43px;cursor:pointer;}#close{display:inline-block;margin:5px;width:100px;height:45px;border:1px solid #10ce67;border-radius:22px;background-color:#10ce67;color:#fff;font-size:16px;line-height:43px;cursor:pointer;} </style> </head> <body class="ie8" style=""> <div id="content"> <div class="wrap"> <div class="title">即将跳转到外部网站</div> <div class="tips">安全性未知,是否继续</div> <div class="content"> <div class="symbol"> <img src="/1.png"> </div> <div title="<?php echo $url;?>" class="link"><?php echo $url;?></div> </div> <div class="contact"> <a class="Jump" href="<?php echo $url;?>">继续前往</a> <a id="close" onclick="closePage()">关闭页面</a> </div> </div> </div> <script> function closePage() { /* 设个定时器,如果页面未关闭,则跳转至首页 */ setTimeout(function() { window.location.href = '/'; }, 5000); /* 通用窗口关闭 */ window.opener=null; window.open('','_self'); window.close(); /* 微信浏览器关闭 */ WeixinJSBridge.call('closeWindow'); } </script> </body> </html>如图:
版权声明:本文为(演员)原创文章,转载时请注明出处!