I’m testing the other thing based on this plugin, but can be consolidated and very useful.
For example, if we need change some TV value on unpublished date.
I have a TV like - membership (guest==0||user==1||vip==3) and on some date VIP membershipping must go down from vip to the guest.
One problem is something wrong with my piece of code, which must this TV changing:
1) Can’t handle with document id detection???
2) This value update is not almost correct, cause it makes replacement of wrong id from this table and then I’m having duplicated TV in one document.
$table = $modx->getFullTableName("site_tmplvar_contentvalues");
$fields = array(
"tmplvarid" => "36",
"contentid" => "464", //must be detected automatically
"value" => 0
);
$modx->db->update($fields, $table);
The second thing is how to make TV changing after document will be unpublished.
Maybe it must be an another plugin with another System Event (OnDocUnPublished)???
--
Any advices are welcome, thx!!!