Commit 9836201e authored by Dries's avatar Dries

- Bugfix. Reported by Gunnar

parent 3b840abe
......@@ -49,7 +49,8 @@ function import_link($type) {
}
function import_cron() {
$result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
// $result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
$result = db_query("SELECT * FROM feed");
while ($feed = db_fetch_array($result)) {
import_refresh($feed);
}
......@@ -215,9 +216,12 @@ function import_element_data($parser, $data) {
}
}
function import_refresh($feed) {
// unset the global variables before we use them:
unset($GLOBALS["channel"], $GLOBALS["element"], $GLOBALS["item"], $GLOBALS["items"], $GLOBALS["tag"]);
// after we unset the variables, we can global them again:
global $items, $channel;
/*
......@@ -239,9 +243,6 @@ function import_refresh($feed) {
}
fclose($fp);
// unset the global variables:
unset($GLOBALS["channel"], $GLOBAL["element"], $GLOBALS["item"], $GLOBAL["items"]);
// parse the data:
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "import_element_start", "import_element_end");
......
......@@ -49,7 +49,8 @@ function import_link($type) {
}
function import_cron() {
$result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
// $result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
$result = db_query("SELECT * FROM feed");
while ($feed = db_fetch_array($result)) {
import_refresh($feed);
}
......@@ -215,9 +216,12 @@ function import_element_data($parser, $data) {
}
}
function import_refresh($feed) {
// unset the global variables before we use them:
unset($GLOBALS["channel"], $GLOBALS["element"], $GLOBALS["item"], $GLOBALS["items"], $GLOBALS["tag"]);
// after we unset the variables, we can global them again:
global $items, $channel;
/*
......@@ -239,9 +243,6 @@ function import_refresh($feed) {
}
fclose($fp);
// unset the global variables:
unset($GLOBALS["channel"], $GLOBAL["element"], $GLOBALS["item"], $GLOBAL["items"]);
// parse the data:
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "import_element_start", "import_element_end");
......
......@@ -49,7 +49,8 @@ function import_link($type) {
}
function import_cron() {
$result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
// $result = db_query("SELECT * FROM feed WHERE timestamp + refresh < ". time());
$result = db_query("SELECT * FROM feed");
while ($feed = db_fetch_array($result)) {
import_refresh($feed);
}
......@@ -215,9 +216,12 @@ function import_element_data($parser, $data) {
}
}
function import_refresh($feed) {
// unset the global variables before we use them:
unset($GLOBALS["channel"], $GLOBALS["element"], $GLOBALS["item"], $GLOBALS["items"], $GLOBALS["tag"]);
// after we unset the variables, we can global them again:
global $items, $channel;
/*
......@@ -239,9 +243,6 @@ function import_refresh($feed) {
}
fclose($fp);
// unset the global variables:
unset($GLOBALS["channel"], $GLOBAL["element"], $GLOBALS["item"], $GLOBAL["items"]);
// parse the data:
$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "import_element_start", "import_element_end");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment