Cron scripts fixup & added isset to database.inc
[mirrors/Kyberia-bloodline.git] / cron / rssparse.php
index 4769c1656b9acd1868f813bd95a077838a9401b6..0302000445df7ddd676d4304427385040111d475 100755 (executable)
@@ -1,17 +1,29 @@
 #!/usr/local/bin/php
 <?php
-require('../config/config.inc');
+/*
+ * Script that restores number of K for all users.
+ * Called once a day.
+ */
+
+
+// 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');
+
+// include lastRSS library
+include INCLUDE_DIR.'/lastRSS.php';
+
+
 $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='28' and nodes.node_id>100");
 
-// include lastRSS library
-include '../inc/lastRSS.php';
-
 // create lastRSS object
 $rss = new lastRSS;
 
@@ -19,8 +31,9 @@ $rss = new lastRSS;
 $rss->cache_dir = './cache';
 $rss->cache_time = 3600; // one hour
 
+// XXX WTF
 while ($set->next()) {
-// load some RSS file
+// load some RSS file 
        if (!preg_match("/http:(.*)/",$set->getString('node_content'))) {
                $rs = $rss->get("http://kyberia.sk/scripts/google2rss.php?num=25&q=".$set->getString('node_content'));
        }
@@ -67,4 +80,4 @@ node_type=13,node_creator='".$set->getString('node_id')."',node_created=NOW()";
 
 
 
-?>
\ No newline at end of file
+?>
This page took 0.138941 seconds and 4 git commands to generate.