We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39706
    • 34 Posts
    Подскажите, что я делаю не так? сниппет:
    $gallery = $modx->getService('gallery','Gallery',$modx->getOption('gallery.core_path',null,$modx->getOption('core_path').'components/gallery/').'model/gallery/',$scriptProperties);
    	  if (!($gallery instanceof Gallery)) return '';
    	  $modx->lexicon->load('gallery:web');
    	  $store = $modx->newObject('galItem');
    	  $store->fromArray(array(
    	    'id' => NULL,
    	    'name' => trim($_POST['title']),
    	    'filename' => intval($_POST['category']).'/',
    	    'description' => trim($_POST['descr']),
    	    'mediatype' => 'image',
    	    'createdon' => strftime('%Y-%m-%d %H:%M:%S'),
    	    'createdby' => intval($_POST['uid']),
    	    'active' => '1',
    	    'watermark_pos' => 'tl'
    	  ));
    	  $store->save();