Commit 49f8264e authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Fix article notification

parent c16b5de4
......@@ -361,7 +361,7 @@ class Comments
}
/**
* Propagate comment updaets to publishing queue
* Propagate comment updates to publishing queue
*
* @param integer $id_topic
*/
......@@ -372,7 +372,7 @@ class Comments
if($this->id_type=="5")
{
$pm->TopicInit($id_topic);
$pm->Article($this->id_item,"");
$pm->Article($this->id_item);
}
}
......
......@@ -112,7 +112,7 @@ class PublishManager
unset($this->layout);
}
public function Article($id_article,$param)
public function Article($id_article,$is_new=false)
{
include_once(SERVER_ROOT."/../classes/article.php");
$a = new Article($id_article);
......@@ -165,10 +165,12 @@ class PublishManager
{
$this->MessageSet($this->tr->Translate("publish_article") . " <a href=\"$url\" target=\"_blank\">{$this->layout->article['headline']}</a>");
}
if ((!($this->layout->article['published_ts'])>0) || $param=="new")
if ((!($this->layout->article['published_ts'])>0) || $is_new)
{
$a->PublishedSet();
$this->ArticleNotify($id_article, $url);
if((!($this->layout->article['published_ts'])>0)) {
$this->ArticleNotify($id_article, $url);
}
}
include_once(SERVER_ROOT."/../classes/twitter.php");
$tw = new TwitterHelper();
......@@ -177,7 +179,7 @@ class PublishManager
{
$this->MessageSet($this->tr->TranslateParams("publish_article_tweet",array($this->layout->article['headline'],implode(", ",$tweets))));
}
if ($param=="new" && $this->layout->article['show_latest']=="0")
if ($is_new && $this->layout->article['show_latest']=="0")
$a->ShowLatestSet();
}
else
......@@ -605,7 +607,7 @@ class PublishManager
$this->MessageSet("publish_article_deleted",array($job['id_item']));
break;
case "update":
$this->Article($job['id_item'],$job['param']);
$this->Article($job['id_item'],isset($job['param']) && $job['param']=='new');
break;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment