[ros-diffs] [dgoette] 413: implement a hack for adding dependencies of dynamic pages
dgoette at svn.reactos.org
dgoette at svn.reactos.org
Mon May 11 23:48:52 CEST 2009
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_EntryTable.class.php
Modified: branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTable.class.php
URL: http://svn.reactos.org/svn/reactos/branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTable.class.php?rev=413&r1=412&r2=413&view=diff
==============================================================================
--- branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTable.class.php [iso-8859-1] (original)
+++ branches/danny-web/www/www.reactos.org/roscms/lib/backend/Backend_EntryTable.class.php [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');
More information about the Ros-diffs
mailing list