'$Include "..\WC_Subs\WC_Subs.WCC" '$Include "BBS_AD.WCS" '$Include "BBS_AD.WCB" sub BBS_Ad_Start ////////////////////////////////////////////////////////////////////// const Days_Max = 30 const Cost_Per_Day_Max = 100 dim Cost as integer dim Cost_Per_Day as integer dim Cost_Per_Day_Min as integer dim Date_Expires as Date dim Line as string dim DateVar as date dim File_BBS_Ad_BBS as integer dim File_BBS_Ad_Tmp as integer dim File_Menu_BBS_Ad as integer dim File_Menu_Dat as integer dim Lines as integer dim Menu_BBS_Pre as string dim Menu_BBS_Ad as string dim Menu_BBS_New as string dim Menu_Dat as string dim Menu_Name as string dim Done as boolean dim Refund_Cost as integer dim Refund_User_ID as long dim Refund_User_Name as string dim Refund_Days as integer ////////////////////////////////////////////////////////////////////// cls ? Copyright ? Menu_Name = "Main" if ParamCount >= 1 then Menu_Name = ParamStr ( 1 ) end if Menu_BBS_Pre = "Menu\" + Menu_Name + ".PRE" Menu_BBS_Ad = "Menu\" + Menu_Name + ".AD" Menu_BBS_New = "Menu\" + Menu_Name + ".BBS" Menu_Dat = "Menu\" + Menu_Name + ".DAT" Lines = 3 if ParamCount >= 2 then Lines = Val ( ParamStr ( 2 ) ) end if Cost_Per_Day_Min = 1 if ParamCount >= 3 then Cost_Per_Day_Min = Val ( ParamStr ( 3 ) ) end if if not Exists ( Menu_BBS_Ad ) then ? Menu_BBS_Ad; " must be created before this program will run." WaitEnter end end if Menu_Info ( Cost, Date_Expires, Cost_Per_Day, \ Refund_Cost, Refund_User_ID, Refund_User_Name, Refund_Days, \ Lines, Menu_Dat, Cost_Per_Day_Min, Cost_Per_Day_Max, Days_Max ) if Ad_Made ( Lines ) then Refund_Send ( Menu_Dat, Refund_Cost, Refund_User_ID, \ Refund_User_Name, Refund_Days ) File_Menu_Dat = FreeFile open Menu_Dat for output as File_Menu_Dat ? #File_Menu_Dat, FormatDate ( Date_Expires, DATE_MASK_ISO ) ? #File_Menu_Dat, Cost_Per_Day ? #File_Menu_Dat, User.UserID ? #File_Menu_Dat, User.Name File_BBS_Ad_BBS = FreeFile open BBS_Ad_BBS for output as File_BBS_Ad_BBS Line = " BBS Ad" Line = string ( 76 - Len ( Line ), "=" ) + Line + " ==" print #File_BBS_Ad_BBS, Line File_BBS_Ad_Tmp = FreeFile open BBS_Ad_Tmp for input as File_BBS_Ad_Tmp while not EOF ( File_BBS_Ad_Tmp ) input #File_BBS_Ad_Tmp, Line print #File_BBS_Ad_BBS, Line print #File_Menu_Dat , Line wend close ( File_BBS_Ad_Tmp ) close ( File_Menu_Dat ) del BBS_Ad_Tmp CurrentDate DateVar Line = " " + FormatDate ( DateVar, DATE_MASK_ISO ) + " " + User.Name Line = string ( 76 - Len ( Line ), "=" ) + Line + " ==" print #File_BBS_Ad_BBS, Line File_Menu_BBS_Ad = FreeFile open Menu_BBS_Ad for input as File_Menu_BBS_Ad while not EOF ( File_Menu_BBS_Ad ) input #File_Menu_BBS_Ad, Line print #File_BBS_Ad_BBS, Line wend close ( File_Menu_BBS_Ad ) close ( File_BBS_Ad_BBS ) Done = CopyFile ( BBS_Ad_BBS, Menu_BBS_New ) if Exists ( Menu_BBS_Pre ) then Done = File_Text_Insert ( Menu_BBS_Pre, Menu_BBS_New ) end if if Done then if User.SubscriptionBalance >= Cost then User.SubscriptionBalance = User.SubscriptionBalance - Cost end if ? "Done!" else del Menu_Dat Beep ? "Failed! You have not been charged." end if WaitEnter end if end sub ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// BBS_Ad_Start