예제 #1
0
 public function run($chnid = 0)
 {
     $channelModel = Channel::findOne($chnid);
     $dataList = DataSource::getContentByChannel($chnid);
     $locals = [];
     $locals['dataList'] = $dataList;
     $locals['currentChannel'] = $channelModel;
     $indexTpl = $this->getTpl($chnid, 'manager');
     return $this->render($indexTpl, $locals);
 }
예제 #2
0
 public function run($chnid)
 {
     $currentChannel = $this->getChannel($chnid);
     $query = DataSource::buildContentQuery($currentChannel['table'], [], 'channel_id=' . $chnid);
     $locals = LuLu::getPagedRows($query);
     $locals['chnid'] = $chnid;
     $locals['currentChannel'] = $currentChannel;
     $locals['currentModel'] = $currentChannel['table'];
     $view = LuLu::getView();
     $view->setTitle(empty($currentChannel['seo_title']) ? $currentChannel['name'] : $currentChannel['seo_title']);
     $view->setMetaTag('keywords', $currentChannel['seo_keywords']);
     $view->setMetaTag('description', $currentChannel['seo_description']);
     $listTpl = $this->getTpl($chnid, 'list_tpl');
     return $this->render($listTpl, $locals);
 }
예제 #3
0
 public function run($chnid = 0)
 {
     if ($chnid === 0) {
         $currentChannel = new Channel();
         $rows = [];
     } else {
         $currentChannel = Channel::findOne($chnid);
         $rows = DataSource::getContentByChannel($chnid);
     }
     $query = new Query();
     $query->select('*')->from($currentChannel['table'])->where(['channel_id' => $chnid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'publish_time desc']);
     //$locals['rows']=$rows;
     $locals['chnid'] = $chnid;
     $locals['channelArrayTree'] = Channel::getChannelArrayTree();
     $locals['currentChannel'] = $currentChannel;
     $tplName = $this->getTpl($chnid, 'index');
     return $this->render($tplName, $locals);
 }
 public function actionIndex($fraid)
 {
     $query = Fragment3Data::find()->where(['fragment_id' => $fraid]);
     $locals = LuLu::getPagedRows($query, ['order' => 'id desc']);
     $ret = [];
     foreach ($locals['rows'] as $row) {
         $id = $row['id'];
         $ret[$id] = ['id' => $row['id'], 'channel_id' => $row['channel_id'], 'content_id' => $row['content_id'], 'sort_num' => $row['sort_num']];
         $item = DataSource::getContentByChannel($row['channel_id'], ['where' => 'id=' . $row['content_id']]);
         if ($item == null || empty($item)) {
             $ret[$id]['title'] = '没有此数据';
         } else {
             $ret[$id]['title'] = $item[0]['title'];
         }
     }
     $locals['rows'] = $ret;
     $locals['currentFragment'] = Fragment::findOne($fraid);
     return $this->render('index', $locals);
 }
예제 #5
0
 public function run($chnid = 0)
 {
     $currentChannel = $this->getChannel($chnid);
     $childChannels = $this->getChildChannels($chnid);
     $dataList = [];
     foreach ($childChannels as $channel) {
         $dataList[$channel['id']] = DataSource::getContentByChannel($channel['id'], ['limit' => 5]);
     }
     $locals = [];
     $locals['dataList'] = $dataList;
     $locals['chnid'] = $chnid;
     $locals['currentChannel'] = $currentChannel;
     $locals['currentModel'] = $currentChannel['table'];
     $view = LuLu::getView();
     $view->setTitle(empty($currentChannel['seo_title']) ? $currentChannel['name'] : $currentChannel['seo_title']);
     $view->setMetaTag('keywords', $currentChannel['seo_keywords']);
     $view->setMetaTag('description', $currentChannel['seo_description']);
     $channelTpl = $this->getTpl($chnid, 'channel_tpl');
     return $this->render($channelTpl, $locals);
 }
예제 #6
0
$channel = $this->getChannel($id);
$style = $index % 2 === 0 ? ' floatLeft' : ' floatRight';
?>
	<div class="tbox border <?php 
echo $style;
?>
" style="width:49%;">
		<div class="middleTitle2">
			<h2><?php 
echo UrlUtility::getChannelLink($channel['id']);
?>
</h2>
		</div>
		<ul class="imgTxtContent1 size95x95">
			<?php 
$dataSource = DataSource::getContentByChannel($channel['id'], ['is_pic' => true, 'limit' => 1]);
echo LoopData::widget(['dataSource' => $dataSource, 'item' => 'item-imgtxt1', 'length' => 13]);
?>
        </ul>
		<ul class="txtContent dot">
			<?php 
