diff options
Diffstat (limited to 'frontend/pages/welcome.php')
-rw-r--r-- | frontend/pages/welcome.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/frontend/pages/welcome.php b/frontend/pages/welcome.php index 4b727e3..2de99a1 100644 --- a/frontend/pages/welcome.php +++ b/frontend/pages/welcome.php @@ -1,13 +1,11 @@ <?php -function init_welcome() { - global $S; +function init_welcome(&$S) { $S['title']='Welcome'; } -function body_welcome() { - global $S; +function body_welcome(&$S) { echo '<h2>Welcome</h2>'; echo '<div class="box"><h3>Most Popular Downloads</h3>'; - $r=$S['pdo']->query('SELECT `build` FROM `downloads` GROUP BY `build` ORDER BY COUNT(*) DESC LIMIT 3'); + $r=query('SELECT `build` FROM `downloads` GROUP BY `build` ORDER BY COUNT(*) DESC LIMIT 3'); if ($r->rowCount()) { while ($build=$r->fetch(PDO::FETCH_COLUMN)) { $build=new sql_build($build); @@ -18,7 +16,7 @@ function body_welcome() { } echo '</div>'; echo '<div class="box"><h3>Recently Downloaded</h3>'; - $r=$S['pdo']->query('SELECT * FROM `downloads` ORDER BY `time` DESC LIMIT 3'); + $r=query('SELECT * FROM `downloads` ORDER BY `time` DESC LIMIT 3'); if ($r->rowCount()) { while ($download=$r->fetch(PDO::FETCH_ASSOC)) { $download=new sql_download($download); @@ -29,7 +27,7 @@ function body_welcome() { } echo '</div>'; echo '<div class="box"><h3>Recently Built</h3>'; - $r=$S['pdo']->query('SELECT * FROM `builds` WHERE `status`="finished/success" ORDER BY `finish` DESC LIMIT 3'); + $r=query('SELECT * FROM `builds` WHERE `status`="finished/success" ORDER BY `finish` DESC LIMIT 3'); if ($r->rowCount()) { while ($build=$r->fetch(PDO::FETCH_ASSOC)) { $build=new sql_build($build); |