I have been using Joomla since 1.0 and I can tell that it is an awesome software. All the websites I do are done with Joomla. However, I have realized that Joomla is missing some options that may be very useful. In this case the capability to auto archive articles; this is very handful especially when you are writing a blog like mine.
In this article, I will show you all how to do this. I will assume you are familiar with your database and you have access to CLI.
Do the following steps:
/usr/bin/mysql -u MYSQL_USER -pMYSQL_PASSWORD DATABASE -e 'UPDATE #PREFIX_content content JOIN #PREFIX_categories category ON category.id=content.catid SET content.state = 2 WHERE DATEDIFF(CURDATE(),created) > 30 AND category.path LIKE "blog/%"'
0 0 * * * /usr/local/bin/auto.archive.sh
Happy blogging!blog comments powered by Disqus