<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Creating an Automatic News Archive - 2018 Version</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Creating-an-Automatic-News-Archive---2018-Version-81300</link>
        <description></description>
        <pubDate>Mon, 15 Jun 2026 00:55:22 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Creating-an-Automatic-News-Archive---2018-Version-81300" rel="self" type="application/rss+xml" />

                <item>
          <title>Creating an Automatic News Archive - 2018 Version</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2242013#post2242013</link>
          <description><![CDATA[<p>Hi Leo, Glad to have you on board.</p>
<p>Your code worked, thank you.</p>
<p>For the record, here is what I did for an automatic archive news item page and the detail page - the code  below is for my LIST page.</p>
<p><code>// load records from 'notices_srpc'<br /> list($notices_srpcRecords, $notices_srpcMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'notices_srpc',<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> 'ignoreRemoveDate' =&gt; true,<br /> 'where' =&gt; "`publishDate` &lt; '".date('Y-m-d H:i:s', strtotime('-1 year'))."'"<br /><br /> ));</code></p>
<p>Then, in order to be able to use the same Detail page as my current news listings, I used this code for the detail page. The key was to use the ignoreRemoveDate.  This is the active page  <a href="http://strafford.org/newsarchiveList.php" rel="nofollow">http://strafford.org/newsarchiveList.php</a></p>
<p><code>list($notices_srpcRecords, $notices_srpcMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'notices_srpc',<br /> 'where' =&gt; whereRecordNumberInUrl(1),<br /> 'limit' =&gt; '1',<br /> 'ignoreRemoveDate' =&gt; true,<br /> ));<br /> $notices_srpcRecord = @$notices_srpcRecords[0]; // get first record</code></p>
]]></description>
          <pubDate>Wed, 02 May 2018 11:24:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2242013#post2242013</guid>
        </item>
                <item>
          <title>Creating an Automatic News Archive - 2018 Version</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241988#post2241988</link>
          <description><![CDATA[<p>Hi,</p>
<p>You can try replacing the where statement with the following and see if the error is still there:</p>
<p><code>'where' =&gt; "`createdDate` &lt; '".date('Y-m-d H:i:s', strtotime('-1 year'))."'"</code></p>
<p>Let me know if this works!</p>
<p>Thanks,</p>]]></description>
          <pubDate>Tue, 24 Apr 2018 14:34:01 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241988#post2241988</guid>
        </item>
                <item>
          <title>Creating an Automatic News Archive - 2018 Version</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2241985#post2241985</link>
          <description><![CDATA[<p>Hi,</p>
<p>I would like to do exactly what mizrahi, requested in this Post 2234008 [<a href="https://www.interactivetools.com/forum/forum-posts.php?postNum=2234008#post2234008" rel="nofollow">https://www.interactivetools.com/forum/forum-posts.php?postNum=2234008#post2234008</a>]</p>
<p>My url for the test News Archive page is :  <a href="http://strafford.org/newsarchiveList.php" rel="nofollow">http://strafford.org/newsarchiveList.php</a></p>
<p>Current news items are shown on the home page of <a href="http://strafford.org" rel="nofollow">http://strafford.org</a> and on this page <a href="http://strafford.org/notices.php" rel="nofollow">http://strafford.org/notices.php</a> </p>
<p>Using the same table "notices_srpc" which holds news items, I would like to have items older than a year appear on another page "newsarchiveList.php" </p>
<p>When I add Greg's suggested code from Post 2234008 for s separate listing of items a year old, as below, the page does not appear at all.</p>
<p><code>// load records from 'notices_srpc'<br /> list($notices_srpcRecords, $notices_srpcMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'notices_srpc',<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> 'where' =&gt; "`createdDate` &lt; '".date('Y-m-d H:i:s', strtotime('-1 year'))."')"<br /> 'ignoreRemoveDate' =&gt; true,<br /> )); </code></p>
<p><br />If the 'ignoreRemoveDate' is removed from the above, I get an error message as follows:<br /><br /><em>MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND `notices_srpc`.hidden = 0 AND `notices_srpc`.publishDate &lt;= NOW() AND (`no' at line 3</em></p>
<p>I noticed a forum post from a user in Post 2235844 <a href="https://www.interactivetools.com/forum/forum-posts.php?postNum=2235844#post2235844" rel="nofollow">https://www.interactivetools.com/forum/forum-posts.php?postNum=2235844#post2235844</a> that they  received this kind of message after a server move.</p>
<p>Indeed after the CMSB was updated by you guys (thanks again) this site was recently moved to a new and better host. I suspect, however, that the where query isn't structured correctly.</p>
<p>I have left the test page (<a href="http://strafford.org/newsarchiveList.php" rel="nofollow">http://strafford.org/newsarchiveList.php</a>) showing the error message. The code on it is:</p>
<p><code>// load viewer library<br /> $libraryPath = 'cmsAdmin/lib/viewer_functions.php';<br /> $dirsToCheck = array('/usr/home/straffordrpc/public_html/','','../','../../','../../../');<br /> foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}<br /> if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }<br /><br /> // load records from 'notices_srpc'<br /> list($notices_srpcRecords, $notices_srpcMetaData) = getRecords(array(<br /> 'tableName' =&gt; 'notices_srpc',<br /> 'loadUploads' =&gt; true,<br /> 'allowSearch' =&gt; false,<br /> 'where' =&gt; "`createdDate` &lt; '".date('Y-m-d H:i:s', strtotime('-1 year'))."')"<br /> ));</code></p>
<p>So in summary, can you help me get a News Archive List page showing items over a) 6 months old and b) over 1 year old? (The client can choose which range they want.)</p>
<p>I am assuming that the same Detail page can be used with both the Current News items and with the Archived News items.</p>
<p>Thanks in advance, J</p>
<p>Note: this site Running CMSB 3.10  and PHP v7.1.15 </p>]]></description>
          <pubDate>Sun, 22 Apr 2018 11:07:45 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2241985#post2241985</guid>
        </item>
              </channel>
    </rss>
  