1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54:
<?php
class Combi extends Zenpage {
function getOldCombiNews() {
return $this->getCombiNews(NULL, NULL, 'published');
}
}
global $plugin_is_filter;
enableExtension('galleryArticles', $plugin_is_filter);
$obj = new Combi();
$combi = $obj->getOldCombiNews();
$cat = new ZenpageCategory('combiNews', true);
$cat->setTitle(gettext('combiNews'));
$cat->setDesc(gettext('Auto category for ported combi-news articles.'));
$cat->save();
foreach ($combi as $article) {
switch ($article['type']) {
case 'images':
$obj = newImage(NULL, array('folder' => $article['albumname'], 'filename' => $article['titlelink']), false);
if ($obj->exists) {
$obj->setPublishDate($article['date']);
self::publishArticle($obj, 'combiNews');
}
break;
case 'albums':
$obj = newAlbum($article['albumname'], false);
if ($obj->exists) {
$obj->setPublishDate($article['date']);
self::publishArticle($obj, 'combiNews');
}
break;
}
}
purgeOption('zenpage_combinews');
purgeOption('combinews-customtitle');
purgeOption('combinews-customtitle-imagetitles');
purgeOption("zenpage_combinews_sortorder");
purgeOption('zenpage_combinews_imagesize');
purgeOption('combinews-thumbnail-width');
purgeOption('combinews-thumbnail-height');
purgeOption('combinews-thumbnail-cropwidth');
purgeOption('combinews-thumbnail-cropheight');
purgeOption('combinews-thumbnail-cropx');
purgeOption('combinews-thumbnail-cropy');
purgeOption('zenpage_combinews_mode');
?>