网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > 帝国Cms
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 106.110.148.226
Old 2015-10-09, 08:55 PM
Janiyah Janiyah is offline
初级会员
 
Join Date: 2011-08-12
Posts: 1
Janiyah 现在声名狼藉
Default 帝国cms中的一些小技巧收录

php三元条件运算符:

<?=$bqr['ftitle']?$bqr['ftitle']:$bqr['title']?>

灵动或者php查询调用编辑器内容的时候要加stripslashes删除反斜杠比如:

<?=stripslashes($r['newstext'])?>

内容页当前信息ID:

$navinfor['id']

列表内容模板信息ID:

$r['id']

当前栏目名:

$class_r[$GLOBALS['navclassid']]['classname'];

当前栏目父栏目:

$class_r[$GLOBALS['navclassid']]['bclassid'];

当前栏目别名:

$class_r[$GLOBALS['navclassid']]['bname'];

当前栏目子栏目:

$class_r[$GLOBALS['navclassid']]['sonclass'];

当前栏目子判断是否为终级栏目:

$class_r[$GLOBALS['navclassid']]['islast'];

当前栏目是否有已审核信息:
$GLOBALS['num']==0为没有信息

帝国cms中引入php路径写法(例子是文件在根目录)
<?php include(ECMS_PATH."./bottom.php");?>

排除置顶、头条、推荐等,sql附加条件:

'istop=0 and isgood=0 and firsttitle=0'

上上级栏目id:

<?php

$bclassid=$class_r[$GLOBALS[navclassid]][bclassid];

$bbclassid=$class_r[$bclassid][bclassid];

echo $bbclassid;

?>

$bbclassid就是上上级父栏目id

投稿、登陆、反馈、留言等之后跳转指定页面:

<input type=hidden name=ecmsfrom value="返回页面地址">

统计信息被收藏数:

<?

$favas=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsfava where id='$navinfor[id]' and classid='$GLOBALS[navclassid]'");

?>

<?=$favas?>就是这条信息的收藏数

列表、结合项判断当前没有信息给出提示:

<?

if($GLOBALS['num']=='0'){

?>

<p>对不起,暂时没有任何信息!</p>

<?

}else{

?>

[!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--]

<?

}

?>

动态使用:

网站名称:<?=$public_r['sitename']?>

网站地址:<?=$public_r['newsurl']?>

帝国自身的时间转换函数:

<?=format_datetime($bqr[newstime],'Y-m-d')?>

此函数自带判断,比较不错,推荐。

判断内容是否有图片,没有图片则显示文中广告 有图片则不显示:

<?php

$string=$navinfor['newstext'];//内容字段

$some="<img ";

$num=explode($some,$string);

if(count($num)>1){//判断内容中是否有图片

?>

[!--newstext--]

<?

}else{

?>

<div id="ad">我是广告</div>

[!--newstext--]

<?

}

?>


截取加过滤标签:


<?=esub(htmlspecialchars(strip_tags($navinfor[newstext])),160)?>

Last edited by Janiyah : 2015-10-09 at 08:58 PM
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 01:21 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.