Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Auto deleting link after it reaches a date value in a new field

Quote Reply
Auto deleting link after it reaches a date value in a new field
Hi Folks

I've added a new user field to links.cfg called closing date. What i want to do is have the link get deleted after the date in that field has been passed.

It will takes to long searching in admin to delete each link
each link. Is this possible ?

Regards

Trevor

Quote Reply
Re: Auto deleting link after it reaches a date value in a new field In reply to
There is no routine in Links that will do that, so you would have to write a custom routine to delete the records (using sub delete_records in db.pl as an example) automatically. It would probably be best to include a routine in nph-build.cgi to do the deleting as part of the building process.

However, if you have the new field defined and the records are updated, you can manually do it quickly yourself without a lot of searching. Just go to the admin screen and click on the Links Delete option. When the search screen opens, put an asterisk in the "Closing Date" field. Then, at the bottom of the screen, set to search to sort on the "Closing Date" in Ascending Order. Then click the Search button. The returned records will be displayed in earliest to latest date sequence and you can select the ones that have expired (they have a Closing Date earlier than today's date) to delete. That would be a lot faster than searching for individual records.

I hope this helps.
Quote Reply
Re: Auto deleting link after it reaches a date value in a new field In reply to
Thanks again for the reply.
One question.

Can you do multiply deteles that way or would you have to delete one at a time?


Trevor
Quote Reply
Re: Auto deleting link after it reaches a date value in a new field In reply to
There will be a checkbox to the left of each record. If you want to delete it, check the box. Otherwise, leave it alone. Then when you click on the delete button, all the checked records will be deleted.