Authored by tmq

bug

... ... @@ -37,7 +37,7 @@ class Controller_Onlinereg extends Controller_Abstract
public function mediaAction()
{
$this->_view['type'] = Facade_Onlinereg::TYPE_ONLINE_MEDIA;
$mediaTotal = Facade_Onlinereg::getDownloadTotalByType(Facade_Onlinereg::TYPE_ONLINE_MEDIA);
$mediaTotal = Facade_Onlinereg::getDownloadTotalByType(Facade_Onlinereg::TYPE_ONLINE_SPONSOR);
$this->_view['mediaTotal'] = $mediaTotal;
$this->setSession('yohood', 'type', Facade_Onlinereg::TYPE_ONLINE_MEDIA);
}
... ...
... ... @@ -61,142 +61,6 @@
</div>
<div class="overlay"></div>
<?php if(count($this->view->partnerList)):?>
<!-- 合作商等信息滑动条 start -->
<div class="cooperation clearfix">
<div class="cooperation-slide-warp">
<div class="cooperation-slide-box">
<div class="slide-wrap clearfix">
<?php
$partnerGroups = array();
foreach($this->view->partnerList as $partner)
{
foreach($this->view->partnerTypes as $key => $type)
{
// echo $key;
// echo $type;
// echo $partner['type'];
if($partner['type'] == $key)
{
$partnerGroups[$type][] = $partner;
// echo $partner;
}
}
}
$groupNum = 0;
$groupLen = 0;
$template = '';
$html = '';
foreach($partnerGroups as $type => $group)
{
foreach ($group as $key => $partner)
{
// echo $partner['name'];
$pic = Lib_Images::getImageUrl($partner['pic'], 'source','fragmentimg');
$html.= <<<EOL
<li>
<a href="{$partner['url']}" title="{$partner['name']}" target="_blank">
<img src="{$pic}" alt=""/>
</a>
</li>
EOL;
$groupLen ++;
if ($groupLen >= 8) {}
if($groupLen>= 16)
{
$templates[] ='<div class="{class}"><h2>'.$type.'</h2><hr><ul class="clearfix">'.$html.'</ul></div>';
$html = '';
$groupLen = 0;
$groupNum = 0;
}
}
if(!empty($html))
{
$templates[] ='<div class="{class}"><h2>'.$type.'</h2><hr><ul class="clearfix">'.$html.'</ul></div>';
$html = '';
}
$groupNum ++;
if($groupNum == 2 && !empty($html))
{
$templates[] ='<div class="{class}"><h2>'.$type.'</h2><hr><ul class="clearfix">'.$html.'</ul></div>';
$html = '';
$groupNum = 0;
$groupLen = 0;
}
}
foreach ($templates as $temp) {
preg_match_all("/<li>/i", $temp, $liLen, PREG_SET_ORDER);
if(count($liLen) > 8)
{
$temp = preg_replace('@<div class="(.*)">(.+)<\/div>@isU', "\\2", $temp);
$template .='<div class="box big-size clearfix">'.$temp.'</div>';
}
else
{
$temp = preg_replace('@<div class="(.*)">(.+)<\/div>@isU', "\\2", $temp);
$template .='<div class="box clearfix">'.$temp.'</div>';
}
}
// $pos = 0;
// foreach($templates as $temp)
// {
// if($pos % 2 == 0)
// {
// $temp = str_replace('{class}','partner', $temp);
// }
// else
// {
// $temp = str_replace('{class}','media', $temp);
// }
// preg_match_all("/<li>/i", $temp, $liLen, PREG_SET_ORDER);
// // echo '111';
// // echo $temp;
// // echo '2222';
// if(count($liLen) > 8)
// {
// $temp = preg_replace('@<div class="(\w+)">(.+)<\/div>@isU', "\\2", $temp);
// // echo '111';
// // echo $temp;
// // echo '222';
// $template .='<div class="box big-size clearfix">'.$temp.'</div>';
// $pos = -1;
// }
// else
// {
// if($pos % 2 == 0)
// {
// $template .='<div class="box clearfix">';
// }
// $template .= $temp;
// if(($pos+1) % 2 == 0)
// {
// $template .='</div>';
// }
// }
// $pos++;
// }
// if($pos % 2 == 1)
// {
// $template .='</div>';
// }
echo $template;
?>
</div>
</div>
<div class="cooperation-slide-control">
<a class="cooperation-slide-prev iconfont" href="javascript:void(0);">&#xe600;</a>
<a class="cooperation-slide-next iconfont" href="javascript:void(0);">&#xe602;</a>
</div>
</div>
</div>
<?php endif;?>
<!-- 合作商等信息滑动条 end -->
</div>
<?php $this->_endblock();?>
<?php $this->_block('js');?>
<script type="text/javascript">
... ...
... ... @@ -10,10 +10,10 @@
if(empty($tag['num'])) continue;
?>
<li <?php echo ($this->view->current_tag == $tag['tag']) ?'class="current"':''?>>
<!-- <a href="--><?php //echo url('news/index',array('tag' => $tag['tag']))?><!--">-->
<!-- --><?php //echo sprintf("%s(%s)", $tag['tag'] == '' ? '全部资讯': $tag['tag'], $tag['num']); ?>
<!-- </a>-->
<a href="<?php echo url('news/index',array('tag' => $tag['tag']))?>">
<?php echo sprintf("%s(%s)", $tag['tag'] == '' ? '全部资讯': $tag['tag'], $tag['num']); ?>
</a>
</li>
<?php endforeach;?>
</ul>
... ...
... ... @@ -9,7 +9,7 @@
<div class="submit-content">
<div class="page-header">
<a href="/onlinereg/media" class="active"><span>在线登记</span></a>
<?php if(!empty($this->mediaTotal)):?>
<?php if($this->view->mediaTotal !=0):?>
<a href="/onlinereg/mediadown" class="end"><span>新闻稿下载</span></a>
<?php endif;?>
</div>
... ...