优化青藏铁路视频专题,实现专题首页的后台新闻更新,添加页面导航条

This commit is contained in:
wlx 2015-05-18 12:22:41 +08:00
parent f9ab91cdc1
commit 4466ce594c
4 changed files with 41 additions and 35 deletions

View File

@ -12,8 +12,11 @@ class QzrController extends DataController
function indexAction()
{
$sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and length(t.data)>2 order by random() limit 3";
$this->view->meatdata=$this->db->fetchAll($sql);
//$sql="select m.uuid,m.title,m.id,m.description from normalmetadata m left join thumbnail t on m.id=t.id where m.uuid in (select d.uuid from datasource d left join source s on d.sourceid=s.id where s.code='heihe') and length(t.data)>2 order by random() limit 3";
//$this->view->meatdata=$this->db->fetchAll($sql);
$archive = new Archive($this->db);
$this->view->info = $archive->getOneArchive('青藏铁路介绍','about');
$this->_helper->viewRenderer('base');
}
function newsAction()

View File

@ -0,0 +1,30 @@
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->data);
$this->headTitle()->setSeparator(' - ');
$this->headLink()->appendStylesheet('/css/water.css');
$this->nav[] = array('link'=>"/qzr",'title'=>'青藏铁路');
?>
<?= $this->render('breadcrumbs.phtml'); ?>
<div class="row">
<div class="span2">
<?= $this->partial('qzr/navi.phtml'); ?>
</div>
<div class="span10">
<?php if ($this->info) : ?>
<div class="well">
<?php if(!empty($this->info['body'])) echo $this->info['body'];?>
</div>
<?php endif; ?>
<?php if ($this->metadata) : ?>
<?php echo $this->page->getNavigation(); ?>
<div id="mdlist">
<ol start="<?php echo $this->offset; ?>">
<?php foreach($this->metadata as $md) : ?>
<li><a href="/qzr/view/uuid/<?php echo $md['uuid']; ?>"><?php echo $md['title']; ?></a></li>
<?php endforeach; ?>
</ol>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -1,28 +1,4 @@
<ul class="nav nav-pills nav-stacked">
<li id="Nav-qzr-index"><a href="/qzr/">青藏铁路介绍</a></li>
<li id="Nav-qzr-news"><a href="/qzr/news">相关新闻</a></li>
</ul>
<ul>
<li id="Nav-qzr-document"><a href="/qzr/document">文档</a></li>
<li id="Nav-qzr-browse"><a href="/qzr/browse">整体浏览</a></li>
<li id="Nav-qzr-thumb"><a href="/qzr/thumb">缩略图浏览</a></li>
<li id="Nav-qzr-tags"><a href="/qzr/tag">关键词导航</a></li>
<li id="Nav-qzr-timeline"><a href="/qzr/timeline">时间轴导航</a></li>
<li id="Nav-qzr-timemap"><a href="/qzr/timemap">时空联合导航</a></li>
</ul>
<form id="search" enctype="application/x-www-form-urlencoded" action="/qzr/search" method="post">
<input type="text" name="q" id="q" value="<?php echo (empty($this->key))?'回车搜索标题和摘要':$this->key; ?>" onfocus="myfocus(this);" onblur="myblur(this);">
<input type="hidden" name="submit" value="submit">
</form>
<script>
function myfocus(element) {
if (element.value == '回车搜索标题和摘要') {
element.value = '';
}
}
function myblur(element) {
if (element.value == '') {
element.value = '回车搜索标题和摘要';
}
}
</script>
</ul>

View File

@ -8,17 +8,14 @@ $this->theme->AppendPlus($this,'jquery');
$this->theme->AppendPlus($this,'jplayer');
$this->headScript()->appendFile("/js/lib/jplayer/add-on/jplayer.playlist.min.js");
$this->headLink()->appendStylesheet('/js/lib/jplayer/skin/blue.monday/jplayer.blue.monday.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/qzr/">青藏铁路</a>');
$this->breadcrumb($this->infos['title']);
$this->breadcrumb()->setSeparator(' > ');
if(!empty($this->infos['keyword'])) $keyword = $this->infos['keyword']; else $keyword = $this->infos['title'];
?>
$this->nav[] = array('link'=>"/qzr",'title'=>'青藏铁路');
?>
<?= $this->render('breadcrumbs.phtml'); ?>
<div class='row'>
<div class='span3'>
<div class='span2'>
<?= $this->partial('qzr/navi.phtml'); ?>
</div>
<div class='span9'>
<div class='span10'>
<p>视频摘要Abstract of the video</p>
<p>Extreme Railway: Qinghai-Tibet Railway Engineer Pasi Lautala takes a look at the hi-tech solutions employed by the Chinese government in building the Qinghai-Tibet railway, which runs all the way from Xining to Lhasa. The 1000 kilometre track was planned over 50 years ago but had to wait until modern technology and engineering know-how could help to overcome the harsh environment of the Tibetan plateau. Permafrost, thin air and sand still threaten the amazing achievement which includes 675 bridges and the worlds highest tunnel. 140,000 labourers built the railway with the help of 2,000 medics who were needed to deal with altitude sickness. Lautala follows the trains route and looks at the structural solutions devised by Chinas top engineers.</p>