I've posted about this some time back, but no one had any viable solution - and now I really need this badly. I'm looking for a hack to content type configuration, or an include file to the flexinode module, that would let the administrator set an unpublish or (preferably) a deletion time for any nodetype
- i.e., there would be a flexinode include called "add deletion" which would put an entry in the flexinode form list that says something like "Delete this node after..." and then a dropdown list specifying time: "1 week; 2 weeks; 1 month"... etc. Or alternately, this deletion form element would appear on the content configuration page for each nodetype.
Last time I posted this, several of you suggested I use the Scheduler module; however, this does not do what I'm looking for. The Scheduler module leaves the scheduling to the user posting the node, and not to the administrator creating the nodetype; also, it relies on actual dates (e.g., "July 23, 2006") rather than specified periods of time ("2 weeks").
This is the last piece I need to create the perfect classified ad system with Drupal. I am using Drupal 4.6.7 and will be updating to 4.6.8 but have no plans to update this installation to 4.7 in the near future. At this point I would be willing to pay someone to do this hack, as it's beyond my PHP powers; if you're interested in doing this as a paid job, you can use the contact form on my account to email me --
Comments
Some helpful directon, maybe
Some helpful directon, maybe (focused on 4.7, though):
how_to_create_a_publish_on_option_for_nodes
---
Work: BioRAFT
The a 4.7 base install and
The a 4.7 base install and the forms API this "hack" would be simple to implement in a module. Pitty you're sticking with the 4.6 code base.
--
Ixis (UK) providing Drupal consultancy and Drupal theme design.
--
Ixis (UK): Drupal support, Drupal hosting.
We're not upgrading to 4.7
We're not upgrading to 4.7 in the near future because I have *87* modules running on this 4.6.7 install, most of them have been customized by us in some way and this website has not even opened to the public yet (scheduled to debut July 18). We just don't have the time now to customize all the 4.7 versions of these modules all over again. We committed to using the 4.6 version a year ago and have to live with that decision, at least for the near future. That's the reason...
hardcode delete time?
If you are willing to hard-code the per-node-type deletion times, even in 4.6 this could be a really minimal module (I think). See the module section of the handbook.
Create a new table with two columns: nid, delete_date
Implement hook_help to get started.
Implement hook_nodeapi to put an entry into this table when a node is created ($op insert). You probably also want to implement $op delete, to avoid future database errors. Maybe $op view to show the deletion date at the bottom of the node to the post's author and/or site admins?
Implement hook_cron roughly as per the lullabot example to retreive the nid values from you table for nodes that should be deleted. Replicate the code from node_delete in your hook_cron to get the job done.
The only trick would be figuring out the right date formating to get it to work. For node types to never be deleted, just don't put an entry in your table.
---
Work: BioRAFT
your site
is it possible to look at your site?
with 78 modules, it must be very fancy!
Anything new on this topic?
Anything new on this topic? I read that workflow has a scheduler integrated, but really could not figure how to work it out...
Any help in deleteing a nodes from a node type after a priod of time fixed by the admin would be greatly appreciated!
Drupalworld