public function onContentAfterSave($context, $article, $isNew)
{
if ((!empty($context) && !in_array($context, array('com_content.article', 'com_content.form'))) || empty($article)) {
return true;
}
$articleId = is_object($article) ?
$article->id : (string) $article;
$this->ping($articleId, $article);
return true;
}
и
public function onContentChangeState($context, $pks, $value)
{
if (!empty($context) && !in_array($context, array('com_content.article', 'com_content.form'))) {
return true;
}
$articleId = $pks[0];
$this->ping($articleId);
return true;
}
и
$database->setQuery("SELECT access, publish_up, state FROM #__content WHERE id='$articleId'");
$articleInfo = $database->loadAssoc();
$url = JUri::root() . "index.php?option=com_content&view=article&id=$articleId";
if (($articleInfo['access'] == 1) && ($articleInfo['state'] == 1)) {
$postdata = http_build_query(array(
'key' => urlencode($key),
'login' => urlencode($yalogin),
'search_id' => urlencode($searchId),
'pluginid' => urlencode($pluginId),
'cmsver' => $cmsver,
'publishdate' => $this->get_date($articleInfo['publish_up']),
'urls' => $url
));