Alexander Levenetz <[EMAIL PROTECTED]> said:
> Hello again,
>
>
> >> (actually deleting an article requires authentication - done by
> >> creating a dummy user who can delete articles and running mgd_auth
> >> prior to the mgd_delete_XXXXX
>
> I know how to delete an article, that works fine ;-) My questions is
> if there is a way to have an article delete itself after a certain
> time. I thought that the end date would maybe take care of that but
> that's not the case as far as I understand.
> The reason for this would be that we have an internal subtopic where we
> create articles that have as a name an activity in the database, f.i.
> "03.02.01 article 'bla' added to topic XYZ". This list gets longer and
> longer but after appr. 60 days articles could be deleted. Doing that
> by hand is quite a task, though... Any better way to do that?
>
OK,
Automatically would involve something like a cron job, that would occur
regularly and delete the older articles.
a number of options exist for this
1. cronjob calling a perl routine (that would do SQL calls) - not very
'repligard safe'
2. cronjob calling lynx to an authenticated page eg.
lynx -dump -auth=ID:PASSWD http://myswebsite.com/cleanuppages > /dev/null
to do this, you would have to make the page cleanuppages as 'authenticated' on
the check box.
then the page would do something like...
if ($objs = mgd_list_topic_articles(12))
while ($objs->fetch()) {
if ($objs->calstart + $objs->caldays + 60) < $today)
mgd_delete_article($objs->id);
3. use the code above at the end of a web page and put the line
mgd_auth("ID","PASSWD",1); before it
(pls check exact syntax in manual)
- note that the last option means that you have to put the id & username to
authenticate into the database - and may add a security hole -
DISCLAIMER: USE AT YOUR OWN RISK! if this code deletes the wrong articles -
I'm not responsible :)
regards
alan
> Alexander
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
Technical Director
Linux Center (HK) Ltd.
www.hklc.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]