Page 1 of 1

Batch-deleting Posts

Posted: Fri Jan 07, 2011 1:31 am
by DrNI
Hi folks,

do you know this feeling... when your past keeps haunting you like a ghost? :roll:

I want do delete some old posts, identified by their post number. Is there a way to do this automatically?

I know how to use Unix commands and the cmd line mysql client, if that should be needed. Feel free to post nerdy answers. :D

Thanks for your assistance and thanks to all of you making s9y available. Great software.
DrNI

Re: Batch-deleting Posts

Posted: Fri Jan 07, 2011 12:25 pm
by garvinhicking
Hi!

If you want ot do that, the best way would be to use SQL directly:

DELETE FROM serendipity_entries WHERE id IN (4,8,15,16,23,42)

This leaves some corpses of data in the database, but that should not really be relevant.

Of course, the cleaner way would be a script like:

Code: Select all

<?php
include 'serendipity_config.inc.php';
serendipity_deleteEntry(4);

serendipity_deleteEntry(8);

serendipity_deleteEntry(15);
...
HTH,
Garvin

Re: Batch-deleting Posts

Posted: Thu Jan 19, 2012 12:31 am
by DrNI
Hi Garvin et al,

it's deletion day again, but somehow this doesn't work any more:

Code: Select all

<?php
include 'serendipity_config.inc.php';
serendipity_deleteEntry(4);

serendipity_deleteEntry(8);

serendipity_deleteEntry(15);
...
Nothing happens, the log remains silent, except for a nice 200 OK line in the access log.

Are there changes to the s9y code that make this solution not work?

Thanks for your help

DrNI

Re: Batch-deleting Posts

Posted: Thu Jan 19, 2012 12:52 pm
by garvinhicking
Hi!

Which s9y version? Also, are you logged in before you call the PHP script? It needs authentication.

Regards,
GArvin

Re: Batch-deleting Posts

Posted: Thu Jan 19, 2012 7:03 pm
by DrNI
Hi Garvin,
garvinhicking wrote: Which s9y version? Also, are you logged in before you call the PHP script? It needs authentication.
I could have guessed that. Did it again after login and of course it worked. Thanks for your help.

DrNI