Auto-archive old articles

The first improvement to add to your site is the possibility to archive old articles. If you use your site in a more intensive manner, you may end up having users view articles from months ago, which have no relevance in the present context. Archiving is a more useful option than deletion, because you might need the files for future use.

The visible_pag field makes the archiving implementation very simple. This field determines whether an article will be displayed or not. You could edit each article and set the field to 0 (not visible), but for a large number of articles this takes a lot of time. This is why you will create a new administration page, allowing you to select a date from a calendar. All records that were posted before that date, are to be set as invisible.

To create this page, follow the next steps:

  1. In the admin folder, create a new file, called archive Open it in Dreamweaver.
  2. Since this is an administrative page, you should apply a Restrict Access to Page server behavior..
  3. Next, you must insert the field that will allow selecting a date. To implement both the form elements and the SQL logic, use the Custom Form Wizard, that is accessible from the MX Kollection tab of the Insert bar.
  4. Once the Custom Form Wizard opens, configure it in the following manner:

When you click the Archive button, the SQL query will run, and will update records as necessary. You can verify this behavior, by opening the Article list in the administration area, and notice the new values.

The next improvement you'll add to your site, is to replace the text-area form element used to enter the article content with InterAKT's KTML Lite control, allowing you to enter rich content visually.