織夢模板中使用php和if判斷語句的技巧
{dede:field.zufang_tel php=yes}
if(@me==""||empty(@me))
@me="<p>無</p>";
{/dede:field.zufang_tel}
|
{dede:arclist orderby='click' titlelen='30' row='10' iif="$str_count>1" elserun="$str=暫時沒有內(nèi)容"}
<li><span class="gptlink">[field:textlink/]</span></li>
{/dede:arclist}
|
$GLOBALS['autoindex']=0;
foreach($GLOBALS[$arr] as $k=>$v){
$GLOBALS['autoindex']++;
|
$str = $this->CTags[$i]->TagValue;
$str_count = $GLOBALS['autoindex'];
if( $this->CTags[$i]->GetAtt("iif")!="" ){
if(! eval("return {$this->CTags[$i]->GetAtt('iif')} ;" )){
if($this->CTags[$i]->GetAtt("elserun")) {
$this->CTags[$i]->TagValue=eval("return {$this->CTags[$i]->GetAtt('elserun')} ;" );
}else{
$this->CTags[$i]->TagValue='';
}
}
}
|
上一篇:織夢用PHP判斷flag自定義屬性是否存在,然后調(diào)用自定義屬性
欄 目:dedecms
下一篇:織夢DedeCMS教程:首頁如何調(diào)用欄目內(nèi)容和單頁內(nèi)容
本文標(biāo)題:織夢模板中使用php和if判斷語句的技巧
本文地址:http://mengdiqiu.com.cn/a1/dedecms/13980.html
您可能感興趣的文章
- 08-05Dedecms文件目錄結(jié)構(gòu)解說(能知道織夢每個文件有什么用)
- 08-05Dedecms5.7版ckeditor網(wǎng)頁編輯器添加中文字體
- 08-05織夢DedeCMS獲取當(dāng)前欄目文章數(shù)量
- 08-05織夢模板如何添加和調(diào)用自定義字段的方法
- 08-05織夢DedeCMS調(diào)用顯示discuz里面主題的方法
- 08-05限制織夢會員每天投稿數(shù)量方法
- 08-05常用的織夢dedecms安全設(shè)置集合整理
- 08-05織夢教程:后臺編輯器添加中文字體方法
- 08-05織夢修改文章排序到第一位如何解決?
- 08-05dede副欄目調(diào)用支持arclist標(biāo)簽