帝国cms文章模型newstext字段默认内容存储是以文件的形式保存的,读取时候需要通过GetTxtFieldText函数读取的
参考代码:
<?php $where='where 1'; if($cur_classid){ $where=$where.' and classid='.$cur_classid; } if($cur_id){ $where=$where.' and id='.$cur_id; } $sql=$empire->query("select id,classid,title,newstext,diggtop from {$dbtbpre}ecms_article {$where} order by lastdotime desc limit 10"); //查询新闻表最新10条记录 while($r=$empire->fetch($sql)) //循环获取查询记录 { ?> <div class="ans-item <?php if($cur_id==$r['id'])echo 'on'; ?>"><b><?=$r['title']?></b><div class="ans-item-answer"><?=GetTxtFieldText($r['newstext'])?></div><div class="identify"><span qid="44" class="prise-num"><?=$r['diggtop']?></span><span class="job-post"><?=$public_r['sitename']?></span></div><span class="arrow-cont"><i class="arrow-icon"></i></span></div> <?php } ?>
如果本文对你有帮助,欢迎打赏本站