Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
Hello! I have made a form with Databound, so people can write theve own post in the website.

But could I do so when someone "Submit" the post in my website from Databound, that the post only be there for 1 day, after that it deletes.

I quess I can use this for that ? <cms:pages masterpage='blog.php' stop_before='2010-03-01'></cms:pages>

But how can I do so it deletes after 24 hours.
You can find out about deleting pages programmatically by studying the advanced tutorial, particularly this page:
http://www.couchcms.com/docs/advanced-t ... elete.html
and this page from the forum:
viewtopic.php?f=4&t=8087

I think you'll want to use the cms:db_delete tag described above, but I can't tell you exactly how. However, the problem I see is that Couch doesn't run continuously in the background. It only executes its code when pages are requested from the server. So anything you do to automatically delete pages would only be executed when someone loads a page in a browser.

What you need instead is an entirely separate utility for deleting expired pages. You would execute it manually from time to time, or set up a cron job to execute it on a regular schedule. So you would use the 'stop_before' parameter to prevent displaying expired pages, and the utility would be used to purge those pages from the database.

These are just some general ideas, but I hope that's at least a little bit helpful to you.
tim wrote: You can find out about deleting pages programmatically by studying the advanced tutorial, particularly this page:
http://www.couchcms.com/docs/advanced-t ... elete.html
and this page from the forum:
viewtopic.php?f=4&t=8087

I think you'll want to use the cms:db_delete tag described above, but I can't tell you exactly how. However, the problem I see is that Couch doesn't run continuously in the background. It only executes its code when pages are requested from the server. So anything you do to automatically delete pages would only be executed when someone loads a page in a browser.

What you need instead is an entirely separate utility for deleting expired pages. You would execute it manually from time to time, or set up a cron job to execute it on a regular schedule. So you would use the 'stop_before' parameter to prevent displaying expired pages, and the utility would be used to purge those pages from the database.

These are just some general ideas, but I hope that's at least a little bit helpful to you.


Thanks for that, are going to look for that!
3 posts Page 1 of 1