添加文档报告、专利与著作权支持;archive类中支持获取内容

This commit is contained in:
wlx 2012-11-30 18:16:06 +00:00
parent a673040e9a
commit 1954ce79ac
4 changed files with 102 additions and 12 deletions

View File

@ -75,15 +75,16 @@ class AboutController extends Zend_Controller_Action
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
$sth->execute(array($siteid)); $sth->execute(array($siteid));
$rows = $sth->fetchAll(); $rows = $sth->fetchAll();
} elseif ($ac=='patent' || $ac=='report') {
$paginator = Zend_Paginator::factory($rows); $archives=new Archive($this->db);
$paginator->setCurrentPageNumber($this->_getParam('page')); $rows=$archives->getArchive($ac);
$paginator->setItemCountPerPage(10); $this->_helper->viewRenderer($ac);
$paginator->setView($this->view); }
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); $paginator = Zend_Paginator::factory($rows);
$this->view->paginator=$paginator; $paginator->setCurrentPageNumber($this->_getParam('page'));
} $paginator->setItemCountPerPage(10);
$paginator->setView($this->view);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
} }
} }

View File

@ -0,0 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('成果发表');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/about.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/about">关于本站</a>');
$this->breadcrumb('<a href="/about/publication">成果发表</a>');
$this->breadcrumb('专利与著作权');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('about/navi.phtml'); ?>
</div>
</div>
<div id="content">
<h2>成果发表</h2>
<div id="tabs-controller">
<ul>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/">期刊文章</a></li>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/ac/report">文档报告</a></li>
<li class="box-shadow active"><a class="text-shadow" href="/about/publication/ac/patent">专利与著作权</a></li>
</ul>
</div>
<div id="datalist">
<?php if (count($this->paginator)): ?>
<ul>
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['title']; ?>
<?php if (!empty($ref->link)) :
echo ' <a href="'.$ref->link.'">下载</a>';
endif;
?>
</li>
<?php endforeach; ?>
</ul>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>
</div>

View File

@ -0,0 +1,41 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle('成果发表');
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/about.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/about">关于本站</a>');
$this->breadcrumb('<a href="/about/publication">成果发表</a>');
$this->breadcrumb('文档报告');
$this->breadcrumb()->setSeparator(' > ');
?>
<div id='sidebar'>
<div id='leftnavi'>
<?= $this->partial('about/navi.phtml'); ?>
</div>
</div>
<div id="content">
<h2>成果发表</h2>
<div id="tabs-controller">
<ul>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/">期刊文章</a></li>
<li class="box-shadow active"><a class="text-shadow" href="/about/publication/ac/report">文档报告</a></li>
<li class="box-shadow"><a class="text-shadow" href="/about/publication/ac/patent">专利与著作权</a></li>
</ul>
</div>
<div id="datalist">
<?php if (count($this->paginator)): ?>
<ul>
<?php foreach ($this->paginator as $item): ?>
<li> <?php echo $item['title']; ?>
<?php if (!empty($ref->link)) :
echo ' <a href="'.$ref->link.'">下载</a>';
endif;
?>
</li>
<?php endforeach; ?>
</ul>
<div class="pagenavi"><?= $this->paginator; ?></div>
<?php endif; ?>
</div>
</div>

View File

@ -219,6 +219,13 @@ class Archive
$sql = "DELETE FROM ".$this->tbl_tag." WHERE id=$aid"; $sql = "DELETE FROM ".$this->tbl_tag." WHERE id=$aid";
@$this->db->exec($sql); @$this->db->exec($sql);
return true; return true;
}//DeleteTags }//DeleteTags
function getArchive($code='')
{
$sql="select * from ".$this->tbl_archives;
if (!empty($code)) $sql.=" where code='".$code."'";
$rs=$this->db->query($sql);
$rows=$rs->fetchAll();
}
} }