brockf / hero

Hero Framework: A powerful Content Management System (CMS) and eCommerce framework built on CodeIgniter.
Other
53 stars 45 forks source link

Event Managment/Close dates for posts #8

Open eckleyval opened 11 years ago

eckleyval commented 11 years ago

This has been worked on in the forms but we need a better solution. I need event management where I can post pages of events on future dates (which is accessible to the public), and the events will automatically remove themselves from the listings after the event date has passed. This can also be managed via a "close date" function for posts. Some of my clients run a ton of events and they have not been able to manually close everything out, which is the only working solution as of now, so this would be an awesome feature for Hero :D Thanks

brockf commented 11 years ago

Hello -

The basic {content} template plugin should already cover you, here, if I understand correctly. You can grab only content items where the close date is >= today's date. Thus all things that have already "closed" will not be retrieved and displayed in the template.

eckleyval commented 11 years ago

I have noticed a call to a close function in the code, but I have never really found out how to set it in the entry. How does one go about doing this? The only date in the publish options is the "publish date"... thanks :D

brockf commented 11 years ago

You are right, actually. We don't have a great way to retrieve posts by less than or greater than comparisons. For == comparisons, you can add the field name and value right into the {content} tag or publish_model->get_content() call as a $filter. But, in this case, you are kind of at a loss.

We will add a close date for posts in the future that will automatically close them.

josev814 commented 8 years ago

I have a fix for this in my fork. I made all content types with standard fields include an unpublish date. The db holds that date and the status of the content type. Once the unpublish date is encountered, the item is then Disabled. You can still see it in the admin section but the users on the front end will no longer see it. I used a cron hook for that part. Items the have a pub date after the current date will also be Disabled initially, and then enabled once the publish date/time occurs.