//循环分类ID,供首页调用. function dump($var, $echo=true, $label=null, $strict=true) { $label = ($label === null) ? '' : rtrim($label) . ' '; if (!$strict) { if (ini_get('html_errors')) { $output = print_r($var, true); $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>'; } else { $output = $label . print_r($var, true); } } else { ob_start(); var_dump($var); $output = ob_get_clean(); if (!extension_loaded('xdebug')) { $output = preg_replace('/\]\=\>\n(\s+)/m', '] => ', $output); $output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES) . '</pre>'; } } if ($echo) { echo($output); return null; }else return $output; } foreach ($zbp->categorysbyorder as $key => $value) { $s .= '<li><a href="' . $value->Url . '">' . $value->ID . '</a></li>'; dump($value->ID); }
文章首页调用缩略图
{foreach $articles as $article} <img src="{$article.Img}" alt="1" border="0" /> {/foreach}
相关文章的调用sqlite中没有rand
{$aid=$article.ID} {$tagid=$article.Tags} {$cid=$article.Category.ID} {php} $tagrd=array_rand($tagid); if( sizeof($tagid)>0 && ($tagid[$tagrd]->Count)>1){ $tagi='%{'.$tagrd.'}%'; $where = array(array('=','log_Status','0'),array('like','log_Tag',$tagi),array('<>','log_ID',$aid)); }else{ $where = array(array('=','log_Status','0'),array('=','log_CateID',$cid),array('<>','log_ID',$aid)); } $array = $zbp->GetArticleList(array('*'),$where,array('random()'=>' '),array(6),''); foreach ($array as $related) { if(($related->ID)!=$aid){ $str .= "<li><span class=\"time\">{$related->Time('m-d')}</span><span class=\"title\"><i class=\"icon-doc-text\"></i><a href=\"{$related->Url}\" title=\"{$related->Title}\">{$related->Title}</a></span><small class=\"pcomm\"><i class=\"icon-comment-1\"></i> <a href=\"{$related->Url}#comments\" rel=\"nofollow\" title=\"《{$related->Title}》上的评论\">{$related->CommNums}</a></small></li>"; } } {/php} {$str}
随机文章展示
{php} $a1 = $zbp->GetArticleList(array('*'),'',array('random()'=>' '),array(6),''); {/php} {foreach $a1 as $article} {if $article.IsTop} {template:post-istop} {else} {template:post-multi} {/if} {/foreach}
最新文章
$array=$zbp->GetArticleList('',$w,array('log_PostTime'=>'DESC'),array($zbp->searchcount),null);
浏览最多的
ViewNums
如何嵌入焦点图,开启幻灯片插件
1、复制tc_slide文件夹到theme中
2、然后在模板的适当位置插入
<div class="yx-rotaion" style="margin-bottom:25px;">
<ul class="rotaion_list">{module:tc_slide}</ul>
</div>
<link rel="stylesheet" rev="stylesheet" href="http://oss.aliyuncs.com/renzhe/files/tc_slide/slide.css" type="text/css" media="all"/>
<script type="text/javascript" src="http://oss.aliyuncs.com/renzhe/files/tc_slide/jquery.yx_rotaion.js"></script>
<script type="text/javascript">
$(".yx-rotaion").yx_rotaion({auto:true});
</script>
图片地址
http://oss.aliyuncs.com/renzhe/files/tc_slide/pics/001.png
http://oss.aliyuncs.com/renzhe/files/tc_slide/pics/002.png
http://oss.aliyuncs.com/renzhe/files/tc_slide/pics/003.png
http://oss.aliyuncs.com/renzhe/files/tc_slide/pics/004.png
<!--焦点图结束—>
3、后台添加一些图片,刷新模板
预览首页
更多相关标签的使用地址
http://wiki.zblogcn.com/doku.php?id=zblogphp:themes:template
http://wiki.zblogcn.com/doku.php?id=zblogphp:themes:templatesyntax