$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 . '&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}" . '&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');
if(!session_id()) { session_start(); } $theme = verify_param("theme", "/^\w+$/", "default"); $isSecure = verify_param("issecure", "/^\d+$/", 0) == 1; $location = get_app_location(true, $isSecure); $lang = Resources::getCurrentLocale(); $link = $location."/client.php?theme=$theme".(!empty($lang) ? "&lang=".$lang : ""); $temp = get_popup_onclick($link, "webim_".getWindowNameSuffix(), "toolbar=0, scrollbars=0, location=0, menubar=0, width=528, height=456, resizable=1", true); // папка online в мэмкэш -------------------- //$operators = Operator::getInstance()->getOnlineOperatorsFromFiles(); $operators = Operator::getInstance()->getOnlineOperatorsFromMemBuff(); $operators_count = count($operators); $no_operators = false; if($operators_count == 0) { $no_operators = true; } if(!isset($_COOKIE[WEBIM_COOKIE_VISITOR_IN_CHAT])) { $visitor = GetVisitorFromRequestAndSetCookie(); $thread = MapperFactory::getMapper("Thread")->getActiveThreadForVisitor($visitor['id']); if(!empty($thread)) { $res = true;