define.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. ###
  3. # @name Define
  4. # @copyright 2015 by Tobias Reich
  5. ###
  6. # Define root
  7. define('LYCHEE', substr(__DIR__, 0, -3));
  8. # Define status
  9. define('LYCHEE_STATUS_NOCONFIG', 0);
  10. define('LYCHEE_STATUS_LOGGEDOUT', 1);
  11. define('LYCHEE_STATUS_LOGGEDIN', 2);
  12. # Define dirs
  13. define('LYCHEE_DATA', LYCHEE . 'data/');
  14. define('LYCHEE_SRC', LYCHEE . 'src/');
  15. define('LYCHEE_UPLOADS', LYCHEE . 'uploads/');
  16. define('LYCHEE_UPLOADS_BIG', LYCHEE_UPLOADS . 'big/');
  17. define('LYCHEE_UPLOADS_MEDIUM', LYCHEE_UPLOADS . 'medium/');
  18. define('LYCHEE_UPLOADS_THUMB', LYCHEE_UPLOADS . 'thumb/');
  19. define('LYCHEE_UPLOADS_IMPORT', LYCHEE_UPLOADS . 'import/');
  20. define('LYCHEE_PLUGINS', LYCHEE . 'plugins/');
  21. # Define files
  22. define('LYCHEE_CONFIG_FILE', LYCHEE_DATA . 'config.php');
  23. # Define urls
  24. define('LYCHEE_URL_UPLOADS_BIG', 'uploads/big/');
  25. define('LYCHEE_URL_UPLOADS_MEDIUM', 'uploads/medium/');
  26. define('LYCHEE_URL_UPLOADS_THUMB', 'uploads/thumb/');
  27. function defineTablePrefix($dbTablePrefix) {
  28. # This part is wrapped into a function, because it needs to be called
  29. # after the config-file has been loaded. Other defines are available
  30. # before the config-file has been loaded.
  31. # Parse table prefix
  32. # Old users do not have the table prefix stored in their config-file
  33. if (!isset($dbTablePrefix)||$dbTablePrefix==='') $dbTablePrefix = '';
  34. else $dbTablePrefix .= '_';
  35. # Define tables
  36. define('LYCHEE_TABLE_ALBUMS', $dbTablePrefix . 'lychee_albums');
  37. define('LYCHEE_TABLE_LOG', $dbTablePrefix . 'lychee_log');
  38. define('LYCHEE_TABLE_PHOTOS', $dbTablePrefix . 'lychee_photos');
  39. define('LYCHEE_TABLE_SETTINGS', $dbTablePrefix . 'lychee_settings');
  40. }
  41. ?>