帝国cms笔记

1.侧边栏或导航部分 点击出现样式
[e:loop={"select classid, classname, classpath from `[!db.pre!]enewsclass` where bclassid='8' order by `classid` asc ",5,24,0,0,0}]

<li 
<?php
if($bqr[classid]==$GLOBALS[navclassid])//当前栏目ID
{
echo "class= 'cur'";
}
?>><a href="[!--news.url--]<?=$class_r[$bqr[classid]]['classpath']?>/" > <?=$class_r[$bqr[classid]]['classname']?></a></li> [/e:loop]

2.列表页获取文章标题,图片
[!--empirenews.listtemp--]
<!--list.var1-->
<!--list.var2-->
<!--list.var3-->
<!--list.var4-->
<!--list.var5-->
[!--empirenews.listtemp--]
<li>
<div class="img"><a href="[!--titleurl--]"><img src="[!--titlepic--]" width="250" height="148"></a></div>
<h2><a href="[!--titleurl--]">[!--title--]</a></h2>
<p>项目位于资阳市雁江区城东新区行政商务核心,西与雁江区政府为邻,北瞰资阳最大森林公园字</p>
<a href="[!--titleurl--]" class="more"><img src="[!--news.url--]skin/style/images/more3.png"></a>
</li>

3.列表页获取文字内容
$fr=$empire->fetch1("select newstext from {$dbtbpre}ecms_news_data_{$r[stb]} where id='$r[id]'");
$listtemp=''.$fr[newstext].'';

4.表单提交跳转地址
<input type="hidden" name="ecmsfrom" value="[!--news.url--]">

5.首页添加友情链接
[e:loop={'select lname,lurl,lpic from [!db.pre!]enewslink where checked=1 order by myorderlimit 0,6',20,24,0}]
<li><a href="<?=$bqr[lurl]?>" target="_blank" ><?=$bqr[lname]?></a></li>
[/e:loop]

6.多图上传 字段名为morepic 存在副表
<?php
    $str=$navinfor[morepic];
    $exp=explode("\\r\\n",$str);
    $exp1=explode("::::::",$exp[0]);
   $exp2=explode("::::::",$exp[1]);
$exp3=explode("::::::",$exp[2]);
$exp4=explode("::::::",$exp[3]);
    ?>           
<li><img src=" <?=$exp1[0]?>"> </li>
<li><img src=" <?=$exp2[0]?>"> </li>
<li><img src=" <?=$exp3[0]?>"> </li>
<li><img src=" <?=$exp4[0]?>"> </li>

7.列表页获取当前栏目链接
列表页获取当前栏目链接 : <?=sys_ReturnBqClassUrl($class_r[$GLOBALS[navclassid]]);?>
列表页获取当前栏目名称 :[!--class.name--]

8.验证码
登陆点击刷新验证码

<input name="key" type="text" size="10" /> <img src="../../ShowKey/?v=login" align="absmiddle" onClick="this.src='../../ShowKey/?v=login&'+Math.random();" alt="点击刷新图片" />  
注册点击刷新验证码

<input name="key" type="text" size="10" />  
 <img src="../../ShowKey/?v=reg" align="absmiddle" onClick="this.src='../../ShowKey/?v=reg&'+Math.random();" alt="点击刷新图片" /> 


 留言点击刷新验证码
  

<input type=text name=key size=6 ><img src="/e/ShowKey/?v=gbook" align="middle" onClick="this.src='/e/ShowKey/?v=gbook&'+Math.random();" alt="点击刷新图片" /> 

 反馈点击刷新验证码

<input type=text name=key size=6 ><img src="/av/e/ShowKey/?v=feedback" align="middle" onClick="this.src='/av/e/ShowKey/?v=feedback&'+Math.random();" alt="看不清楚,点击刷新" />

9.判断是手机还是pc
<script>
    if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iOS|iPad|Backerry|WebOS|Symbian|Windows Phone|Phone)/i))) {
        window.location.href = "http://gcj.whyh100.com/e/wap";
    }else{ 
       
    } 
</script>

10.简述去除HTML标记
function NoHTML($string){  
    $string = preg_replace("'<script[^>]*?>.*?</script>'si", "", $string);//去掉javascript  
    $string = preg_replace("'<[\/\!]*?[^<>]*?>'si", "", $string);         //去掉HTML标记  
    $string = preg_replace("'([\r\n])[\s]+'", "", $string);               //去掉空白字符  
    $string = preg_replace("'&(quot|#34);'i", "", $string);               //替换HTML实体  
    $string = preg_replace("'&(amp|#38);'i", "", $string);  
    $string = preg_replace("'&(lt|#60);'i", "", $string);  
    $string = preg_replace("'&(gt|#62);'i", "", $string);  
    $string = preg_replace("'&(nbsp|#160);'i", "", $string);  
    $string = preg_replace("'&(middot|#183);'i", "", $string);  

    return $string;  

11.特殊字符处理
<?php echo mb_convert_encoding("2017 ", "GBK","UTF-8") ;?>

12.首页添加news
 [e:loop={9,8,0,0,'','newstime DESC'}]
 <dt><span>[<?=date('Y-m-d',$bqr[newstime])?>]</span><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=esub($bqr[title],20)?></a></dt>
[/e:loop]

[e:loop={13,7,0,0,'','newstime DESC'}]
<li class="clearfix"><b>[<?=date('Y-m-d',$bqr[newstime])?>]</b><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=esub($bqr[title],32,'…')?></a></li>
[/e:loop]

[e:loop={8,3,0,1,'','newstime DESC'}]
<li><a href="<?=$bqsr['titleurl']?>" target="_blank"><h3><?=esub($bqr[title],30)?> </h3><img src="<?=$bqr[titlepic]?>" width="347" height="351"  > </a></li>
[/e:loop]
[e:loop={18,1,0,1,'','newstime DESC'}]
<div id="myTab1_Content0"><div class="tabimg"><a href="<?=$bqsr['titleurl']?>" target="_blank"><img src="$bqr[titlepic]" width="1058" height="562"><p><?=esub($bqr[title],20)?></p></a></div></div>
[/e:loop]

12.表单搜索
<form action="/e/search/index.php" method="post" name="search_news" id="searchform">
<input type="hidden" name="show" value="title,casno,mf,mw,source,productid" />
<input type="hidden" name="tempid" value="1" />
<input type="hidden" name="tbname" value="news" />
<input type="hidden" name="classid" value="3">
<table border="0" cellspacing="6" cellpadding="0">
<tr>
<td>
<input placeholder="search" name="keyboard" type="text" id="keyboard" class="inputText" style='width:500px;height:26px;position:relative;top:-2px;padding-left:5px;z-index:9999;' />
</td>
<td><input type="image" class="inputSub" src="/images/search_button.gif" style='position:relative;left:-31px;height:16px;width:16px;top:-2px;z-index:9999;' />
</td>
</tr>
</table>
</form>
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值