Пример #1
0
function get_user_addr($addr)
{
    if (Settings::get('geolink') && preg_match("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $addr, $matches)) {
        $user_ip = $matches[1];
        return get_popup(str_replace("{ip}", $user_ip, Settings::get('geolink')), '', htmlspecialchars($addr), "GeoLocation", "ip{$user_ip}", Settings::get('geolinkparams'));
    }
    return htmlspecialchars($addr);
}
Пример #2
0
function get_user_addr($addr)
{
    global $settings;
    if ($settings['geolink'] && preg_match("/(\\d+\\.\\d+\\.\\d+\\.\\d+)/", $addr, $matches)) {
        $userip = $matches[1];
        return get_popup(safe_htmlspecialchars(str_replace("{ip}", $userip, $settings['geolink'])), '', safe_htmlspecialchars($addr), "GeoLocation", safe_htmlspecialchars("ip{$userip}"), safe_htmlspecialchars($settings['geolinkparams']));
    }
    return safe_htmlspecialchars($addr);
}
Пример #3
0
function generate_button($title, $locale, $style, $group, $inner, $showhost, $forcesecure, $modsecurity)
{
    $link = get_app_location($showhost, $forcesecure) . "/client.php";
    if ($locale) {
        $link = append_query($link, "locale={$locale}");
    }
    if ($style) {
        $link = append_query($link, "style={$style}");
    }
    if ($group) {
        $link = append_query($link, "group={$group}");
    }
    $modsecfix = $modsecurity ? ".replace('http://','').replace('https://','')" : "";
    $jslink = append_query("'" . $link, "url='+escape(document.location.href{$modsecfix})+'&referrer='+escape(document.referrer{$modsecfix})");
    $temp = get_popup($link, "{$jslink}", $inner, $title, "webim", "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width=640,height=480,resizable=1");
    return "<!-- webim button -->" . $temp . "<!-- / webim button -->";
}
Пример #4
0
    $filename = dirname(__FILE__) . '/../' . Button::getImageNameFromParam($image, null, $lang, null, true);
    if (file_exists($filename)) {
        // isset($info['GIF Read Support']) && $info['GIF Read Support'] && TODO check other file types
        $size = @getimagesize($filename);
    }
}
$location = WEBIM_ROOT;
if ($showhost) {
    $location = ($forcesecure ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . WEBIM_ROOT;
}
$alt = Resources::Get('webim.online.consultant');
$departmentParam = !empty($departmentkey) ? '&departmentkey=' . $departmentkey : '';
$button_img = '<img alt="' . $alt . '" src="' . $location . '/button.php?bim=' . $image . '&amp;lang=' . $locale . $departmentParam . '" border="0"';
if (!empty($size)) {
    $button_img .= ' width="' . $size[0] . '" height="' . $size[1] . '" ';
}
$button_img .= ' />';
$chooseOperatorParam = !empty($chooseoperator) ? '&chooseoperator=' . $chooseoperator : '';
$chooseDepartmentParam = !empty($choosedepartment) ? '&choosedepartment=1' : '';
$chatimmediatelyParam = !empty($chatimmediately) ? '&chatimmediately=1' : '';
$link = $location . "/client.php?theme={$theme}" . '&amp;lang=' . $locale . $chooseOperatorParam . $chooseDepartmentParam . $departmentParam . $chatimmediatelyParam;
$temp = get_popup($link, $button_img, '', 'webim_' . getWindowNameSuffix(), 'toolbar=0, scrollbars=0, location=0, menubar=0, width=540, height=480, resizable=1', empty($chatimmediately));
$buttonCode = '<!-- webim button -->' . $temp . '<!-- /webim button -->';
$trackerCode = getTrackerCode($location, $theme, $forcesecure);
$buttonCode .= getAutoInviteCode($location, $theme);
$code = $includeTracker ? $trackerCode . $buttonCode : $buttonCode;
$TML->assign('code', htmlspecialchars($code));
$TML->assign('code_raw', $code);
$TML->assign('image', $image);
Browser::SendHtmlHeaders();
$TML->display('gen_button.tpl');