示例#1
0
 public function header()
 {
     $where['siteid'] = get_site_id();
     $res = CMS_M('web_baseinfo')->where($where)->select();
     foreach ($res as $key => $val) {
         if ($val['info_key'] == 'title') {
             $title = $val['info_val'];
             $id = id();
             $cat_id = cat_id();
             if (!empty($cat_id)) {
                 $all_parent = array();
                 get_single_parent($cat_id, $all_parent);
                 krsort($all_parent);
                 foreach ($all_parent as $single_Parent) {
                     if ($single_Parent['title'] == '') {
                         $title = $single_Parent['cat_name'] . ' - ' . $title;
                     } else {
                         $title = $single_Parent['title'] . ' - ' . $title;
                     }
                 }
             }
             if (!empty($cat_id) && !empty($id)) {
                 $top_parent_id = top_parent($cat_id);
                 $res = CMS_M('category')->where('category_id=' . $top_parent_id)->find();
                 $table = CMS_M('cm_table')->where('table_id=' . $res['module_id'])->find();
                 $table_name = $table['table_name'];
                 $table_m = CMS_M($table_name);
                 $table_m_pk = CMS_M($table_name)->getPk();
                 $art = CMS_M($table_name)->where($table_m_pk . '=' . $id)->find();
                 if ($art['title'] != '') {
                     $title = $art['title'] . ' - ' . $title;
                 }
             }
             $this->assign('seo_' . $val['info_key'], $title);
         } else {
             $this->assign('seo_' . $val['info_key'], $val['info_val']);
         }
     }
 }
    echo $artRow[article_id];
    ?>
"><?php 
    echo $artRow[title];
    ?>
</a></li>
        <?php 
}
?>
		</ol>
      </div>
      
      <div class="clicks">
        <h2>热门点击</h2>
		<?php 
$hits_art = hits2art(cat_id(), $num = 10);
?>
        <ol>
		<?php 
foreach ($hits_art as $hitsRow) {
    ?>
			<li><span><a href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $hitsRow['cat_id'];
    ?>
"><?php 
    echo $hitsRow['cat_name'];
    ?>
</a></span><a href="<?php 
<div class="site_yrl"><?php 
echo $site_nav;
?>
</div>

<div class="md30"></div>

<div class="single_center">
	<p class="mei_jian_title">美派新闻</p>
	<p class="mei_jian_title2">news</p>
	
	
	<div class="md50"></div>
	
	<?php 
$arts = cat2article(cat_id(), $is_all = 1, $num = 20, $order = 'no');
?>
	
	
	<div class="nes_ul">
		<?php 
foreach ($arts['lists'] as $art) {
    ?>
		<div class="new_li">
			<a href="<?php 
    echo CON_PATH;
    ?>
/<?php 
    echo $art[article_id];
    ?>
/cat_id/<?php 
                     $val = eval($val);
                     // echo "'$val'</p>";
                 }
                 if ($pattern[0] != '@' || $val) {
                     break;
                 }
             }
         }
     }
     $values[$info] = $val;
     $log .= "\t\t<td>{$val}</td>\n";
 }
 $empty = !count($values);
 // convert the category name to an id
 if ($values['cat'] && !is_numeric($values['cat'])) {
     $values['cat'] = cat_id($values['cat']);
 }
 // convert dates to timestamps
 foreach (array('datecreated', 'startdate', 'enddate', 'datemodified') as $date) {
     if (isset($values[$date]) && !is_numeric($date)) {
         if (ereg('(.*)\\.[0-9]+', $values[$date], $parts)) {
             $values[$date] = $parts[1];
         }
         $values[$date] = strtotime($values[$date]);
     }
 }
 if (!isset($values['datecreated'])) {
     $values['datecreated'] = $values['startdate'];
 }
 if (!isset($values['datemodified'])) {
     $values['datemodified'] = $values['datecreated'];
</a></li>
	<?php 
}
?>
	


</ul>
<div class="md20"></div>

<div class="pro_ge_f"></div>
<div class="md20"></div>


<?php 
$pros = cat2article($cat_id = cat_id(), $is_all = 1, $num = 50, $order = 'no');
?>
<ul class="pro_ul huodong_ul" style="min-height:400px;">
	

</ul>




<div class="md10"></div>


<div class="ajax_load" >
	<img id='newLoading' src='__PUBLIC__/statics/default/images/loading.gif' style="display:none"/>
