<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Automatic news archive</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Automatic-news-archive-79518</link>
        <description></description>
        <pubDate>Mon, 07 Sep 2026 14:09:50 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Automatic-news-archive-79518" rel="self" type="application/rss+xml" />

                <item>
          <title>Automatic news archive</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234012#post2234012</link>
          <description><![CDATA[<p>Thanks.</p>
<p>FYI, the first getRecords worked fine, though it was missing a comma at the end of the where</p>
<p>The second getRecords didn't work, until I added back the "removeDate" fields, and the missing comma.</p>
]]></description>
          <pubDate>Mon, 19 May 2014 13:14:12 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234012#post2234012</guid>
        </item>
                <item>
          <title>Automatic news archive</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234008#post2234008</link>
          <description><![CDATA[<p>Hi mizrahi,</p>
<p>The following getRecords function should retrieve records that were created after the current date last year:</p>
<p><code>  // news items<br />  list($news_itemsRecords, $news_itemsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'news_items',<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'perPage'     =&gt; '20',<br />    'where'    =&gt;   "(removeDate &gt;= NOW() OR removeDate='0000-00-00 00:00:00') AND (`createdDate` &gt;= '".date('Y-m-d H:i:s', strtotime('-1 year'))."')"<br />    'ignoreRemoveDate' =&gt;  true,<br />  )); <br /></code></p>
<p>Then this function would retrieve records that are older than a year:</p>
<p><code>  // news items<br />  list($news_itemsRecords, $news_itemsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'news_items',<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'perPage'     =&gt; '20',<br />    'where'    =&gt;   "`createdDate` &lt; '".date('Y-m-d H:i:s', strtotime('-1 year'))."')"<br />    'ignoreRemoveDate' =&gt;  true,<br />  )); <br /><br /></code></p>
<p>So the strtotime function can take a string that tell it to carry out some basic date math (for example '2013-03-10 - 1 year', '+1 week ', etc).</p>
<p>I've used this function to get the date from last year formatted for MySQL. You might need to change the date column that this statement searches. </p>
<p>Thanks!</p>
<p>Greg</p>]]></description>
          <pubDate>Mon, 19 May 2014 10:34:57 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234008#post2234008</guid>
        </item>
                <item>
          <title>Automatic news archive</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2234005#post2234005</link>
          <description><![CDATA[<p>I would like to have the news area on a site automatically archive. I want everything within the past 12 months to display on a "Recent News" page, and everything older than 12 months to display on a "News Archive" page. Can someone assist me with the database calls for this? Here is the basic query...</p>
<p><code>// news items<br />  list($news_itemsRecords, $news_itemsMetaData) = getRecords(array(<br />    'tableName'   =&gt; 'news_items',<br />    'loadUploads' =&gt; true,<br />    'allowSearch' =&gt; false,<br />    'perPage'     =&gt; '20',<br />     'where'    =&gt; "(removeDate &gt;= NOW() OR removeDate='0000-00-00 00:00:00')",<br />     'ignoreRemoveDate' =&gt;  true,<br />  )); </code></p>
]]></description>
          <pubDate>Mon, 19 May 2014 09:30:51 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2234005#post2234005</guid>
        </item>
              </channel>
    </rss>
  