From 4697698b032d6da2827faaadd597f37064371eb2 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Fri, 29 Aug 2014 16:37:11 +0200 Subject: [PATCH] Define tables global (#214 #196) --- php/define.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/php/define.php b/php/define.php index fac3830..1d285ab 100644 --- a/php/define.php +++ b/php/define.php @@ -26,4 +26,15 @@ define('LYCHEE_CONFIG_FILE', LYCHEE_DATA . 'config.php'); define('LYCHEE_URL_UPLOADS_THUMB', 'uploads/thumb/'); define('LYCHEE_URL_UPLOADS_BIG', 'uploads/big/'); +# Parse table prefix +# Old users do not have the table prefix stored in their config-file +if (!isset($dbTablePrefix)) $dbTablePrefix = ''; +else $dbTablePrefix .= '_'; + +# Define tables +define('LYCHEE_TABLE_ALBUMS', $dbTablePrefix . 'lychee_albums'); +define('LYCHEE_TABLE_LOG', $dbTablePrefix . 'lychee_log'); +define('LYCHEE_TABLE_PHOTOS', $dbTablePrefix . 'lychee_photos'); +define('LYCHEE_TABLE_SETTINGS', $dbTablePrefix . 'lychee_settings'); + ?> \ No newline at end of file