<div id="sidebox">


<div class="ads">
    <a href="signup.php" target="_blank"><img src="<?php echo THEME_PATH; ?>/images/tp-10.gif" border="0" /></a>
</div>


<table id="searchBox">
<form name="searchForm" method="GET" action="" onSubmit="if(this.so.value=='Search...') {alert('请输入搜索条件！');return false;}">
<input name="md" type="hidden" value="Affiliate_PZone_Views_Post" />
<tr>
    <td><input id="so" name="so" type="text" value="Search..." maxlength="20" onfocus="if(this.value=='Search...') this.value=''" onblur="if(this.value=='') this.value='Search...'" /></td>
    <td><input type="image" src="<?php echo THEME_PATH; ?>/images/searchbutton.gif" />
    </td>
</tr>
</form>
</table>


<div class="cen2R">
<?php
//获取文章列表示例
$params = array(
    'paged'=>true,  //是否分页
    'pageid'=>1,    //当前页码
    'limit'=>10,    //每页显示条数
    //'cateid'=>array('fab0f29f','71fcfd2e')   //文章分类，为空则显示所有分类，也可直接传入单个分类ID的字符串
);
$posts = $this->a_core->getPosts($params);
?>
    <div class="cen2R1"><strong>最新文章</strong></div>
    <div class="cen2R2">
    <?php
        if($posts) {
            $s_template = '<a href="index.php?md=Affiliate_PZone_Views_Post&cateid=%s" target="_self">[%s]</a><a href="index.php?md=Affiliate_PZone_Views_Post&id=%s" target="_self" title="%s">%s</a>&nbsp;<span class="font2">%s</span><br />';
            foreach($posts['articles'] as $row) {
                echo sprintf($s_template,$row['cateid'],$row['catename'],$row['ID'],$row['title'],$row['title'],$row['postime']);
            }
        }else {
            echo '暂无内容。';
        }
    ?>
    </div>
</div>


</div>