echo LoopData::widget(['dataSource' => $row, 'length' => 18]);
?>
		</ul>
	</div>
<?php 
if ($index % 2 === 1) {
    echo '<div class="clear"></div>';
}
?>
예제 #7
0
				</ul>
            </div>

            <div class="tbox dot">
            	<div class="middleTitle2">
                    <h2><?php 
echo $this->getChannelUrl(106);
?>
</h2>
                </div>
                <div class="ad">
                    <a href="http://forum.china.com.cn/hot/jf/"><img src="http://images.china.cn/attachement/jpg/site1000/20140606/7427ea210a0214fb640305.jpg" border="0" width="307" height="64" style="margin:0 0 15px 2px;" alt="《交锋》栏目" /></a>
                </div>
                <ul class="txtContent">
            		<?php 
$dataSource = DataSource::getContentByChannel(106, ['limit' => 2]);
echo LoopData::widget(['dataSource' => $dataSource]);
?>
				</ul>
            </div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="container column">
        <div class="bigTitle">
            <h2>
                <a href="">时政社会</a>
            </h2>
            <span>
                <!--begin 8020594-7183244-1-->
                <a title="" href="tw/node_7185034.htm" target="_blank">台湾</a>︱<a title="" href="gangao/node_7185033.htm" target="_blank">港澳</a>︱<a title="" href="env/node_7185031.htm" target="_blank">环境</a>︱<a title="" href="http://photostock.china.com.cn/Web_CHN/default.aspx" target="_blank">图片库</a>︱<a title="" href="http://opinion.china.com.cn/lib_opinion_0_1.html" target="_blank">观点库</a>
예제 #8
0
	            <li><a href="2014-06/30/content_32807605.htm">上海车牌均价超7万 13.5万人竞拍中标率创新低</a></li>
	
	            <li><a href="2014-06/30/content_32807283.htm">湖北大冶液化气站发生爆燃 已造成8人受伤</a></li>
	
	            <li><a href="2014-06/30/content_32807212.htm">甘肃计划生育工作者不到岗长期在外打工被通报</a></li>
	
	            <li><a href="shehui/2014-06/30/content_32807637.htm">河南村民修下水道挖出三尊元末明初汉白玉雕像(图)</a></li>
	        </ul>
	    </div>
	    <div class="tbox border dot">
	        <div class="middleTitle3">
	            <h2><a href="node_7183298.htm" target="_blank" class="">最新更新</a></h2>
	        </div>
	        <ul class="txtContent">
	        	<?php 
$dataSource = DataSource::getContentByChannel($chnid, ['order' => 'publish_time desc']);
echo LoopData::widget(['dataSource' => $dataSource, 'params' => ['length' => 19]]);
?>
	        </ul>
	    </div>
	    <div class="tbox border">
	        
	        <div class="ad">
	        	<img alt="" src="<?php 
echo CommonUtility::getThemeUrl();
?>
/images/ad2.png">
	        </div>
	    </div>
	</div>
</div>
예제 #9
0
?>
	        </ul>
	    </div>	    
            <div class="tbox border">
                <div class="middleTitle3">
                    <h2><a href="xxx">图片新闻</a></h2>
                </div>
                <ul class="imgContent w120">
	                <?php 
$dataSource = DataSource::getContentByChannel(103, ['is_pic' => true, 'limit' => 4]);
echo LoopData::widget(['dataSource' => $dataSource, 'item' => 'item-img', 'length' => 19]);
?>
	        	
                </ul>
            </div>	    
	    <div class="tbox border dot">
	        <div class="middleTitle3">
	            <h2><a href="node_7183298.htm" target="_blank" class="">热点评论</a></h2>
	        </div>
	        <ul class="txtContent">
	        	<?php 
$dataSource = DataSource::getContentByChannel($chnid, ['order' => 'commonts desc']);
echo LoopData::widget(['dataSource' => $dataSource, 'length' => 19]);
?>
	        </ul>
	       
	    </div>	
	</div>
</div>

예제 #10
0
<div class="container fullColumn">
	<div class="bigTitle">
		<h2>
		<?php 
$channel = $this->getCachedChannels(104);
echo $channel['name'];
?>
</h2>
	</div>
	<div class="clear"></div>
	<div class="columnL">
		<ul class="uList dot">
			<li class="bold"><a href="http://china.cankaoxiaoxi.com/2014/0628/407597.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=1" target="_blank">陈政高任住建部部长 辽宁棚改模式或全国推广 </a></li>
			<?php 
