sub Message_Send_Uploader ( \ User_Name as string, \ User_ID as long, \ Cost as integer, \ File_Name as string ) REM ------------------------------------------------------------------ dim MsgHeader as MessageHeader REM ------------------------------------------------------------------ MsgHeader.From = MakeWild.SysOpName MsgHeader.FromTitle = "EVALFILE" MsgHeader.To = User_Name MsgHeader.ToID = User_ID MsgHeader.Subject = "EvalFile Uploader Reward" FlagSet ( MsgHeader.Flags, 1 ) if not AddMessage ( MsgHeader, \ "You received " + Dollars_Str ( Cost ) + \ " for the upload of " + File_Name + ".", \ "", Config.Mail_Conference ) then Beep ? "Error in placing message in conference "; ? Config.Mail_Conference; ? " for "; User_Name end if end sub sub Obsolete_Sort_All_Files REM ------------------------------------------------------------------ dim Counter as long // const Total_Files = 1000 dim FileRec as FileRecord dim Rating as real dim Count as long type Rating_Rec_Type Name as string*12 Rating as string*7 Count as string*5 end type dim Rating_Rec as Rating_Rec_Type dim File_Name as string dim File_Area as long dim FileArea_Tmp as string dim FileArea_Txt as string dim Got_Next_File as boolean dim SrchRec as SearchRec dim FileAreaRec as FileAreaRecord dim AllFiles_Path as string dim AllFiles_Size as long dim Index as long dim FileRecNext as FileRecord dim AllFiles_DateTime as DateTime dim New_User_Sec_Profile as SecurityProfile dim NewUserSec_Found as boolean dim Sort_Str as string*15 dim File_Num_1, File_Num_2, File_Num_3 as integer REM if not GetSecProfile ( New_User_Sec_Profile, MakeWild.NewUserSec ) then ? "Warning: unable to fine security profile for "; ? MakeWild.NewUserSec; "!" ? "Delaying 10 seconds..." delay 10 NewUserSec_Found = false else NewUserSec_Found = true end if if GetFirstFile ( FileRecNext, 1 ) then File_Num_3 = FreeFile open AllFiles_Txt for output as File_Num_3 ? #File_Num_3, "" ? #File_Num_3, "" ? #File_Num_3, " "; AllFiles_Txt; " "; CurrentDateTime AllFiles_DateTime ? #File_Num_3, FormatDate ( AllFiles_DateTime.D, "yyyy-mm-dd" ); " "; ? #File_Num_3, FormatTime ( AllFiles_DateTime.T, "hh:mm" ); " "; ? #File_Num_3, MakeWild.BBSName; " "; MakeWild.Phone ? #File_Num_3, " Created by "; Copyright ? #File_Num_3, "" ? #File_Num_3, " Rating = user evaluation, 1.0 is great, 0.0 is poor." ? #File_Num_3, " Count = number of user evaluations for this file." ? #File_Num_3, " Cost = amount deducted from your account balance to download." ? #File_Num_3, "" do Counter = 1 File_Area = FileRecNext.Area if GetFileArea ( FileAreaRec, File_Area ) then ? " ----------------------------------------------------------------------" ? " ----------------------------------------------------------------------" ? " "; FormatNumber ( File_Area, "@####" ); ": "; ? FileAreaRec.Name ? " ----------------------------------------------------------------------" ? " ----------------------------------------------------------------------" ? "" if New_User_Sec_Profile.AccessFileList ( File_Area ) or \ not NewUserSec_Found then ? #File_Num_3, " ----------------------------------------------------------------------" ? #File_Num_3, " ----------------------------------------------------------------------" ? #File_Num_3, " "; FormatNumber ( File_Area, "@####" ); ": "; ? #File_Num_3, FileAreaRec.Name ? #File_Num_3, " ----------------------------------------------------------------------" ? #File_Num_3, " ----------------------------------------------------------------------" ? #File_Num_3, "" else ? "File Area "; File_Area; " not added to "; AllFiles_Txt; ? " since security profile" ? MakeWild.NewUserSec; " does not have file list access." end if else Beep ? "Error: unable to get file area name for"; File_Area; "!" end if SortStart FileArea_Tmp = TrdParty + "\" + PROGRAM_DIR + "\ALL" + \ FormatNumber ( File_Area, "@####" ) + ".TMP" ? "Creating temporary file "; FileArea_Tmp; "..." if Exists ( FileArea_Tmp ) then Del ( FileArea_Tmp ) end if File_Num_1 = FreeFile Open FileArea_Tmp for random as File_Num_1 len = Len ( Rating_Rec_Type ) do Rating_Rec.Name = FileRecNext.Name Eval_Rec_Get ( Rating, Count, FileRecNext.Name, Config.Bias_Count ) Rating_Rec.Rating = FormatNumber ( Rating, "#.#####" ) Rating_Rec.Count = FormatNumber ( Count, "@####" ) if Rating_Rec.Rating = "1.00000" then Sort_Str = "~~~~~" else Sort_Str = Right ( Rating_Rec.Rating, 5 ) end if Sort_Str = Sort_Str + Rating_Rec.Count \ + FormatNumber ( FileRecNext.Cost, "@####" ) SortAdd ( Sort_Str, Counter ) put #File_Num_1, Counter, Rating_Rec Counter = Counter + 1 ? "."; Got_Next_File = GetNextFile ( FileRecNext, 1 ) if not Got_Next_File then exit do end if loop until FileRecNext.Area <> File_Area ? FileArea_Txt = TrdParty + "\" + PROGRAM_DIR + "\ALL" + \ FormatNumber ( File_Area, "@####" ) + ".TXT" ? "Creating file area sorted listing "; FileArea_Txt; "..." File_Num_2 = FreeFile open FileArea_Txt for output as File_Num_2 do Counter = SortPrev if Counter > -1 then get #File_Num_1, Counter, Rating_Rec ? #File_Num_2, Pad ( Rating_Rec.Name, 12 ); " "; ? #File_Num_2, Rating_Rec.Rating; " "; ? #File_Num_2, Rating_Rec.Count; " " if New_User_Sec_Profile.AccessFileList ( File_Area ) or \ not NewUserSec_Found then if File_Record_Found ( FileRec, File_Area, Rating_Rec.Name ) then ? #File_Num_3, " "; ? #File_Num_3, Pad ( Rating_Rec.Name, 12 ); " "; ? #File_Num_3, Rating_Rec.Rating; " "; ? #File_Num_3, Rating_Rec.Count; " "; ? #File_Num_3, LeftPad ( Dollars_Str ( FileRec.Cost ), 6 ); " "; ? #File_Num_3, FileRec.Uploader ? #File_Num_3, " "; Mid ( FileRec.Description, 1, 70 ) ? #File_Num_3, "" else ? "Error: unable to get file info for "; Rating_Rec.Name; "!" end if end if end if loop until Counter < 0 Close ( File_Num_1 ) ? "Deleting temporary file "; FileArea_Tmp; "..." Del ( FileArea_Tmp ) Close ( File_Num_2 ) loop until not Got_Next_File Close ( File_Num_3 ) if FindFirst ( AllFiles_Txt, 0, SrchRec ) = 0 then AllFiles_Size = SrchRec.Size else ? "Error: unable to locate "; AllFiles_Txt; "!" AllFiles_Size = 0 end if if GetFileInfo ( FileRec, AllFiles_Txt ) then if File_Path_Found ( AllFiles_Path, FileRec ) then ? "Updating "; AllFiles_Txt; "..." if CopyFile ( AllFiles_Txt, AllFiles_Path + AllFiles_Txt ) then CurrentDateTime ( FileRec.FileTime ) FileRec.Size = AllFiles_Size if not UpdateFile ( FileRec ) then ? "Error: unable to update "; AllFiles_Txt; "!" end if else ? "Error: unable to copy "; AllFiles_Txt; " to "; \ AllFiles_Path + AllFiles_Txt + "!" end if else ? "Error: unable to find path for "; AllFiles_Txt; "." end if else ? "Adding "; AllFiles_Txt; " to File Area 1..." if GetFileArea ( FileAreaRec, 1 ) then if CopyFile ( AllFiles_Txt, FileAreaRec.Path + AllFiles_Txt ) then FileRec.Size = AllFiles_Size FileRec.Name = AllFiles_Txt FileRec.Password = "" CurrentDateTime ( FileRec.FileTime ) CurrentDateTime ( FileRec.LastAccess ) FileRec.Uploader = "EvalFile" FileRec.UploaderID = 0 FileRec.Description = "List of all files on this BBS sorted by EvalFile ratings" FileRec.Flags = 4 FileRec.Downloads = 0 FileRec.Cost = 0 FileRec.Area = 1 FileRec.KeyWords ( 1 ) = "LIST" FileRec.KeyWords ( 2 ) = "ALLFILES" FileRec.KeyWords ( 3 ) = "FILES" FileRec.KeyWords ( 4 ) = "BBS" FileRec.KeyWords ( 5 ) = "EVALFILE" FileRec.KeyWords ( 6 ) = "RATINGS" FileRec.StoredPath = "" FileRec.LongDesc ( 1 ) = "List of all files on this BBS sorting by EvalFile ratings" FileRec.LongDesc ( 2 ) = "" FileRec.LongDesc ( 3 ) = "Files are sorted by file area, rating, and evaluation count." for Index = 4 to 15 FileRec.LongDesc ( Index ) = "" next Index if not AddFile ( FileRec ) then ? "Error: unable to add "; AllFiles_Txt; "!" end if else ? "Error: unable to copy "; AllFiles_Txt; " to "; \ FileAreaRec.Path + AllFiles_Txt + "!" end if else ? "Error: unable to get info on File Area 1!" end if end if else Beep ? "Error: No files available on the BBS!" ? "Delaying 10 seconds..." Delay 10 end if end sub function Reward_Uploader ( \ byval Uploader as string, \ byval Cost as integer, \ byval File_Name as string ) \ as boolean ////////////////////////////////////////////////////////////////////// dim Uploader_Rec as UserRecord dim Log_Str_Reward as string dim Temp as boolean dim File_Num as integer dim Total_Reward as integer dim Payments as string dim Payments_Dir as string ////////////////////////////////////////////////////////////////////// Temp = false if GetUser ( Uploader_Rec, Uploader ) then Uploader_Rec.SubscriptionBalance = \ Uploader_Rec.SubscriptionBalance + Cost if User.UserID = Uploader_Rec.UserID then User.SubscriptionBalance = User.SubscriptionBalance + Cost Temp = true elseif UpdateUser ( Uploader_Rec ) then Temp = true end if if Temp then Message_Send_Uploader ( Uploader, Cost, File_Name ) Log_Str_Reward = "EvalFile: $" + \ FormatNumber ( Cost / 100, "@##.##" ) + " reward to " + \ Uploader + " for upload of " + File_Name ActivityLog ( Log_Str_Reward ) Uploader_Payments_Total_Save ( Uploader_Rec.UserID, \ Uploader_Rec.Name, \ Uploader_Payments_Total_Load ( Uploader_Rec.UserID, \ Uploader_Rec.Name ) \ + Cost ) end if end if Reward_Uploader = Temp end function