It makes more sense to use the type of page you have for the type, and it prepare published to be a state instead of a type
20 lines
No EOL
573 B
PHP
20 lines
No EOL
573 B
PHP
|
|
<?php defined('KOBLOG') or die('Koblog CMS.');
|
|
|
|
class KoblogUpdater {
|
|
// Special function to upgrade
|
|
public static function upgradeArticlesToPageTypes()
|
|
{
|
|
global $pages;
|
|
foreach ($pages->db as $key => $fields) {
|
|
if ($fields['type'] === "published") {
|
|
$pages->db[$key]['type'] = "article";
|
|
} else {
|
|
//$pages->db[$key]['sticky'] = false; // Not really important for static
|
|
}
|
|
}
|
|
|
|
return $pages->save();
|
|
}
|
|
|
|
} |