示例#1
0
}
// configure smarty for HTML output
$smarty = new Smarty();
$smarty->template_dir = $config['basedir'] . "/code/templates";
$smarty->compile_dir = $config['basedir'] . "/code/templates_c";
$smarty->config_dir = $config['basedir'] . "/code/configs";
$smarty->compile_check = $sotfVars->get('smarty_compile_check', 0);
$smarty->debugging = $sotfVars->get('debug_smarty', 0);
$smarty->show_info_include = $sotfVars->get('debug_smarty', 0);
// this object contains various utilities
$utils = new sotf_Utils();
// for easier access
$scriptUrl = mygetenv('SCRIPT_NAME');
debug('scripturl', $scriptUrl);
// page object is for request handling and page generation
$page = new sotf_Page();
// we need trick for making pages indexed by Google
// therefore we pass some parameters in pathinfo
// after this call getParameter can be used to get these parameters as well
$pathinfoParamExceptions = array('listen', 'getFile', 'getIcon', 'getJingle', 'getUserFile');
if (!in_array($page->action, $pathinfoParamExceptions)) {
    sotf_Utils::collectPathinfoParams();
}
// permissions object is for managing and asking for permissions
$permissions = new sotf_Permission();
// the repository of radio stations
$repository = new sotf_Repository($config['repositoryDir'], $db);
// now you have the following global objects: $config, $db, $userdb, $smarty, $page, $repository, $user, $permission
// is that too many?
// forwarding all $config to smarty is a security risk
// $smarty->assign("CONFIG", $config);
示例#2
0
}
// configure smarty for HTML output
$smarty = new Smarty();
$smarty->template_dir = $config['basedir'] . "/code/templates";
$smarty->compile_dir = $config['basedir'] . "/code/templates_c";
$smarty->config_dir = $config['basedir'] . "/code/configs";
$smarty->compile_check = $sotfVars->get('smarty_compile_check', 1);
$smarty->debugging = $sotfVars->get('debug_smarty', 0);
$smarty->show_info_include = $sotfVars->get('debug_smarty', 0);
// this object contains various utilities
$utils = new sotf_Utils();
// for easier access
$scriptUrl = mygetenv('SCRIPT_NAME');
debug('scripturl', $scriptUrl);
// page object is for request handling and page generation
$page = new sotf_Page();
///////////////////////////////////////////////////
// Handle language change
///////////////////////////////////////////////////
if ($_GET['uilang']) {
    $page->setUILanguage($_GET['uilang']);
    $url = $_GET['okURL'];
    if (!$url) {
        $url = $config['localPrefix'];
    }
    $page->redirect($url);
    exit;
}
// we need trick for making pages indexed by Google
// therefore we pass some parameters in pathinfo
// after this call getParameter can be used to get these parameters as well
示例#3
0
        error_log("COOKIE: {$key} = {$value}", 0);
    }
    //  foreach($_ENV as $key => $value) {
    //  error_log("ENV: $key = $value",0);
    //}
}
// configure smarty for HTML output
$smarty = new Smarty();
$smarty->template_dir = "{$basedir}/code/templates";
$smarty->compile_dir = "{$basedir}/code/templates_c";
$smarty->config_dir = "{$basedir}/code/configs";
$smarty->compile_check = $sotfVars->get('smarty_compile_check', 0);
$smarty->debugging = $sotfVars->get('debug_smarty', 0);
$smarty->show_info_include = $sotfVars->get('debug_smarty', 0);
// this object contains various utilities
$utils = new sotf_Utils();
// page object is for request handling and page generation
$page = new sotf_Page();
// now you have the following global objects: $db, $smarty, $page
// add basic variables to Smarty
$smarty->assign("ROOTDIR", $rootdir);
$smarty->assign("IMAGEDIR", $imagedir);
$smarty->assign("CACHEDIR", $cacheprefix);
$smarty->assign("DEBUG", $debug);
$smarty->assign("ACTION", $page->action);
$smarty->assign("LANG", $lang);
if ($debug) {
    $smarty->assign("VIEWLOG", $page->logURL());
}
debug("action:", $page->action);
debug("lang", $lang);