summaryrefslogtreecommitdiff
path: root/templates/themes/catalog/theme.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-31 22:14:26 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-31 22:14:26 -0400
commita052a791b553c770ef407f91b697bef7a62df5b1 (patch)
treef49b8edf930f6d27fd14db4970107f128b02b992 /templates/themes/catalog/theme.php
parent232f4ff8680e81dbee3902c01af6c702555fbc0f (diff)
Add optional database table prefix (issue #118; see issue comments for details)
Diffstat (limited to 'templates/themes/catalog/theme.php')
-rw-r--r--templates/themes/catalog/theme.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index 5c9f6769..4e2d40db 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -37,7 +37,7 @@
$recent_posts = array();
$stats = array();
- $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM `posts_%s` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error());
+ $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM ``posts_%s`` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error());
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
$post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id']));