标签:des style blog http color io os 使用 ar
//循环分类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
更多相关标签的使用地址
http://wiki.zblogcn.com/doku.php?id=zblogphp:themes:template
http://wiki.zblogcn.com/doku.php?id=zblogphp:themes:templatesyntax
http://wiki.zblogcn.com/doku.php?id=zblogphp:themes:tips
标签:des style blog http color io os 使用 ar
原文地址:http://www.cnblogs.com/renzhe/p/3982612.html