PDA

View Full Version : delete post in cron by datamanager


developpez.com
09-14-2007, 05:37 PM
Hello !

I try to delete post in a cron "/includes/cron/file.php"

i find this code in cleanup.php :

// delete expired thread redirects
$threads = $vbulletin->db->query_read("
SELECT threadid
FROM " . TABLE_PREFIX . "threadredirect
WHERE expires < " . TIMENOW . "
");

while ($thread = $vbulletin->db->fetch_array($threads))
{
$thread['open'] = 10;
$threadman =& datamanager_init('Thread', $vbulletin, ERRTYPE_SILENT, 'threadpost');
$threadman->set_existing($thread);
$threadman->delete(false, true, NULL, false);
unset($threadman);
}

how can i do the same thing for the post ?

i can't find any documentation on the datamanager for post delete ...

Best reguards !!

Dismounted
09-15-2007, 04:23 AM
To delete posts:
$postman =& datamanager_init('Post', $vbulletin, ERRTYPE_STANDARD, 'threadpost');
$postman->set_existing($post);
$postman->delete();
unset($postman);
Where $post is the post's information.

developpez.com
09-15-2007, 05:37 AM
Thanks you !

best reguards

Forum-Germany
09-19-2009, 03:08 PM
Hello.

I would extinguish with pleasure automatically (Crone job) certain contributions in a subject.
But the first contribution should not be extinguished, but all the others.

I am nobody vBulletin spezialist and do not know a lot so well and would be glad about hilfe very much.

How must the file PHP look certainly?

Many thanks.