本文整理汇总了PHP中cat_id函数的典型用法代码示例。如果您正苦于以下问题:PHP cat_id函数的具体用法?PHP cat_id怎么用?PHP cat_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cat_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
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']);
}
}
}
示例2: hits2art
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
示例3: cat2article
<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
示例4: eval
$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'];
示例5: cat2article
</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>
示例6: cat2article
<?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>
示例7: cat2article
<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;
?>
示例8:
?>
</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>
示例9: cat_id
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>
示例10: sub_cat
</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
示例11: rgba
?>
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">
示例12: createobject
$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]);
示例13: sub_cat
<?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>
示例14:
<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: site_nav
function site_nav()
{
$id = id();
$cat_id = cat_id();
$siteUrl = '';
$siteUrl .= '<a href="' . $_SESSION['siteUrl'] . '" >首页</a> > ';
$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> > ';
}
$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> > ';
}
}
return $siteUrl;
}