Skip to content
This repository was archived by the owner on Dec 6, 2019. It is now read-only.

Commit 1670363

Browse files
author
nshahzad
committed
2.1 final build
git-svn-id: file:///var/svn/phpvms/trunk@924 e188d3d8-5a48-0410-b2de-ed2772025908
1 parent aa999a1 commit 1670363

File tree

6 files changed

+154
-10
lines changed

6 files changed

+154
-10
lines changed

core/classes/ezdb/ezdb_base.class.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,20 +665,25 @@ public function build_select($params)
665665

666666
public function build_where($fields)
667667
{
668-
$sql='';
669-
670-
if(!is_array($fields))
668+
if(count($fields) === 0 || empty($fields) === true)
669+
{
670+
return '';
671+
}
672+
673+
// It's a string
674+
if(!is_array($fields) && !is_object($fields))
671675
{
672676
$fields = str_ireplace('WHERE', '', $fields);
673677
return ' WHERE '.$fields;
674678
}
675679

676-
if(count($fields) === 0)
680+
// Cast it to an array...
681+
if(is_object($fields))
677682
{
678-
return '';
683+
$fields = (array) $fields;
679684
}
680685

681-
$sql .= ' WHERE ';
686+
$sql = ' WHERE ';
682687

683688
$where_clauses = array();
684689
foreach($fields as $column_name => $value)
@@ -730,8 +735,7 @@ public function build_where($fields)
730735
$sql.= implode(' AND ', $where_clauses).' ';
731736
unset($where_clauses);
732737

733-
return $sql;
734-
738+
return $sql;
735739
}
736740

737741
public function build_update($fields)

core/logs/log.txt

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
=====
2+
Time:
3+
=====
4+
Time: 04.18.10 16:53:26
5+
Backtrace: DB::write_debug > DB::get_results > StatsData::TotalFlightsToday > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Dashboard->index > call_user_func_array > MainController::RunAllActions
6+
Query: SELECT COUNT(*) AS `total` FROM phpvms_pirepsDATE(`submitdate`) = CURDATE()
7+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`submitdate`) = CURDATE()' at line 1
8+
=====
9+
10+
11+
=====
12+
13+
=====
14+
Time:
15+
=====
16+
Time: 04.18.10 16:53:28
17+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
18+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
19+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
20+
=====
21+
22+
23+
=====
24+
25+
=====
26+
Time:
27+
=====
28+
Time: 04.18.10 16:53:31
29+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
30+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
31+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
32+
=====
33+
34+
35+
=====
36+
37+
=====
38+
Time:
39+
=====
40+
Time: 04.18.10 17:00:06
41+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
42+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
43+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
44+
=====
45+
46+
47+
=====
48+
49+
=====
50+
Time:
51+
=====
52+
Time: 04.18.10 17:02:39
53+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
54+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
55+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
56+
=====
57+
58+
59+
=====
60+
61+
=====
62+
Time:
63+
=====
64+
Time: 04.18.10 17:06:34
65+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
66+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
67+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
68+
=====
69+
70+
71+
=====
72+
73+
=====
74+
Time:
75+
=====
76+
Time: 04.18.10 17:06:47
77+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
78+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
79+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
80+
=====
81+
82+
83+
=====
84+
85+
=====
86+
Time:
87+
=====
88+
Time: 04.18.10 17:06:59
89+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
90+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
91+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
92+
=====
93+
94+
95+
=====
96+
97+
=====
98+
Time:
99+
=====
100+
Time: 04.18.10 17:08:10
101+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
102+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
103+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
104+
=====
105+
106+
107+
=====
108+
109+
=====
110+
Time:
111+
=====
112+
Time: 04.18.10 17:08:34
113+
Backtrace: DB::write_debug > DB::get_results > PIREPData::findPIREPS > PIREPData::getRecentReportsByCount > PIREPS->RecentFrontPage > call_user_func_array > MainController::Run > include > TemplateSet->getTemplate > TemplateSet->showTemplate > Template::show > CodonModule->render > Frontpage->index > call_user_func_array > MainController::RunAllActions
114+
Query: SELECT p.*, UNIX_TIMESTAMP(p.submitdate) as submitdate, u.pilotid, u.firstname, u.lastname, u.email, u.rank, a.id AS aircraftid, a.name as aircraft, a.registration, dep.name as depname, dep.lat AS deplat, dep.lng AS deplng, arr.name as arrname, arr.lat AS arrlat, arr.lng AS arrlng FROM phpvms_pireps p LEFT JOIN phpvms_aircraft a ON a.id = p.aircraft LEFT JOIN phpvms_airports AS dep ON dep.icao = p.depicao LEFT JOIN phpvms_airports AS arr ON arr.icao = p.arricao LEFT JOIN phpvms_pilots u ON u.pilotid = p.pilotid WHERE ORDER BY p.submitdate DESC LIMIT 5
115+
Error: (1064) - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY p.submitdate DESC LIMIT 5' at line 10
116+
=====
117+
118+
119+
=====
120+

core/modules/PIREPS/PIREPS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ protected function SubmitPIREP()
462462
*/
463463
public function RecentFrontPage($count = 10)
464464
{
465-
$this->set('reports', PIREPData::GetRecentReportsByCount($count));
465+
$this->set('reports', PIREPData::getRecentReportsByCount($count));
466466
$this->render('frontpage_reports.tpl');
467467
}
468468
}

core/modules/Profile/Profile.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ public function stats()
105105

106106
$this->render('profile_stats.tpl');
107107
}
108+
109+
public function badge()
110+
{
111+
$this->set('badge_url', fileurl(SIGNATURE_PATH.'/'.PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid).'.png'));
112+
$this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid));
113+
$this->render('profile_badge.tpl');
114+
}
108115

109116
public function editprofile()
110117
{

core/templates/profile_badge.tpl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<h3>Pilot Badge</h3>
2+
<p align="center">
3+
<img src="<?php echo $badge_url ?>" />
4+
</p>
5+
<p>
6+
<strong>Direct Link:</strong>
7+
<input onclick="this.select()" type="text" value="<?php echo $badge_url ?>" style="width: 100%" />
8+
<br /><br />
9+
<strong>Image Link:</strong>
10+
<input onclick="this.select()" type="text" value='<img src="<?php echo $badge_url ?>" />' style="width: 100%" />
11+
<strong>BBCode:</strong>
12+
<input onclick="this.select()" type="text" value='[img]<?php echo $badge_url ?>[/img]' style="width: 100%" />
13+
</p>

core/templates/profile_main.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<ul>
5252
<li><a href="<?php echo url('/profile/editprofile'); ?>">Edit My Profile, Email and Avatar</a></li>
5353
<li><a href="<?php echo url('/profile/changepassword'); ?>">Change my Password</a></li>
54-
<li><a href="<?php echo SITE_URL.SIGNATURE_PATH.'/'.$pilotcode.'.png' ?>">View my Badge</a></li>
54+
<li><a href="<?php echo url('/profile/badge'); ?>">View my Badge</a></li>
5555
<li><a href="<?php echo url('/profile/stats'); ?>">My Stats</a></li>
5656
<li><a href="<?php echo url('/downloads'); ?>">View Downloads</a></li>
5757
</ul>

0 commit comments

Comments
 (0)