3 Any page that has "DeletedPage" as content will be removed if that wasn't
4 changed in a given timeframe (typically a month or two weeks). If a page
5 is completely empty that will also work. Other aliases to engage this
7 - "deleted" (or "DeletedPage")
8 - "DeletePage" or "delete"
9 - simply "trash" or a link to "TrashCan"
10 - "RemovePage", "remove"
11 - "RemovedPage", "removed"
13 This feature is also known as MeatBall:KeptPages.
17 // define("DELETEPAGES", 1);
21 if (defined("DELETEPAGES") && DELETEPAGES && $keptpages) {
23 echo "[$cron]: Scanning for pages to kill...\n";
47 $all = ewiki_db::GETALL("id", "version", "lastmodified");
48 while ($row = $all->get()) {
50 #-- check that it wasn't modified lately
51 if (time() >= $row["lastmodified"] + $keptpages) {
53 #-- check page content for trigger words
55 $row = ewiki_db::GET($id);
56 $text = strtolower(trim($row["content"]));
57 $refs = trim($row["refs"]);
58 if (in_array($text, $triggers)
59 or ewiki_in_array($refs, $triggers))
61 #-- purge it, no mercy!!!!!
63 for ($v=$row["version"]; $v>=1; $v--) {
64 if (ewiki_db::GET($id, $v)) {
66 ewiki_db::DELETE($id, $v);