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?

藏色散人
藏色散人Original
2020-01-06 09:08:002079browse

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(&#39;m&#39;), gmdate(&#39;d&#39;), gmdate(&#39;Y&#39;)); 
  $limitday = $ntime -($subday * 24 * 3600)+(1*24 * 3600); 
  $orwheres[] = " arc.senddate < $limitday "; 
 } 
  else if ($subday == 7) 
 {   
  $ntime = gmmktime(0, 0, 0, gmdate(&#39;m&#39;), gmdate(&#39;d&#39;), gmdate(&#39;Y&#39;)); 
  $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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn