來自于typecho主題joe的留言板樣式,joe主題有很多地方可以學習,由于習慣了emlog的主題使用,又不太直接換typecho?動手就借鑒到emlog的主題留言板里。

實現(xiàn)步驟
以下需要通過修改主題文件來實現(xiàn),操作前有需要的自行備份,不多介紹別的了,直接goto。
所需要的附件都打包在附件下載了
將以下代碼,新建文件,上傳到自己的主題文件夾/page里,以下只是給出一個例子,具體還需根據(jù)所在主題樣式的更改page_guestbook.php
<?php /* Custom:page_gusetbook Description:留言板 */ if(!defined('EMLOG_ROOT')) {exit('error!');} ?> <div class="container container-page"> <?php include View::getView('page/page_side');?> <div class="content"> <header class="article-header"> <h1 class="article-title"><?php echo $log_title; ?></h1> <style> .guestbook_detail__leaving{padding-top:15px;}.guestbook_detail__leaving-none{padding:15px 0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;color:#fff;}.guestbook_detail__leaving-list{position:relative;height:320px}.guestbook_detail__leaving-list .item{display:none;position:absolute;width:200px;overflow:hidden;box-shadow:0 2px 10px 1px rgba(0,0,0,0.2);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:0.88;height:210px;}.guestbook_detail__leaving-list .item .user{display:flex;align-items:center;padding:0 10px;color:#fff;border-bottom:1px dashed rgba(255,255,255,0.85);height:40px;cursor:move}.guestbook_detail__leaving-list .item .user .avatar{width:20px;height:20px;border-radius:50%}.guestbook_detail__leaving-list .item .user .nickname{min-width:0;flex:1;margin:0 5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.guestbook_detail__leaving-list .item .user .nickname a{color:#fff}.guestbook_detail__leaving-list .item .user .date{margin-left:auto}.guestbook_detail__leaving-list .item .wrapper{padding:10px}.guestbook_detail__leaving-list .item .wrapper .content{height:140px;overflow-y:auto;word-break:break-word;line-height:24px;}.guestbook_detail__leaving-list .item .wrapper .guestbook_content .draw_image{max-width:100%}.guestbook_detail__leaving-list .item .wrapper .guestbook-content .owo_image{max-height:24px} </style> </header> <script src="域名/book.js"></script> <div class="guestbook_container"> <div class="guestbook_main"> <div class="guestbook_detail"> </div> </div> <?php guestbook($comments); ?> <!-- 評論開始 --> <?php if($allow_remark == 'y'): ?> <?php blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark); ?> <div id="postcomments" class=" <?php echo $Tconfig["wow"];?>"> <ol class="commentlist"> <?php blog_comments($comments); ?> </ol> </div> <?php endif;?> <!-- 評論結束 --> </div> </div> <?php include View::getView('footer');?>
guestbook.js,上傳到主題所引用的js文件夾里,也可以用上述代碼自帶的外部js,需要給所在主題的添加代碼module.php。
進入emlog后臺,來到頁面,鏈接別名:頁面模板:按照下圖來設置,并且需要開啟允許評論guestbookpage/page_guestbook最后可以進入頁面看看效果了。

? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
相關文章

暫無評論...