Can it be solved that only the wall entries will be deleted automatically by the admin after 2 weeks?
He also deleted everything in the groups. Fault.
July 29 has not been deleted now, all old ones have been deleted from the wall entries.
Thank you ~Z~Man, testing.
Yes, because in line 18 of your code you used >=
, but it has to be <=
(the dates you want to delete have to be SMALLER than the current date -14 days) and not greater)
Yes, delete the july 29-15 wall posts. Old posts not delete.
Okay, but your code is deleting the only latest (14 days old) entries, and all older entries are not deleted?
~Z~Man: Yes.
I'm not quite sure: Do you want to delete all wall entries which are older than 2 weeks?
So there is no syntax error:
function delete2weeksposts(){
$wall = new OssnWall;
$listUser = $wall->GetPosts(array(
'pagelimit' => false,
'wheres' => array(
"(FROMUNIXTIME(o.timecreated) >= DATESUB(NOW(), INTERVAL 2 WEEK))"
)));
if($listUser){
foreach($listUser as $post){
$post->deleteObject($post->guid);
ossntriggercallback('post', 'delete', $post->guid);
}
}
}
delete2weeksposts();
Deleted everything on the wall until July 15, that's not good. It stays every July 29 to July 15 and everything else is canceled. I'd like this.
Arsalan Shah: Now I am trying to delete the wall entries, I copied the code to index.php, sintax error on this line-);
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)