</div>
						<?php 
}
?>
		
						</ul>
						<div class="clear"></div>
					</div>
					<div id="side_nav_bo_bg"></div>
				</div>
			</div>
			<div id="contact_con_right">
				<div id="contact_con_right_mid" style="margin-top:-3px;">
					
					<div id="contact_con_con">
					<?php 
$art = cat2article(cat_id());
?>
						<ul id="anli_list">
						<?php 
foreach ($art['lists'] as $key => $artRow) {
    ?>
							<li>
								<div class="anli_list_tit">
									<p class="anli_list_name_ch"><?php 
    echo $artRow['title'];
    ?>
</p>
									<p class="anli_list_name_eng"><?php 
    echo $artRow['eng_title'];
    ?>
</p>
      <p>电话:13662012345</p>
      <p>Email:dancesmiling@qq.com</p>
      <ul class="linkmore">
        <li><a href="/" class="talk" title="给我留言"></a></li>
        <li><a href="/" class="address" title="联系地址"></a></li>
        <li><a href="/" class="email" title="给我写信"></a></li>
        <li><a href="/" class="photos" title="生活照片"></a></li>
        <li><a href="/" class="heart" title="关注我"></a></li>
      </ul>
    </div>
  </div>
  <!--info end-->
  <div class="blank"></div>
  <div class="blogs">
   <?php 
$art = cat2article(cat_id(), 0);
?>
    <ul class="bloglist">
	<?php 
foreach ($art as $artRow) {
    ?>
	
      <li>
        <div class="arrow_box">
          <div class="ti"></div>
          <!--三角形-->
          <div class="ci"></div>
          <!--圆形-->
          <h2 class="title"><a href="<?php 
    echo CON_PATH;
    ?>
?>
</p>
	
	<div class="single_contetn" >
		<div class="md30"></div>
		<?php 
echo $art['lists'][0]['content'];
?>
		
		
		<div class="clear"></div>
	</div>
	<div class="clear"></div>
	
	<?php 
if (cat_id() == 109) {
    ?>

    <form action="__APP__/Content/liu_yan" method="post">
	<div class="formsub">
		<div class="form_left">
            <div class="input_row">
                <div class="input_label">姓名:</div>
                <input type="text" name="name"/>
            </div>

            <div class="input_row">
                <div class="input_label">电话:</div>
                <input type="text" name="tel"/>
            </div>
    echo 'cat_asdf_active';
}
?>
" href="__APP__/Content/lists/cat_id/107">美派新闻</a>
	</li>
</ul>


<div class="md20"></div>

<div class="pro_ge_f"></div>
<div class="md20"></div>

<div class="wingle_content">
<?php 
$ccate = cat_id();
?>

<?php 
$art = cat2article($ccate, $is_all = 1, $num = 1, $order = 'no');
?>

<P class="single_title"><?php 
echo $art['lists'][0]['title'];
?>
</P>
<div class="md10"></div>
<?php 
echo $art['lists'][0]['content'];
?>
</div>
		</div>
	</div>
	
	
	<div id="main_contact">
		<div id="main_contact_con">
			<img src="__PUBLIC__/statics/default/images/anli_bg1.jpg" />
			<div id="contact_con_left">
				<div id="side_nav_wrap">
					<div id="side_nav_con">
						<img id="about_tit" src="__PUBLIC__/statics/default/images/case_tit.png" />
						<?php 
$subcat = sub_cat(top_parent(cat_id()));
?>
						<ul id="side_nav2" cat_id="<?php 
echo cat_id();
?>
" >
						<?php 
foreach ($subcat as $subcatRow) {
    ?>
							<li cat_id="<?php 
    echo $subcatRow[category_id];
    ?>
" ><a href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $subcatRow[category_id];
    ?>
"><?php 
    ?>
 href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $value[category_id];
    ?>
" title="个人博客模板"><?php 
    echo $value['cat_name'];
    ?>
</a></li>
	  <?php 
}
?>
	  <li><a <?php 
if (19 == cat_id()) {
    echo 'style="color: #993333; background: rgba(20, 20, 20, 0.8); box-shadow: 0px 1px 0px rgba(255,255,255,.1), inset 0px 1px 1px rgba(0,0,0,.7); border-radius: 6px;"';
}
?>
 href="__APP__/Content/show_ex/cat_id/19" title="个人博客模板">案例</a></li>
    </ul>
    <script src="js/silder.js"></script><!--获取当前页导航 高亮显示标题--> 
  </nav>
</header>
<!--header end-->



<div id="mainbody" style="margin-bottom:36px;">
  <div class="blogs">
    <div id="index_view">
     $calendar = createobject('calendar.socalendar', array());
     $cal_owner = False;
 }
 if ($cal_owner != $values['owner']) {
     $calendar->open_box($cal_owner = $values['owner']);
 }
 // echo "<p>adding: ".dump_array($values)."</p>\n";
 $calendar->event_init();
 // set some reasonable defaults
 $calendar->set_recur_none();
 if ($values['priority'] < 1 || $values['priority'] > 3) {
     $values['priority'] = 2;
 }
 // convert the category name to an id
 if ($values['category'] && !is_numeric($values['category'])) {
     $values['category'] = cat_id($values['category']);
 }
 if (empty($values['title'])) {
     $values['title'] = '(' . lang('none') . ')';
 }
 foreach (array('owner', 'title', 'description', 'location', 'category', 'priority', 'public') as $name) {
     $calendar->add_attribute($name, $values[$name]);
 }
 if (!isset($values['modtime'])) {
     $values['modtime'] = $values['start'];
 }
 // convert dates to timestamps
 foreach (array('start', 'end', 'modtime') as $date) {
     if (isset($values[$date]) && !is_numeric($date)) {
         // convert german DD.MM.YYYY format into ISO YYYY-MM-DD format
         $values[$date] = ereg_replace('([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})', '\\3-\\2-\\1', $values[$date]);
    <?php 
$subcat = sub_cat(top_parent(cat_id()));
?>

    <?php 
foreach ($subcat as $subcatRow) {
    ?>
    <li><a href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $subcatRow[category_id];
    ?>
" class="fangan_ul_a_d <?php 
    if (cat_id() == $subcatRow['category_id']) {
        echo 'fangan_li_nor';
    }
    ?>
"><?php 
    echo $subcatRow['cat_name'];
    ?>
</a></li>
    <?php 
}
?>

</ul>

<div class="md30"></div>
<ul class="fangan_ul">

	<li><a href="__APP__/Content/lists/cat_id/105" class="fangan_ul_a_d <?php 
if (cat_id() == 105) {
    echo 'fangan_li_nor';
}
?>
">美派简介</a></li>
	<li><a href="__APP__/Content/lists/cat_id/106" class="fangan_ul_a_d <?php 
if (cat_id() == 106) {
    echo 'fangan_li_nor';
}
?>
">品牌背景</a></li>
	<li><a href="__APP__/Content/lists/cat_id/107" class="fangan_ul_a_d <?php 
if (cat_id() == 107) {
    echo 'fangan_li_nor';
}
?>
">美派新闻</a></li>
	<li><a href="__APP__/Content/lists/cat_id/105" class="fangan_ul_a_d">美国达泰瓷砖</a></li>
	<li><a href="__APP__/Content/lists/cat_id/105" class="fangan_ul_a_d">意大利马拉齐</a></li>

</ul>

<div class="md30"></div>



<div class="site_yrl"><?php 
echo $site_nav;
示例#15
0
文件: Cms.php 项目: huang81820/mycms
function site_nav()
{
    $id = id();
    $cat_id = cat_id();
    $siteUrl = '';
    $siteUrl .= '<a href="' . $_SESSION['siteUrl'] . '" >首页</a>&nbsp;>&nbsp;';
    $resList = array();
    if (empty($cat_id) && empty($id)) {
    } elseif (!empty($id) && !empty($cat_id)) {
        //内容页
        get_single_parent($cat_id, $resList);
        $top_parent = $resList[count($resList) - 1];
        krsort($resList);
        $module_id = $top_parent['module_id'];
        $table = CMS_M('cm_table')->where('table_id=' . $module_id)->find();
        $table_name = $table['table_name'];
        $con_m = CMS_M($table_name);
        $pk = $con_m->getPk();
        $res = CMS_M($table_name)->where($pk . '=' . $id)->find();
        foreach ($resList as $val) {
            $siteUrl .= '<a href="' . CAT_PATH . '/' . $val['category_id'] . '">' . $val['cat_name'] . '</a>&nbsp;>&nbsp;';
        }
        $siteUrl .= $res['title'];
    } elseif (empty($id) && !empty($cat_id)) {
        //分类页
        get_single_parent($cat_id, $resList);
        krsort($resList);
        foreach ($resList as $val) {
            $siteUrl .= '<a href="' . CAT_PATH . '/' . $val['category_id'] . '">' . $val['cat_name'] . '</a>&nbsp;>&nbsp;';
        }
    }
    return $siteUrl;
}
	<div id="main_contact">
		<div id="main_contact_con">
			<img src="<?php 
echo $origin_cat['thumb'];
?>
" />
			<div id="contact_con_left">
				<div id="side_nav_wrap">
					<div id="side_nav_con">
						<img id="about_tit" src="__PUBLIC__/statics/default/images/news_side_tit.png" />
						<ul id="side_nav2" cat_id="<?php 
echo cat_id();
?>
" >
							<?php 
$subcat = sub_cat(top_parent(cat_id()));
?>
							<?php 
foreach ($subcat as $subcatRow) {
    ?>
							<li cat_id="<?php 
    echo $subcatRow[category_id];
    ?>
"><a href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $subcatRow[category_id];
    ?>
"><?php 
    echo $subcatRow['cat_name'];
        <ul  class="nav_ul">
			
        	<li class="nav_li <?php 
if (is_index() == 1) {
    echo 'active_li';
}
?>
"><a href="__APP__/Content/index">首页</a></li>
            <li class="nav_li <?php 
if (cat_id() == 57 || cat_id() == 58 || cat_id() == 96 || cat_id() == 97 || cat_id() == 98) {
    echo 'active_li';
}
?>
"><a href="__APP__/Content/lists/cat_id/57">铺贴解决方案</a></li>
            <li class="nav_li <?php 
if (cat_id() == 102 || cat_id() == 100 || cat_id() == 101 || cat_id() == 103 || cat_id() == 104) {
    echo 'active_li';
}
?>
"><a href="__APP__/Content/lists/cat_id/102">优质产品</a></li>
            <li class="nav_li"><a href="#">网上商城</a></li>
            <li class="nav_li"><a href="__APP__/Content/lists/cat_id/109">加盟美派</a></li>
            <li class="nav_li"><a href="__APP__/Content/lists/cat_id/105">关于美派</a></li>
        </ul>
        </div>
    </div>
    <!--结束头部-->

    <div class="center_border">

		
		<a id="nav_btn" href="#"></a>
		
	</div>	
	<div class="position">
		<div class='position_con'>
			<?php 
echo $site_nav;
?>
		</div>
	</div>
	
	<div class="width96 martop20"  >
		<ul id="nor_txt_list">
			<?php 
$subcat = sub_cat(cat_id());
?>
			<?php 
foreach ($subcat as $subcatRow) {
    ?>
			<li><a href="<?php 
    echo CAT_PATH;
    ?>
/<?php 
    echo $subcatRow[category_id];
    ?>
"><?php 
    echo $subcatRow['cat_name'];
    ?>
</a></li>
			<?php 
					</div>
					<div id="side_nav_bo_bg"></div>
				</div>
			</div>
			<div id="contact_con_right">
				<div id="contact_con_right_mid">
					<div id="contact_tit">
						<span id="contact_tit_desc"><?php 
echo $list_cat_name;
?>
</span>
						<span id="contact_tit_btn"></span>
					</div>
					<div id="contact_con_con">
						<?php 
$art = cat2article(cat_id(), $is_all = 1, $num = 1);
?>
						<?php 
echo $art['lists'][0]['content'];
?>
					</div>
				</div>
				<div id="contact_con_right_bo"></div>
			</div>
		</div>
		



		
		
<?php 
if ($caty == 104) {
    ?>
<p class="list_pro_title">专家级产品</p>
	<p class="list_pro_title2">EXPERT LEVEL</p>
	<div class="md10"></div>
	<p class="list_pro_title3">专家级产品融合当代建筑审美及使用需求,用于多个世界著名建筑中。</p><?php 
}
?>


<div class="md20"></div>

<?php 
$pr_cat_id = cat_id();
$advertise_id = 0;
if ($pr_cat_id == 102) {
    $advertise_id = 4;
}
if ($pr_cat_id == 103) {
    $advertise_id = 5;
}
if ($pr_cat_id == 100) {
    $advertise_id = 6;
}
if ($pr_cat_id == 101) {
    $advertise_id = 7;
}
if ($pr_cat_id == 104) {
    $advertise_id = 8;