Changeset 213 for dev/mods/feed_syndication/feed_fetcher.php
- Timestamp:
- 05/08/07 16:40:42 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/mods/feed_syndication/feed_fetcher.php
r193 r213 25 25 $link = ""; 26 26 $x=0; 27 28 function setConfig($key, $value) {29 global $config;30 if (method_exists($config, 'setConfig'))31 return $config->setConfig($key, $value);32 $qry = new DBQuery();33 $qry->execute("select cfg_value from kb3_config34 where cfg_key = '".$key."' and cfg_site = '".KB_SITE."'");35 if ($qry->recordCount())36 $sql = "update kb3_config set cfg_value = '".$value."'37 where cfg_site = '".KB_SITE."' and cfg_key = '".$key."'";38 else39 $sql = "insert into kb3_config values ( '".KB_SITE."','".$key."','".$value."' )";40 $qry->execute($sql);41 }42 43 function getConfig($key) {44 global $config;45 if (method_exists($config, 'getConfig'))46 return $config->getConfig($key);47 $qry = new DBQuery();48 $qry->query("select ".$key." from kb3_config where cfg_site = '".KB_SITE."'");49 $row = $qry->getRow();50 if (isset($row[$key]))51 return $row[$key];52 return false;53 }54 55 function delConfig($key) {56 global $config;57 $qry = new DBQuery();58 $qry->execute("delete from kb3_config where cfg_key = '".$key."' and cfg_site = '".KB_SITE."'");59 }60 27 61 28 class Fetcher { … … 89 56 xml_parser_free($xml_parser); 90 57 91 if ( getConfig('fetch_verbose') ) {58 if (config::get('fetch_verbose') ) { 92 59 if ($x) 93 60 $html .= "<div class=block-header2>".$x." kills added from feed: ".$url."<br>".$str." <i><br>(".$cprs.")</i><br><br></div>"; … … 120 87 $killid = $parser->parse( true ); 121 88 if ( $killid == 0 || $killid == -1 || $killid == -2 ) { 122 if ( $killid == 0 && getConfig('fetch_verbose') )89 if ( $killid == 0 && config::get('fetch_verbose') ) 123 90 $html .= "Killmail is malformed.<br>"; 124 if ( $killid == -2 && getConfig('fetch_verbose') )91 if ( $killid == -2 && config::get('fetch_verbose') ) 125 92 $html .= "Killmail is not related to ".KB_TITLE.".<br>"; 126 if ( $killid == -1 && getConfig('fetch_verbose') )93 if ( $killid == -1 && config::get('fetch_verbose') ) 127 94 $html .= "Killmail already posted <a href=\"?a=kill_detail&kll_id=".$parser->dupeid_."\">here</a>.<br>"; 128 95 } … … 132 99 $html .= "Killmail succsessfully posted <a href=\"?a=kill_detail&kll_id=".$killid."\">here</a>.<br>"; 133 100 134 if (class_exists('Comments') && getConfig('fetch_comment')) { // for the Eve-Dev Comment Class101 if (class_exists('Comments') && config::get('fetch_comment')) { // for the Eve-Dev Comment Class 135 102 $comments = new Comments($killid); 136 $comments->addComment("liq's feed syndication", getConfig('fetch_comment')." mail fetched from: ".$uurl.")");103 $comments->addComment("liq's feed syndication", config::get('fetch_comment')." mail fetched from: ".$uurl.")"); 137 104 } 138 if (class_exists('Comment') && getConfig('fetch_comment')) { // for the D2 Killboard Comment Class105 if (class_exists('Comment') && config::get('fetch_comment')) { // for the D2 Killboard Comment Class 139 106 $comment = new Comment($killid); 140 $comment->postComment( getConfig('fetch_comment')." \n\n\n <i>mail fetched from:\n ".$uurl."</i>", "liquidism");107 $comment->postComment(config::get('fetch_comment')." \n\n\n <i>mail fetched from:\n ".$uurl."</i>", "liquidism"); 141 108 } 142 109 $x++;