Cron scripts fixup & added isset to database.inc
[mirrors/Kyberia-bloodline.git] / cron / templates.php
index d7fa82e982e9a3ab58510e9c5d3803bf18b548ce..47e10eed018ecb660c3804094687b85eb4c8cb62 100755 (executable)
@@ -1,13 +1,25 @@
 #!/usr/local/bin/php
 <?php
-require('../config/config.inc');
+/*
+ * Script that XXX ? create template files from sql ?
+ * Called XXX
+ */
+
+
+// Use relative address of config file
+// Change this, if you move you cron directory.
+$dir=substr(__FILE__, 0, strrpos(__FILE__, '/'));
+require($dir.'/../wwwroot/config/config.inc');
+
 //connecting to database and creating universal $db object
-require(SYSTEM_ROOT.'/inc/log.inc');
-require(SYSTEM_ROOT.'/inc/database.inc');
-require(SYSTEM_ROOT.'/inc/nodes.inc');
+require(INCLUDE_DIR.'/log.inc');
+require(INCLUDE_DIR.'/database.inc');
+require(INCLUDE_DIR.'/nodes.inc');
 $db=new CLASS_DATABASE();
 
-$set=$db->query("select nodes.*,node_content.*,nodes.node_id as node_id from nodes left join node_content on nodes.node_id=node_content.node_id where node_type='14'");
+$set=$db->query("select nodes.*,node_content.*,nodes.node_id as node_id from nodes 
+               left join node_content on nodes.node_id=node_content.node_id 
+               where node_type='14'");
 
 while ($set->next()) {
        $node_content=$set->getString('node_content');
@@ -18,8 +30,4 @@ while ($set->next()) {
        chown(OWN_TEMPLATE_DIR.$template_id.".tpl","www");
 }
 
-
-
-
-
-?>
\ No newline at end of file
+?>
This page took 0.111544 seconds and 4 git commands to generate.