change index page

This commit is contained in:
wlx 2014-06-12 03:25:06 +00:00
parent b6d34f1b43
commit 0dee17f92b
2 changed files with 8 additions and 7 deletions

View File

@ -50,7 +50,8 @@ class IndexController extends Zend_Controller_Action
$News = new Archive($this->db);
$time = date("Y-m-d H:i:s",time());
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<'$time' AND image!='' and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='featured') order by ts_published desc LIMIT 5";
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<'$time' AND image!=''
and id in (select ar_catalog.aid from ar_category left join ar_catalog on ar_category.id=ar_catalog.cid where ar_category.code='featured') order by ts_published desc LIMIT 5";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);
@ -63,7 +64,9 @@ class IndexController extends Zend_Controller_Action
$this->view->news = $rows;
//$time = date("Y-m-d H:i:s",time());
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<now() and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news') order by ts_published desc LIMIT 12 ";
$sql = "SELECT * FROM archive WHERE is_pub=true and sub='$this->subnews' AND ts_published<now()
and id in (select ar_catalog.aid from ar_catalog left join ar_category on ar_catalog.cid=ar_category.id where ar_category.ptype='news')
order by ts_published desc LIMIT 12 ";
$sth = $this->db->query($sql);
$rows = $sth->fetchAll(PDO::FETCH_BOTH);

View File

@ -2,12 +2,10 @@
$this->headTitle($this->config->title->site);
$this->headTitle('首页');
$this->headTitle()->setSeparator(' - ');
$auth = Zend_Auth::getInstance();
?>
<!-- Wrap the rest of the page in another container to center all the content. -->
<link href="../../../../../htdocs/sjyportal/css/style.css" rel="stylesheet" type="text/css" />
<link href="/sjyportal/css/style.css" rel="stylesheet" type="text/css" />
<!-- Three columns of text below the carousel -->
@ -22,7 +20,7 @@
<a href="<?= $v['url'] ?>" title="<?= $v['title'] ?>"><i class="icon-ok-sign"> </i><?= mb_strlen($v['title']) > 23 ? mb_substr($v['title'],0,23,'utf-8')."...":$v['title'] ?></a>
</li>
<?php } ?>
<span class="pull-right"><a href="/archives/news/localnews" target="_blank" class="more">更多>></a></span>
<span class="pull-right"><a href="/archives" target="_blank" class="more">更多>></a></span>
</ul>
</div>
</div>
@ -36,7 +34,7 @@
<a href="<?= $v['url'] ?>" title="<?= $v['title'] ?>"><i class=" icon-ok-sign"> </i><?= $v['title'] ?></a>
</li>
<?php } ?>
<span class="pull-right"><a href="/archives/news/localnews" target="_blank" class="more">更多>></a></span>
<span class="pull-right"><a href="/archives/" target="_blank" class="more">更多>></a></span>
</ul>
</div>
</div>