Commit e63f0a4f authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Propagate event features

parent 8318e027
......@@ -135,6 +135,22 @@ class Ontology
}
}
}
// Propagate event keywords to articles
if($id_type==$types['event']) {
include_once(SERVER_ROOT."/../classes/pagetypes.php");
include_once(SERVER_ROOT."/../classes/article.php");
include_once(SERVER_ROOT."/../classes/topic.php");
$pt = new PageTypes();
$features = $pt->FeaturesByFunction(24);
foreach($features as $feature) {
if($feature['condition_id']>0 && $feature['id_type']=="3") {
$a = new Article($feature['condition_id']);
$a->ArticleLoad();
$t = new Topic($a->id_topic);
$t->queue->JobInsert($t->queue->types['article'],$feature['condition_id'],"update");
}
}
}
}
public function KeywordsByType( $id_type )
......
......@@ -84,6 +84,16 @@ class PageTypes
$this->propagate = $ini->GetModule("layout","feature_propagate",1);
}
public function FeaturesByFunction($id_function) {
$rows = array();
$db =& Db::globaldb();
$sqlstr = "SELECT f.condition_id,pf.id_type
FROM features f
INNER JOIN page_features pf ON f.id_feature=pf.id_feature
WHERE $id_function";
$db->QueryExe($rows, $sqlstr);
}
public function FeatureDelete($id_feature,$id_style,$id_type)
{
$db =& Db::globaldb();
......
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