
<div id="main" class="mainwarp">

<div class="clear"></div>

<div class="postcontext">
    <div id="locationnav">当前位置：
        <a href="index.php">首页</a> >
        <a href="index.php?md=Affiliate_PZone_Views_Post&so=<?php echo $this->p_so; ?>">搜索"<?php echo $this->p_so; ?>"</a> >
        结果列表
    </div>
    <?php
        if($this->p_haveposts) {
            $sectionHTML = '<div class="list-section"><p class="list_title"><a href="index.php?md=Affiliate_PZone_Views_Post&cateid=%s">[%s]</a><a href="index.php?md=Affiliate_PZone_Views_Post&id=%s&so=%s">%s</a></p><p class="postpreview">%s<a href="index.php?md=Affiliate_PZone_Views_Post&id=%s&so=%s" target="_blank">[阅读全文]</a></p><p class="postattrs">%s</p></div>';
            foreach($this->p_posts['articles'] as $post) {
                $title = str_replace($this->p_so,'<span style="color:red;">'.$this->p_so.'</span>',$post['title']);
                $context = str_replace($this->p_so,'<span style="color:red;">'.$this->p_so.'</span>',cut_str(str_replace('&nbsp;','',strip_tags($post['context'])),200));
                echo sprintf($sectionHTML,$post['cateid'],$post['catename'],$post['ID'],$this->p_so,$title,$context,$post['ID'],$this->p_so,$post['postime']);
            }
            if($this->p_posts['paged']) {
                $pageNavHTML = '<div class="pagenav">第%d/%d页 每页显示%d条记录 共%d条记录 <a href="index.php?md=Affiliate_PZone_Views_Post&so=%s&pageid=%d">上一页</a> <a href="index.php?md=Affiliate_PZone_Views_Post&so=%s&pageid=%d">下一页</a></div>';
                echo sprintf($pageNavHTML,
                    $this->p_posts['pagenav']['page'],
                    $this->p_posts['pagenav']['pages'],
                    $this->p_posts['pagenav']['limit'],
                    $this->p_posts['pagenav']['total'],
                    $this->p_so,
                    $this->p_posts['pagenav']['page']-1,
                    $this->p_so,
                    $this->p_posts['pagenav']['page']+1
                );
            }
        }else {
            QUnit_Global::includeTemplate('404.tpl.php');
        }
    ?>
</div>


<?php QUnit_Global::includeTemplate('sidebox.tpl.php'); ?>

<div class="clear"></div>

</div>