For a lot of sites I’m using this old NewsPublisher mod from luke.stokes and The Man Can!
http://modxcms.com/forums/index.php/topic,824.0.html
bug traker :
http://modxcms.com/bugs/task/129
works great with new Ditto 1.1 features
but need an hack of document parser
// HACK **********************************************************
// Insert this about line 1700 in document.parser.class.inc.php
// right after function getTemplateVarOutput
# Set template variable value
function setTV($tvname, $value, $docid="") {
if($tvname== "") return false;
if($docid == "") $docid = $this->documentIdentifier;
//get id of tv
$result=$this->db->select("id", $this->getFullTableName("site_tmplvars"), "name = '". $tvname . "'");
if (!$result) return false;
$row=$this->fetchRow($result);
// query the db to see if there are any records to update
$result=$this->db->select("Count(*) AS RecordsExist", $this->getFullTableName("site_tmplvar_contentvalues") , "tmplvarid=".$row['id']." AND contentid=".$docid);
$row2=$this->fetchRow($result);
if (!$row2['RecordsExist']) {
$fields = array(
"tmplvarid" => $row['id'],
"contentid" => $docid,
"value" => $value
);
$rows_affected = $this->db->insert($fields, $this->getFullTableName("site_tmplvar_contentvalues"));
} else {
$rows_affected = $this->db->update("value='" . $value . "'", $this->getFullTableName("site_tmplvar_contentvalues") , "tmplvarid=".$row['id']." AND contentid=".$docid);
}
return $rows_affected;
}
// END HACK **********************************************************
why don’t add it in new releas?
edit: original luke.stokes’s NP mod uses an old version of NewsPublisher I have updated it with NP 1.4 attached to this post