Filter_Plugin_LargeData_Comment 挂载在后台评论管理页(Admin_CommentMng)列表查询构造的末尾、$zbp->GetCommentList() 执行之前,插件可以修改评论管理列表的 select、where、order、limit 与 option 参数,用于在大数据量场景下优化评论列表查询或实现自定义筛选与排序。
Filter_Plugin_LargeData_Comment
Admin_CommentMng
$zbp->GetCommentList()
&$select, &$where, &$order, &$limit, &$option
下例让后台评论管理列表默认隐藏被插件标记为垃圾的评论,保持审核工作区整洁:
<?php RegisterPlugin("demoAPP", "ActivePlugin_demoAPP"); function ActivePlugin_demoAPP() { Add_Filter_Plugin('Filter_Plugin_LargeData_Comment', 'demoAPP_LargeData_Comment'); } function demoAPP_LargeData_Comment(&$select, &$where, &$order, &$limit, &$option) { // 仅在未显式搜索时追加过滤,避免影响按关键词查找垃圾评论的场景 if (!GetVars('search')) { $where[] = array('NOT LIKE', 'comm_Meta', '%demoapp-spam%'); } }
zb_system/function/c_system_admin.php
comm_
comm_Meta
comm_IsChecking
log_
$select
$where
$order
$limit
$option
array(偏移量, 条数)
pagebar
$zbp->cache
大数据评论列表查询
Filter_Plugin_LargeData_Comment挂载在后台评论管理页(Admin_CommentMng)列表查询构造的末尾、$zbp->GetCommentList()执行之前,插件可以修改评论管理列表的 select、where、order、limit 与 option 参数,用于在大数据量场景下优化评论列表查询或实现自定义筛选与排序。接口信息
Filter_Plugin_LargeData_Comment&$select, &$where, &$order, &$limit, &$option完整案例
下例让后台评论管理列表默认隐藏被插件标记为垃圾的评论,保持审核工作区整洁:
注意事项
zb_system/function/c_system_admin.php的后台评论管理查询处,仅当打开后台「评论管理」页时触发,前台评论列表不经过本接口;comm_(如comm_Meta、comm_IsChecking),追加 where 条件时不要沿用文章表的log_前缀;$select、$where、$order、$limit、$option即可生效;$limit是array(偏移量, 条数)形式的数组,$option中携带pagebar分页对象;$zbp->cache中的计数)上做同步修正,避免后台数量提示与列表不符。