变更集1411293
时间戳: 2016年5月5日09:11:20 PM ( 8年 (之前) 位置: eve-shipinfo/trunk 文件夹: -
6已编辑
-
类/EVEShipInfo.php (已修改) ( 4个差异 ) -
classes/EVEShipInfo/Collection/Ship/Attribute.php类 (已修改) ( 7个差异 ) -
classes/EVEShipInfo/Plugin.php类 (已修改) ( 2个差异 ) -
classes/EVEShipInfo/Shortcode.php类 (已修改) ( 1个差异 ) -
data/data.zip (已修改) ( 以前的 ) -
错误代码.txt (已修改) ( 1个差异 )
图例:
未修改 补充 远离的
-
eve-shipinfo/trunk/classes/EVEShipInfo.php 1411207元 1411293兰特 1196 1196 受保护的$tables=数组( 1197 1197 “元”, 1198 “属性”, 1198 1199 “模块”, 1199 1200 '模块_插槽', … … 1227 1228 ) 1228 1229 ); 1229 1230 1231 $queries[]=数组( 1232 “table”=>“attributes”, 1233 “数据”=>“属性”, 1234 “字段”=>数组( 1235 'attributeName=%s', 1236 '属性ID=%d', 1237 “defaultValue=%s”, 1238 '显示名称=%s', 1239 '可堆叠=%d', 1240 “highIsGood=%d” 1241 ) 1242 ); 1243 1230 1244 $queries[]=数组( 1231 1245 “table”=>“modules_slots”, … … 1283 1297 'fields'=>数组( 1284 1298 '类型ID=%d', 1285 'attributeName=%s', 1286 1299 '属性ID=%d', 1287 1300 “valueInt=%d”, 1288 “valueFloat=%f”, 1289 “defaultValue=%s”, 1290 '显示名称=%s', 1291 '可堆叠=%d', 1292 “highIsGood=%d” 1301 'valueFloat=%f' 1293 1302 ) 1294 1303 ); … … 1299 1308 $query=“INSERT INTO”$ this->getTableName($def['table'])。 “SET”.内爆(',',$def['fields']); 1300 1309 $entries=$this->loadDataJSON($def['data']); 1310 1301 1311 foreach($entries作为$entry){ 1302 1312 $this->dbQuery($query,$entry); -
eve-shipinfo/trunk/classes/EVEShipInfo/Collection/Ship/Attribute.php 1411207元 1411293兰特 三 三 类EVEShipInfo_Collection_Ship_Attribute 4 4 { 5 常量ERROR_UNKNOWN_ATTRIBUTE=17001; 6 5 7 受保护的$rawData; 6 8 … … 22 24 受保护的$plugin; 23 25 26 受保护的静态$globalData; 27 24 28 公共函数__construct(EVEShipInfo_Collection_Ship$Ship,$name) 25 29 { … … 29 33 $this->name=$name; 30 34 31 $this->rawData=$this->插件->dbFetch( 32 “”选择“ 33 * 34 发件人 35 “.$this->plugin->getTableName('ships_attributes')。” 36 何处 37 类型ID=%d 38 和 39 attributeName=%s“, 40 阵列( 41 $this->ship->getID(), 42 $名称 43 ) 35 if(!$this->register()){ 36 回报; 37 } 38 39 $values=$this->plugin->dbFetch( 40 “”选择“ 41 * 42 发件人 43 “.$this->plugin->getTableName('ships_attributes')。” 44 何处 45 类型ID=%d 46 和 47 attributeID=%d“, 48 阵列( 49 $this->ship->getID(), 50 self::$globalData[$name]['attributeID'] 51 ) 44 52 ); 53 54 $this->rawData=array_merge(self::$globalData[$name],$values); 55 } 56 57 受保护函数寄存器() 58 { 59 if(isset(self::$globalData[$this->name]){ 60 回报; 61 } 62 63 $global=$this->plugin->dbFetch( 64 “”选择“ 65 * 66 发件人 67 “.$this->plugin->getTableName('attributes')。” 68 何处 69 attributeName=%s“, 70 阵列( 71 $this->名称 72 ) 73 ); 74 75 if(空($global)){ 76 抛出新的EVEShipInfo_Exception( 77 '未知属性['.$this->name.'].', 78 '在数据库中找不到属性['.$this->name.']。', 79 自身::ERROR_UNKNOWN_ATTRIBUTE 80 ); 81 } 82 83 self::$globalData[$this->name]=$global; 45 84 } 46 85 … … 52 91 受保护函数getProperty($name) 53 92 { 54 if(isset($this->rawData[$name])){ 55 return$this->rawData[$name]; 56 } 57 58 返回null; 93 if(isset($this->rawData[$name])){ 94 return$this->rawData[$name]; 95 } 96 97 返回null; 59 98 } 60 99 … … 63 102 公共函数getUnitName() 64 103 { 65 if(!isset($this->unitName)){ 66 //单元名称为英文,以便支持翻译 67 //我们在本地翻译本机字符串。 68 $this->unitName=$this->translateNativeString( 69 $this->getProperty('displayName') 70 ); 71 } 72 73 return$this->unitName; 104 if(!isset($this->unitName)){ 105 //单元名称为英文,以便支持翻译 106 //我们在本地翻译本机字符串。 107 $this->unitName=$this->translateNativeString( 108 $this->getProperty('displayName') 109 ); 110 } 111 112 return$this->unitName; 74 113 } 75 114 76 115 公共函数getCategoryName() 77 116 { 78 return$this->getProperty('categoryName'); 117 return$this->getProperty('categoryName'); 79 118 } 80 119 81 120 公共函数getIconID() 82 121 { 83 return$this->getProperty('iconID'); 122 return$this->getProperty('iconID'); 84 123 } 85 124 86 125 公共函数getValue($pretty=false) 87 126 { 88 $int=$this->getProperty('valueInt'); 89 $float=$this->getProperty('valueFloat'); 90 $value=$int; 127 $int=$this->getProperty('valueInt'); 128 $float=$this->getProperty('valueFloat'); 129 $value=$int; 91 130 92 if(strlen($value)<1 ) { 93 $value=浮动美元; 94 } 95 96 if($漂亮){ 97 $tokens=爆炸('.',$value); 98 if(isset($令牌[1])){ 99 返回number_format($value,2); 100 } 101 102 返回number_format($value); 103 } 104 105 返回$value; 131 如果($float>$value ) { 132 $value=$float; 133 } 134 135 if($漂亮){ 136 $tokens=爆炸('.',$value); 137 if(isset($令牌[1])){ 138 返回number_format($value,2); 139 } 140 141 返回number_format($value); 142 } 143 144 返回$value; 106 145 } 107 146 … … 116 155 公共函数getValuePretty() 117 156 { 118 $result=$this->getValue(true); 119 120 $units=$this->getUnitName(); 121 if(!空($单位)){ 122 $result.=“”$ 单位; 123 } 124 125 返回$result; 157 $result=$this->getValue(true); 158 159 $units=$this->getUnitName(); 160 if(!空($单位)){ 161 $result.=“”$ 单位; 162 } 163 164 返回$result; 126 165 } 127 166 128 167 公共函数__toString() 129 168 { 130 $value=$this->getValue(); 131 返回$value; 169 $value=$this->getValue(); 170 返回$value; 132 171 } 133 172 … … 136 175 受保护的函数translateNativeString($string) 137 176 { 138 if(!isset(self::$stringTranslations)){ 139 self::$stringTranslations=数组( 140 “HP”=>__(“HP”,“eve-shipinfo”), 141 ‘MW’=>__(‘MW’,‘eve-shipinfo’), 142 “m/sec”=>__(“m/sec”,“eve-shipinfo”), 143 'tf'=>__('tf','eve shipinfo'), 144 “m”=>__(“m”,“eve-shipinfo”), 145 's'=>__('s','eve-shipinfo'), 146 ‘GJ’=>__(‘GJ’,‘eve shipinfo’), 147 “mm”=>__(“mm”,“eve-shipinfo”), 148 “m3”=>__(“m3”,“eve-shipinfo”), 149 “Mbit/sec”=>__(“MB/S”,“eve-shipinfo”) 150 ); 151 } 152 153 if(isset(self::$stringTranslations[$string]){ 154 return self::$stringTranslations[$string]; 155 } 156 157 返回$string; 177 if(!isset(self::$stringTranslations)){ 178 self::$stringTranslations=数组( 179 “HP”=>__(“HP”,“eve-shipinfo”), 180 ‘MW’=>__(‘MW’,‘eve-shipinfo’), 181 “m/sec”=>__(“m/sec”,“eve-shipinfo”), 182 'tf'=>__('tf','eve-shipinfo'), 183 “m”=>__(“m”,“eve-shipinfo”), 184 's'=>__('s','eve-shipinfo'), 185 ‘GJ’=>__(‘GJ',‘eve-shipinfo’), 186 “mm”=>__(“mm”,“eve-shipinfo”), 187 “m3”=>__(“m3”,“eve-shipinfo”), 188 “Mbit/sec”=>__(“MB/S”,“eve-shipinfo”) 189 ); 190 } 191 192 if(isset(self::$stringTranslations[$string]){ 193 return self::$stringTranslations[$string]; 194 } 195 196 返回$string; 158 197 } 159 198 } -
eve-shipinfo/trunk/classes/EVEShipInfo/Plugin.php 1411207元 1411293兰特 212 212 } 213 213 214 公共函数dbQuery($query,$params=array() ) 214 公共函数dbQuery($query,$params=array() ,$dump=假 ) 215 215 { 216 216 全局$wpdb; … … 218 218 if(!空($params)){ 219 219 $query=$wpdb->prepare($query,$params); 220 } 221 222 if($dump){ 223 echo'<pre-style=“background:#fff;color:#000;padding:17px;”>'.print_r($query,true)'</ 预>'; 220 224 } 221 225 -
eve-shipinfo/trunk/classes/EVEShipInfo/Shortcode.php 1202080兰特 1411293兰特 40 40 $this->attributes=shortcode_atts($this->getDefaultAttributes(),$attributies); 41 41 $this->content=$content; 42 43 $this->process(); 42 43 尝试 44 { 45 $this->process(); 46 } 47 catch(EVEShipInfo_Exception$e) 48 { 49 $this->content=“EVEShipino错误号”$ e->getCode().''$ e->getMessage(); 50 } 44 51 45 52 返回$this->内容; -
eve-shipinfo/trunk/errorcodes.txt 1236586兰特 1411293兰特 1 1001 2 1101 三 1201 4 1301 5 1401 6 1501 7 1601 1 17001