function deleteFileByCommentId($iCommentId) { global $sModule; $sDBModule = DB_PREFIX . ucfirst($sModule); $iId = (int) getValue("SELECT `ID` FROM `" . $sDBModule . "Files` WHERE `Description`='" . $iCommentId . "' LIMIT 1"); if ($iId > 0) { _deleteFile($iId); } }
} break; /** * Delete files (reported files) */ /** * Delete files (reported files) */ case 'removeFile': if ($sFile == "") { $sContents = parseXml($aXmlTemplates['result'], "msgErrorDelete", FAILED_VAL); } elseif ($sFile != "") { $aFiles = explode(",", $sFile); if (count($aFiles) > 0) { for ($i = 0; $i < count($aFiles); $i++) { $bResult = _deleteFile($aFiles[$i]); } } $sContents = parseXml($aXmlTemplates['result'], "", SUCCESS_VAL); } break; /** * Upload user's file */ /** * Upload user's file */ case 'uploadFile': $sContents = uploadFile($_FILES['Filedata']['tmp_name'], $sId); $sContentsType = "other"; break;