本文整理汇总了PHP中base64UrlDecode函数的典型用法代码示例。如果您正苦于以下问题:PHP base64UrlDecode函数的具体用法?PHP base64UrlDecode怎么用?PHP base64UrlDecode使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了base64UrlDecode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: savePassThruToCookie
function savePassThruToCookie($_fullname, $_email, $_company, $_question, $_phone, $_customs)
{
global $INPUTS;
initData(array("INPUTS"));
if (!empty($_fullname) && $INPUTS[111]->Cookie && $INPUTS[111]->Active) {
setCookieValue("form_111", cutString(base64UrlDecode($_fullname), 255), true);
}
if (!empty($_email) && $INPUTS[112]->Cookie && $INPUTS[112]->Active) {
setCookieValue("form_112", cutString(base64UrlDecode($_email), 255), true);
}
if (!empty($_company) && $INPUTS[113]->Cookie && $INPUTS[113]->Active) {
setCookieValue("form_113", cutString(base64UrlDecode($_company), 255), true);
}
if (!empty($_question) && $INPUTS[114]->Cookie && $INPUTS[114]->Active) {
setCookieValue("form_114", base64UrlDecode($_question), true);
}
if (!empty($_phone) && $INPUTS[116]->Cookie && $INPUTS[116]->Active) {
setCookieValue("form_116", base64UrlDecode($_phone), true);
}
foreach ($INPUTS as $index => $input) {
if ($input->Custom && $input->Active && !empty($_customs[$index]) && $input->Cookie) {
setCookieValue("cf_" . $index, $_customs[$index], true);
}
}
}
示例2: testSignInvoice
public function testSignInvoice()
{
require_once '_helpers.php';
$config = (include '_config.php');
if (!$this->checkConfig($config)) {
$this->markTestSkipped('Config is empty');
return;
}
$fiscal_verification = new \Neonbug\FiscalVerification\FiscalVerification($config['client_key_filename'], $config['client_key_password'], $config['ca_public_key_filename'], $config['base_url']);
$header = $this->getTestHeader($fiscal_verification);
$invoice = $this->getTestInvoice($fiscal_verification, $config['tax_number'], 'premise1');
$token = $fiscal_verification->signRequest($header, $invoice, false);
$token_arr = explode('.', $token);
$this->assertCount(3, $token_arr);
$signature = $token_arr[2];
$signature_decoded = base64UrlDecode($signature);
$sign_data = base64UrlEncode($header) . '.' . base64UrlEncode($invoice);
$ret = openssl_verify($sign_data, $signature_decoded, openssl_pkey_get_public(file_get_contents($config['client_key_filename'])), 'SHA256');
$this->assertEquals($ret, 1);
}
示例3: CreateChat
function CreateChat($_internalUser, $_visitor, $_host = false, $custom = "", $etpl = "", $_customsInTranscript = true, $_externalSelf = true, $pdm = null)
{
global $CONFIG;
if (!empty($CONFIG["gl_sfc"]) && createSPAMFilter() || empty($this->ChatId)) {
return;
}
UserGroup::PersistentJoin($this->UserId, $this->SystemId);
$this->InternalUser = $_internalUser;
$this->InternalUser->SetLastChatAllocation();
$this->SetStatus(CHAT_STATUS_WAITING);
initData(array("INPUTS"));
queryDB(false, "INSERT INTO `" . DB_PREFIX . DATABASE_VISITOR_CHAT_OPERATORS . "` (`chat_id`,`user_id`,`jtime`,`status`) VALUES ('" . DBManager::RealEscape($this->ChatId) . "','" . DBManager::RealEscape($this->InternalUser->SystemId) . "'," . time() . "," . ($_host ? 0 : 1) . ");");
$this->CreateArchiveEntry($_internalUser, $_visitor, $custom, $etpl, $_customsInTranscript, $pdm);
if ($_internalUser->IsBot) {
define("CALLER_SYSTEM_ID", $_internalUser->SystemId);
$this->InternalActivate();
$this->ExternalActivate();
$this->SetStatus(CHAT_STATUS_ACTIVE);
} else {
if (!empty($_internalUser->AppDeviceId) && $_internalUser->AppBackgroundMode) {
$name = !empty($this->Fullname) ? $this->Fullname : getNoName($this->UserId . getIP());
$_internalUser->AddPushMessage($this->ChatId, $this->SystemId, $name, 0);
}
}
if (!empty($_GET["acid"])) {
$pchatid = base64UrlDecode($_GET["acid"]);
$result = queryDB(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_VISITOR_CHATS . "` WHERE `visitor_id`='" . DBManager::RealEscape($this->UserId) . "' AND `chat_id`='" . DBManager::RealEscape($pchatid) . "' AND (`exit` > " . (time() - 30) . " OR `exit`=0) LIMIT 1;");
if ($result && DBManager::GetRowCount($result) == 1) {
$row = DBManager::FetchArray($result);
if (empty($row["waiting"])) {
$this->RepostChatHistory(2, $pchatid, $this->InternalUser->SystemId, 0, 0, $this->UserId . "~" . $this->UserId . "_OVL", $this->ChatId, $this->SystemId, true, false, $_externalSelf);
}
}
}
}
示例4: define
* LiveZilla picture.php
*
* Copyright 2011 LiveZilla GmbH
* All rights reserved.
* LiveZilla is a registered trademark.
*
* Improper changes to this file may cause critical errors.
***************************************************************************************/
define("IN_LIVEZILLA", true);
if (!defined("LIVEZILLA_PATH")) {
define("LIVEZILLA_PATH", "./");
}
require LIVEZILLA_PATH . "_definitions/definitions.inc.php";
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
require LIVEZILLA_PATH . "_lib/objects.global.users.inc.php";
require LIVEZILLA_PATH . "_definitions/definitions.dynamic.inc.php";
header("Content-Type: image/jpg;");
if (isset($_GET["intid"]) && setDataProvider()) {
getData(true, false, false, false);
$id = getInternalSystemIdByUserId(base64UrlDecode($_GET["intid"]));
if (isset($INTERNAL[$id])) {
if ($INTERNAL[$id]->LoadPictures()) {
if (!empty($INTERNAL[$id]->WebcamPicture)) {
exit(base64_decode($INTERNAL[$id]->WebcamPicture));
} else {
exit(base64_decode($INTERNAL[$id]->ProfilePicture));
}
}
}
}
exit(getFile("./images/nopic.jpg"));
示例5: _actionTokenlogin
/**
* Logs in a user if an activation token is provided.
*
* @param KCommandContext $context Command chain context
*
* @return bool true on success
*/
protected function _actionTokenlogin(KCommandContext $context)
{
if ($this->token == '') {
throw new AnErrorException(array('No token is provided'), KHttpResponse::FORBIDDEN);
return false;
}
$user = $this->getService('repos://site/users.user')->find(array('activation' => $this->token));
if (!$user) {
throw new AnErrorException(array('This token is invalid'), KHttpResponse::NOT_FOUND);
return false;
}
$person = $this->getService('repos://site/people.person')->find(array('userId' => $user->id));
$newUser = $user->lastvisitDate->compare($user->registerDate) ? true : false;
$redirectUrl = $person->getURL();
//if this is a first time user, then unblock them
if ($newUser) {
$user->block = 0;
$person->enable();
$person->save();
}
$user->activation = '';
$user->save();
$this->token = null;
$this->_request->token = null;
if ($this->reset_password) {
$redirectUrl .= '&get=settings&edit=account';
$_SESSION['reset_password_prompt'] = 1;
}
$credentials = array('username' => $user->username, 'password' => $user->password, 'remember' => true);
$this->getService('com:people.helper.person')->login($credentials, $credentials['remember']);
if ($this->return) {
$_SESSION['return'] = $this->getService('com://site/people.filter.return')->sanitize($this->return);
$returnUrl = base64UrlDecode($this->return);
$this->getResponse()->setRedirect($returnUrl);
} else {
$_SESSION['return'] = null;
$msg = JText::_('COM-PEOPLE-PROMPT-UPDATE-PASSWORD');
$this->getResponse()->setRedirect(JRoute::_($redirectUrl), $msg);
}
$this->getResponse()->status = KHttpResponse::ACCEPTED;
return true;
}
示例6: SetTranscriptEmail
function SetTranscriptEmail()
{
global $CONFIG;
if (isset($_POST["p_tc_declined"])) {
queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_ARCHIVE . "` SET `transcript_receiver`='' WHERE `chat_id`='" . @mysql_real_escape_string($this->ChatId) . "';");
} else {
if (isset($_POST["p_tc_email"])) {
queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_CHAT_ARCHIVE . "` SET `transcript_receiver`='" . @mysql_real_escape_string(base64UrlDecode($_POST["p_tc_email"])) . "' WHERE `chat_id`='" . @mysql_real_escape_string($this->ChatId) . "';");
}
}
}
示例7: replaceLoginDetails
function replaceLoginDetails($_html)
{
$data = !isset($_GET[GET_EXTERN_USER_EMAIL]) ? getCookieValue("login_email") : base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]);
$_html = str_replace("<!--login_value_email-->", htmlentities($data, ENT_QUOTES, "UTF-8"), $_html);
$data = !isset($_GET[GET_EXTERN_USER_NAME]) ? getCookieValue("login_name") : base64UrlDecode($_GET[GET_EXTERN_USER_NAME]);
$_html = str_replace("<!--login_value_name-->", htmlentities($data, ENT_QUOTES, "UTF-8"), $_html);
$data = !isset($_GET[GET_EXTERN_USER_COMPANY]) ? getCookieValue("login_company") : base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]);
$_html = str_replace("<!--login_value_company-->", htmlentities($data, ENT_QUOTES, "UTF-8"), $_html);
return $_html;
}
示例8: abortTracking
if (empty($_GET[GET_TRACK_URL])) {
abortTracking(3);
}
}
$currentURL = new HistoryURL(substr(base64UrlDecode($_GET[GET_TRACK_URL]), 0, 2083), isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? base64UrlDecode($_GET[GET_TRACK_SPECIAL_AREA_CODE]) : "", base64UrlDecode(@$_GET[GET_EXTERN_DOCUMENT_TITLE]), $referrer, time());
if ($currentURL->Referrer->IsInternalDomain()) {
$currentURL->Referrer = new BaseUrl("");
}
if ($currentURL->Url->Excluded) {
abortTracking(4);
}
$EXTERNALUSER->Save($CONFIG, array($_GET[GET_TRACK_RESOLUTION_WIDTH], $_GET[GET_TRACK_RESOLUTION_HEIGHT]), $_GET[GET_TRACK_COLOR_DEPTH], $_GET[GET_TRACK_TIMEZONE_OFFSET], isset($_GET[GEO_LATITUDE]) ? $_GET[GEO_LATITUDE] : "", isset($_GET[GEO_LONGITUDE]) ? $_GET[GEO_LONGITUDE] : "", isset($_GET[GEO_COUNTRY_ISO_2]) ? $_GET[GEO_COUNTRY_ISO_2] : "", isset($_GET[GEO_CITY]) ? $_GET[GEO_CITY] : "", isset($_GET[GEO_REGION]) ? $_GET[GEO_REGION] : "", isset($_GET[GEO_TIMEZONE]) ? $_GET[GEO_TIMEZONE] : "", isset($_GET[GEO_ISP]) ? $_GET[GEO_ISP] : "", isset($_GET[GEO_SSPAN]) ? $_GET[GEO_SSPAN] : "", isset($_GET[GEO_RESULT_ID]) ? $_GET[GEO_RESULT_ID] : "");
}
} else {
if (!empty($_SERVER["HTTP_REFERER"])) {
$currentURL = new HistoryURL(substr($_SERVER["HTTP_REFERER"], 0, 2083), isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? base64UrlDecode($_GET[GET_TRACK_SPECIAL_AREA_CODE]) : "", "", "", time());
if ($currentURL->Url->Excluded) {
abortTracking(5);
} else {
if (!$currentURL->Url->IsInternalDomain()) {
abortTracking(6);
}
}
$EXTERNALUSER->Save($CONFIG, null, "", "", -522, -522, "", "", "", "", "", "", "", false);
} else {
abortTracking(-1);
}
}
if ($EXTERNALUSER->IsCrawler) {
abortTracking(8);
} else {
示例9: Generate
function Generate()
{
foreach ($this->InternalUsers as $internaluser) {
if ($internaluser->LastActive > time() - $this->Config["timeout_clients"] && $internaluser->Status < 2) {
for ($count = 0; $count < count($internaluser->Groups); $count++) {
if (isset($_GET[GET_EXTERN_INTERN_USER_ID]) && !empty($_GET[GET_EXTERN_INTERN_USER_ID]) && $internaluser->UserId == base64URLdecode($_GET[GET_EXTERN_INTERN_USER_ID])) {
if (!($this->GroupValues["req_for_group"] && $internaluser->Groups[$count] != base64UrlDecode($_GET[GET_EXTERN_GROUP])) || isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "user") {
$this->GroupValues["set_by_get_user"] = $internaluser->Groups[$count];
}
}
if (!isset($this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]])) {
$this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]] = 0;
}
$this->GroupValues["groups_online_amounts"][$internaluser->Groups[$count]]++;
}
}
}
$counter = 0;
foreach ($this->InternalGroups as $id => $group) {
if (!$group->IsExternal) {
continue;
}
$used = false;
$amount = isset($this->GroupValues["groups_online_amounts"]) && is_array($this->GroupValues["groups_online_amounts"]) && array_key_exists($id, $this->GroupValues["groups_online_amounts"]) && $group->IsOpeningHour() ? $this->GroupValues["groups_online_amounts"][$id] : 0;
$transport = base64_encode($id) . "," . base64_encode($amount) . "," . base64_encode($group->Description) . "," . base64_encode($group->Email);
if ($this->GroupValues["req_for_group"] && $amount > 0 && $id == base64UrlDecode($_GET[GET_EXTERN_GROUP])) {
$this->GroupValues["set_by_get_group"] = $id;
$used = true;
} elseif ($amount > 0 && getCookieValue("login_group") != null && $id == getCookieValue("login_group") && !isset($requested_group)) {
$this->GroupValues["set_by_cookie"] = $id;
$used = true;
} elseif ($amount > 0 && $group->IsStandard) {
$this->GroupValues["set_by_standard"] = $id;
$used = true;
} elseif ($amount > 0 && empty($this->GroupValues["set_by_online"])) {
$this->GroupValues["set_by_online"] = $id;
$used = true;
}
if (!in_array($id, $this->GroupValues["groups_hidden"]) && ($group->IsExternal || $used)) {
$counter++;
if ($amount > 0) {
$this->GroupAvailable = true;
$this->GroupValues["groups_online"][$id] = $transport;
} else {
$this->GroupValues["groups_offline"][$id] = $transport;
}
}
}
if (isset($_GET[GET_EXTERN_PREFERENCE]) && $_GET[GET_EXTERN_PREFERENCE] == "group") {
if (isset($this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])]) && $this->GroupValues["groups_online_amounts"][base64UrlDecode($_GET[GET_EXTERN_GROUP])] > 0) {
$this->GroupValues["set_by_get_user"] = null;
$this->GroupValues["req_for_user"] = false;
}
}
if (!empty($this->GroupValues["set_by_get_user"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]])) {
$this->GroupValues["groups_output"][$this->GroupValues["set_by_get_user"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_user"]];
} else {
if (!empty($this->GroupValues["set_by_get_group"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]])) {
$this->GroupValues["groups_output"][$this->GroupValues["set_by_get_group"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_get_group"]];
} else {
if (!empty($this->GroupValues["set_by_cookie"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]])) {
$this->GroupValues["groups_output"][$this->GroupValues["set_by_cookie"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_cookie"]];
} else {
if (!empty($this->GroupValues["set_by_standard"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]])) {
$this->GroupValues["groups_output"][$this->GroupValues["set_by_standard"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_standard"]];
} else {
if (!empty($this->GroupValues["set_by_online"]) && isset($this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]])) {
$this->GroupValues["groups_output"][$this->GroupValues["set_by_online"]] = $this->GroupValues["groups_online"][$this->GroupValues["set_by_online"]];
}
}
}
}
}
foreach ($this->GroupValues["groups_online"] as $id => $transport) {
if (!isset($this->GroupValues["groups_output"][$id])) {
$this->GroupValues["groups_output"][$id] = $transport;
}
}
$result = array_merge($this->GroupValues["groups_output"], $this->GroupValues["groups_offline"]);
foreach ($result as $key => $value) {
$chat_input_fields = "new Array(";
$count = 0;
foreach ($this->InternalGroups[$key]->ChatInputsHidden as $index) {
if ($count > 0) {
$chat_input_fields .= ",";
}
$chat_input_fields .= "'" . $index . "'";
$count++;
}
$value .= "," . base64_encode($chat_input_fields . ");");
$chat_input_fields = "new Array(";
$count = 0;
foreach ($this->InternalGroups[$key]->ChatInputsMandatory as $index) {
if ($count > 0) {
$chat_input_fields .= ",";
}
$chat_input_fields .= "'" . $index . "'";
$count++;
}
$value .= "," . base64_encode($chat_input_fields . ");");
//.........这里部分代码省略.........
示例10: GetServerInput
function GetServerInput($_default = "", &$_changed = false, $_capitalize = false)
{
$rValue = "";
if (isset($_GET["f" . $this->Index]) && base64UrlDecode($_GET["f" . $this->Index]) != "") {
$rValue = base64UrlDecode($_GET["f" . $this->Index]);
} else {
if (isset($_POST["p_cf" . $this->Index]) && base64UrlDecode($_POST["p_cf" . $this->Index]) != "") {
$rValue = base64UrlDecode($_POST["p_cf" . $this->Index]);
} else {
if (isset($_GET["cf" . $this->Index]) && base64UrlDecode($_GET["cf" . $this->Index]) != "") {
$rValue = base64UrlDecode($_GET["cf" . $this->Index]);
} else {
if ($this->GetIndexName() != null && isset($_GET[$this->GetIndexName()]) && base64UrlDecode($_GET[$this->GetIndexName()]) != "") {
$rValue = base64UrlDecode($_GET[$this->GetIndexName()]);
} else {
if ($this->PostIndexName() != null && isset($_POST[$this->PostIndexName()]) && base64UrlDecode($_POST[$this->PostIndexName()]) != "") {
$rValue = base64UrlDecode($_POST[$this->PostIndexName()]);
}
}
}
}
}
if ($_capitalize) {
$rValue = ucwords(strtolower($rValue));
}
if ($rValue != $_default && !empty($rValue)) {
$_changed = true;
}
return $rValue;
}
示例11: postHTML
function postHTML($_text, $_translation, $_add, $_operator, $_name)
{
global $LZLANG;
$post = $_add ? !$_operator ? getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_EXTERN) : getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_OPERATOR) : getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_ADD);
$post = str_replace("<!--name-->", $_operator ? $_name : (!empty($_name) ? $_name : $LZLANG["client_guest"]), $post);
$post = str_replace("<!--time-->", date("H:i"), $post);
$color = getBrightness(base64UrlDecode($_GET["ovlc"])) > getBrightness(base64UrlDecode($_GET["ovlct"])) ? $_GET["ovlct"] : $_GET["ovlc"];
$post = str_replace("<!--color-->", $_operator ? hexDarker(str_replace("#", "", base64UrlDecode($color)), 30) : "#000000", $post);
$_text = preg_replace('/(<(?!img)\\w+[^>]+)(style="[^"]+")([^>]*)(>)/', '${1}${3}${4}', strip_tags($_text, "<a><br><b><ul><li><ol><b><i><u><strong><img>"));
if (!empty($_translation)) {
$_translation = preg_replace('/(<(?!img)\\w+[^>]+)(style="[^"]+")([^>]*)(>)/', '${1}${3}${4}', strip_tags($_translation, "<a><br><b><ul><li><ol><b><i><u><strong><img>"));
$_text = $_translation . "<div class='lz_overlay_translation'>" . $_text . "</div>";
}
return str_replace("<!--message-->", $_text, $post);
}
示例12: processActions
$chat->Load();
$chat->Destroy();
}
$TRACKINGSCRIPT .= processActions($BROWSER);
$TRACKINGSCRIPT .= "lz_tracking_callback(" . $CONFIG["poll_frequency_tracking"] . ",'" . $_GET[GET_TRACK_START] . "');";
$BROWSER->LastActive = time();
if (isnull($BROWSER->FirstActive)) {
$BROWSER->FirstActive = time();
}
$BROWSER->Referrer = !isset($BROWSER->Referrer) ? isset($_GET[GET_TRACK_REFERRER]) ? trim(slashesStrip(base64UrlDecode($_GET[GET_TRACK_REFERRER]))) : "" : $BROWSER->Referrer;
$url = isset($_GET[GET_TRACK_URL]) ? substr(base64UrlDecode($_GET[GET_TRACK_URL]), 0, 1024) : "";
if (!isset($BROWSER->History)) {
$BROWSER->History = array();
}
if (count($BROWSER->History) == 0 || count($BROWSER->History) > 0 && $BROWSER->History[count($BROWSER->History) - 1][1] != $url) {
$BROWSER->History[] = array(time(), $url, isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? base64UrlDecode($_GET[GET_TRACK_SPECIAL_AREA_CODE]) : "", false, base64UrlDecode(@$_GET[GET_EXTERN_DOCUMENT_TITLE]));
}
if (count($BROWSER->History) > DATA_URL_STORAGE_AMOUNT) {
array_shift($BROWSER->History);
define("ARRAY_MAX_SIZE", true);
}
if ($count != count($BROWSER->History) || defined("ARRAY_MAX_SIZE")) {
$BROWSER->Save();
} else {
$BROWSER->KeepAlive();
}
if (isset($CONFIG["gl_hide_inactive"]) && $CONFIG["gl_hide_inactive"] && $BROWSER->History[count($BROWSER->History) - 1][0] < time() - ACTIVE_TIME) {
exit("lz_tracking_stop_tracking();");
}
}
}
示例13: postHTML
function postHTML($_text, $_translation, $_add, $_operator, $_name, $_time, $_senderId)
{
global $LZLANG, $INTERNAL, $USER;
$post = $_add ? !$_operator ? getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_EXTERN) : getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_OPERATOR) : (!$_operator ? getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_ADD) : getFile(TEMPLATE_HTML_MESSAGE_OVERLAY_CHAT_OPERATOR_ADD));
if ($_operator && !empty($USER->Browsers[0]->DesiredChatPartner) && isset($INTERNAL[$USER->Browsers[0]->DesiredChatPartner]) && isset($INTERNAL[$_senderId])) {
$image = "<img class=\"lz_overlay_chat_operator_picture\" src=\"" . LIVEZILLA_URL . $INTERNAL[$USER->Browsers[0]->DesiredChatPartner]->GetOperatorPictureFile() . "\" width=\"52\" height=\"39\">";
} else {
$image = "";
}
$post = str_replace("<!--name-->", $_operator ? $_name : (!empty($_name) ? $_name : $LZLANG["client_guest"]), $post);
$post = str_replace("<!--time-->", $_time, $post);
$post = str_replace("<!--picture-->", $image, $post);
$post = str_replace("<!--lang_client_edit-->", strtoupper($LZLANG["client_edit"]), $post);
$color = getBrightness(base64UrlDecode($_GET["ovlc"])) > getBrightness(base64UrlDecode($_GET["ovlct"])) ? $_GET["ovlct"] : $_GET["ovlc"];
$post = str_replace("<!--color-->", $_operator ? hexDarker(str_replace("#", "", base64UrlDecode($color)), 50) : "#000000", $post);
$_text = preg_replace('/(<(?!img)\\w+[^>]+)(style="[^"]+")([^>]*)(>)/', '${1}${3}${4}', strip_tags($_text, "<a><br><b><ul><li><ol><b><i><u><strong><img>"));
if (!empty($_translation)) {
$_translation = preg_replace('/(<(?!img)\\w+[^>]+)(style="[^"]+")([^>]*)(>)/', '${1}${3}${4}', strip_tags($_translation, "<a><br><b><ul><li><ol><b><i><u><strong><img>"));
$_text = $_translation . "<div class='lz_overlay_translation'>" . $_text . "</div>";
}
return str_replace("<!--message-->", $_text, $post);
}
示例14: str_replace
$html = str_replace("<!--voucher_id-->", base64UrlEncode($ticket->Id), $html);
$html = str_replace("<!--server-->", LIVEZILLA_URL, $html);
$ofc = !empty($_POST["form_ofc"]) ? "&ofc=MQ__" : "";
if (!empty($_POST["form_extends"]) && !empty($_POST["form_group"])) {
$html = str_replace("<!--co-->", "&co=" . base64UrlEncode($_POST["form_extends"]) . "&intgroup=" . base64UrlEncode($_POST["form_group"]) . $ofc, $html);
} else {
if (!empty($_POST["form_group"])) {
$html = str_replace("<!--co-->", "&intgroup=" . base64UrlEncode($_POST["form_group"]) . $ofc, $html);
} else {
$html = str_replace("<!--co-->", $ofc, $html);
}
}
exit($html);
} else {
if (!empty($_GET["confirm"]) && $_GET["confirm"] == "1" && !empty($_GET["vc"]) && strlen(base64UrlDecode($_GET["vc"])) == 16) {
require LIVEZILLA_PATH . "_lib/functions.pp.paypal.inc.php";
$voucher = new CommercialChatVoucher("", base64UrlDecode($_GET["vc"]));
if ($voucher->Load()) {
if (PayProvValidatePayment($voucher->Price)) {
languageSelect($voucher->Language);
$voucher->SetPaymentDetails(PayProvGetPaymentId(), PayProvGetPayerId(), PayProvGetPaymentDetails());
if (empty($PAYMENTERROR)) {
$voucher->SetVoucherParams(!empty($voucher->Voided), true, false, false, false, true, base64UrlDecode($_GET[GET_EXTERN_GROUP]));
} else {
$voucher->SetVoucherParams(!empty($voucher->Voided), false, false, false, false);
}
}
}
}
}
unloadDataProvider();
示例15: getChatVoucherTemplate
function getChatVoucherTemplate($html = "")
{
global $CONFIG, $COUNTRIES, $LZLANG;
if (!is("DB_CONNECTION") || !empty($CONFIG["db"]["ccpp"]["Custom"])) {
return "";
}
if (!empty($CONFIG["gl_ccac"])) {
foreach ($CONFIG["db"]["cct"] as $type) {
$html .= $type->GetTemplate();
}
}
$cchtml = getFile(PATH_TEMPLATES . "chat_voucher_checkout.tpl");
$mycountry = "";
$replacements = array("<!--lp_company-->" => "", "<!--lp_firstname-->" => "", "<!--lp_email-->" => "", "<!--lp_lastname-->" => "", "<!--lp_taxid-->" => "", "<!--lp_business_type-->" => "", "<!--lp_address_1-->" => "", "<!--lp_address_2-->" => "", "<!--lp_city-->" => "", "<!--lp_state-->" => "", "<!--lp_country-->" => "", "<!--lp_phone-->" => "", "<!--lp_zip-->" => "");
$prefillco = !empty($_GET["co"]) ? " OR id='" . DBManager::RealEscape(base64URLDecode($_GET["co"])) . "'" : "";
if (!isnull(getCookieValue("userid")) || !empty($prefillco)) {
$result = queryDB(true, "SELECT * FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_VOUCHERS . "` WHERE `visitor_id`='" . DBManager::RealEscape(getCookieValue("userid")) . "'" . $prefillco . " ORDER BY `created` DESC LIMIT 1;");
if ($result) {
if ($row = DBManager::FetchArray($result)) {
$replacements = array("<!--lp_company-->" => $row["company"], "<!--lp_firstname-->" => $row["firstname"], "<!--lp_lastname-->" => $row["lastname"], "<!--lp_taxid-->" => $row["tax_id"], "<!--lp_email-->" => $row["email"], "<!--lp_business_type-->" => $row["business_type"], "<!--lp_address_1-->" => $row["address_1"], "<!--lp_address_2-->" => $row["address_2"], "<!--lp_city-->" => $row["city"], "<!--lp_state-->" => $row["state"], "<!--lp_country-->" => $row["country"], "<!--lp_phone-->" => $row["phone"], "<!--lp_zip-->" => $row["zip"]);
$mycountry = $row["country"];
}
}
}
$clist = $COUNTRIES;
asort($clist);
$countrieshtml = "";
foreach ($clist as $isokey => $value) {
if (!empty($isokey)) {
$countrieshtml .= $isokey == $mycountry ? "<option value=\"" . $isokey . "\" SELECTED>" . utf8_encode($value) . "</option>" : "<option value=\"" . $isokey . "\">" . utf8_encode($value) . "</option>";
}
}
$cchtml = str_replace("<!--countries-->", $countrieshtml, $cchtml);
foreach ($replacements as $key => $value) {
$cchtml = str_replace($key, $value, $cchtml);
}
$cchtml = str_replace("<!--show_VAT-->", !empty($CONFIG["gl_ccsv"]) ? "''" : "none", $cchtml);
$cchtml = str_replace("<!--voucher_form-->", $html, $cchtml);
if (!empty($CONFIG["db"]["ccpp"]["PayPal"]->LogoURL)) {
$cchtml = str_replace("<!--pp_logo_url-->", " src=\"" . $CONFIG["db"]["ccpp"]["PayPal"]->LogoURL . "\"", $cchtml);
} else {
$cchtml = str_replace("<!--pp_logo_url-->", "", $cchtml);
}
$cchtml = str_replace("<!--extends_voucher-->", !empty($_GET["co"]) && strlen(base64UrlDecode($_GET["co"])) == 16 ? base64UrlDecode($_GET["co"]) : "", $cchtml);
$cchtml = str_replace("<!--ofc-->", !empty($_GET["ofc"]) ? "MQ__" : "", $cchtml);
$cchtml = str_replace("<!--VAT-->", str_replace("<!--VAT-->", $CONFIG["gl_ccva"], $LZLANG["client_voucher_include_vat"]), $cchtml);
return $cchtml;
}