if($subday > 0) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; }修改为:
if($subday > 0) { if($subday == 1) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } else if ($subday == 2) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $lomitday = $ntime; $orwheres[] = " arc.senddate < $lomitday && arc.senddate > $limitday"; } else if ($subday == 3) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime -($subday * 24 * 3600)+(1*24 * 3600); $orwheres[] = " arc.senddate < $limitday "; } else if ($subday == 7) { $ntime = gmmktime(0, 0, 0, gmdate('m'), gmdate('d'), gmdate('Y')); $limitday = $ntime - ($subday * 24 * 3600); $orwheres[] = " arc.senddate > $limitday "; } } }至于使用方法,注释已经很详细了
{dede:arclist row=10 titlelen=32 subday='1'}<li><a href="[field:arcurl/]">[field:title/]</a></li>{/dede:arclist}//当subday=1的时候调用1天内的文章
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!