print <<<EOT
-->
<div id="top"><div id="viewmode">浏览模式: 标准 | <a href="http://www.bpsky.net/viewmode.html=list{$modelink}">列表</a></div><b>$navtext</b></div>
<!--
EOT;
这是[标准模式]的切换条。
foreach($articledb as $key => $article){
print <<<EOT
--><div class="post">
<div class="posttitle"><!--
EOT;
$tatol在这里指Blog里所包含的文章总数,用大白话来解释就是,如果文章总数超过0篇(存在有文章才列显出来),则将$articledb数据集数组(可能是分类数据)递归返回给$article变量(数组)。
PS:我刚刚查看了一下Sablog的index.php文件,确认了,articledb是不是单纯的数据集,而是数据集数组。已经将额定条目的数据集打包成数组,这和我们常识的db有点区别。我也差点被骗了.
print <<<EOT
-->[置顶] <!--
EOT;
}
$article['stick'] 这个变量是置顶变量,如果其值不为0,表示条件成立,它来判断是否置顶被选择.
print <<<EOT
--><a href="http://www.bpsky.net/action.html=show&id=$article[articleid]">$article[title]</a></div>
<div class="postdate">Submitted by <a href="http://www.bpsky.net/action.html=showuser&id=$article[authorid]">$article[author]</a> on $article[dateline]</div>
<div class="content">$article[content]
<!--
EOT;
if (!empty($article['description'])) {print <<<EOT
-->
<p><a href="http://www.bpsky.net/action.html=show&id=$article[articleid]">阅读全文</a></p>
<!--
EOT;
}print <<<EOT
--></div>
<!--
EOT;
!empty($article['description']判断:如果文章不包函文章描述时,条件成立!,也就是说,当文章不包描述时也列显“阅读全文”开关。如果包涵描述而不会显示阅读全文开关。
PS:sablog里有一个潜规则,就是当采用描述作为文章概文时,说明文章本身内容过大,不易于首显。
if ($options['attachments_display'] == 0) {
if ($article['image']) {
foreach ($article['image'] as $image) {
if($image[6]){print <<<EOT
--><div class="attach">图片附件(缩略图):<br /><a href="./attachment.php?id=$image[0]" target="_blank"><img src="$image[1]" border="0" alt="大小: $image[2] 尺寸: $image[3] x $image[4] 浏览: $image[5] 次 点击打开新窗口浏览全图" width="$image[3]" height="$image[4]" /></a></div>
<!--
EOT;
} else {print <<<EOT
--><div class="attach">图片附件:<br /><a href="./attachment.php?id=$image[0]" target="_blank"><img src="$image[1]" border="0" alt="大小: $image[2] 尺寸: $image[3] x $image[4] 浏览: $image[5] 次 点击打开新窗口浏览全图" width="$image[3]" height="$image[4]" /></a></div>
<!--
EOT;
}}}
$options['attachments_display']估计是控制直显方式的图片。
$article['image']这个变量很有趣。在index.php中,对混排方式处理过后的余图片附件总数!也就是说,如果混排图片中还有余下的图片,则以附件方式列显。
foreach($article[file] as $file){
if($file){print <<<EOT
--><div class="attach"><b>附件: </b><a href="attachment.php?id=$file[0]" target="_blank">$file[1]</a> ($file[2], 下载次数:$file[3])</div>
<!--
EOT;
非图附件依次列出。
$imagenum = count($article['image']);
$filenum = count($article['file']);
$attachnum = $filenum+$imagenum;
if ($attachnum != 0) {
print <<<EOT
--><div class="attach"><div class="attach-desc">本文有${attachnum}个附件 (图片:$imagenum, 文件:$filenum)</div></div>
<!--
EOT;
}}
如果在设置中图片以文件模式提供的,那么这段代码将有效。
print <<<EOT
--><div class="tags"><b>Tags</b>: $article[alltags]</div>
<!--
EOT;
}
标签的处理:
$cname = urlencode($article[cname]);
$cname就是分类信息,而对其进行了urlencode加密,是为了方便中文以get方式传输。
--><div class="postmetadata"><a href="http://www.bpsky.net/cid.html=$article[cid]&cname=$cname">$article[cname]</a> | <a href="http://www.bpsky.net/action.html=show&id=$article[articleid]#comment">评论</a>:<font color="#CC0000">$article[comments]</font> | <a href="http://www.bpsky.net/action.html=show&id=$article[articleid]#trackbacks">Trackbacks</a>:<font color="#CC0000">$article[trackbacks]</font> | <a href="http://www.bpsky.net/action.html=show&id=$article[articleid]">阅读</a>:<font color="#CC0000">$article[views]</font></div>
</div>
<!--
EOT;
文章状态信息:
-->
$multipage
<!--
EOT;
$multipage是sablog封装好的"分页条"变量:
-->
<p><strong>没有任何文章</strong></p>
<!--
EOT;
}
?>
(教程来自bpsky.net)



