帝国cms会员中心判断会员组显示不同内容
<?php
if($tmgetgroupid==1){ //如果会员组id为1;
//开始 显示如下内容
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql)){
echo"<li style='height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href='"."$info[titleurl]"."'> "."$info[title]"." <br/> 共: "."$info[Exnum]"." 题, 更新时间:".date('Y-m-d',$info[newstime])."</a></li>"; //date()不能加双引号,否则时间戳不会格式化;拼接是个很痛苦的活,改成<?php {?> <?php} ?>
}
//结束
}elseif($tmgetgroupid==3){//如果会员组id为3;
//开始 显示如下内容
//结束
};
?>
不要拼接,用<?php {?> <?php} ?>,不过有点多
<?php
if($tmgetgroupid==1){
php
{?>
html+<?=xxx>
<?php
}
}elseif($tmgetgroupid==3){
php
{?>
html+<?=xxx>
<?php
}
};
?>
<?php
if($tmgetgroupid==1){
//开始
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql))
{?>
<li style=' height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href="<?=$info[titleurl]?>"> <?=$info[title]?> <br/>
共: <?=$info[Exnum]?> 题,
更新时间:<?=date('Y-m-d',$info[newstime])?></a></li>
<?php
}
//结束
}elseif($tmgetgroupid==3){
//开始
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql))
{?>
<li style=' height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href="<?=$info[titleurl]?>"> <?=$info[title]?> <br/>
共: <?=$info[Exnum]?> 题,
更新时间:<?=date('Y-m-d',$info[newstime])?></a></li>
//结束
<?php
}
};
?>
<?php
$infosql=$empire->query("select * from phome_ecms_news order by newstime desc limit 5");
while($info=$empire->fetch($infosql))
{?>
<li style=' height:100px;line-height:31px;text-indent:10px;border-top:1px solid #eee;font-size:16px;'><a target=_blank href="<?=$info[titleurl]?>"> <?=$info[title]?> <br/>
共: <?=$info[Exnum]?> 题,
更新时间:<?=date('Y-m-d',$info[newstime])?></a></li>
<?php
}
?>