Posiadam na swoim forum skrypt do obsługi pobierania plików. Skrypt na starym serwerze działał bez problemów.
Na nowym serwerze wyrzuca błąd 500 lub pustą stroną, niezależnie od ustawienia raportowanie błędów.Skrypt korzysta z IPBWI oraz smarty. Przypuszczam że błąd jest w tym pliku:
<?php class user { public function __construct($id = -1) { if ($id == "-1") { $this->browser = $_SERVER['HTTP_USER_AGENT']; $this->ip = $_SERVER['REMOTE_ADDR']; $this->name = $member["name"]; $this->name = "portals"; //w celach testowych else { $this->logged = true; if ($member['avatar_type'] == "upload") $this->avatar = "http://www.stalkerteam.pl/uploads/{$member["avatar_location"]}"; else $this->avatar = $member["avatar_location"]; } } } public function getUser($name) { if ($name == -1) $name = $this->name; if ($this->logged == true) { $result = $db->query("SELECT * FROM st_users WHERE name = '{$this->name}'"); if ($result->num_rows == 0) { //Gdy brak takiego użytkownika $result = $db->query("INSERT INTO st_users (name, downloaded_current_month,`limit`) VALUES ('{$this->name}','0', '6000')"); $result = $db->query("SELECT * FROM st_users WHERE name = '{$this->name}'"); } $user = $result->fetch_array(); } $this->downloaded_current_month = $user['downloaded_current_month']; $this->download_limit = $user['limit']; $this->id = $user['id']; $this->user_type = $user['user_type']; $this->remaining_current_month = $this->download_limit - $this->downloaded_current_month; if ($this->downloaded_current_month != 0) $this->remaining_percentage = ($this->download_limit / $this->downloaded_current_month) * 10; else $this->remaining_percentage = 100; if ($this->user_type == 1) $this->admin = true; else $this->admin = false; return true; } public function can_download_this_file($size) { $size = (int) $size; if ($this->downloaded_current_month + $size <= $this->download_limit) return True; else return False; } public function subtract_transfer($mb) { $mb = (int) $mb; $out = $this->downloaded_current_month + $mb; if ($out > $this->download_limit) { //To raczej nie powinno mieć miejsca bo sprawdzenie jest przy wywołaniu. $error->script_error = 'Error in subtract_transfer($mb) out is negative'; $error->end(); } $result=$db->query("UPDATE st_users SET downloaded_current_month = '$out' WHERE id = '{$this->id}'"); } public function is_downloaded_this_file($file_id) { $result=$db->query("SELECT * FROM st_downloads WHERE user_id = '{$this->id}' AND file_id = '{$file_id}'"); if ($result->num_rows == 0) return false; else return true; } } ?>