首页 > 电脑专区 > CMS教程 > 帝国cms >

帝国cms灵动标签/跨表跨栏目调用自定义字段值phpif相等显示A不相等显示B

来源:互联网 2023-03-14 23:15:15 版权归原作者所有,如有侵权,请联系我们

2、第1种写法:Sbr办公区 - 实用经验教程分享!

?phpif($navinfor['writer']){ $writer=$navinfor['writer'];?>[e:loop={"select titleurl,title,writer from phome_ecms_A where writer ='$navinfor[writer]' limit 1",10,24,0}]?$writer='a href="'.$bqr['titleurl'].'" target="_blank">'.$bqr['writer'].'/a>';?>[/e:loop]?php echo $writer;}?>

2、第2种写法:Sbr办公区 - 实用经验教程分享!

?php$z=$empire->fetch1("select titleurl,title,writer from phome_ecms_B where id ='$navinfor[id]' limit 1"); //调用本篇文章的作者$zz=$empire->fetch1("select writer from {$dbtbpre}ecms_A where writer = '$z[writer]'"); //调用本篇文章的作者与A表的所有作者对比if(empty($zz[writer])) //判断 如果 对比结果为空{?>?=$navinfor['writer']?>?php}else{ //如果判断结果为真 输出?>[e:loop={"select titleurl,title,writer from phome_ecms_A where writer ='$navinfor[writer]' and writer!='' limit 1",10,24,0}]a href="?=$bqr['titleurl']?>" target="_blank">?=$bqr['writer']?>/a>[/e:loop]       ?php}?>​​​​​​​

参考,:52历史,古诗文模板作者Sbr办公区 - 实用经验教程分享!

以上方法由办公区教程网编辑摘抄整理自互联网仅供大家参考!Sbr办公区 - 实用经验教程分享!


标签: PHP自定义字段值帝国CMS知识社区

办公区 Copyright © 2016-2023 www.bgqu.net. Some Rights Reserved. 备案号:湘ICP备2020019561号