-
Posts
44 -
Joined
-
Last visited
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Posts posted by Wingthor
-
-
Ok, thats strange the
and MONTH(submitdate)=MONTH(curdate())
in the SQL should limit that. Try replace curdate() with now(). Are you using mysql?
Are you linking correctly?
- 1
-
For now, gives you current month.
Assuming you are using the Touchdown stats from David Clark...
Add the following to the file TouchdownStatsData.class.php located under common (BACKUP FIRST!!!!) MARK! Both inpastes must go over the last '}' brackets in the bottom of files.
//Added by [your name] 2011.xx.xx get_stats_by_cur_month () $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' and MONTH(submitdate)=MONTH(curdate()) ORDER BY landingrate DESC"; return DB::get_results($query);}
Then add to the following file under module, TouchdownStats TouchdownStats.php
//Added by [your name] 2011.xx.xx public function top_landing_this_month () { $this->set('stats', TouchdownStatsData::get_stats_by_cur_month()); $this->show('touchdownstats/touchdownstats_index.tpl'); }
Link to http://your.site.ok/TouchdownStats/top_landing_this_month
The month selection require a bit more work. If you want limit the returned data, use same technique as above and paste in addition in TouchdownStatsData.class.php:
//Added by [your name] 2011.xx.xx public function get_stats_by_cur_month_limited ($howmany) { $query = "SELECT pilotid, code, flightnum, depicao, arricao, aircraft, landingrate, submitdate FROM `".TABLE_PREFIX."pireps` WHERE landingrate < '0' and MONTH(submitdate)=MONTH(curdate()) ORDER BY landingrate DESC"; return DB::get_results($query); }
And in th file TouchdownStats.php:
public function top_landing_this_month_limited () { $this->set('stats', TouchdownStatsData::get_stats_by_cur_month_limited($howmany)); $this->show('touchdownstats/touchdownstats_index.tpl'); }
To link limits use /top_landing_this_month_limited/X where x is the number you want to limit it to.
Must say my database is rather slim, so I don't know how this will look in a big DB. Anyway copy the files you are manipulating, ALWAYS.
Sorry for the brief answer, will come up with the month selection later. Make a mark that the scritp will return an error if the dataset is empty in the foreach clause in the tpl file. So probably you will get an error in the begining of each month .
Regards
- 1
-
Do you wan't limit the view to current month, or any mount?
-
Hi again...
I currently working with an addon which I think will have to 'explode' the raw data from the pireps table in the database. When inspecting the database it seems like FSPassengers pirep's raw data goes to the field log, while fsfk's goes to the table source. Where the free Xacars goes I don't know, does any one know?
Is this a bug, which I can expected to be fixed? It is no big issue, but it is nice to know when coding the addon.
Regards
Never mind, seems like the reports in the fspx pireps missing aircraft info. Guess thats why some data apears in the log field of the table.
-
Yeah, Im considiring building a kind of SQL generator. But Im not sure if it that can be done, since I am planning to extract info from the RAW PIREPS data. There is a lot more info in these than it is is fields in the pireps table, so builing a flexible easy to use SQL generator might be difficult.
Regards
-
That would be a good edition as this is all manually done at the moment apart from the ranks which are tied in to specified hours in the admin section.
You would have to create a module for the admin side with the logic and definable parameters.
Would be nice to see
It will be an adminstration addon, where you can activate predefined awards. Thats why I need as many predefined awards as possible. In case you want give awards for number of landings, you just define how many landings the pilot needs before he is awarded, then activate the award. Then it will activate event driven scripts which parses the awards into phpvms's ordinary award system. Think that should work.
Regards
-
Hi all,
I currently have som spare time, and wants to refresh my PHP knowledge. I also want to have a nice frontpage showing new awards. So I need a lot of them. The deadline for the project is currently open.
First question is that if this is build before?
Second is I could need som input creating awards. I have pasted in the result of my brainstoring below, but need som input from the public. The system is a kind of inspired by FSX own award system. Hopefully it can contribute to an internal and friendly competition among your pilots. The awards must be based on objective data from an acars system. So the data must be there, and the data must be able to be extraced with sql, eg x number of landings. Every contribution is appreciated, I will judge if I can get out the data. You can also comment on what I have come up with so far. Espesially I need help on the naming of the awards. You will understand when reading the output on my braingstorming.
Typeof awards:Landingsx number of landings [several intervals]x landing on a particullary [difficult] airfield [several intervals]x landing rate below ...best landing of a month/yearworst landing of the month and landing rate greater than xx (drunken pilot)x number of landings with rate lower than y in a rowTimex hours flownschedueld flights ontime block to block with respect to bid....deviance less than x timeSpent to much time on the toilet with xx/xy (member 10000m club) worst scheduele miss for a given time (month).x hours flownx hrs online flyingAircraft typeMost hours flown month/yearlongest distance month/yearMost landings month/yearlowest fbh a month/yearmax speed and landed a monthDistanceMost nm a month/yearx nm distance flown, several numbers....like promotingmost dist/hours a month/yearPassenger flownx numbersCargo flownx numbers [several intervals]Thanks in advance...
-
Hi again...
I currently working with an addon which I think will have to 'explode' the raw data from the pireps table in the database. When inspecting the database it seems like FSPassengers pirep's raw data goes to the field log, while fsfk's goes to the table source. Where the free Xacars goes I don't know, does any one know?
Is this a bug, which I can expected to be fixed? It is no big issue, but it is nice to know when coding the addon.
Regards
-
You can create your own admin module just as you can on the pilot side. Just place it in the admin/modules folder. To automatically add your link under the addons section of the admin menu put this in your new module file
Stupid question...
Where is the addons section of the admin menu ?
Regards
-
You're going to want to leave $page_content in your layout.tpl, otherwise pages won't have their content.
To add custom pages, you can either create them through the Pages thing in the admin panel or create your own module to show the template, which would look something like this:
<?php class MyPage extends CodonModule { public function index() { Template::Show('mypage.tpl'); } } ?>
Which would be in MyPage.php in a core/modules/MyPage/ folder, and to view it would be mysite.com/index.php/MyPage
Alternatively, if you're just wanting to edit the homepage, change the code in frontpage_main.tpl
Ok, I see. So in the documentation where it states:
"As you can see, this is the entire HTML page, with several important variables being output:* <?php echo $page_title ?> - This goes between the title tags* <?php echo $page_htmlhead;?> - This goes right above the </head> tag* <?php echo $page_htmlreq; ?> - This goes immediately following the <body> tag* <?php echo $page_content;?> - This goes where the body of the page (the content) is supposed to showYou can use the Template::Show() calls instead of the above ones, it's the same thing. For an example, view the crystal (the default skin) layout.tpl file. If there is a layout.tpl file, then the header.tpl and footer.tpl files will get ignored."That goes for you can choose to use "<?php echo $page_content;?>" or Template::Show('page_content')
Ok, thats fine I will find a way. Thanks for a quick reply
Regards
-
I am developing a new VMS site. I don't want the "echo $page_content;" in my layout.tpl file. But want to pont to an other tpl file. As it is stated in the 'Editing Template' page in the PHPVMS homepage documentation (http://forum.phpvms.net/page/index.html?record=32), it states that I can put a template dir under my lib/skins/[template), and call it by the fuction Template::Show('whichever.tpl').
I have made a 'test.tpl' file under my skins templates directory directory, and added (Template::Show('test.tpl'); to the layout.tpl file in skin root directory. This generated this error:
"Notice: The template file "/phpvms//core/templates/test.tpl" doesn't exist in /phpvms/core/classes/TemplateSet.class.php on line 248"So why does phpvms don't find the test.tpl under my skins directory. I have also noticed the the double '//' between phpvms and core in the error message. The file isn't there anyway. And I want it to look under '/var/www/phpvms/lib/skins'. So is my method wrong? I don't want the template to written over by any update.
Regards
Wingthor
-
the file is larger than maximum global quota, but the direct link is: http://www.oneworldvirtual.com/files/flight_schedule.zip
Link is dead. Anyone know where to get it?
Regards
-
Well, CLI is different. You have to make sure it's configured correctly to host on localhost or wherever your server is supposed to be setup. But in short, MySQL isn't setup correctly
The problem is that the database is gone corrupt. From the mysql.log I get the following error on a bunch of files, when clicking on to my site, one for every table gone corrupt:
Cannot find table phpvms/phpvms_pilots from the internal data dictionaryof InnoDB though the .frm file for the table exists. Maybe youhave deleted and recreated InnoDB data files but have forgottento delete the corresponding .frm files of InnoDB tables, or youhave moved .frm files to another database?Seehow you can resolve the problem.So I better dig after the the database from the orginal site and hope they are OK there.
Think I can manage from here. Thanks for the help!!
Regards
-
There's on SITE_ROOT, that's figured out automatically.
The error you posted above - seems as though it can't connect to the database. Make sure those settings are correct
I can connect to the database from CLI using the data given in local.config.php. However, when cheking the database in webmin, it gives me the following error:
SQL show index from `phpvms_acarsdata` failed : Table 'phpvms.phpvms_acarsdata' doesn't existBut I can't see the relevanse. Like I told earlier I can connect to the database fine from CLI (Command Line Interface) on my Linux server.
Regards
-
Make sure the paths are correct in local.config.php
Hum, I can't find any setting for SITE_ROOT in my local.config.php, the file ends with som days_long settings.
Which line is it? Or could you paste a line in a reply so I could adjust it to my site?
Regards
-
Have a look at your hard coded paths, they are possibly different than your old server.
Think it must be something with the "CURRENT_SKIN". That is not a real path I guess. At least not on my site.
-
Have a look at your hard coded paths, they are possibly different than your old server.
I have search, without trace after the old site. I have fgrep-ed the whole site without result. Is is local.config.php it should be? The database?
Regards
-
After I moved my phpvms site to an other server I get this error message:
Notice: The template file "/var/www/phpvms//lib/skins/CURRENT_SKIN/header.tpl" doesn't exist in /var/www/phpvms/core/classes/TemplateSet.class.php on line 227Recent ReportsNo reports have been filedNewest PilotsWarning: Invalid argument supplied for foreach() in /var/www/phpvms/core/templates/frontpage_recentpilots.tpl on line 3Users OnlineThere have been 0 user(s), and 1 guest(s) online in the past 20 minutes.Notice: The template file "/var/www/phpvms//lib/skins/CURRENT_SKIN/footer.tpl" doesn't exist in /var/www/phpvms/core/classes/TemplateSet.class.php on line 227What can that be?
Skin is default, crystal and the only one installed.
Regards
Wingthor
Landing rates by month and all time
in Development Help
Posted
Ah, check if it takes data from other years?