0 Пользователей и 1 Гость просматривают эту тему.
  • 0 Ответов
  • 788 Просмотров
*

Wertos

  • Захожу иногда
  • 489
  • 22 / 0
Код: php
if (!defined('_JEXEC')) {
    define( '_JEXEC', 1 );
    define('JPATH_BASE', realpath(dirname(__FILE__)));
    require_once ( JPATH_BASE .'/includes/defines.php' );
    require_once ( JPATH_BASE .'/includes/framework.php' );
    $basePath = JPATH_ADMINISTRATOR.'/components/com_content';
    require_once $basePath.'/models/article.php';
    defined('DS') or define('DS', DIRECTORY_SEPARATOR);
}

$app = JFactory::getApplication('site');
$config = array();
$article_model = new ContentModelArticle($config);

$art = array(
  'id'    => 0,
  'catid' => 2,
  'title' => $title,
  'alias' => $alias,
  'created_by' => 1028,
  'state' => 1,
  'introtext' => trim(strip_tags($introtext,'<p><br /><br/><br>')),
  'fulltext' => trim(strip_tags($fulltext,'<p><br /><br/><br>')),
  'tags' => $tag_ids,
  'urls' => '{"urla":false,"urlatext":"","targeta":"","urlb":false,"urlbtext":"","targetb":"","urlc":false,"urlctext":"","targetc":""}',
  'attribs' => '{"show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_icons":"","show_print_icon":"","show_email_icon":"","show_vote":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_layout":"","show_publishing_options":"","show_article_options":"","show_urls_images_backend":"","show_urls_images_frontend":""}',
  'metadata' => '{"robots":"","author":"","rights":"","xreference":""}',
  'language' => '*',
  'created' => JHTML::Date(time(), 'Y-m-d H:i:s')
);

    $data['rules'] = array(
        'core.edit.delete' => array(),
        'core.edit.edit' => array(),
        'core.edit.state' => array(),
    );
    $article_model->save($data);
Эта конструкция добавляет материал. Она работает. Хотелось бы узнать, при такой схеме плагины отрабатывают или нет и если отрабатывают то какой группы ?
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться