- Timestamp:
- 05/08/07 16:40:42 (15 years ago)
- Location:
- dev/mods
- Files:
-
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/mods/example_mod/home.php
r212 r213 108 108 $page->addContext($tkbox->generate()); 109 109 110 if (config::get KillPoints())110 if (config::get('kill_points')) 111 111 { 112 112 $tklist = new TopScoreList(); -
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++; -
dev/mods/feed_syndication/settings.php
r212 r213 40 40 $html .= '<div class="kl-loss">Cant retrieve version information from: '.$versionserver.'</div><br><br>'; 41 41 42 if ( getConfig('fetch_feed_count'))43 $feedcount = getConfig('fetch_feed_count');42 if (config::get('fetch_feed_count')) 43 $feedcount = config::get('fetch_feed_count'); 44 44 else 45 45 $feedcount = 3; … … 49 49 if ( ctype_digit($_POST['fetch_feed_count']) && $_POST['fetch_feed_count'] > 0) { 50 50 $feedcount = $_POST['fetch_feed_count']; 51 setConfig('fetch_feed_count', $feedcount);51 config::set('fetch_feed_count', $feedcount); 52 52 for ($i = 99; $i>=$feedcount; $i--) { 53 delConfig('fetch_url_'.$i);53 config::del('fetch_url_'.$i); 54 54 } 55 55 } 56 56 if ( $_POST['fetch_verbose'] ) 57 setConfig('fetch_verbose', '1');58 else 59 setConfig('fetch_verbose', '0');57 config::set('fetch_verbose', '1'); 58 else 59 config::set('fetch_verbose', '0'); 60 60 61 61 if ( $_POST['fetch_compress'] ) 62 setConfig('fetch_compress', '0');63 else 64 setConfig('fetch_compress', '1');62 config::set('fetch_compress', '0'); 63 else 64 config::set('fetch_compress', '1'); 65 65 66 66 if ( $_POST['fetch_comment'] ) 67 setConfig('fetch_comment', $_POST['fetch_comment']);68 else 69 setConfig('fetch_comment', '');67 config::set('fetch_comment', $_POST['fetch_comment']); 68 else 69 config::set('fetch_comment', ''); 70 70 71 71 for ($i = 1; $i<=$feedcount; $i++) { … … 75 75 $friends = "on"; 76 76 else $friends = ""; 77 setConfig($url, $_POST[$url].':::'.$time[$i].':::'.$friends);77 config::set($url, $_POST[$url].':::'.$time[$i].':::'.$friends); 78 78 $feed[$i] = $_POST[$url]; 79 79 } else 80 setConfig($url, '');80 config::set($url, ''); 81 81 $feed[$i] = ''; 82 82 } … … 84 84 $feed = array(); 85 85 for ($i = 1; $i<=$feedcount; $i++) { 86 $str = getConfig('fetch_url_'.$i);86 $str = config::gset('fetch_url_'.$i); 87 87 $tmp = explode(':::', $str); 88 88 $feed[$i] = $tmp[0]; … … 113 113 if ( $_POST['fetch_losses'] ) 114 114 $str .= "&losses=1"; 115 if ( ! getConfig('fetch_compress') )115 if ( !config::get('fetch_compress') ) 116 116 $str .= "&gz=1"; 117 117 if ( $_POST['range1'] && $_POST['range2'] ) { … … 130 130 $html .= $feedfetch->grab( $feed[$i], $myid.$str ); 131 131 } 132 setConfig($cfg, $feed[$i].':::'.$lastkllid.':::'.$friend);132 config::set($cfg, $feed[$i].':::'.$lastkllid.':::'.$friend); 133 133 $time[$i] = $lastkllid; 134 134 } … … 203 203 $html .= "<tr><td height=50px width=150px><b>Comment for automatically parsed killmails?</b></td>"; 204 204 $html .= "<td><input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\""; 205 if ( getConfig('fetch_comment') )206 $html .= getConfig('fetch_comment');205 if ( config::get('fetch_comment') ) 206 $html .= config::get('fetch_comment'); 207 207 $html .= "\"><br><i> (leave blank for none)</i><br></td></tr>"; 208 208 $html .= "<tr><td height=30px width=150px><b>Enable compression?</b></td>"; 209 209 $html .= "<td><input type=checkbox name=fetch_compress id=fetch_compress"; 210 if ( ! getConfig('fetch_compress') )210 if ( !config::get('fetch_compress') ) 211 211 $html .= " checked=\"checked\""; 212 212 $html .= "><i> (enables GZip compression for feeds that support this feature, for streams that do not support GZip compression regular html mode will be used automatically)</i></td>"; … … 214 214 $html .= "<tr><td height=30px width=150px><b>Verbose mode?</b></td>"; 215 215 $html .= "<td><input type=checkbox name=fetch_verbose id=fetch_verbose"; 216 if ( getConfig('fetch_verbose') )216 if ( config::get('fetch_verbose') ) 217 217 $html .= " checked=\"checked\""; 218 218 $html .= "><i> (displays advanced feed request information and errormessages when the imported mail is rejected for being malformed, already exists or is not related to your corp or alliance)</i></td>"; -
dev/mods/forum_post/cc_detail.php
r212 r213 229 229 230 230 $killboard = $page->killboard_; 231 if (config::get KillPoints())231 if (config::get('kill_points')) 232 232 { 233 233 $tklist = new TopContractScoreList(); -
dev/mods/forum_post/class.killsummarytable.php
r212 r213 108 108 109 109 $sql = 'SELECT count(*) AS knb, scl_id, scl_class,'; 110 if (config::get Config('ship_values'))110 if (config::get('ship_values')) 111 111 { 112 112 $sql .= ' sum(ifnull(ksv.shp_value,scl.scl_value)) AS kisk FROM kb3_kills kll … … 142 142 143 143 $sql = 'SELECT count(*) AS lnb, scl_id, scl_class,'; 144 if (config::get Config('ship_values'))144 if (config::get('ship_values')) 145 145 { 146 146 $sql .= ' sum(ifnull(ksv.shp_value,scl.scl_value)) AS lisk FROM kb3_kills kll … … 401 401 402 402 // Build our Post 403 $set_colours = unserialize(config::get Config('forum_post_colours')); //load colour settings403 $set_colours = unserialize(config::get('forum_post_colours')); //load colour settings 404 404 if(!is_array($set_colours)) { $set_colours = array(); } // if the settings have been reset create an empty array so as not to brake the code later on 405 $set_styles = unserialize(config::get Config('forum_post_styles')); //load style settings405 $set_styles = unserialize(config::get('forum_post_styles')); //load style settings 406 406 if(!is_array($set_styles)) { $set_styles = array(); } // if the settings have been reset create an empty array so as not to brake the code later on 407 $set_isk = config::get Config('forum_post_isk',$_POST['isk']); // load isk setting407 $set_isk = config::get('forum_post_isk',$_POST['isk']); // load isk setting 408 408 409 409 //print_r($set_styles); … … 441 441 $style_close = ""; 442 442 } 443 $order = config::get Config('forum_post_order');443 $order = config::get('forum_post_order'); 444 444 445 445 if($order == "first"){ -
dev/mods/forum_post/settings.php
r212 r213 24 24 if(isset($_POST['Reset'])) 25 25 { 26 config::set Config('forum_post_colours',"");27 config::set Config('forum_post_styles',"");26 config::set('forum_post_colours',""); 27 config::set('forum_post_styles',""); 28 28 $confirm = "<strong>Settings Reset</strong><br/>"; 29 29 } … … 56 56 57 57 } 58 config::set Config('forum_post_colours',serialize($forum_post_colours) );59 config::set Config('forum_post_styles',serialize($forum_post_styles));60 config::set Config('forum_post_isk',$_POST['isk']);61 config::set Config('forum_post_order',$_POST['order']);58 config::set('forum_post_colours',serialize($forum_post_colours) ); 59 config::set('forum_post_styles',serialize($forum_post_styles)); 60 config::set('forum_post_isk',$_POST['isk']); 61 config::set('forum_post_order',$_POST['order']); 62 62 63 63 $confirm = "<strong>Settings Saved</strong><br/>"; … … 68 68 $html .= $confirm; 69 69 70 $set_colours = unserialize(config::get Config('forum_post_colours')); //load colour settings70 $set_colours = unserialize(config::get('forum_post_colours')); //load colour settings 71 71 if(!is_array($set_colours)) { $set_colours = array(); } // if the settings have been reset create an empty array so as not to brake the code later on 72 $set_styles = unserialize(config::get Config('forum_post_styles')); //load style settings72 $set_styles = unserialize(config::get('forum_post_styles')); //load style settings 73 73 if(!is_array($set_styles)) { $set_styles = array(); } // if the settings have been reset create an empty array so as not to brake the code later on 74 $set_isk = config::get Config('forum_post_isk',$_POST['isk']); // load isk setting74 $set_isk = config::get('forum_post_isk',$_POST['isk']); // load isk setting 75 75 76 76 //print_r($set_styles); … … 142 142 143 143 Place ship class at start or end of each line?<br/>'; 144 if(config::get Config('forum_post_order') != "last"){144 if(config::get('forum_post_order') != "last"){ 145 145 146 146 $html .= '<input name="order" type="radio" value="first" checked="checked"/>Start<br/> -
dev/mods/known_members/corp_detail.php
r212 r213 406 406 407 407 case "known_members": 408 if( $config->getConfig('known_members_own'))408 if(config::get('known_members_own')) 409 409 { 410 410 $alliance->getID(); … … 432 432 $qry->execute($query); 433 433 $cnt = $qry->recordCount(); 434 $clmn = $config->getConfig('known_members_clmn');434 $clmn = config::get('known_members_clmn'); 435 435 436 436 $html .= "<div class=block-header2>Known Pilots (".$cnt.")</div>"; … … 535 535 $menubox->addOption("link","Top killers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_kills"); 536 536 537 if (config::get KillPoints())537 if (config::get('kill_points')) 538 538 $menubox->addOption("link","Top scorers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_scores"); 539 539 $menubox->addOption("link","Top solokillers", "?a=corp_detail&crp_id=" . $corp->getID() . "&view=pilot_solo"); -
dev/mods/known_members/settings.php
r212 r213 4 4 if ($_POST['submit']) 5 5 { 6 if($_POST['known_members_own']){ 7 $config->setConfig('known_members_own', '1'); 8 } 9 else 10 { 11 $config->setConfig('known_members_own', '0'); 12 } 13 14 $clmn = ""; 15 if($_POST['img']) {$clmn .=",img";} 16 if($_POST['kll_pnts']) {$clmn .=",kll_pnts";} 17 if($_POST['dmg_dn']) {$clmn .=",dmg_dn";} 18 if($_POST['dmg_rcd']) {$clmn .=",dmg_rcd";} 19 if($_POST['eff']) {$clmn .=",eff";} 20 if($_POST['lst_sn']) {$clmn .=",lst_sn";} 21 $config->setConfig('known_members_clmn', $clmn); 22 23 $html .= "Setting Saved"; 6 if($_POST['known_members_own']){ 7 config::set('known_members_own', '1'); 8 } 9 else 10 { 11 config::set('known_members_own', '0'); 12 } 13 $clmn = ""; 14 if($_POST['img']) {$clmn .=",img";} 15 if($_POST['kll_pnts']) {$clmn .=",kll_pnts";} 16 if($_POST['dmg_dn']) {$clmn .=",dmg_dn";} 17 if($_POST['dmg_rcd']) {$clmn .=",dmg_rcd";} 18 if($_POST['eff']) {$clmn .=",eff";} 19 if($_POST['lst_sn']) {$clmn .=",lst_sn";} 20 config::set('known_members_clmn', $clmn); 21 $html .= "Setting Saved"; 24 22 } 25 23 … … 30 28 $html .= "<table class=kb-subtable>"; 31 29 $html .= "<tr><td><b>Remove Known Members page for board owner:</b></td><td><input type=checkbox name=known_members_own id=known_members_own"; 32 if ( $config->getConfig('known_members_own'))30 if (config::get('known_members_own')) 33 31 { 34 32 $html .= " checked=\"checked\""; … … 39 37 $html .= "<div class=block-header2>Show Columns</div>"; 40 38 $html .= "<table class=kb-subtable>"; 41 $clmn = $config->getConfig('known_members_clmn');39 $clmn = config::get('known_members_clmn'); 42 40 43 41 $html .= "<tr><td><b>Add Char. Portrait:</b></td><td><input type=checkbox name=img id=img";