destoon 更新资讯
修改module/article/admin/index.inc.php文件
在switch中添加新case(访问xxx.com/index.php?moduleid=21&action=tohtmlreplace)[注意action只能是小写]
【此方法只是骚操作,巧取了默认的tohtml的方式,省略了其他步骤】
case 'tohtmlreplace':
$content = file_get_contents(DT_ROOT . '/module/article/admin/replaceBody.txt');
$arr = json_decode($content, true);
if (count($arr) <= 0) {
msg('没有可更新的资讯');
}
$currentPage = $_REQUEST['currentPage'] ? $_REQUEST['currentPage'] : 1;
$html_itemids = array_slice($arr, 0, 50, true);
$html_itemids = array_keys($html_itemids);//获取下标
$i = 0;
foreach($html_itemids as $itemid) {
tohtml('show', $module);
unset($arr[$html_itemids[$i]]);
$i++;
}
file_put_contents(DT_ROOT . '/module/article/admin/replaceBody.txt', json_encode($arr));
$currentPage ++;
msg('当前跳转页数'.$currentPage, "?moduleid=21&action=tohtmlreplace¤tPage=$currentPage");
break;
destoon更新资讯
最新推荐文章于 2024-09-10 14:26:18 发布