mseiwald Posted June 27, 2012 Report Posted June 27, 2012 Is there a way in the schedule_results.tpl to check the latest pirep submit dates with todays date so that i can make something like if the pirep submitdate == today for that flight number and then echo a specific image in the line of that specific scheduled flight? The reason i want something like that is because i want that every flightnumber can only be flown once per day. Any ideas? Quote
Moderators Parkho Posted June 27, 2012 Moderators Report Posted June 27, 2012 How much are you gonna pay for that???!!!! loll! just joking! So, you want the schedules to be disabled after they were flown!? You need to search through the PIREPS for that schedule # and simply make it disabled on that day but do you want this for a certain pilot or for all other pilots as well? Quote
mseiwald Posted June 27, 2012 Author Report Posted June 27, 2012 Hi Parviz, yes that`s exactly what i want. All already completed flights on that day should be disabled for all pilots. So that every flight number can only be flown once per day. If a pilot has flown a flight it then is considered completed and can not be booked by other pilots on that day. If that is much work to figure out how that works i wouldn`t mind to pay a reasonable amount for it Quote
Moderators Parkho Posted June 27, 2012 Moderators Report Posted June 27, 2012 Well, I started working on it as you may know i'm not an expert. By the way, there is no need to pay for what you can get for free! Quote
mseiwald Posted June 27, 2012 Author Report Posted June 27, 2012 Thank you very much for trying to get it working. It would be amazing if you could figure it out Quote
STARs Posted June 27, 2012 Report Posted June 27, 2012 this addon would be charming hope parviz could figure out something for us best of luck parviz! Quote
Strider Posted June 27, 2012 Report Posted June 27, 2012 I think that your VA will very quickly become a ghost town if you implement this. People who join VA's are doing it for fun, not so that they can only fly a route once per day. In the real world, yes some routes are flown only once a day, but others are flown multiple times a day. This is taking realism a bit too far. There is a limit as to how far you can make your VA realistic before people will just atop flying for it as it will become too much of a chore and wont like it. Quote
mseiwald Posted June 27, 2012 Author Report Posted June 27, 2012 Hm Daniel i don`t agree with you on that point. I have been flying for a German VA named "Leipzig Air" before and they use a system like that. They simulate the operations very realistic and also are very restrictive on accepting PIREPS and i think that is the reason why they are one of the best known and a very popular german VA. There are a lot of people who prefer a realistic operation. A VA should be for people who are having fun simulating the operations of a real world airline. People who just want to have fun flying around shall in my opinion just fire up their FS and go flying but they don`t need a VA for that. We have a big choice of routes every day so i think there will still be enough options available. And if a route shall be served like in RW more than 1 time a day then I make it like in reality and create a second or third flight number for it. So i don`t see a problem there. 2 Quote
Moderators Parkho Posted June 28, 2012 Moderators Report Posted June 28, 2012 Manuel, I've been meaning to ask you how you added "Last Location" to your signature or what file did you edit since I've been looking for that .tpl or module. Thanks Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 Hi Parviz, actually i just followed the steps in the first post of that thread if i remember right. It was a few months ago when i added the Last Location to the Badge http://forum.phpvms.net/topic/2665-last-location-in-badge/page__hl__badge__fromsearch__1 Quote
Guest lorathon Posted June 28, 2012 Report Posted June 28, 2012 The easiest way to do this would be to set the schedule disabled upon PIREP submission. Then setup a cron that runs a 12:00 am server time that resets all schedules to enabled. Quote
Moderators Parkho Posted June 28, 2012 Moderators Report Posted June 28, 2012 I The easiest way to do this would be to set the schedule disabled upon PIREP submission. Then setup a cron that runs a 12:00 am server time that resets all schedules to enabled. That's a good way. I can do the first part but not the cron job, can you help me? Thanks Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 that sounds like a good way. how would i do that? do you have a code for such a cron job? that would be great. Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 oh but i see one problem there....what about the tour flights? they of course should be bookable anytime. That was the reason why i tried to check the pirep date with todays date and based on that just exclude the flights from being displayed on the schedules. Because then it would be possible to exclude all tour flights...in my case all have a T in the flightnumber...so it`s easy to identify them. EDIT: not a problem anymore.... I`ll just add the booking buttons to the tour page directly...so there is no need to have them inside the regular schedules anymore then. Quote
Guest lorathon Posted June 28, 2012 Report Posted June 28, 2012 Just add an if statement on the set to disabled script. If flight number contains "T" then continue. This will ensure that the tour schedules are never disabled. For the cron you will need to write an update script. Set enabled to 1 where enabled = 0. Then add the cron job to your cPanel to run every evening. Quote
Moderators servetas Posted June 28, 2012 Moderators Report Posted June 28, 2012 Wrong topic, please delete it. Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 hmmmm i have no idea how to disable the schedules upon pirep submission and how to write the cron job. i would be really grateful if one of you could help me with that. Quote
Guest lorathon Posted June 28, 2012 Report Posted June 28, 2012 I would but I am heading out after work. Be gone until the 8th. If you dont have it finished when I get back let me know and I will knock it out for ya. Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 thank you! that would be great. i`ll see if i can get this to work somehow and if i fail I`ll let you know Quote
Strider Posted June 28, 2012 Report Posted June 28, 2012 You obviously just skimmed my reply, as I had pointed out that real world airlines never just fly a route once per day, some routes yes, but others they will fly multiple times. Take Aer Lingus flights between Dublin and Heathrow, they operate around 12 flights a day on the one route. And the VA you mentioned, I have never heared of it until you mentioned it. Maybe in Germany it is well known. And if you think that people who want to fly for fun don't need a VA, then what are you doing in the VA business? You have a very small mind if you think like that. Something like what you want will cause more trouble then it is worth. There is another problem with your request, just because you can set the schedule not to show a route after it has been filed, doesn't mean people can't fly it after that. And if you start rejecting perfectly good pireps just because it has been filed already that day, you will start to annoy pilots, and they will stop having fun. Quote
Guest lorathon Posted June 28, 2012 Report Posted June 28, 2012 Please do not insult each other. You have a very small mind if you think like that. Quote
mseiwald Posted June 28, 2012 Author Report Posted June 28, 2012 Hi Daniel, You obviously just skimmed my reply, as I had pointed out that real world airlines never just fly a route once per day, some routes yes, but others they will fly multiple times. Take Aer Lingus flights between Dublin and Heathrow, they operate around 12 flights a day on the one route. And you obviously did the same to my reply I stated that this is correct....but I`m sure also Aer Lingus uses different flight numbers, different dep/arr times and maybe for some reason even different routings at different times. And the VA you mentioned, I have never heared of it until you mentioned it. Maybe in Germany it is well known. Yeah of course it only is well known in German Speaking Countries because their website is in German only. And if you think that people who want to fly for fun don't need a VA, then what are you doing in the VA business? You have a very small mind if you think like that. Of course we all fly for fun. But what i said was a virtual airline shall be for pilots who fly for fun && want to simulate a realistic airline operation. I call Hellenic Airways a virtual "AIRLINE", not a virtual flying club and not a online logbook for fun flyers or something like that. It is stated several times on my website that " we simulate the operations of real world airlines as close as possible". Also in our Operations Manual which is accessible for the public all reasons for PIREPS being rejected are listed. So everyone has the chance to see how we operate and that we are aiming for a as real as it gets simulation before joining us. Something like what you want will cause more trouble then it is worth. There is another problem with your request, just because you can set the schedule not to show a route after it has been filed, doesn't mean people can't fly it after that. And if you start rejecting perfectly good pireps just because it has been filed already that day, you will start to annoy pilots, and they will stop having fun. I don`t think it will cause a lot of trouble if we do it the way Jeff has proposed. Also when the Flights are disabled for the rest of that day people won`t be able to fly them anymore. So no need to reject any PIREPS for that reason. I thank you for sharing your concerns....however i don`t think that making the VA more realistic will result in pilots not to join us but in fact the opposite. Nobody is forced to use this modification. One can if he wants a more realistic operation but nobody must add it. There are so many VA`s out there....and also thousands of Flightsim enthusiasts. I don`t need 100s of pilots in my VA....it would be enough to just have 30 active people or so who wants to fly realistic airline operations just as i and my staff do.....and if someone wants to fly just for fun he is free to join any of the 1000 other VA`s out there. kind regards Quote
Moderators Parkho Posted June 29, 2012 Moderators Report Posted June 29, 2012 After reading your argument, I think Manuel has the right to ask for what he wants for his VA, so it doesn't matter if someone likes it or not that's what he wants and that's what he's eventually going to get and if there are some issues along, that's totally his business. Quote
STARs Posted June 29, 2012 Report Posted June 29, 2012 Could you avoid fighting at the forum? I would prefer that you guys should continue via PM instead. Quote
mseiwald Posted July 3, 2012 Author Report Posted July 3, 2012 i think i have found a easy way that allows to hide the already flown flights from the schedules for that day. i have created a new column in the schedules table called "lastflown" now when a pirep is sent it should automatically insert the submitdate into that column. so it will be easy to skip those flights from being displayed by just adding a if statement like if($route->lastflown == $today) { continue; } i already tried to make it work but failed. I don`t get the lastflown column populated with todays date. I was trying to add a update function to the PIREPData.class.php to add the submitdate into the lastflown column where code and flightnumber match schedules<->pirep. it would be amazing if someone could tell me how i can update that table....i just need the submitdate that is sent to the pireps table anyway to also populate the column in the schedules table. I hope that wouldn`t be too difficult. kind regards Manuel Quote
Moderators Parkho Posted July 3, 2012 Moderators Report Posted July 3, 2012 Ok that's good, first you need to assign a value to $today like this: $today = date("Y-m-d"); ////// This gives you today's date $pirepdate = date(DATE_FORMAT, strtotime($pirep->submitdate)); ////// This formats the pirep's submit date. If($today == $pirepdate) { continue; } But you will need a foreach for your column meaning another foreach inside the already existing foreach and of course you need to pull the pirep data for your foreach. Complicated huh! . I'm working on it let me see if I can resolve it Quote
mseiwald Posted July 3, 2012 Author Report Posted July 3, 2012 yeah i know i already came that far by getting it via PIREPData::getRecentReportsByCount(50) inside the schedule_results.tpl. $reports = PIREPData::getRecentReportsByCount(50); foreach($reports as $report) { $pirepdate = date(DATE_FORMAT, strtotime($report->submitdate)) $today = date("Y-m-d"); If($today == $pirepdate && $report->flightnum == $route->flightnum) { echo.......(some images...because what i originally wanted was to have a image displayed if the route was flown and another if it wasn`t flown. } else { echo..... } } this brought up the right image of course but besides the one i wanted to show only for the already flown routes it also was giving out 49 times the other image hehe there is a function missing to get the latest Pirep by code & flightnum.... that would be a way to get it done. So it came to my mind to add the latest submitdate directly into the schedules table......that way you wouldn`t need a second foreach loop. Isn`t it possible to have the column lastflown in the schedules table populated with the submitdate when a pirep is filed? Quote
Moderators Parkho Posted July 3, 2012 Moderators Report Posted July 3, 2012 I don't think that's doable but I was thinking of using the find pirep function in PIREPData passing the submitedate value as today and then use a foreach and an if statement. Don't know if it works though. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.