某些情况下,我们需要调用昨天发布和某个时间段发布的文件,这个是我在以前做一个网页游戏站点时候使用到得,而织梦默认的只能够调去X天内发布的文章,于是我们就需要自己动手DIY了,
具体的文件是include\taglib\arclist.lib.PHP
找到:
0) { $ntime = gmmktime(0,gmdate('m'),gmdate('d'),gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; }
修改为:
0) { if($subday == 1) { $ntime = gmmktime(0,gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } else if ($subday == 2) { $ntime = gmmktime(0,gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $lomitday = $ntime; $orwheres[] = " arc.senddate < $lomitday && arc.senddate > $limitday"; } else if ($subday == 3) { $ntime = gmmktime(0,gmdate('Y')); $limitday = $ntime -($subday * 24 * 3600)+(1*24 * 3600); $orwheres[] = " arc.senddate < $limitday "; } else if ($subday == 7) { $ntime = gmmktime(0,gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } } }
至于使用方法,注释已经很详细了
PHP">{dede:arclist row=10 titlelen=32 subday='1'}