欢迎访问,本站接受互联网网站仿站、功能定制、定制插件、主题,如果需要的话可以联系我 QQ:2283276927

zblog php 随机文章代码如下:带缩略图

雨夜 3354次浏览 3个评论
<li class="widget widget_random_posts">
                                <header>
                                    <h3>
                                        <i class="fa fa-certificate">
                                        </i>
                                        随机文章
                                    </h3>
                                </header>
                                <div class="main">
                                    <ul class="thumb">
                                        {php}
                                            $articles=$zbp->GetArticleList(
                                            array('*'),
                                            array(array('=','log_Type',0),
                                            array('=','log_Status',0)),
                                            array('rand()'=>' '),
                                            array(5),
                                            null
                                            );
                                        {/php}
                                         {foreach $articles as $article}
                                        <li>

                                            <a href="{$article.Url}" class="picbox"
                                            rel="bookmark" title="{$article.Title}">
                                                <img src="{php}$clsjtp=rand(1,4);$pattern="/<[img|IMG].*?src=[\'|\"](.*?(?:[\.gif|\.jpg|\.png]))[\'|\"].*?[\/]?>/";$content = $article->Content;
                                                  preg_match_all($pattern,$content,$matchContent);
                                                  if(isset($matchContent[1][0]))
                                                  $clsjtp=$matchContent[1][0];
                                                  else
                                                  $clsjtp="$host/zb_users/theme/$theme/style/img/suiji/$clsjtp.jpg";{/php}{$clsjtp}"class="thumb" width="60" height="60" title="{$article.Title}"
                                                alt="{$article.Title}" />
                                            </a>
                                            <h4 class="title">
                                                <a href="{$article.Url}" title="{$article.Title}">
                                                    {$article.Title}
                                                </a>
                                            </h4>
                                            <p class="postmeta">
                                                <span class="time">
                                                    {$article.Time('Y-m-d')}
                                                </span>
                                                <span class="eye">阅读({$article.ViewNums})</span>
                                            </p>
                                        </li>
                                          {/foreach}
                                    </ul>
                                </div>
                            </li>



涂涂研版版权所有,如未注明 , 均为原创,转载需注明出处。
发表我的评论换个身份
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(3) 个小伙伴在吐槽
  1. 谢谢分享的代码!
    深蓝 2014-09-06 AM 10:36 回复
  2. 路過前來支持一下~~ :D
    超級efly 2014-08-25 PM 10:47 回复
    • 欢迎
      雨夜 2014-09-02 PM 05:28 回复

主题定制开发流程

ZBLOGPHP开发流程

联系我们