首页 » 日记 » 正文内容
11个月前 寻梦xunm 160 日记
例如:有时候需要把动态页面(前提是动态页面功能是通过评论改的)的数据调用在首页,使用下面函数即可。
//调用独立页面信息,$cid为独立页面的cid
function cidshuo($cid){
    $db = Typecho_Db::get();
    $cid = (int) $cid ?? '';
    $comment = $db->fetchAll($db->select()->from('table.comments')
                ->where('cid = ? AND status = ? AND parent = ?', $cid, 'approved', '0')
                ->order('coid', Typecho_Db::SORT_DESC)
                ->limit(1));
    return $comment;
}
使用方法
<?php echo cidshuo(545); ?>
0 赞 or 打赏
喜欢就打赏一点
微信 支付宝
已有0 条评论,0 个点赞
隐私

Q Q:1340326824

vipshiyi@qq.com

QQ群:422720328

生活所迫,再见了苦逼的BUG们,以后有缘在会吧。