Cron scripts fixup & added isset to database.inc
[mirrors/Kyberia-bloodline.git] / cron / swish_generator.php
index ed6981224360bd66716aa97ec86ebb51a460cc0f..d28f2666dd91508e04b6e2c9688f24871ca7da87 100755 (executable)
@@ -1,16 +1,28 @@
 #!/usr/local/bin/php
 <?php
-error_reporting(0);
-//requiring main config file with path/database etc. constants
-require('/storage/system/www-docroot/kyberia.sk/config/config.inc');
+/*
+ * Script that XXX
+ * Called XXX
+ */
+
+//error_reporting(0);
+
+// 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 from nodes left join node_content on node_content.node_id=nodes.node_id where node_system_access='public' and date(node_created)<=current_date()-interval 1 day and (nodes.k>0 or nodes.node_views>0)");
+$set=$db->query("select nodes.*,node_content from nodes 
+               left join node_content on node_content.node_id=nodes.node_id 
+               where node_system_access='public' and 
+               date(node_created)<=current_date()-interval 1 day and 
+               (nodes.k>0 or nodes.node_views>0)");
 while ($set->next()) {
        $node_id=$set->getString('node_id');
        $node_content=$set->getString('node_content');
This page took 0.14245 seconds and 4 git commands to generate.