--- textlinkads.old/textlinkads.module 2006-08-24 10:01:58.000000000 -0700 +++ textlinkads/textlinkads.module 2006-09-20 06:08:17.000000000 -0700 @@ -319,7 +319,7 @@ function textlinkads_update_links($url, $parser = new xml2array(); if ($data = $parser->parseXMLintoarray($xml)) { // there is just one link - if ($data['LINKS']['LINK']['URL']) { + if (is_array($data['LINKS']) && $data['LINKS']['LINK']['URL']) { $links = array($data['LINKS']['LINK']); } else { @@ -357,6 +357,7 @@ function textlinkads_next_rss_ad() { * @return Array */ function textlinkads_get_links($type = 'text') { + $links = array(); $limit = ($type == 'text') ? variable_get('textlinkads_total', 4) : variable_get('feed_default_items', 10); $where = ($type == 'text') ? 'text IS NOT NULL && beforetext IS NOT NULL && aftertext IS NOT NULL' : 'rsstext IS NOT NULL'; $result = db_query("SELECT * FROM {textlinkads} WHERE $where LIMIT %d", $limit); @@ -475,4 +476,4 @@ function textlinkads_get_js() { __END__; return $js; -} \ No newline at end of file +}