@auto[] ^use[padparser.p] ##################################################################### # # @bodyMain[]

Submit or update software


^switch[$form:do]{ ^case[submit]{ ^if(def $form:padURL){ ^blockSubmitPAD[$form:padURL;$form:category] }{ PAD URL still not specified! } } ^case[remove]{ To remove the program from our listing send an email to specifying program name as it appears in our listings. } ^case[DEFAULT]{ ^blockSubmitForm[] } } ##################################################################### # Осуществляем сабмит # @blockSubmitPAD[padURL;catID][f;icon;shot;img;PAD;companyHash;CID;PID;programHash;descHash] Submitting...
^try{ $f[^fileLoad[binary;$padURL]] $PAD[^padparser::init[^taint[as-is][$f.text]]] ^if(def $PAD && def ^PAD.isValidPad[]){ # Информация о компании $companyHash[^PAD.getCompanyInfo[]] # Информация о программе $programHash[^PAD.getProgramInfo[]] $descHash[^PAD.getProgramDescriptions[English]] ^if(def $programHash.Application_Icon_URL){ ^try{ $icon[^fileLoad[binary;$programHash.Application_Icon_URL]] Application icon loaded ($icon.size bytes)
^if($icon.size > 10000){ $errors[$errors
Icon size exceeds 10Kb!] $icon[] } }{ $exception.handled(1) $errors[$errors
Unable to fetch Application Icon file from: $programHash.Application_Icon_URL] } } ^if(def $programHash.Application_Screenshot_URL){ ^try{ $shot[^fileLoad[binary;$programHash.Application_Screenshot_URL]] Application screenshot loaded ($shot.size bytes)
^if($shot.size > 256000){ $errors[$errors
Screenshot size exceeds 250Kb!] $shot[] }{ $img[^image::measure[$shot]] } }{ $exception.handled(1) $errors[ $errors
Unable to fetch Application Screenshot file from: $programHash.Application_Screenshot_URL ($exception.type^: $exception.comment ($exception.source)) ] } }
^if(!def $errors){ # Сабмит информации о компании Submitting company information...
$CID[^DATA.submitCompany[$companyHash]] ^if($CID > 0){ # Формируем дополнительные поля информации о программе Submitting program...
$programHash.Company_ID[$CID] $programHash.Program_Nick[^title2Nick[$programHash.Program_Name]] $programHash.Program_User_Category($catID) $programHash.Program_True_Category(0) $programHash.Site_Priority(0) $programHash.Site_Submitted[^getDateNow[]] $programHash.Site_Screenshot_Width(^if(def $img){$img.width}{100}) $programHash.Site_Screenshot_Height(^if(def $img){$img.height}{10}) $PID[^DATA.submitProgram[$programHash;$descHash]] # Сохраняем PAD в папку ^if(^PID.int(-1) != -1){ ^PAD.saveTo[$ROOT/db/pad/${PID}.xml] } # Сохраняем иконку и скриншот ^if(def $icon){ ^icon.save[binary;$ROOT/db/icon/${PID}.^file:justext[$icon.name]] } ^if(def $shot){ ^shot.save[binary;$ROOT/db/screenshot/${PID}.^file:justext[$shot.name]] } }{ $errors[$errors
Error submitting company info!] } } }{ $errors[$errors
Invalid PAD file!] } ^mail:send[ $.from[RFT Robot ] $.to[$submitMail] $.subject[Submission: $programHash.Program_Name $programHash.Program_Version] $.text[ Hi there, A new submission on RealFileTools: $programHash.Program_Name $programHash.Program_Version by $companyHash.Company_Name Description: $descHash.Char_Desc_250 -- Best regards, RFT Robot ] ] }{ # $exception.handled(1) $errors[ $errors
Fatal error fetching PAD file: $padURL
$exception.type^: $exception.comment ($exception.source)
$exception.source ($exception.file, line: $exception.lineno, col: $exception.colno) ] } ^if(def $errors){ An error occured while submitting your application, webmasters have been notified
$errors ^mail:send[ $.from[RFT Robot ] $.to[$bugrepMail] $.subject[Error while submitting: $programHash.Program_Name $programHash.Program_Version] $.text[ Hi there, Error message: $errors -- Best regards, RFT Robot ] ] }{
Thanks for submitting $programHash.Program_Name!
It will appear in our listings after approvement } ##################################################################### # Формирует форму сабмита # @blockSubmitForm[]
Choose category: ^blockSubmitCats[]
Your PAD URL:
 ^;
Remove PAD
##################################################################### # Формирует список категорий # @blockSubmitCats[]