The version of vichan running on lainchan.org
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

51 lines
1.0KB

  1. <?php
  2. /*
  3. * This script will look for Tinyboard in the following places (in order):
  4. * - $TINYBOARD_PATH environment varaible
  5. * - ./
  6. * - ./Tinyboard/
  7. * - ../
  8. */
  9. ini_set('display_errors', 1);
  10. error_reporting(E_ALL);
  11. set_time_limit(0);
  12. $shell_path = getcwd();
  13. if (php_sapi_name() != 'cli') {
  14. die("This script is executable only from Command Line Interface.");
  15. }
  16. if(getenv('TINYBOARD_PATH') !== false)
  17. $dir = getenv('TINYBOARD_PATH');
  18. elseif(file_exists('inc/functions.php'))
  19. $dir = false;
  20. elseif(file_exists('Tinyboard') && is_dir('Tinyboard') && file_exists('Tinyboard/inc/functions.php'))
  21. $dir = 'Tinyboard';
  22. elseif(file_exists('../inc/functions.php'))
  23. $dir = '..';
  24. else
  25. die("Could not locate Tinyboard directory!\n");
  26. if($dir && !chdir($dir))
  27. die("Could not change directory to {$dir}\n");
  28. if(!getenv('TINYBOARD_PATH')) {
  29. // follow symlink
  30. chdir(realpath('inc') . '/..');
  31. }
  32. putenv('TINYBOARD_PATH=' . getcwd());
  33. require 'inc/functions.php';
  34. $mod = Array(
  35. 'id' => -1,
  36. 'type' => ADMIN,
  37. 'username' => '?',
  38. 'boards' => Array('*')
  39. );