$rows = DataSource::getContentByChannel(104);
foreach ($rows as $row) {
    ?>
			<li>
				<?php 
    echo Html::a($row['title'], ['content/detail', 'chnid' => $row['channel_id'], 'id' => $row['id']]);
    ?>
				<span class="time"><?php 
    TTimeHelper::showTime($row['publish_time'], 'm-d');
    ?>
</span></li>
			<?php 
}
?>
		</ul>	
	</div>
예제 #11
0
					</div>
					
				</div>
				<div class="listData dotDiv">
					<ul>
						<li class="bold-item"><a href="http://china.cankaoxiaoxi.com/2014/0628/407597.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=1" target="_blank">陈政高任住建部部长 辽宁棚改模式或全国推广 </a></li>
						<li><a href="http://world.huanqiu.com/exclusive/2014-06/5038885.html" mon="ct=1&amp;a=2&amp;c=top&pn=2" target="_blank">中国军舰钓岛附近搜救渔船 日战机赶往事发海域</a></li>
						<li><a href="http://china.cankaoxiaoxi.com/2014/0628/407598.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=3" target="_blank">中纪委通报许杰被开除党籍 罕见因渎职被追究 </a></li>
						<li><a href="http://politics.people.com.cn/n/2014/0628/c1001-25211633.html" mon="ct=1&amp;a=2&amp;c=top&pn=4" target="_blank">薄熙来案主审法官任最高法环境资源庭副庭长</a></li>
						<li><a href="http://www.vistastory.com/a/201406/1626.html" mon="ct=1&amp;a=2&amp;c=top&pn=5" target="_blank">国务院:公民将拥有统一社会信用代码 网上行为将入档</a></li>
						<li><a href="http://news.youth.cn/jsxw/201406/t20140628_5430673.htm" mon="ct=1&amp;a=2&amp;c=top&pn=6" target="_blank">解放军某军港附近现涉外会所 政府巨资收购拆除</a></li>
					</ul>
					<ul>
						<li class="bold-item"><a href="http://2014.baidu.com/" mon="ct=1&amp;a=2&amp;c=top&pn=7" target="_blank">世界杯16强产生</a>&nbsp;<a href="http://2014.baidu.com/" mon="ct=1&amp;a=2&amp;c=top&pn=7" target="_blank">世界杯小组赛数据榜最佳11人</a></li>
						<?php 
$dataSource = DataSource::getContentByChannel($channelIds);
?>
						<li><a href="http://2014.sina.com.cn/news/uru/2014-06-27/202016127.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=8" target="_blank">苏亚雷斯归国总统亲自欢迎</a>&nbsp;<a href="http://2014.sina.com.cn/news/uru/2014-06-27/192516118.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=8" target="_blank">意大利被咬大将:禁令过重</a></li>
						<li><a href="http://2014.sina.com.cn/news/por/2014-06-27/235716162.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=9" target="_blank">C罗世界杯惊魂!房间藏男人</a>&nbsp;<a href="http://2014.sina.com.cn/news/arg/2014-06-28/035316240.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=9" target="_blank">梅西太强!对手自嘲是坨屎</a></li>
						<li><a href="http://2014.sina.com.cn/news/ger/2014-06-28/031016229.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=10" target="_blank">德媒曝国脚家属团险遭空难</a>&nbsp;<a href="http://2014.sina.com.cn/news/nig/2014-06-27/184616110.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=10" target="_blank">未收到奖金!非洲雄鹰罢训</a></li>
						<li><a href="http://2014.sina.com.cn/news/mex/2014-06-28/015016181.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=11" target="_blank">世界杯5大女神</a>&nbsp;<a href="http://2014.sina.com.cn/news/arg/2014-06-27/173216097.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=11" target="_blank">最佳阵容:梅西内马尔</a>&nbsp;<a href="http://2014.sina.com.cn/news/fra/2014-06-28/000016163.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=11" target="_blank">八大争议</a></li>
						<li><a href="http://2014.sina.com.cn/news/spa/2014-06-28/021116187.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=12" target="_blank">数据析最大冷门非西班牙</a>&nbsp;<a href="http://2014.sina.com.cn/news/eng/2014-06-28/002016164.shtml" mon="ct=1&amp;a=2&amp;c=top&pn=12" target="_blank">英媒抨击杰拉德:就不该入选</a></li>
					</ul>
				</div>
			</div>
			
		</div>
		<div class="tbox ad">
			<img src="<?php 
echo LuLu::getWebUrl();
?>