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天内的文章
新闻热点
疑难解答