通用读者墙单特效页代码(附EMLOG代码)

2017-12-17 6 PHP代码 蓝优

这个是扒某个网站然后略作修改的代码,其他不多说,进入教程模式!

通用版本

<div class="page-single">
<div class="likepage clearfix">
<div class="container">
<div class="like-post col-xs-6 col-sm-4 col-md-3">
<div class="like-post-box">
<a href="http://www.92mo.cn/" rel="external nofollow" target="_blank">
<div class="views"><span class="sealik">吐槽 | </span><span class="count num">1条</span></div>
<div class="title">
<img class="lazy thumbnail" style="float:left;" src="http://www.92mo.cn/favicon.ico">
<h2>蓝优网</h2>
</div>
</a>
</div>
</div>
</div> </div> </div>
EMLOG版本


 <div class="page-single"><div class="likepage clearfix"><div class="container">
<?php
global $CACHE;$user_cache = $CACHE->readCache('user');$name = $user_cache[1]['name'];
$DB = MySql :: getInstance();
$sql = "SELECT count(*) AS comment_nums,poster,mail,url FROM ".DB_PREFIX."comment where date >0 and poster !='". $name ."' and  poster !='匿名' and hide ='n' group by poster order by comment_nums DESC limit 0,66";
$result = $DB -> query( $sql );
$x=1; 
while( $row = $DB -> fetch_array( $result ) )
if ($x<=1) {
{
$img = "";
 if( $row[ 'url' ] )
{$tmp = "<div class=\"like-post col-xs-6 col-sm-4 col-md-3\"><div class=\"like-post-box\">
<a href=\"" . $row[ 'url' ] . "\" rel=\"external nofollow\" target=\"_blank\"><div class=\"views\"><span class=\"sealik\">吐槽 | </span><span class=\"count num\">" . $row[ 'comment_nums' ] . "条</span></div>
<div class=\"title\"><img class=\"lazy thumbnail\" style=\"float:left;\" src=\"" . getqqtx($row['mail']) . "\" ><h2>" . $row[ 'poster' ] ."</h2>
</div></a></div></div>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}
}elseif($x<=2){
$img = "";
 if( $row[ 'url' ] )
{$tmp = "<div class=\"like-post col-xs-6 col-sm-4 col-md-3\"><div class=\"like-post-box\">
<a href=\"" . $row[ 'url' ] . "\" rel=\"external nofollow\" target=\"_blank\"><div class=\"views\"><span class=\"sealik\">吐槽 | </span><span class=\"count num\">" . $row[ 'comment_nums' ] . "条</span></div>
<div class=\"title\"><img class=\"lazy thumbnail\" style=\"float:left;\" src=\"" . getqqtx($row['mail']) . "\" ><h2>" . $row[ 'poster' ] ."</h2>
</div></a></div></div>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}elseif($x<=3){
$img = "";
 if( $row[ 'url' ] )
{$tmp = "<div class=\"like-post col-xs-6 col-sm-4 col-md-3\"><div class=\"like-post-box\">
<a href=\"" . $row[ 'url' ] . "\" rel=\"external nofollow\" target=\"_blank\"><div class=\"views\"><span class=\"sealik\">吐槽 | </span><span class=\"count num\">" . $row[ 'comment_nums' ] . "条</span></div>
<div class=\"title\"><img class=\"lazy thumbnail\" style=\"float:left;\" src=\"" . getqqtx($row['mail']) . "\" ><h2>" . $row[ 'poster' ] ."</h2>
</div></a></div></div>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}elseif($x>=4){
$img = "";
 if( $row[ 'url' ] )
{$tmp = "<div class=\"like-post col-xs-6 col-sm-4 col-md-3\"><div class=\"like-post-box\">
<a href=\"" . $row[ 'url' ] . "\" rel=\"external nofollow\" target=\"_blank\"><div class=\"views\"><span class=\"sealik\">吐槽 | </span><span class=\"count num\">" . $row[ 'comment_nums' ] . "条</span></div>
<div class=\"title\"><img class=\"lazy thumbnail\" style=\"float:left;\" src=\"" . getqqtx($row['mail']) . "\" ><h2>" . $row[ 'poster' ] ."</h2>
</div></a></div></div>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}

echo $output ;
 ?>
  </div> </div> </div>
最后附上CSS代码就完事了


html{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}
*,:after,:before{-webkit-box-sizing:inherit;-moz-box-sizing:inherit;box-sizing:inherit}
body{cursor:url(../images/default.cur),auto!important}
body a{cursor:url(../images/link.cur),pointer}
blockquote,body,dd,dl,figure,form,h1,h2,h3,h4,h5,h6,p,pre{margin:0}
em,i{font-style:italic}
p{color:#3d464d;font-size:14px;line-height:1.6}
body{-moz-transition:all .5s ease;-ms-transition:all .5s ease;-o-transition:all .5s ease;-webkit-transition:all .5s ease;background-color:#f1f1f1;line-height:1.5;transition:all .5s ease}
textarea{font-size:14px;line-height:1.4}
a{color:#48494d;text-decoration:none;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease;cursor:pointer}
a:hover{text-decoration:none;color:#00A7EB}
img{vertical-align:middle}
a img{border:0 none}
body{font-family:suxingme,"Open Sans",Arial,"Hiragino Sans GB","Microsoft YaHei",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
@media screen and (max-width:650px){.like-post-box .title h2{padding-left:10px}
}
.likepage{padding:30px 0}
.like-post{margin-bottom:30px}
.like-post-box{position:relative;background:#FFF;-webkit-box-shadow:0 5px 10px 0 rgba(146,146,146,.1);-moz-box-shadow:0 5px 10px 0 rgba(146,146,146,.1);box-shadow:0 5px 10px 0 rgba(146,146,146,.1);-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:1px solid #e4ecf3}
.like-post-box:hover{transform:translateY(-6px);-webkit-transform:translateY(-6px);-moz-transform:translateY(-6px);box-shadow:0 26px 40px -24px rgba(0,0,0,.3);-webkit-box-shadow:0 26px 40px -24px rgba(0,0,0,.3);-moz-box-shadow:0 26px 40px -28px rgba(0,0,0,.3);-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}
.like-post-box a{display:block}
.like-post-box .image{height:200px;background-position:center top;background-repeat:no-repeat;background-size:cover}
.like-post-box .title{background:#fff;padding:15px 13px}
.like-post-box .title h2{font-size:14px;height:38px;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;display:-webkit-box;-webkit-line-clamp:2;padding-left:20px;line-height:38px}
.like-post-box .title h2 a{color:#FFF}
.like-post-box .views{position:absolute;right:5px;top:5px;background:rgba(232,40,74,.8);color:#FFF;padding:3px 8px;font-size:12px;border-radius:3px}
@media screen and (min-width:991px) and (max-width:1199px){.likepage{padding:5px 0}
.like-post{padding:5px;margin:0}
.like-post-box .image{height:150px}
}
@media screen and (min-width:768px) and (max-width:991px){.likepage{padding:0}
.like-post{padding:5px;margin:0}
.like-post-box .image{height:150px}
}
@media screen and (max-width:767px){.likepage{padding:5px}
.like-post{padding:0 0 2px 1px;margin:0}
.like-post-box .image{height:130px}
.container{width:auto;padding:0}
.page-single.container{padding:0;width:100%}
}
.thumbnail{height: 40px;width: 40px;display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}
.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}
.col-xs-6{width:50%;float:left;position:relative;min-height:1px;padding-right:15px;padding-left:15px}
.col-xs-6{width:50%;float:left}
@media (min-width:992px){.col-md-3{width:25%}
}
@media (min-width:992px){.col-md-3,.col-md-4{float:left}
}
@media (min-width:768px){.col-md-3{width:25%}
}
@media (min-width:768px){.col-md-3,.col-md-4{float:left}
}
@media (min-width:768px){.col-sm-4{width:33.33333333%}
}
@media (min-width:768px){.col-sm-4{float:left}
} 


标签: EMLOG教程 特效代码
版权声明:若无特殊注明,本文皆《蓝优》原创,转载请保留文章出处。
本文链接:通用读者墙单特效页代码(附EMLOG代码) - http://www.92mo.cn/daima/67.html

发表新评论

快捷功能:

全部评论(6条)
  1. 头像
    回复 Reynald 男爵 2018-01-24 01:49

    评论: how to use this code ? shall i must create a new php file ?

    1. 评论头像
      回复 蓝优 官方 2018-01-24 02:26

      回复了Reynald:Yes, create a new PHP file

      1. 评论头像
        回复 Reynald 男爵 2018-01-24 03:50

        回复了蓝优:评论: ok thanks i'll try it

      1. 评论头像
        回复 Reynald 男爵 2018-01-24 15:12

        回复了蓝优:评论: i've done it but i'm getting this error

        Fatal error: Call to a member function readCache() on null in /var/www/***/***/***/affairesnonresolues/wall.php on line 3

        I'm using Emlog 6+ , any idea ?
        Thanks.

  1. 头像
    回复 Reynald 男爵 2018-01-24 00:13

    评论: is someone can help me with thos code ? how to use it ? i would like to have this wall too on my site ?
    thanks for the help

    1. 评论头像
      回复 蓝优 官方 2018-01-24 01:11

      回复了Reynald:What?