Exemplo n.º 1
0
function FlashChatBridge_init()
{
    $host = pnServerGetVar('HTTP_HOST');
    $protocol = pnServerGetProtocol();
    $adress = pnServerGetVar('SERVER_ADDR');
    $server = $protocol . '://' . $host;
    pnModSetVar('FlashChatBridge', 'width', 800);
    pnModSetVar('FlashChatBridge', 'height', 600);
    pnModSetVar('FlashChatBridge', 'autosize', 0);
    pnModSetVar('FlashChatBridge', 'client_path', $server . ':35555/');
    pnModSetVar('FlashChatBridge', 'server_data_path', 'somewhere/123flashchat/server/data/');
    pnModSetVar('FlashChatBridge', 'init_room', 1);
    pnModSetVar('FlashChatBridge', 'client_type', "standard");
    pnModSetVar('FlashChatBridge', 'active_chat_standard', 1);
    pnModSetVar('FlashChatBridge', 'init_host', $adress);
    pnModSetVar('FlashChatBridge', 'init_port', '51127');
    pnModSetVar('FlashChatBridge', 'init_host_s', $adress);
    pnModSetVar('FlashChatBridge', 'init_port_s', '');
    pnModSetVar('FlashChatBridge', 'init_host_h', $adress);
    pnModSetVar('FlashChatBridge', 'init_port_h', '');
    return true;
}
Exemplo n.º 2
0
/**
* Get current URL
*
* @access public
* @param args array additional parameters to be added to/replaced in the URL (e.g. theme, ...)
* @return string current URL
* @todo cfr. BaseURI() for other possible ways, or try PHP_SELF
*/
function pnGetCurrentURL()
{
    $server = pnServerGetHost();
    $protocol = pnServerGetProtocol();
    $baseurl = "{$protocol}://{$server}";
    // get current URI
    $request = pnServerGetVar('REQUEST_URI');
    if (empty($request)) {
        // adapted patch from Chris van de Steeg for IIS
        // TODO: please test this :)
        $scriptname = pnServerGetVar('SCRIPT_NAME');
        $pathinfo = pnServerGetVar('PATH_INFO');
        if ($pathinfo == $scriptname) {
            $pathinfo = '';
        }
        if (!empty($scriptname)) {
            $request = $scriptname . $pathinfo;
            $querystring = pnServerGetVar('QUERY_STRING');
            if (!empty($querystring)) {
                $request .= '?' . $querystring;
            }
        } else {
            $request = '/';
        }
    }
    return $baseurl . $request;
}