/** * plgContentAutotweetPost * * @param string &$subject Param * @param object $params Param */ public function __construct(&$subject, $params) { parent::__construct($subject, $params); $pluginParams = $this->pluginParams; // Joomla article specific params $this->categories = $pluginParams->get('categories', ''); $this->excluded_categories = $pluginParams->get('excluded_categories', ''); $this->post_modified = (int) $pluginParams->get('post_modified', 0); $this->show_category = (int) $pluginParams->get('show_category', 0); $this->show_hash = (int) $pluginParams->get('show_hash', 0); $this->use_text = (int) $pluginParams->get('use_text', 0); $this->use_text_count = $pluginParams->get('use_text_count75', SharingHelper::MAX_CHARS_TITLE); $this->static_text = strip_tags($pluginParams->get('static_text', '')); $this->static_text_pos = (int) $pluginParams->get('static_text_pos', 1); $this->static_text_source = (int) $pluginParams->get('static_text_source', 0); $this->metakey_count = (int) $pluginParams->get('metakey_count', 1); $this->interval = (int) $pluginParams->get('interval', 60); // Correct value if value is under the minimum if ($this->interval < 60) { $this->interval = 60; } }
/** * onContentAfterSave * * @param object $context The context of the content passed to the plugin. * @param object $article A JTableContent object * @param bool $isNew If the content is just about to be created * * @return boolean */ public function onContentAfterSave($context, $article, $isNew) { // Autotweet Advanced Attrs parent::onContentAfterSave($context, $article, $isNew); if (($context == 'com_content.article' || $context == 'com_content.form') && ($isNew || $this->post_modified || $this->_post_modified_as_new == $article->id || $this->advanced_attrs && $this->advanced_attrs->postthis == self::POSTTHIS_YES) && ($article->featured > 0 || 0 == $this->post_featured_only) && 1 == $article->state) { $this->postArticle($article); } return true; }