8d7
<  */
10,12c9
< // Next two lines depend on the path of this file: /sites/all/modules/bowob/bowob.php
< $_SERVER['SCRIPT_NAME'] = $_SERVER['PHP_SELF'] = substr($_SERVER['SCRIPT_NAME'], 0, -33) . 'index.php';
< define('DRUPAL_ROOT', dirname(dirname(dirname(dirname(dirname(realpath(__FILE__)))))));
---
> */
14,15c11,45
< require(DRUPAL_ROOT . '/includes/bootstrap.inc');
< drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
---
> if (!empty($_SERVER['SCRIPT_FILENAME'])) 
> {
>   $drupal_path = dirname(dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));
>   if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
>     $drupal_path = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
>     $depth = 2;
>     do {
>       $drupal_path = dirname($drupal_path);
>       $depth++;
>     } while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10);
>   }
> }
> 
> if (!isset($bootstrap_file_found) || !$bootstrap_file_found) 
> {
>   $drupal_path = '../../../../..';
>   if (!file_exists($drupal_path . '/includes/bootstrap.inc')) {
>     $drupal_path = '../..';
>     do {
>       $drupal_path .= '/..';
>       $depth = substr_count($drupal_path, '..');
>     } while (!($bootstrap_file_found = file_exists($drupal_path . '/includes/bootstrap.inc')) && $depth < 10);
>   }
> }
> 
> if (!isset($bootstrap_file_found) || $bootstrap_file_found) 
> {
>   $current_cwd = getcwd();
>   chdir($drupal_path);
>   if (!defined('DRUPAL_ROOT')){
>     define('DRUPAL_ROOT', $drupal_path);
>   }
>   require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
>   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
> }
