0){if($subday==1){$ntime =gmmktime(0,0,0,gmdate('m')}}"."/> 0){if($subday==1){$ntime =gmmktime(0,0,0,gmdate('m')}}".">
Home > Article > CMS Tutorial > How does DreamWeaver call articles published in a certain time period?
How does Dreamweaver call articles published in a certain time period?
Dreamweaver DEDECMS calls a certain time period Published articles
Recommended learning: 梦Weavercms
//Time limit (used to call recent popular articles, popular comments, etc.), the time here can only Calculate to day, otherwise the cache function will be invalid
//When subday=1, call the article within 1 day
//When subday=2, call yesterday’s article
//When subday=3 When calling all articles from 2 days ago
//When subday=7, calling all articles within 7 days
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 "; } } }
The above is the detailed content of How does DreamWeaver call articles published in a certain time period?. For more information, please follow other related articles on the PHP Chinese website!