| @@ -18,6 +18,11 @@ discard block | ||
| 18 | 18 | |
| 19 | 19 | // TODO - НЕ ОБЯЗАТЕЛЬНО ОТПРАВЛЯТЬ ЧЕРЕЗ ЕМЕЙЛ! ЕСЛИ ЭТО ФЕЙСБУЧЕК ИЛИ ВКШЕЧКА - МОЖНО ЧЕРЕЗ ЛС ПИСАТЬ!! | 
| 20 | 20 | // TODO - OK 4.6 | 
| 21 | + | |
| 22 | + /** | |
| 23 | + * @param integer $confirmation_type_safe | |
| 24 | + * @param string $email_unsafe | |
| 25 | + */ | |
| 21 | 26 |    public function db_confirmation_get_latest_by_type_and_email($confirmation_type_safe, $email_unsafe) { | 
| 22 | 27 | $email_safe = $this->db->db_escape($email_unsafe); | 
| 23 | 28 | |
| @@ -26,12 +31,21 @@ discard block | ||
| 26 | 31 |            `type` = {$confirmation_type_safe} AND `email` = '{$email_safe}' ORDER BY create_time DESC LIMIT 1;", true); | 
| 27 | 32 | } | 
| 28 | 33 | // TODO - OK 4.6 | 
| 34 | + | |
| 35 | + /** | |
| 36 | + * @param integer $confirmation_type_safe | |
| 37 | + */ | |
| 29 | 38 |    public function db_confirmation_delete_by_type_and_email($confirmation_type_safe, $email_unsafe) { | 
| 30 | 39 | $email_safe = $this->db->db_escape($email_unsafe); | 
| 31 | 40 | |
| 32 | 41 |      return $this->db->doquery("DELETE FROM {{confirmations}} WHERE `type` = {$confirmation_type_safe} AND `email` = '{$email_safe}'"); | 
| 33 | 42 | } | 
| 34 | 43 | // TODO - OK 4.6 | 
| 44 | + | |
| 45 | + /** | |
| 46 | + * @param integer $confirmation_type_safe | |
| 47 | + * @param string $email_unsafe | |
| 48 | + */ | |
| 35 | 49 |    public function db_confirmation_get_unique_code_by_type_and_email($confirmation_type_safe, $email_unsafe) { | 
| 36 | 50 | $email_safe = $this->db->db_escape($email_unsafe); | 
| 37 | 51 | |
| @@ -50,6 +64,11 @@ discard block | ||
| 50 | 64 | return $confirm_code_unsafe; | 
| 51 | 65 | } | 
| 52 | 66 | // TODO - OK 4.6 | 
| 67 | + | |
| 68 | + /** | |
| 69 | + * @param integer $confirmation_type_safe | |
| 70 | + * @param string $confirmation_code_unsafe | |
| 71 | + */ | |
| 53 | 72 |    public function db_confirmation_get_by_type_and_code($confirmation_type_safe, $confirmation_code_unsafe) { | 
| 54 | 73 | $confirmation_code_safe = $this->db->db_escape($confirmation_code_unsafe); | 
| 55 | 74 | |
| @@ -702,7 +702,7 @@ discard block | ||
| 702 | 702 | * Рассчёт бонуса ММ | 
| 703 | 703 | * | 
| 704 | 704 | * @param $dark_matter | 
| 705 | - * @param bool|true $direct | |
| 705 | + * @param boolean $direct | |
| 706 | 706 | * @param bool|false $return_bonus | 
| 707 | 707 | * | 
| 708 | 708 | * @return float|int | 
| @@ -738,6 +738,12 @@ discard block | ||
| 738 | 738 | |
| 739 | 739 | // Дополнительная ре-трансляция адреса, если в каком-то случае платежная система ожидает нелогичный ответ | 
| 740 | 740 | // Пример: иксолла при неправильно заданном пользователе в ордере ожидает НЕПРАВИЛЬНЫЙ_ОРДЕР, а не НЕПРАВИЛЬНЫЙ_ПОЛЬЗОВАТЕЛЬ | 
| 741 | + | |
| 742 | + /** | |
| 743 | + * @param integer $error_code | |
| 744 | + * | |
| 745 | + * @return integer|null | |
| 746 | + */ | |
| 741 | 747 |    function retranslate_error($error_code, $options = array()) { | 
| 742 | 748 | return isset($options['retranslate_error'][$error_code]) ? $options['retranslate_error'][$error_code] : $error_code; | 
| 743 | 749 | } | 
| @@ -103,6 +103,7 @@ | ||
| 103 | 103 | /** | 
| 104 | 104 | * Set custom template location (able to use directory outside of phpBB) | 
| 105 | 105 | * @access public | 
| 106 | + * @param string $template_path | |
| 106 | 107 | */ | 
| 107 | 108 | function set_custom_template($template_path, $template_name, $fallback_template_path = false) | 
| 108 | 109 |    { | 
| @@ -83,8 +83,7 @@ discard block | ||
| 83 | 83 |        { | 
| 84 | 84 | $this->inherit_root = $phpbb_root_path . 'styles/' . $user->theme['template_inherit_path'] . '/template'; | 
| 85 | 85 | } | 
| 86 | - } | |
| 87 | - else | |
| 86 | + } else | |
| 88 | 87 |      { | 
| 89 | 88 |        trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR); | 
| 90 | 89 | } | 
| @@ -120,8 +119,7 @@ discard block | ||
| 120 | 119 | |
| 121 | 120 | $this->inherit_root = $fallback_template_path; | 
| 122 | 121 | $this->orig_tpl_inherits_id = true; | 
| 123 | - } | |
| 124 | - else | |
| 122 | + } else | |
| 125 | 123 |      { | 
| 126 | 124 | $this->orig_tpl_inherits_id = false; | 
| 127 | 125 | } | 
| @@ -195,8 +193,7 @@ discard block | ||
| 195 | 193 | } | 
| 196 | 194 | |
| 197 | 195 | unset($str[$blocks[$blockcount]]); | 
| 198 | - } | |
| 199 | - else | |
| 196 | + } else | |
| 200 | 197 |      { | 
| 201 | 198 | // Top-level block. | 
| 202 | 199 | unset($this->_tpldata[$blockname]); | 
| @@ -232,8 +229,7 @@ discard block | ||
| 232 | 229 | if ($filename = $this->_tpl_load($handle)) | 
| 233 | 230 |      { | 
| 234 | 231 | ($include_once) ? include_once($filename) : include($filename); | 
| 235 | - } | |
| 236 | - else | |
| 232 | + } else | |
| 237 | 233 |      { | 
| 238 | 234 |        eval(' ?>' . $this->compiled_code[$handle] . '<?php '); | 
| 239 | 235 | } | 
| @@ -287,8 +283,7 @@ discard block | ||
| 287 | 283 | if (!file_exists($filename) || @filesize($filename) === 0) | 
| 288 | 284 |      { | 
| 289 | 285 | $recompile = true; | 
| 290 | - } | |
| 291 | - else if (classSupernova::$config->load_tplcompile) | |
| 286 | + } else if (classSupernova::$config->load_tplcompile) | |
| 292 | 287 |      { | 
| 293 | 288 | // No way around it: we need to check inheritance here | 
| 294 | 289 | if ($user->theme['template_inherits_id'] && !file_exists($this->files[$handle])) | 
| @@ -376,15 +371,13 @@ discard block | ||
| 376 | 371 | $this->files[$row['template_filename']] = $file; | 
| 377 | 372 | $this->files_inherit[$row['template_filename']] = $file; | 
| 378 | 373 | $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id']; | 
| 379 | - } | |
| 380 | - else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id']) | |
| 374 | + } else if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id']) | |
| 381 | 375 |              { | 
| 382 | 376 | // Ok, we have a situation. There is a file in the subtemplate, but nothing in the DB. We have to fix that. | 
| 383 | 377 | $force_reload = true; | 
| 384 | 378 | $this->files_template[$row['template_filename']] = $user->theme['template_inherits_id']; | 
| 385 | 379 | } | 
| 386 | - } | |
| 387 | - else | |
| 380 | + } else | |
| 388 | 381 |            { | 
| 389 | 382 | $this->files_template[$row['template_filename']] = $user->theme['template_id']; | 
| 390 | 383 | } | 
| @@ -394,8 +387,7 @@ discard block | ||
| 394 | 387 | if ($row['template_filename'] == $this->filename[$handle]) | 
| 395 | 388 |              { | 
| 396 | 389 | $compile->_tpl_load_file($handle, true); | 
| 397 | - } | |
| 398 | - else | |
| 390 | + } else | |
| 399 | 391 |              { | 
| 400 | 392 | $this->files[$row['template_filename']] = $file; | 
| 401 | 393 | $this->filename[$row['template_filename']] = $row['template_filename']; | 
| @@ -410,8 +402,7 @@ discard block | ||
| 410 | 402 |            { | 
| 411 | 403 | $this->compiled_code[$handle] = $compile->compile(trim($row['template_data'])); | 
| 412 | 404 | $compile->compile_write($handle, $this->compiled_code[$handle]); | 
| 413 | - } | |
| 414 | - else | |
| 405 | + } else | |
| 415 | 406 |            { | 
| 416 | 407 | // Only bother compiling if it doesn't already exist | 
| 417 | 408 |              if (!file_exists($this->cachepath . str_replace('/', '.', $row['template_filename']) . DOT_PHP_EX)) | 
| @@ -422,8 +413,7 @@ discard block | ||
| 422 | 413 | } | 
| 423 | 414 | } | 
| 424 | 415 | } | 
| 425 | - } | |
| 426 | - else | |
| 416 | + } else | |
| 427 | 417 |        { | 
| 428 | 418 | $file = $this->root . '/' . $row['template_filename']; | 
| 429 | 419 | |
| @@ -511,8 +501,7 @@ discard block | ||
| 511 | 501 | // We're adding a new iteration to this block with the given | 
| 512 | 502 | // variable assignments. | 
| 513 | 503 | $str[$blocks[$blockcount]][] = $vararray; | 
| 514 | - } | |
| 515 | - else | |
| 504 | + } else | |
| 516 | 505 |      { | 
| 517 | 506 | // Top-level block. | 
| 518 | 507 | $s_row_count = (isset($this->_tpldata[$blockname])) ? sizeof($this->_tpldata[$blockname]) : 0; | 
| @@ -612,8 +601,7 @@ discard block | ||
| 612 | 601 | $key = sizeof($this->_tpldata[$blockname]); | 
| 613 | 602 | unset($this->_tpldata[$blockname][($key - 1)]['S_LAST_ROW']); | 
| 614 | 603 | $vararray['S_LAST_ROW'] = true; | 
| 615 | - } | |
| 616 | - else if ($key === 0) | |
| 604 | + } else if ($key === 0) | |
| 617 | 605 |        { | 
| 618 | 606 | unset($this->_tpldata[$blockname][0]['S_FIRST_ROW']); | 
| 619 | 607 | $vararray['S_FIRST_ROW'] = true; | 
| @@ -711,8 +699,7 @@ discard block | ||
| 711 | 699 | if(!$name) | 
| 712 | 700 |      { | 
| 713 | 701 | $this->assign_vars($values); | 
| 714 | - } | |
| 715 | - else | |
| 702 | + } else | |
| 716 | 703 |      { | 
| 717 | 704 | $this->assign_block_vars($name, $values); | 
| 718 | 705 | } | 
| @@ -10,6 +10,7 @@ discard block | ||
| 10 | 10 | * | 
| 11 | 11 | * 1.0 - copyright (c) 2010 by Gorlum for http://supernova.ws | 
| 12 | 12 | * @version 1.0 | 
| 13 | + * @param integer $lab_require | |
| 13 | 14 | */ | 
| 14 | 15 | function eco_get_lab_max_effective_level(&$user, $lab_require) | 
| 15 | 16 |  { | 
| @@ -193,6 +194,9 @@ discard block | ||
| 193 | 194 | return $result; | 
| 194 | 195 | } | 
| 195 | 196 | |
| 197 | +/** | |
| 198 | + * @param integer[] $unit_list | |
| 199 | + */ | |
| 196 | 200 | function eco_is_builds_in_que($planet_que, $unit_list) | 
| 197 | 201 |  { | 
| 198 | 202 | $eco_is_builds_in_que = false; | 
| @@ -55,6 +55,9 @@ discard block | ||
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | |
| 58 | +/** | |
| 59 | + * @param integer $build_mode | |
| 60 | + */ | |
| 58 | 61 |  function que_build($user, $planet, $build_mode = BUILD_CREATE, $redirect = true) { | 
| 59 | 62 | global $lang, $config; | 
| 60 | 63 | |
| @@ -378,6 +381,9 @@ discard block | ||
| 378 | 381 | return classSupernova::db_que_list_by_type_location($user_id, $planet_id, $que_type, $for_update); | 
| 379 | 382 | } | 
| 380 | 383 | |
| 384 | +/** | |
| 385 | + * @param integer $unit_id | |
| 386 | + */ | |
| 381 | 387 |  function que_add_unit($unit_id, $user = array(), $planet = array(), $build_data, $unit_level = 0, $unit_amount = 1, $build_mode = BUILD_CREATE) { | 
| 382 | 388 | // TODO Унифицировать проверки | 
| 383 | 389 | |
| @@ -141,6 +141,9 @@ | ||
| 141 | 141 | "); | 
| 142 | 142 | } | 
| 143 | 143 | |
| 144 | +/** | |
| 145 | + * @param string $email_unsafe | |
| 146 | + */ | |
| 144 | 147 |  function player_create($username_unsafe, $email_unsafe, $options) { | 
| 145 | 148 | sn_db_transaction_check(true); | 
| 146 | 149 | |
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | |
| 3 | +/** | |
| 4 | + * @return double | |
| 5 | + */ | |
| 3 | 6 | function flt_fleet_speed($user, $fleet) | 
| 4 | 7 |  { | 
| 5 | 8 | if (!is_array($fleet)) | 
| @@ -29,6 +29,9 @@ | ||
| 29 | 29 | } | 
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | +/** | |
| 33 | + * @param string $group_name | |
| 34 | + */ | |
| 32 | 35 | function flt_spy_scan($target_planet, $group_name, $section_title, $target_user = array()) | 
| 33 | 36 |  { | 
| 34 | 37 | global $lang; | 
| @@ -26,6 +26,10 @@ | ||
| 26 | 26 | return true; | 
| 27 | 27 | } | 
| 28 | 28 | |
| 29 | +/** | |
| 30 | + * @param integer $mode | |
| 31 | + * @param integer $mercenary_id | |
| 32 | + */ | |
| 29 | 33 |  function mrc_mercenary_hire($mode, $user, $mercenary_id) { | 
| 30 | 34 | global $config, $lang, $sn_powerup_buy_discounts; | 
| 31 | 35 | |