Example #1
0
 public function index()
 {
     $term = sp_get_term($_GET['id']);
     $tplname = $term["list_tpl"];
     $tplname = sp_get_apphome_tpl($tplname, "list");
     $this->assign($term);
     $this->assign('cat_id', intval($_GET['id']));
     $this->display(":{$tplname}");
 }
 public function index()
 {
     $term = sp_get_term($_GET['id']);
     if (empty($term)) {
         header('HTTP/1.1 404 Not Found');
         header('Status:404 Not Found');
         if (sp_template_file_exists(MODULE_NAME . "/404")) {
             $this->display(":404");
         }
         return;
     }
     $tplname = $term["list_tpl"];
     $tplname = sp_get_apphome_tpl($tplname, "list");
     $this->assign($term);
     $this->assign('cat_id', intval($_GET['id']));
     $this->display(":{$tplname}");
 }
 public function index()
 {
     $term = sp_get_term($_GET['id']);
     if (empty($term)) {
         header('HTTP/1.1 404 Not Found');
         header('Status:404 Not Found');
         if (sp_template_file_exists(MODULE_NAME . "/404")) {
             $this->display(":404");
         }
         return;
     }
     if ($term['parent'] != 0) {
         $parentid = $term['parent'];
         $termschildren = $this->terms_model->where(array('parent' => $parentid))->select();
         //获得二级栏目
     } else {
         $termschildren = $this->terms_model->where(array('parent' => $term['term_id']))->select();
         //获得二级栏目
     }
     //kjdump($term);
     switch ($term['catype']) {
         case '1':
             $postdata = $this->getcaseslist($term['term_id']);
             break;
             //文章
         //文章
         case '0':
             $postdata = $this->getarticlelist($term['term_id']);
             break;
             //案例
         //案例
         default:
             $this->display(":404");
             break;
     }
     //kjdump($postdata );
     $tplname = $term["list_tpl"];
     //$tplname=sp_get_apphome_tpl($tplname, "list");
     $this->assign('term', $term);
     $this->assign('parentid', $parentid);
     //$this->assign('cat_id', intval($_GET['id']));
     $this->assign('termschildren', $termschildren);
     $this->assign('postdata', $postdata);
     $this->display(":{$tplname}");
 }
 public function index()
 {
     $terms_db = M('Terms');
     $term = sp_get_term($_GET['id']);
     if (empty($term)) {
         header('HTTP/1.1 404 Not Found');
         header('Status:404 Not Found');
         if (sp_template_file_exists(MODULE_NAME . "/404")) {
             $this->display(":404");
         }
         return;
     }
     $tlist = $terms_db->where(array('parent' => $_GET['id']))->select();
     $tplname = $term["list_tpl"];
     $tplname = sp_get_apphome_tpl($tplname, "list");
     $this->assign($term);
     $this->assign('tlist', $tlist);
     $this->assign('cat_id', intval($_GET['id']));
     $this->display(":{$tplname}");
 }
 public function index()
 {
     $term = sp_get_term($_GET['id']);
     if (empty($term)) {
         header('HTTP/1.1 404 Not Found');
         header('Status:404 Not Found');
         if (sp_template_file_exists(MODULE_NAME . "/404")) {
             $this->display(":404");
         }
         return;
     }
     $tplname = $term["list_tpl"];
     $tplname = sp_get_apphome_tpl($tplname, "list");
     $dbPosts = M('posts');
     $dieYear['max'] = $dbPosts->field(array('MAX(LEFT(post_diedate,4))' => 'max'))->find()['max'];
     $dieYear['min'] = $dbPosts->field(array('MIN(LEFT(post_diedate,4))' => 'min'))->find()['min'];
     $this->assign('dieYear', $dieYear);
     $this->assign($term);
     $this->assign('cat_id', intval($_GET['id']));
     $this->display(":{$tplname}");
 }
}
?>
							
						</ul>
					</div>
				</div>
			</div>
			<div class="suof">
				<a href="#"></a>
			</div>
		</div>
    </aside>
</div>
<div class="conbanbox">
		<?php 
$pterm = sp_get_term($parent);
$pd = $pterm['description'];
?>
	<div class="conban">
    	<?php 
if (ishttp($pd)) {
    ?>
<div class="item item_1" style="background-image:url(<?php 
    echo $pd;
    ?>
);data:#2b74ba;"></div>
    	<?php 
} else {
    ?>
    		<div class="item item_1" style="background-image:url(/tpl/hualibootx/Public/images/page-general.png);data:#2b74ba;"></div><?php 
}
?>
							
						</ul>
					</div>
				</div>
			</div>
			<div class="suof">
				<a href="#"></a>
			</div>
		</div>
    </aside>
</div>
<div class="conbanbox">
	<div class="conban">
		<?php 
$term = sp_get_term($term_id);
?>
		<?php 
if (ishttp($term['description'])) {
    ?>
<div class="item item_1" style="background-image:url(<?php 
    echo $term['description'];
    ?>
);data:#2b74ba;"></div>
    	<?php 
} else {
    ?>
    		<div class="item item_1" style="background-image:url(/tpl/hualibootx/Public/images/page-general.png);data:#2b74ba;"></div><?php 
}
?>
    </div>
echo $result['count'];
?>
 条结果</h4>
				<ul class="searchlist">
				<?php 
if (is_array($result['posts'])) {
    $i = 0;
    $__LIST__ = $result['posts'];
    if (count($__LIST__) == 0) {
        echo "";
    } else {
        foreach ($__LIST__ as $key => $vo) {
            $mod = $i % 2;
            ++$i;
            $smeta = json_decode($vo['smeta'], true);
            $fl = sp_get_term($vo['term_id']);
            ?>
					<li>
						> <span><?php 
            if (!empty($fl['name'])) {
                ?>
[ <a href="<?php 
                echo UU('list/index', array('id' => $fl['term_id']));
                ?>
"><?php 
                echo $fl['name'];
                ?>
</a> ]<?php 
            }
            ?>
</span>&nbsp;