Gossamer Forum
Home : Products : Gossamer Links : Discussions :

time limited links

Quote Reply
time limited links
Hello again :-)

Is there any way how to create time-limited links? I mean links that would be displayed for admin-defined period of time - ie. 3 months.

I think it would be possible to do it by creating new column "Time_limited" in Links's database with two values "Yes" and "No". Then on every build, the system would take a look at each link's timestamp and if it would be older ie. more than 3 months and Time_limited would be set to "Yes", system would automatically delete that link.

I hope somebody of you has something similar yet implemented, because I think it is impossible to run bigger Classified Ads directory without this option.

Thank you in ahead for any help and suggestions :-)

Robo
Quote Reply
Re: [Robo] time limited links In reply to
Okay,

All you need is to run a cron job every night that deletes links where Add_Date is greater than three months ago.
Quote Reply
Re: [giovanni] time limited links In reply to
How can I do that? (I don't have dedicated server)
Quote Reply
Re: [Robo] time limited links In reply to
Do you have access to Cron? Can you get a cronjob set up?
Quote Reply
Re: [giovanni] time limited links In reply to
Do you have shell access?
Quote Reply
Re: [giovanni] time limited links In reply to
nope Unsure

but i can use "virtual" shell access in FileMan OR talk to my hosting company
Quote Reply
Re: [Robo] time limited links In reply to
I'd talk to your hosting company. Ask them to setup cron to run a perl script on your server once every 24 hours.
Quote Reply
Re: [giovanni] time limited links In reply to
ok, i think that would be possible for sure - Prohosting is cool in that - they will do everything for you...

now... what should i put into that perl script?
Quote Reply
Re: [Robo] time limited links In reply to
2 secs

Last edited by:

giovanni: Aug 8, 2002, 3:59 AM
Quote Reply
Re: [giovanni] time limited links In reply to
huh? Smile
Quote Reply
Re: [Robo] time limited links In reply to
OK, check your PM. Check it before you run it just so it doesn't do anything you don't want it to. It's quite simple.

By running the code you assume full responsibilty for any outcome. There is no warranty and it is provided as is.
Quote Reply
Re: [giovanni] time limited links In reply to
lol that's gonna fill him with confidence :)

You can create a cronjob like:

system "crontab /full/path/to/mycron.txt" or die "$!, $?";

In mycron.txt you'd put the code for the cronjob eg...

* * * * * /path/to/myscript.cgi