Remove Expired Page
NB! Remove Expired Page plugin is deprecated for CMSimple_XH version 1.6 and later. On CMSimple_XH version 1.6 and above you can set expiration period for a page in Page tab.
Remove Expired Page creates no HTML output and therefore satisfies XH requirements
ExpiredPage is a CMSimple plugin which removes pages at a custom date. Many pages have a limited life and when their content expires the page needs to be removed.
ExpiredPage automate this process by doing it possible to indicate the date when the page has to be removed. ExpiredPage is running once a day and is activated by the users of the website. All pages that are marked to be removed this day (or before) have deployed #CMSimple remove#and became invisible according to Developer manual.
GPL3. You are allowed to make code changes in this plugin to tailor it to your needs.This plugin is for personal use and you may not redistribute either original or modified code. By downloading this plugin you agree to this limitation to the GPL license.
ExpiredPage requires a preinstalled pluginloader.
Download and uncompress expiredpage.zip
Upload the entire expiredpage directory to your "plugins" directory.
In order to remove the page on a specific date paste:
#CMSimple removepage(expiration_date);# somewhere on the page.
Expiration_date has a format yyyymmdd where yyyy is 4 digit year such as "2008", mm, is 2 digit months, for example, "09" and dd is the 2 digit day for instance "02" or "31".
From version 1.1 the expiration_date is the last visibility date and the page is removed just after midnight next day. removepage(20081231); will be visible all the day 31 December 2008 and will be removed on 1 January 2008 at 00:00 am.
ExpiredPage behaves in a same way as hide function and you can place the script alongside another cmsimple script.
You can adjust your time zone in configuration menu.
ExpiredPage creates a file log.txt. If the file is not created at first run of this plugin you may create it manualy in plugin/expiredpage directory. This file needs write permissions.
You can test ExpiredPage by changing field "test" in Plugin Config of ExpiredPage to "true". Go to the page you want to test and enter
#CMSimple removepage(99999999);# on the page.
Save page. After saving the page will now contain
#CMSimple remove# #CMSimple removepage( 99999999 );#
Change to "NORMAL MODE" and check that page is not visible. If the page is still visible, you did not enter the cmsimple string correctly. Check your script and configuration of scripting_regexp in the configuration under SETTINGS.
After succesfully test change the configuration of "test" back to "false" and delete #CMSimple remove# from the test page. Change the date from 99999999 to the date you want the page to expire.
ExpiredPage uses GMT time. You can adjust time zone to your local time in Plugin Config.
The ExpiredPage plugin is tested with CMSimple versions 3.0 and higher and php version 4.3 and 5.2.
Some plugins can handle cmsimple remove function incorectly. If you experience that removed pages are deleted set variable $plugin_cf['expiredpage']['action'] to"hide" instaed of "remove" in index.php in plugin directory.
5. Change summary
version 1.1.2 October 2011
- call to eregi replaced by stristr
version 1.1.1 february 2009
- bug fix -action parameter works now as described.
- test part of help file and this document corrected.
version 1.1 released december 2008
- For compatibility with Newsbox Rotator the expiration date is the last day the page is visible. Removepage(20081231) is removed on January 1 2009 00:00 am (just after midnight). It's not necessary to initialize plugin in your template anymore. If you udate from version 1.0 please remove from the part of your template.
6. Known problems
- CMSimple plugin Menumanager ver. 2008b and earlier removes alle pages with #CMSimple remove#. For work around se compatibility section.
This CMSimple plugin is distributed in the hope that it will be useful - without any warranty; without even the implied warranty of fitnes for a particualr purpose.
© simpleSolutions, December 2008.