- Timestamp:
- 11/04/06 05:44:08 (14 years ago)
- Location:
- dev/common
- Files:
-
- 1 added
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin.php
r33 r47 14 14 $config->setStyleBanner($_POST['style_banner']); 15 15 $config->setStyleName($_POST['style_name']); 16 if ($_POST['kill_points'] == "on") 17 { 18 $killpoints = 1; 19 } 20 else 21 { 22 $killpoints = 0; 23 } 24 if ($_POST['least_active'] == "on") 25 { 26 $leastactive = 1; 27 } 28 else 29 { 30 $leastactive = 0; 31 } 32 $config->setKillPoints($killpoints); 33 $config->setLeastActive($leastactive); 34 if ($_POST['comments'] == "on") 16 17 // new function checkCheckbox, checks $_POST[arg] and inserts 0 if != 'on' 18 $config->checkCheckbox('kill_points'); 19 $config->checkCheckbox('ship_values'); 20 $config->checkCheckbox('least_active'); 21 22 if ($config->checkCheckbox('comments')) 35 23 { 36 24 require_once('autoupgrade.php'); 37 25 check_commenttable(); 38 $config->setConfig('comments', '1'); 39 } 40 else 41 { 42 $config->setConfig('comments', '0'); 43 } 44 if ($_POST['comments_pw'] == "on") 45 { 46 $config->setConfig('comments_pw', '1'); 47 } 48 else 49 { 50 $config->setConfig('comments_pw', '0'); 51 } 52 if ($_POST['comments_count'] == "on") 53 { 54 $config->setConfig('comments_count', '1'); 55 } 56 else 57 { 58 $config->setConfig('comments_count', '0'); 59 } 26 } 27 $config->checkCheckbox('comments_pw'); 28 $config->checkCheckbox('comments_count'); 29 60 30 $config->setPostPassword($_POST['post_password']); 61 31 $config->setPostMailto($_POST['post_mailto']); … … 144 114 } 145 115 $html .= "></td></tr>"; 116 $html .= "<tr><td width=120><b>Use custom shipvalues:</b></td><td><input type=checkbox name=ship_values id=ship_values"; 117 if ($config->getConfig('ship_values')) 118 { 119 $html .= " checked=\"checked\""; 120 } 121 $html .= "></td></tr>"; 146 122 $html .= "<tr><td width=120><b>Enable Comments:</b></td><td><input type=checkbox name=comments id=comments"; 147 123 if ($config->getConfig('comments')) -
dev/common/admin_menu.php
r34 r47 6 6 $menubox->addOption("Contracts", "?a=admin_cc&op=view&type=contract"); 7 7 $menubox->addOption("Campaigns", "?a=admin_cc&op=view&type=campaign"); 8 $menubox->addOption("Ship Values", "?a=admin_shp_val"); 8 9 $menubox->addOption("Synchronization", "?a=admin_sync"); 9 10 $menubox->addOption("Mods", "?a=admin_mods"); -
dev/common/autoupgrade.php
r44 r47 8 8 if ($result) 9 9 { 10 check_commenttablerow();10 check_commenttablerow(); 11 11 return; 12 12 } … … 29 29 if ($result) 30 30 { 31 check_commenttablerow(); 31 $query = 'ALTER TABLE `kb3_comments` CHANGE `ID` `id` INT( 11 ) NOT NULL AUTO_INCREMENT'; 32 $qry->execute($query); 32 33 return; 33 34 } … … 35 36 $qry->execute($query); 36 37 } 38 39 function check_shipvaltable() 40 { 41 $qry = new DBQuery(); 42 $query = 'select count(*) from kb3_ships_values'; 43 $result = mysql_query($query); 44 if ($result) 45 { 46 return; 47 } 48 $query = 'CREATE TABLE `kb3_ships_values` ( 49 `shp_id` INT( 11 ) NOT NULL , 50 `shp_value` BIGINT( 4 ) NOT NULL , 51 INDEX ( `shp_id` ) 52 ) TYPE = MYISAM ;'; 53 $qry->execute($query); 54 } 55 37 56 ?> -
dev/common/class.killboard.php
r16 r47 132 132 } 133 133 134 function checkCheckbox($name) 135 { 136 if ($_POST[$name] == "on") 137 { 138 $this->setConfig($name, '1'); 139 return true; 140 } 141 $this->setConfig($name, '0'); 142 return false; 143 } 144 134 145 function setStyleName($name) 135 146 { -
dev/common/class.killlist.php
r10 r47 29 29 { 30 30 if (!count($this->groupby_)) 31 $this->sql_ = "select kll.kll_id, kll.kll_timestamp, plt.plt_name,31 $this->sql_ = "select distinct kll.kll_id, kll.kll_timestamp, plt.plt_name, 32 32 crp.crp_name, ali.all_name, kll.kll_ship_id, 33 33 kll.kll_system_id, kll.kll_ship_id, … … 41 41 fbcrp.crp_name as fbcrp_name"; 42 42 43 global $config; 44 if ($config->getConfig('ship_values')) 45 { 46 $this->sql_ .= ', ksv.shp_value'; 47 } 43 48 if (count($this->groupby_)) 44 49 { … … 50 55 on ( shp.shp_id = kll.kll_ship_id ) 51 56 inner join kb3_ship_classes scl 52 on ( scl.scl_id = shp.shp_class ) 53 inner join kb3_pilots plt 57 on ( scl.scl_id = shp.shp_class )"; 58 if ($config->getConfig('ship_values')) 59 { 60 $this->sql_ .= ' left join kb3_ships_values ksv on (shp.shp_id = ksv.shp_id)'; 61 } 62 63 $this->sql_ .= "inner join kb3_pilots plt 54 64 on ( plt.plt_id = kll.kll_victim_id ) 55 65 inner join kb3_corps crp … … 63 73 inner join kb3_systems sys 64 74 on ( sys.sys_id = kll.kll_system_id )"; 75 65 76 // involved filter 66 77 if (! $this->mixedinvolved_) … … 180 191 } 181 192 if ($this->limit_) $this->sql_ .= " limit " . $this->offset_ . ", " . $this->limit_; 182 // echo $this->sql_."<p>";193 // echo '<p>'.$this->sql_."</p>"; 183 194 $this->qry_->execute($this->sql_); 184 195 } … … 234 245 if ($row['scl_class'] != 2 && $row['scl_class'] != 3 && $row['scl_class'] != 11) 235 246 $this->realkillcounter_++; 247 248 global $config; 249 if ($config->getConfig('ship_values')) 250 { 251 if ($row['shp_value']) 252 { 253 $row['scl_value'] = $row['shp_value']; 254 } 255 } 236 256 237 257 $this->killisk_ += $row['scl_value'] / 1000000; -
dev/common/comments.php
r45 r47 4 4 function bbencode($string) 5 5 { 6 $string = strip_tags( &$string);6 $string = strip_tags(stripslashes($string)); 7 7 $string = str_replace(array('[b]','[/b]','[i]','[/i]','[u]','[/u]'), 8 8 array('<b>','</b>','<i>','</i>','<u>','</u>'), $string); … … 10 10 $string = preg_replace('^\[kill=(.*?)](.*?)\[/kill]^', '<a href="\?a=kill_detail&kll_id=\1">\2</a>', $string); 11 11 $string = preg_replace('^\[pilot=(.*?)](.*?)\[/pilot]^', '<a href="\?a=pilot_detail&plt_id=\1">\2</a>', $string); 12 return nl2br( $string);12 return nl2br(addslashes($string)); 13 13 } 14 14 … … 30 30 if ($_POST['comment'] == '') 31 31 { 32 $html .= "Error: Sil lent type hey? good for you, bad for a comment.";32 $html .= "Error: Silent type hey? good for you, bad for a comment."; 33 33 } 34 34 else … … 56 56 57 57 $qry = new DBQuery(); 58 $qry->execute("SELECT * FROM kb3_comments WHERE `kll_id` = $kll_id");58 $qry->execute("SELECT id,* FROM kb3_comments WHERE `kll_id` = $kll_id"); 59 59 if ($qry->recordCount() == 0) 60 60 { … … 67 67 { 68 68 $name = $data['name']; 69 $comment = $data['comment'];69 $comment = stripslashes($data['comment']); 70 70 $html .= "\n<div class=\"comment-text\" style=\"position: relative;\"><a href=\"?a=search&searchtype=pilot&searchphrase=".$name."\">".$name."</a>:"; 71 71 if ($data['posttime'] && $data['posttime'] != '0000-00-00 00:00:00') … … 76 76 if ($page->isAdmin()) 77 77 { 78 $html .= "<a href=\"javascript:openWindow('?a=comments_delete&c_id=".$data[' ID']."', null, 480, 350, '' );\">Delete Comment</a>";78 $html .= "<a href=\"javascript:openWindow('?a=comments_delete&c_id=".$data['id']."', null, 480, 350, '' );\">Delete Comment</a>"; 79 79 } 80 80 $html .= "</div>"; -
dev/common/portrait_grab.php
r10 r47 40 40 $html .= "<a href=\"?a=igb\">Return</a><br>"; 41 41 42 $updated = true;42 //$updated = true; 43 43 } 44 44 }