Тут вообще-то ничего интересного,
просто мои закладки и прочий говнокод

EVO CMS / Разное

IMAGES
Базовый набор картинок для работы

PNG + SVG

gallery.php
Переход с evoGallery на SimpleGallery

Кладём gallery.php в корень.
Правим пути. Запускаем. Потом не забыть удалить.

<?php
define('MODX_API_MODE', true);
define('MODX_BASE_PATH', __DIR__ . '/');
define('MODX_BASE_URL', '/');
define('MODX_SITE_URL', 'http://sitename.ru/');
include_once("index.php");
$modx->db->connect();
if (empty ($modx->config)) {
$modx->getSettings();
}
include_once(MODX_BASE_PATH.'assets/plugins/simplegallery/lib/table.class.php');
$modx->invokeEvent("OnManagerPageInit");
$q = $modx->db->query("SELECT * FROM {$modx->getFullTableName('portfolio_galleries')} ORDER BY `content_id` ASC, `sortorder` ASC, `id` ASC");
$fs = \Helpers\FS::getInstance();
$sg = new \SimpleGallery\sgData($modx);
while ($row = $modx->db->getRow($q)) {
$path = 'assets/galleries/'.$row['content_id'].'/';
if ($fs->checkFile($path.'original/'.$row['filename'])) {
$sg->create();
$sg->set('sg_rid',$row['content_id']);
$sg->set('sg_title',$row['title']);
$sg->set('sg_description',$row['description']);
$sg->set('sg_image',$path.$row['filename']);
$fs->moveFile($path.$row['filename'],$path.'large/'.$row['filename']);
$fs->moveFile($path.'original/'.$row['filename'],$path.$row['filename']);
$name = MODX_BASE_PATH . $path.$row['filename'];
$info = getimagesize($name);
$properties = array(
'width' => $info[0],
'height' => $info[1],
'size' => filesize($name)
);
$sg->set('sg_properties',$properties);
$sg->save();
}
}