define.php 1.5 KB

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