phpcms v9 邓士鹏(石家庄职业技术学院)
头部标题、关键词、描述调用:
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
外部css、js、img调用:{CSS_PATH}、{JS_PATH}、{IMG_PATH}
头部调用:{template "content","header"}
底部调用:{template "content","footer"}
导航首页链接:{$siteurl($siteid)}
首页栏目a标签 链接地址调用:{$CATEGORYS[9][url]}
首页详情链接:{$r[url]}
搜索调用:
第一步
<form action="{APP_PATH}index.php" method="get" target="_blank">
<div class="search">
<input type="hidden" name="m" value="search"/>
<input type="hidden" name="c" value="index"/>
<input type="hidden" name="a" value="init"/>
<input type="hidden" name="typeid" value="1" id="typeid"/>
<input type="hidden" name="siteid" value="{$siteid}" id="siteid"/>
<input type="text" class="fl a1" onfocus="if(this.value=='输入您想要的信息'){this.value='';}" onblur="if(this.value==''){this.value='输入您想要的信息';}" value="输入您想要的信息" name="q" id="q"/>
<input type="submit" value="" class="tijiao fl a2" value=""/>
</div>
</form>
第二步
修改Search文件中的header和footer
Header中所有date需要修改
{pc:get sql="select * from v9_page where catid=25" return="data2"}
{loop $data2 $r}
第三步
替换list文件
导航下拉调用:
(方法一):
<ul>
<li><a href="{$siteurl($siteid)}">首页</a></li>
{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
{loop $data $n $r}
<li>
<a href="{$r[url]}">{$r[catname]}</a>
<ul>
{if $r[catid]==1 || $r[catid]==9 || $r[catid]==10 || $r[catid]==11 || $r[catid]==12}
{pc:get sql="select * from v9_category where parentid=$r[catid] order by listorder asc"}
{loop $data $n $s}
<li><a href="{$s[url]}">{$s[catname]}</a></li>
{/loop}
{/pc}
{/if}
</ul>
</li>
{/loop}
{/pc}
</ul>
(方法二):
<ul id=nav>
<li class="dangqian" ><a href="{$siteurl($siteid)}">网站首页</a></li>
{pc:content action="category" catid="0" siteid="$siteid" order="listorder asc" num="6"}
{loop $data $n $r}
<li><a href="{$r[url]}">{$r[catname]}</a>
{if $r[catid]==9 || $r[catid]==11 || $r[catid]==12 || $r[catid]==13}
<ul>
{pc:content action="category" catid="$r[catid]" siteid="$siteid" order="listorder asc"}
{loop $data $n $s}
<li><a href="{$s[url]}">{$s[catname]}</a></li>
{/loop}
{/pc}
</ul>
{else}
{if $r[catid]==10}
<ul>
{pc:content action="category" catid="$r[catid]" siteid="$siteid" order="listorder asc"}
{loop $data $n $s}
<li><a href="{$s[url]}">{$s[catname]}</a></li>
<li><a href="">携手金德</a></li>
<li><a href="">直播间</a></li>
{/loop}
{/pc}
</ul>
{/if}
{/if}
</li>
{/loop}
{/pc}
<div class="clearfix"></div>
</ul>
banner调用:
(一)
<ul id="slides">
{pc:content action="lists" catid="15" moreinfo="1" thumb="" num="10" order="listorder desc"}
{loop $data $n $r}
<li style="background:url('{$r[tusrc]}') no-repeat center top">
<a href="{$siteurl($siteid)}" target="_blank"></a></li>
{/loop}
{/pc}
</ul>
(二)第一张图和其余两张图样式不一样
{pc:content action="lists" catid="20" num="3" order="listorder desc" moreinfo="1"}
{loop $data $r}
<div {if $n==1}class="item active"{else}class="item"{/if}>
<img src="{$r[thumb]}" alt="First slide">
</div>
{/loop}
{/pc}
从第2条开始调用:
{pc:content action="lists" catid="6" order="id DESC LIMIT 1,8--" thumb="" moreinfo="1" }
{loop $data $n $r}
<li><span style="float:right">[{date('Y-m-d',"$r[inputtime]")}]</span><a href="{$r[url]}" title="{$r[title]}">{$r[title]}</a></li>
{/loop}
{/pc}
首页缩略图调用,如果没有缩略图其它图片代替:
<img src="{if $r[thumb]}{$r[thumb]}{else}{IMG_PATH}nopic.gif{/if}" width="161" height="107">
缩略图:<img src="{$r[thumb]}" width="225" height="161"/>
产品栏目名称调用:
{loop subcat(9,0,0,$siteid) $r}
<a href="{$r[url]}">{$r[catname]}</a>
{/loop}
文字友情链接:
{pc:link action="type_list" siteid="1" linktype="0" order="listorder DESC" num="8" }
{loop $data $n $r}
<a href="{$r[url]}" target="_blank">{$r[name]}</a>|
{/loop}
{/pc}
图片友情链接:
{pc:link action="type_list" siteid="$siteid" linktype="1" order="listorder DESC" num="8" return="pic_link"}
{loop $pic_link $v}
<li><a href="{$v['url']}" title="{$v['name']}" target="_blank"><img src="{$v[logo]}" width="88" height="31" /></a></li> {/loop}
{/pc}
栏目描述调用:{$CATEGORYS[$catid][description]}
栏目名称调用:{$CATEGORYS[$catid][catname]} 栏目父级名称调用:{$CATEGORYS[$parentid][catname]}
栏目图片调用:{$CAT[image]}或{$CATEGORYS[$CAT[parentid]][image]}或{$CATEGORYS[$catid][image]}
面包屑:<a href="{siteurl($siteid)}">首页</a> > {catpos($catid)}
{catpos($catid)} 显示文章位置导航
{$CATEGORYS[$catid][url]} 显示当前栏目链接
单页面内容调用:
{pc:get sql="select * from v9_page where catid=$catid"}
{loop $data $n $r}
{$r[content]}或{str_cut(strip_tags($r['content']),"300","…")}或{str_cut(strip_tags($r['content']),"300"," ")}
{/loop}
{/pc}
栏目子栏目名称调用:(方法一)
{pc:get sql="select * from v9_category where parentid=21"}
{loop $data $n $s}
<li><a href="{$s[url]}">{$s[catname]}<span class="pull-right">></span></a></li>
{/loop}
{/pc}
(方法二)
{pc:content action="category" catid="10" num="5" siteid="$siteid" order="id ASC"}
{loop $data $r}
<li><div class="data-link"><a href="{$r[url]}" >{$r[catname]}</a></div></li>
{/loop}
{/pc}
(方法三)
{pc:get sql="select * from v9_category where catid in(76)" return="data"}
{loop $data $r}
<div>
<a href="index.php?m=wap&a=page&catid=76"><img src="{thumb($r[image],220,200,1)}" /></a>
</div>
<div class="hkfwcontent">
<a class="nr" href="index.php?m=wap&a=page&catid=76">
<span>{$r[catname]}</span>
<p id="wrap">{$r['description']}</p>
</a>
</div>
{/loop}
{/pc}
(方法四)
<div class="left_nr">
<div class="cpfw">
<img src="{IMG_PATH}nav_bj01.jpg" />
<p>{$CATEGORYS[$CAT[parentid]][catname]}</p>
<p class="yingyu">{$CATEGORYS[$CAT[parentid]][description]}</p>
</div>
<ul class="sub_nav">
{pc:content action="category" catid="$parentid" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<a href="{$r[url]}"><li>{$r[catname]}</li></a>
<div style="height:1px; width:230px; </div>
{/loop}
{/pc}
</ul>
</div>
公用频道页调用子栏目:
<div class="leftnav">
<ul>
{pc:content action="category" catid="$catid" siteid="$siteid" order="listorder asc"}
{loop $data $k $r}
<li {if $n==1} class="dangqianye"{/if}><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
公用列表页调用子栏目:
<div class="leftnav">
<ul>
{pc:content action="category" catid="$parentid" siteid="$siteid" order="listorder asc"}
{loop $data $n $r}
<li {if $catid==$r[catid]} class="dangqianye"{/if}><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
列表页标题内容调用:
{pc:content action="lists" catid="$catid" num="16" order="id DESC"或order="listorder desc" moreinfo="1" page="$page"}
<ul class="u1">
{loop $data $r}
<li><span>{date('Y-m-d',$r[inputtime])}</span><a href="{$r[url]}" target="_blank" {title_style($r[style])}>{$r[title]}</a> <a href="{$r['url']}"><img src="{$r[thumb]}" width="155" height="115" class="fl"/></a></li>
<p>{str_cut(strip_tags($r['content']),"250","…")}</p>
{/loop}
</ul>
<div id="pages" class="text-c">{$pages}</div>
{/pc}
文章标题:{$title} 文章内容:{$content} 摘要{$r['description']} 关键字:{$keywords}
时间:{$inputtime} 来源:{$copyfrom} 评论:<a href="#comment_iframe" id="comment">0</a> 点击:<script type="text/javascript" src="{JS_PATH}jquery.min.js"></script>
<b id="hits" style="font-weight:normal;></b>
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
上下篇:
<strong>上一篇:</strong><a href="{$previous_page[url]}">{$previous_page[title]}</a><br />
<strong>下一篇:</strong><a href="{$next_page[url]}">{$next_page[title]}</a>
相关文章调用:
{pc:content action="relation" relation="$relation" id="$id" catid="$catid" num="5" keywords="$rs[keywords]"}
{loop $data $r}
<li><a href="{$r[url]}" target="_blank">{str_cut($r[title],32,'')}<i>({date('Y-m-d',$r[inputtime])})</i></a></li>
{/loop}
{/pc}
列表页内容随机调用:
{pc:content action="lists" catid="$catid" num="8" order="rand()" return="info"}
<ul class="list lh24 f13">
{loop $info $v}
<li><a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{$v['title']}</a></li>
{/loop}
</ul>
{/pc}
加入浏览器收藏:
(一)
<a href="javascript:;" onclick="AddFavorite();">加入收藏</a>
<script language="javascript">
//加入收藏夹,兼容多种浏览器
function AddFavorite(sURL, sTitle)
{
try{window.external.addFavorite(sURL, sTitle);}
catch (e)
{
try{window.sidebar.addPanel(sTitle, sURL, "");}
catch (e){alert("加入收藏失败,请使用Ctrl+D进行添加");}
}
}
//设置为首页
function SetHome(obj,vrl){
try{obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);}
catch(e){
if(window.netscape) {
try {netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}
catch (e) {alert("此操作被浏览器拒绝!\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',vrl);
}
}
}
</script>
(二)
<ahref="http://hbwlpv.com/"onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('{siteurl($siteid)}');">设为首页</a>|
<a href="http://hbwlpv.com/" onclick="javascript:window.external.AddFavorite('http://hbwlpv.com/','安徽卧龙泵阀公司')">加入收藏</a>
phpcmsv9首页头条推荐:
(一)
{pc:content action="position" posid="2" order="listorder DESC" num="1"}
{loop $data $r}
<img src=" src="{$r[thumb]}" title="{$r[title]}" src="{$r[title]}">
<div class="headlinetop"> <a href="{$r[url]}" target="_blank">
<h3>{str_cut($r[title],20,'')}</h3>
<p>{str_cut($r[description],102)}</p>
</a> </div>
{/loop}
{/pc}
(二)
{pc:content action="position" posid="2" catid="33" order="listorder ASC" num="3"}
{loop $data $r}
<li>
<a href="{$CATEGORYS[$r[catid]][url]}" class="fwlist_a22">{$CATEGORYS[$r[catid]][catname]} </a>
<p class="fwlist_p2">{$r[title]}</p>
<img src="{$r[thumb]}" width="284" height="156"/></a>
</li>
{/loop}
{/pc}
<!--单个调用关键字列表-->
<span>此文关键字:</span>
{loop $keywords $keyword}
<li><a href="{APP_PATH}index.php?m=content&c=tag&catid={$catid}&tag={urlencode($keyword)}" class="blue">{$keyword}</a></li>
{/loop}
调用子级栏目内容:
(方法一)
{php $j=1;}
{loop subcat($catid) $v}
{php if($v['type']!=0) continue;}
{pc:content action="lists" catid="$v[catid]" order="inputtime DESC"}
{loop $data $v}
<img src="{$v[thumb]}" width="155" height="115" class="fl"/>
{/loop}
{/pc}
{$j++}
{/loop}
(方法二)
{pc:content action="category" catid="26" siteid="$siteid" order="id ASC"}
{loop $data $r}
<dl class="am-accordion-item ">
<dt class="am-accordion-title servce_dt" >
{$r[catname]}<i class="icon_acd"></i>
</dt>
<dd class="am-accordion-bd am-collapse servce_dd1">
{pc:content action="lists" catid="$r[catid]" order="listorder asc" moreinfo="1"}
{loop $data $v}
<div class="am-accordion-content">
<h5 class="ac_con_q0"><i class="icon_acd"></i>{$v[title]}</h5>
<div class="ac_con_answer ac_con_a0">{$v[content]}</div>
</div>
{/loop}
{/pc}
</dd>
</dl>
{/loop}
{/pc}
调用留言内容:
{pc:get sql="select * from v9_form_fankui" num="4" page="$page"}
{loop $data $n $r}
<table width="700" border="0" cellpadding="0" cellspacing="0" class="bkk">
<tbody>
<tr>
<td width="499" height="25" background="{IMG_PATH}bgly.jpg" class="wenzi12"> 姓名:<font color="#3399FF"><b>{$r[name]}</b></font></td>
<td width="247" background="{IMG_PATH}bgly.jpg" class="wenzi12"><span class="wz1">发表时间:{date("Y-m-d","$r[datetime]")}</span></td>
</tr>
<tr>
<td height="41" colspan="2" background="{IMG_PATH}xian.JPG" class="wz13"> {$r[content]} </td>
</tr>
<tr>
<td height="25" colspan="2" background="{IMG_PATH}xian.JPG" class="hf">回复内容:{$r[answer]} <br></td>
</tr>
</tbody>
</table>
<br>
{/loop}
{/pc}
标题选中状态:
1、指定id:
<div class="vidnav">
<ul>
<li><a href="{$CATEGORYS[13]['url']}" {if $catid==13 }class="a_hover"{/if}>全部</a></li>
{pc:content action="category" catid="13" num="25" order="listorder ASC"}
{loop $data $r}
<li><a {if $catid==$r[catid]}class="a_hover"{/if} href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
2、一级栏目:
头部(频道页、列表页、详情页共同):
<div class="mainnav">
<ul id=nav>
<li {if !$catid} class="dangqian"{/if}><a href="{$siteurl($siteid)}">网站首页</a></li>
{pc:content action="category" catid="0" siteid="$siteid" order="listorder asc" num="6"}
{loop $data $n $r}
<li {if $catid==$r[catid]||$parentid==$r[catid]||$top_parentid==$r[catid]} class="dangqian"{/if}>
<a href="{$r[url]}">{$r[catname]}</a>
</li>
{/loop}
{/pc}
<div class="clearfix"></div>
</ul>
</div>
左侧导航:
<div class="leftnav">
<ul>
{pc:content action="category" catid="7 " siteid="$siteid" order="listorder asc"}
{loop $data $n $r}
<li {if $catid==$r[catid]||$parentid==$r[catid]||$CAT[parentid]==$r[catid]}class="dangqian"{/if}>
<ahref="{$r[url]}">{$r[catname]}</a>
</li>
{/loop}
{/pc}
</ul>
</div>
3、频道页选中一级栏目和相应的第一个二级栏目:
头部一级栏目代码:
<ul id=nav>
<li {if !$catid} class="dangqian"{/if}><a href="{$siteurl($siteid)}">网站首页</a></li>
{pc:content action="category" catid="0" siteid="$siteid" order="listorder asc" num="6"}
{loop $data $n $r}
<li {if $catid==$r[catid]} class="dangqian"{/if}><a href="{$r[url]}">{$r[catname]}</a>
</li>
{/loop}
{/pc}
<div class="clearfix"></div>
</ul>
左侧子栏目代码:
<div class="leftnav">
<ul>
{pc:content action="category" catid="$catid" siteid="$siteid" order="listorder asc"}
{loop $data $k $r}
<li {if $n==1} class="dangqianye"{/if}><a href="{$r[url]}"> {$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
4、列表页选中当前子栏目和相应的一级栏目:
头部一级栏目代码:
<ul id=nav>
<li {if !$catid} class="dangqian"{/if}><a href="{$siteurl($siteid)}">网站首页</a></li>
{pc:content action="category" catid="0" siteid="$siteid" order="listorder asc" num="6"}
{loop $data $n $r}
<li {if $r[catid]==$parentid} class="dangqian"{/if}><a href="{$r[url]}">{$r[catname]}</a>
</li>
{/loop}
{/pc}
<div class="clearfix"></div>
</ul>
左侧子栏目代码:
<div class="leftnav">
<ul>
{pc:content action="category" catid="$parentid" siteid="$siteid" order="listorder asc"}
{loop $data $n $r}
<li {if $parentid ==$r[catid]} class="dangqianye"{/if}><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
5、详情页选中当前子栏目和相应的一级栏目:
头部一级栏目代码:
<ul id=nav>
<li {if !$catid} class="dangqian"{/if}><a href="{$siteurl($siteid)}">网站首页</a></li>
{pc:content action="category" catid="0" siteid="$siteid" order="listorder asc" num="6"}
{loop $data $n $r}
<li {if $catid==$r[catid] || $top_parentid==$r[catid]} class="dangqian"{/if}>
<a href="{$r[url]}">{$r[catname]}</a>
</li>
{/loop}
{/pc}
<div class="clearfix"></div>
</ul>
左侧子栏目代码:
<div class="leftnav">
<ul>
{pc:content action="category" catid="$top_parentid" siteid="$siteid" order="listorder asc"}
{loop $data $n $r}
<li {if $catid==$r[catid]} class="dangqianye"{/if}><a href="{$r[url]}">{$r[catname]}</a></li>
{/loop}
{/pc}
</ul>
</div>
6、如果头部栏目不是调用,则选中状态需要写固定的id号:
<div class="mainnav">
<div class="content">
<ul>
<li {if !$catid} class="dangqian"{/if}><a href="{$siteurl($siteid)}"><img src="{IMG_PATH}shouye.png" /></a></li>
<li {if $catid==9}class="dangqian"{/if}><a href="{$CATEGORYS[9][url]}"><img src="{IMG_PATH}gybz.png" /></a></li>
<li {if $catid==10}class="dangqian"{/if}><a href="{$CATEGORYS[10][url]}"><img src="{IMG_PATH}zzjs.png" /></a></li>
<li {if $catid==11}class="dangqian"{/if}><a href="{$CATEGORYS[11][url]}"><img src="{IMG_PATH}czal.png" /></a></li>
<li {if $catid==12}class="dangqian"{/if}><a href="{$CATEGORYS[12][url]}"><img src="{IMG_PATH}ycwz.png" /></a></li>
<li {if $catid==13}class="dangqian"{/if}><a href="{$CATEGORYS[13][url]}"><img src="{IMG_PATH}qqfl.png" /></a></li>
<li {if $catid==14}class="dangqian"{/if}><a href="{$CATEGORYS[14][url]}"><img src="{IMG_PATH}tszs.png" /></a></li>
<li {if $catid==15}class="dangqian"{/if}><a href="{$CATEGORYS[15][url]}"><img src="{IMG_PATH}qqpx.png" /></a></li>
<li {if $catid==16}class="dangqian"{/if}><a href="{$CATEGORYS[16][url]}"><img src="{IMG_PATH}flyz.png" /></a></li>
<li {if $catid==17}class="dangqian"{/if}><a href="{$CATEGORYS[17][url]}"><img src="{IMG_PATH}bztj.png" /></a></li>
<li {if $catid==18}class="dangqian"{/if}><a href="{$CATEGORYS[18][url]}"><img src="{IMG_PATH}zxly.png" /></a></li>
<li {if $catid==19}class="dangqian"{/if}><a href="{$CATEGORYS[19][url]}"><img src="{IMG_PATH}lxwm.png" /></a></li>
</ul>
</div>
</div>
调用服务器时间(当前时间)的新闻:
{pc:content action="lists" catid="37" order="listorder desc" moreinfo="1"}
{loop $data $r}
<!-- <?php echo date('Y-m-d',$r[inputtime])?>
<?php echo date('Y-m-d',time())?> -->
{php $now=date('Y-m-d',time());}
{if date('Y-m-d',time())==date('Y-m-d',$r[inputtime])}
<tr>
<th>{$r[shijian]}</th>
<th>{$r[title]}</th>
<th>{$r[zhibiaomingcheng]}</th>
<th>{$r[qianzhi]}</th>
<th>{$r[yucezhi]}</th>
<th>{$r[gongbuzhi]}</th>
<th>{date('Y-m-d',$r[inputtime])}</th>
</tr>
{else}
<tr>
<th>今天暂无公告!</th>
<th></th>
<th></th>
</tr>
{/if}
{/loop}
{/pc}
邮箱的连接:<a href="mailto:boss@mail.com" >联系我们</a>
QQ的链接:
<a href="http://wpa.qq.com/msgrd?v=3&uin=946780264&site=www.cactussoft.cn&menu=yes" target="_blank" title="点击这里给我发消息" >客服</a>
列表页左侧子栏目链接不同:
{pc:content action="category" catid="$catid" siteid="$siteid" order="listorder asc"}
{loop $data $n $r}
{if $r[catid]==29}
<a href="{$CATEGORYS[33][url]}" target="_self" class="productclass_dolphin">{$r[catname]}</a>
{elseif $r[catid]==30}
<a href="{$CATEGORYS[32][url]}" target="_self" class="productclass_dolphin">{$r[catname]}</a>
{else}
<a href="{$r[url]}" target="_self" class="productclass_dolphin">{$r[catname]}</a>
{/if}
{/loop}
{/pc}
频道页内容部分默认选中第一个子栏目的内容:
(单页面)
{pc:content action="category" catid="$catid" num="25" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
{if $n==1}
{pc:get sql="SELECT * FROM jk_page where catid=$r[catid]"}
{loop $data $key $val}
{$val[content]}
{/loop}
{/pc}
{/if}
{/loop}
{/pc}
多图字段图片和名称的调用:
一、列表页调用:
方法一(自定义):
{pc:content action="lists" catid="$catid" order="listorder DESC" moreinfo="1"}
{loop $daibiaozuo $pic_k $r}
<li>
<img src="{$r[url]}" width="357" height="202">
<div class="xgt">
<span>{$r[alt]}</span>
</div>
</li>
{/loop}
{/pc}
方法二(组图字段):
{pc:content action="lists" catid="23" moreinfo="1" order="listorder desc"}
{loop $data $n $r}
<h3>{$r[title]}</h3>
<p>{$r[content]}</p>
<div class="clear"></div>
<div class="fourimg">
<ul>
{loop string2array($r['pictureurls']) $pic_k $v}
<li><img src="{thumb($v[url],381,246)}"></li>
{/loop}
</ul>
<div class="clear"></div>
</div>
<div class="clear"></div>
{/loop}
{/pc}
二、任意页面调用自定义字段多图:
{pc:content action="lists" catid="$catid" num="1" order="id ASC" moreinfo="1" }
{loop $data $v}
<h1>{$v[title]}</h1>
<ul class="topList-con">
{loop string2array($v['pictureurls']) $pic_k $r}
<li>
<div class="item">
<div class="imgBox"><img src="{thumb($r[url],350,200)}" width="350" height="200" alt="{$r[alt]}"/></div>
<div class="img_title">{$r[alt]}</div>
</div>
</li>
{/loop}
</ul>
{/loop}
{/pc}
加到会员个人中心的收藏:
<span id='favorite'>
<a href="javascript:;" onclick="add_favorite('{addslashes($title)}');" class="t6">收藏</a>
</span>
<script language="javascript">
//加入收藏夹,兼容多种浏览器
function add_favorite(title) {
$.getJSON('{APP_PATH}api.php?op=add_favorite&title='+encodeURIComponent(title)+'&url='+encodeURIComponent(location.href)+'&'+Math.random()+'&callback=?', function(data){
if(data.status==1) {
// $("#favorite").html('收藏成功');
alert('收藏成功!请到个人中心查看');
} else {
alert('请登录');
}
});
}
</script>
新闻类频道页调用子分类名称和对应分类下的内容:
<div class="tabox">
<div class="hd">
<ul>
{pc:content action="category" catid="$catid" num="2" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<li>{$r[catname]}</li>
{/loop}
{/pc}
</ul>
</div>
<div class="bd">
{pc:content action="catgory" catid="$catid" order="listorder desc" moreinfo="1"}
{loop $data $n $r}
<ul class="lh" style="display: none;">
{pc:content action="lists" catid="$r[catid]" order="listorder desc" moreinfo="1" num="10" page="$page"}
<li>
{loop $data $n $s}
<div class="one">
<span><a href="{$s[url]}">{$s[title]}</a></span>
<p><a href="{$s[url]}" >{str_cut(strip_tags($s[content]),"200")}<font style="color:#FF6600"><更多></font></a></p>
</div>
{/loop}
</li>
<div class="page_con">{$pages}</div>
{/pc}
</ul>
{/loop}
{/pc}
</div>
</div>
同一个模板根据不同catid显示不同的表单:
{if $catid==12}
<form method="post" action="index.php?m=formguide&c=index&a=show&formid=15&siteid=1" name="myform" id="myform">
<p>姓名:<input type="text" value="" name="info[name]" id="name"></p>
<p>电话:<input type="text" value="" name="info[phone]" id="phone"></p>
<p id="jl">写下您的工作经历吧:<textarea name='info[content]' id='content'></textarea></p>
<input id="qdtj" type="submit" value="确定提交" name="dosubmit" id="dosubmit">
</form>
{else}
<form method="post" action="index.php?m=formguide&c=index&a=show&formid=16&siteid=1" name="myform" id="myform">
<p>姓名:<input type="text" value="" name="info[name]" id="name"></p>
<p>电话:<input type="text" value="" name="info[phone]" id="phone"></p>
<p id="ly">请写下您的留言吧:<textarea></textarea></p>
<input id="qdtj" type="submit" value="确定提交" name="dosubmit" id="dosubmit">
</form>
{/if}
频道页一级栏目自动跳转到其下的第一个子栏目:
<?PHP
if($child){
$child_arrary=explode(',',$arrchildid);
$to_url=$CATEGORYS[$child_arrary[0]][url];
echo "<script>window.location.href='".$to_url."'</script>";
}
?>
phpcms v9 调用当前栏目标签代码汇总
当前栏目id: {$catid}
当前栏目名: {$CATEGORYS[$catid][catname]}
当前栏目目录名: {$CATEGORYS[$catid][catdir]}
当前栏目url: {$CATEGORYS[$catid][url]}
当前栏目位置(面包屑导航): 首页 > {catpos($catid)} 正文
当前栏目描述: {$CATEGORYS[$catid][description]}
当前栏目图片:
当前栏目的内容数: {$CATEGORYS[$catid][items]}
当前栏目的点击数: {$CATEGORYS[$catid][hits]}
当前栏目的上级栏目id: {$CATEGORYS[$catid][parentid]}
新闻列表页前两条显示“靠谱”两字:
{pc:content action="lists" catid="$catid" num="4" order="listorder desc" moreinfo="1" page="$page" return="info"}
{php $j='靠谱';}
<ul class="nlwrap">
{loop $info $r}
{php $num++}
{if $num<=2}
<li><span style="color:blue;">{php echo $j}</span>
<a href="{$r[url]}">{$r[title]}</a>
<span>{date('Y-m-d',$r[inputtime])}</span>
<p>{str_cut(strip_tags($r[content]),"400")}</p>
<a href="{$r[url]}">查看详情>></a>
</li>
{else}
<li>
<a href="{$r[url]}">{$r[title]}</a>
<span>{date('Y-m-d',$r[inputtime])}</span>
<p>{str_cut(strip_tags($r[content]),"400")}</p>
<a href="{$r[url]}">查看详情>></a>
</li>
{/if}
{/loop}
</ul>
<div class="seppage">
{$pages}
</div>
{/pc}
产品分类页间隔行样式相同并且每类小图标不同(小图标命名从1开始,例如1.png):
{pc:content action="category" catid="$catid" order="listorder asc" moreinfo="1"}
{loop $data $r}
{if $n%2!==0}
<div class="cpzx_c1">
<div class="cpl"><img src="{$r[image]}"></div>
<div class="cpr">
<ul>
<li><img src="{IMG_PATH}{$n}.png"> <span>{$r[catname]}</span></li>
<li><p>{$r[description]}</p></li>
<li><a href="{$r[url]}"><input type="button" value="查看更多"></a></li>
</ul>
</div>
</div>
{else}
<div class="cpzx_c2">
<div class="cp2l">
<ul>
<li><img src="{IMG_PATH}{$n}.png"> <span>{$r[catname]}</span></li>
<li><p>{$r[description]}</p></li>
<li><a href="{$r[url]}"><input type="button" value="查看更多"></a></li>
</ul>
</div>
<div class="cp2r"><img src="{$r[image]}"></div>
</div>
{/if}
{/loop}
{/pc}
轮播图id号从零自增,第一张图显示其余隐藏:
{pc:content action="lists" catid="15" order="listorder desc" moreinfo="1"}
{php $j=-1}
{loop $data $r}
{php $j++}
{if $j==0}
<a target="_blank" href="{$r[url]}"><img src="{$r[thumb]}" border="0" class="photorollx3_dolphinpic" id="photorollx3_dolphinpic_{$j}" style="display: inline; width:199px; height:134px; "></a>
{else}
<a target="_blank" href="{$r[url]}"><img src="{$r[thumb]}" border="0" class="photorollx3_dolphinpic" id="photorollx3_dolphinpic_{$j}" style="display: none; width:199px; height:134px; "></a>
{/if}
{/loop}
{/pc}
实现首页、列表页调用浏览量:
1、Phpcms v9首页调用点击量
{pc:content action="lists" catid="$r[catid]" num="5" order="id DESC" return="info"}
{php $categorys = getcache('category_content_'.$siteid,'commons');}
<ul class="list lh24 f14">
{loop $info $v}
{php $category = $categorys[$v[catid]];}
{php $modelid = $category['modelid'];}
{php $db = pc_base::load_model('hits_model'); $_r = $db->get_one(array('hitsid'=>'c-'.$modelid.'-'.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class("comment_tag", "comment"); $comment_total = $comment_tag->count(array('commentid'=>'content_'.$v[catid].'-'.$v[id].'-'.$modelid));}
<li>·<a href="{$v['url']}" target="_blank" title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],40)}</a> 点击:{$views} 评论:{if $comment_total}{$comment_total}{else}0{/if}</li>
{/loop}
</ul>
{/pc}
2、Phpcms v9列表页调取点击量
{php $db = pc_base::load_model(‘hits_model’); $_r = $db->get_one(array(‘hitsid’=>’c-’.$modelid.’-’.$r[id])); $views = $_r[views]; }
点击:{$views}
网站头部显示当前时间:
<div style="color:#ce8e8e">
欢迎光临,现在是
<label id="nnowdate"></label>
<script>
setInterval("document.getElementById('nnowdate').innerHTML=new Date().toLocaleString().substring(0,10) + ' ' + new Date().toLocaleTimeString();",1000);
</script>
</div>
列表页调用产品浏览量和没有产品浏览过其他的内容:
<div class="aboutrig right">
<p class="titl"><a href="/"> 首页</a> >{catpos($catid)}</p>
<div class="clearfix nelistya">
<ul class="clearfix">
{pc:content action="lists" catid="$catid" order="listorder DESC" page="$page" num="15"}
{loop $data $r}
{php $h_md=pc_base::load_model('hits_model');$get_db=$h_md->get_one(array('hitsid'=>"c-".$modelid."-".$r[id]));$views=$get_db[views];}
<li class="clearfix"><b class="okb2"></b><a href="{$r[url]}" class="left" >{$r[title]}</a><span class="right">[{date("Y-m-d",$r[inputtime])}](点击<strong>{$views}</strong>)</span></li>
{/loop}
</ul>
<div class=" clear pagee">
<p>{$pages}</p>
</div>{/pc}
</div>
<div class="xiangguan">
<span style="margin-left: 18px;">浏览过本站的还浏览了</span>
{php $aa=array(18,20,41,44,19,17,43,42,45,21,22,46);}
{php $bb= rand(0,11);}
{php $cc= $aa[$bb];}
{pc:content action="lists" catid="$cc" moreinfo="1" thumb="" num="4" return="info"}
<ul>
{loop $info $v}
<li><a href="{$v[url]}" title="{$v[title]}"><img src="{$v[thumb]}" width="150" height="110" alt="{$v[title]}" /></a><div><a href="{$v[url]}">{str_cut("$v[title]","34","…")}</a></div></li>
{/loop}
</ul>
{/pc}
</div>
</div>
站长统计
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1264511182'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/stat.php%3Fid%3D1264511182%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));</script>
排序
listorder DESC,inputtime desc,id DESC
111111111111111111111111111111
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=897089630&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:897089630:52" alt="点击这里给我发消息" title="点击这里给我发消息"/></a>
标题
<h3>{$CATEGORYS[103][catname]}</h3>
<p style="margin-bottom:40px;">{$CATEGORYS[103][ description ]}</p>
时间
{date('Y',$r[inputtime])}
内容页时间
{$inputtime}
{date('Y-m-d',$rs[inputtime])}
<img src="{$CATEGORYS[$top_parentid][image]}" alt="{$CATEGORYS[$top_parentid][catname]}" title="{$CATEGORYS[$top_parentid][catname]}">
站点名称:
首先在模板需要调用站点名的地方先加上这个设置全局变量
{php $SITE = getcache('sitelist','commons');}
然后在需要显示站点名的地方用这个标签就可以
{$SITE[$siteid][name]}
分享网址
http://www.bshare.cn/help/installAction
去处标签strip_tags 控制字段长度str_cut
{str_cut(strip_tags($r['content']),"300","...")}
英文目录
<p>{$CATEGORYS[8][catdir]}</p>
内容页点击量
点击:</span><span id="hits"></span></h1>
<script language="JavaScript" src="{APP_PATH}api.php?op=count&id={$id}&modelid={$modelid}"></script>
phpcms v9 邓士鹏(石家庄职业技术学院)的更多相关文章
- tp5 隐藏index.php 邓士鹏
tp5 隐藏index.php ------------------------------------------------------------------------------------ ...
- php 邓士鹏
// $is_company = $_groupid > 5 || ($_groupid == 4 && $user['regid'] > 5); $_E = ($MOD[ ...
- ecshop ad调用指定广告的方法 邓士鹏
在include/lib_goods.php文件下面新增:function getads($cat,$num){$time = gmtime();$sql = "SELECT * FRO ...
- 邓士鹏【MySql大全】
禁止使用系统关键字: typename 1.计算两个日期的时间差函数 SELECT TIMESTAMPDIFF(MONTH,'2009-10-01','2009-09-01'); interval可是 ...
- TP6文档-邓士鹏
2019年5月11日 - 教程为您提供<ThinkPHP6.0极速入门(视频教程)>之 TP6的目录结构 章节的在线实战教程供您学习,你可以进行笔记.提问.讨论和资料下载 https:// ...
- PHPCMS V9实现硬件地址MAC绑定访问技术实现
目的:会员登录需要 用户名.密码.身份识别码(新增字段) 效果: 解决方法: 目前数据库中macaddress字段已经添加,修改了phpcms\modules\member\index.php 63 ...
- phpcms v9使用GET调用指定id文章内容、页面数据方法
不知道大家有没有相同的体会?在使用Phpcms V9建站调用数据的时候,基础的数据用默认的模板的调用语句就好了,但复杂不常见的数据怎么调用呢?我们技术可能会研究半天,怀着探索的精神不断尝试.孜孜不倦. ...
- phpcms V9 整合 Discuz! X2 教程
整合原理: UCenter 作服务端:phpsso 与 Discuz! 分别作 UCenter 的客户端应用:phpsso 与 Discuz! 通过 UCenter 发生交互. phpcms 通过 p ...
- phpcms v9图片生成缩略图变成黑色解决方法
今天客户反映,上传的图片生成缩略图有的图片变成黑色,出现问题就百度了一下,有不少网友也遇到这样的问题,但是官方论坛也没有给出解决办法,那还得靠自己解决了,于是就研究phpcms v9 图片压缩代码.打 ...
随机推荐
- ExtJs 给grid某一单元格重新赋值
// 司机,搬运工提成 var commissionMoney = (waybillsFtQty * commissionMoneyRatio / personCount).toFixed(2); / ...
- B4010 菜肴制作 拓扑排序(附随机跳题代码)
今天写了一个自己的随机跳题小程序,第一次试发现跳的全是不可做题,但是在周围我一眼看见了这个题,不能说一眼看出来,但是也是比较有思路,所以就做他了! 做得比较顺利,做完之后美滋滋,突然发现样例第三组过不 ...
- bzoj 4318 OSU! —— 期望DP
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4318 期望DP,因为平方的期望不等于期望的平方,所以用公式递推: 第一次推错了囧,还是看这位 ...
- IJ-Error:常见错误
ylbtech-IJ-Error:常见错误 1.返回顶部 1. This application has no explicit mapping for /error, so you are seei ...
- bzoj1606[Usaco2008 Dec]Hay For Sale 购买干草(01背包)
1606: [Usaco2008 Dec]Hay For Sale 购买干草 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1240 Solved: 9 ...
- 自己对javascript闭包的了解
目录 闭包的概念 谈谈函数执行环境,作用域链以及变量对象 闭包和函数柯里化 闭包造成的额外的内存占用 (注意我说的不是“内存泄漏”!) 闭包只能取得包含函数的最后一个值 正文 前言: 在这篇文章里, ...
- .Net Core项目上Azure Docker云
1.找到创建资源-容器-Container Instances 2.安装模板,填写私有映像表的相关信息 3.创建成功,运行测试.
- ROS-节点-Topic
前言:本部分主要介绍ros一些基础功能的使用,包括创建和编译工作空间.功能包.节点以及话题. 第一种方式:使用roboware studio软件操作 1.1 创建工作空间 回车然后点击保存. 1.2 ...
- nginx编译安装新模块
nginx的模块是需要重新编译nginx,而不是像apache一样配置文件引用.so 这里以安装第三方ngx_http_google_filter_module模块为例 下载第三方扩展模块ngx_ht ...
- Android @Field parameters can only be used with form encoding
今天在学习Retrofit的时候,当post请求时 public interface NewsDataService { @POST("news/list") Call<Ne ...