function redirect_browser($url, $hard = false) { hook_finish(); $original_url = $url; if ($hard) { header('HTTP/1.1 301 Moved Permanently'); } if (!preg_match('/^https?:/', $url) && $url[0] != "/" && $url[0] != "?") { $url = _BASE_HREF . $url; } if (false && _DEBUG_MODE) { module_debug::$show_debug = true; module_debug::log(array('title' => 'Redirecting', 'file' => 'includes/functions.php', 'data' => "to '{$original_url}'" . ($url != $original_url ? " (converted to: {$url})" : '') . "<br/><br/>Please <a href='{$url}'>Click Here</a> to perform the redirect.")); module_debug::print_heading(); } else { /*$url .= (strpos($url,'?')===false ? '?' : '&') . "redirect".time(); ?> <meta http-equiv="refresh" content="0;url=<?php echo htmlspecialchars($url);?>"> <script type="text/javascript">window.location.href='<?php echo $url;?>';</script> Redirecting... <?php*/ header("Location: " . $url); } exit; }
//$m = (isset($_REQUEST['m'])) ? trim(basename($_REQUEST['m'])) : false; $h = isset($_REQUEST['h']) ? trim(basename($_REQUEST['h'])) : false; if ($dont_init_plugins && $m && !isset($plugins[$m])) { $external_plugins_to_load = array(); $external_plugins_to_load[] = basename($m); if (in_array('wordpress', $external_plugins_to_load)) { $external_plugins_to_load[] = 'envato'; } foreach ($external_plugins_to_load as $external_plugin_to_load) { $external_plugin_to_load = basename($external_plugin_to_load); $plugin_dir = 'includes/plugin_' . $external_plugin_to_load; if (is_dir($plugin_dir) && is_file($plugin_dir . "/" . $external_plugin_to_load . ".php")) { require_once $plugin_dir . "/" . $external_plugin_to_load . ".php"; eval('$plugins[$external_plugin_to_load] = new module_' . $external_plugin_to_load . '();'); $plugins[$external_plugin_to_load]->init(); } } } if ($m && isset($plugins[$m])) { if (method_exists($plugins[$m], 'external_hook')) { if (function_exists('newrelic_name_transaction')) { newrelic_name_transaction('External: ' . $m . '/' . $h); if (function_exists('newrelic_capture_params')) { newrelic_capture_params(); } } $plugins[$m]->external_hook($h); } } hook_finish();