一、内容页写if、elseif、else的判断语句:
$listtemp = '<li class=" g_over">';
$listtemp .= '<a href="[!--titleurl--]" class="img" rel="nofollow" target="_blank" title="[!--title--]">';
if(!empty($r[pic]))
{
$listtemp .= '<img src="[!--pic--]" alt="" title="[!--title--]">';
}
else{
$listtemp .= '<span style="font-size:30px; margin-top:100px; color:#000;">[!--title--]</span>';
}
$listtemp .= '</a>';
$listtemp .= '<div class="goods-padding">';
$listtemp .= '<div class="title">';
$listtemp .= '<a target="_blank" href="[!--titleurl--]" target="_blank">[!--title--]</a>';
$listtemp .= '</div>';
$listtemp .= '</div>';
$listtemp .= '</li>';
二、内容页写if、elseif、else的判断语句:
在内容页不能用[!--zdy_renshu--]这样的语法写在php里面,只能用成这样的$navinfor['zdy_renshu']:
<?php
if($navinfor['zdy_renshu']==1){echo "100人以下";}
elseif($navinfor['zdy_renshu']==2){echo "101-500人";}
elseif($navinfor['zdy_renshu']==3){echo "501-1000人";}
else{echo "1000人以上";}
?>