Permalink
Browse files

Fix the mobile site after the db abstraction.

  • Loading branch information...
1 parent dccfd84 commit 4e538040ba52c6833d7378bcb75783b4065a1c9c @adamdecaf adamdecaf committed May 28, 2012
View
2 mobile/application/helpers/header.php
@@ -4,4 +4,4 @@
* Adam Shannon
*/
-$nav_items = DB::search("SELECT `name`,`href`,`style` FROM `" . DB::$database . "`.`nav-items` ORDER BY `position` ASC");
+$nav_items = DB::search("SELECT `name`,`href`,`style` FROM `" . $database . "`.`nav-items` ORDER BY `position` ASC");
View
4 mobile/application/helpers/main.php
@@ -9,13 +9,13 @@
}
// For now we want the blog posts pulled and displayed.
-$posts = DB::search("SELECT * FROM `" . DB::$database . "`.`blog-posts` WHERE `timestamp` < " . DB::clean($url['older_than']) . " ORDER BY `timestamp` DESC LIMIT 10");
+$posts = DB::search("SELECT * FROM `" . $database . "`.`blog-posts` WHERE `timestamp` < " . DB::clean($url['older_than']) . " ORDER BY `timestamp` DESC LIMIT 10");
// Create an array of authors, organized by their user id.
$authors = array();
foreach ($posts as $post) {
if (@empty($authors[$post['author']]) && @$authors[$post['author']] != '0') {
- $result = DB::single("SELECT `first_name`,`last_name` FROM `" . DB::$database . "`.`users` WHERE `id` = '" . DB::clean($post['author']) . "' LIMIT 1");
+ $result = DB::single("SELECT `first_name`,`last_name` FROM `" . $database . "`.`users` WHERE `id` = '" . DB::clean($post['author']) . "' LIMIT 1");
$authors[$post['author']] = $result['first_name'] . ' ' . $result['last_name'];
}
}
View
2 mobile/application/helpers/show_post.php
@@ -26,7 +26,7 @@
// Load the commenters real names.
foreach ($comments as $comment) {
if (empty($authors[$comment['author']]) && $authors[$comment['author']] != '0') {
- $result = DB::single("SELECT `first_name`,`last_name` FROM `" . DB::$database . "`.`users` WHERE `id` = '" . DB::clean($comment['author']) . "' LIMIT 1");
+ $result = DB::single("SELECT `first_name`,`last_name` FROM `" . $database . "`.`users` WHERE `id` = '" . DB::clean($comment['author']) . "' LIMIT 1");
$authors[$comment['author']] = $result['first_name'] . ' ' . $result['last_name'];
}
}
View
5 mobile/index.php
@@ -20,9 +20,6 @@
include '../admin/system/libs/log-actions.php';
Log::set($database);
-// Include the errors handler
-require '../system/errors/errors.php';
-
// Load the user stuff. (Facebook)
require_once "../system/libs/facebook/facebook.php";
require '../application/helpers/user.php';
@@ -59,7 +56,7 @@
default:
include '../application/helpers/detect_page.php';
- $url_stubs = get_possible_url_stubs();
+ $url_stubs = get_possible_url_stubs($database);
if (in_array($url['page'], $url_stubs)) {
// Load that specifc page from the db and display it.

0 comments on commit 4e53804

Please sign in to comment.