Author: dgoette
Date: Tue May 12 01:48:51 2009
New Revision: 413
URL:
http://svn.reactos.org/svn/reactos?rev=413&view=rev
Log:
implement a hack for adding dependencies of dynamic pages
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
Modified:
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
URL:
http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/r…
==============================================================================
---
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
[iso-8859-1] (original)
+++
branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTabl…
[iso-8859-1] Tue May 12 01:48:51 2009
@@ -283,6 +283,37 @@
return false;
}
+ // @HACK
+ if (1) {
+ $stmt=&DBConnection::getInstance()->prepare("SELECT name FROM
".ROSCMST_ENTRIES." WHERE id=:data_id");
+
$stmt->bindParam('data_id',$revision['data_id'],PDO::PARAM_INT);
+ $stmt->execute();
+ $name = $stmt->fetchColumn();
+
+ $stmt=&DBConnection::getInstance()->prepare("SELECT r.id FROM
".ROSCMST_ENTRIES." d JOIN ".ROSCMST_REVISIONS." r ON r.data_id=d.id
WHERE d.name = :name AND d.type='dynamic' AND r.archive IS FALSE AND r.status =
'stable' ORDER BY r.datetime DESC LIMIT 1");
+ if (strpos($name,'newsletter_') === 0) {
+ $stmt->bindValue('name','newsletter',PDO::PARAM_STR);
+ }
+ elseif (strpos($name,'news_page_') === 0) {
+ $stmt->bindValue('name','news_page',PDO::PARAM_STR);
+ }
+ elseif (strpos($name,'interview_') === 0) {
+ $stmt->bindValue('name','interview',PDO::PARAM_STR);
+ }
+ elseif (strpos($name,'blog_') === 0) {
+ $stmt->bindValue('name','blog',PDO::PARAM_STR);
+ }
+ else {
+ $stmt=null;
+ }
+
+ if ($stmt !== null) {
+ $stmt->execute();
+ $data = $stmt->fetchColumn();
+ Dependencies::addManual($data,$name,'content');
+ }
+ } // HACK END
+
// make entry stable
Revision::setStatus($revision['id'],'stable');