本文整理汇总了PHP中display_language_box函数的典型用法代码示例。如果您正苦于以下问题:PHP display_language_box函数的具体用法?PHP display_language_box怎么用?PHP display_language_box使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_language_box函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$def_language = "en";
// default Payment Box Language
$public_key = "-your public key for coin box-";
// from gourl.io
$private_key = "-your private key for coin box-";
// from gourl.io
// IMPORTANT: Please read description of options here - https://gourl.io/cryptocoin_payment_api.html#options
/********************************/
/** PAYMENT BOX **/
$options = array("public_key" => $public_key, "private_key" => $private_key, "webdev_key" => "", "orderID" => $orderID, "userID" => $userID, "userFormat" => $userFormat, "amount" => 0, "amountUSD" => $amountUSD, "period" => $period, "language" => $def_language);
// Initialise Payment Class
$box = new Cryptobox($options);
// coin name
$coinName = $box->coin_name();
// Optional - Language selection list for payment box (html code)
$languages_list = display_language_box($def_language);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title><?php
echo $coinName;
?>
Pay-Per-View / Page Access Cryptocoin Payment Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='Expires' content='-1'>
<meta name='robots' content='all'>
<script src='../cryptobox.min.js' type='text/javascript'></script>
</head>
示例2: cryptopayments
//.........这里部分代码省略.........
}
if ($amountCurrency == "USD") {
$amountUSD = $amount;
$amountCoin = 0;
$default_show = false;
} else {
$amountUSD = 0;
$amountCoin = $amount;
$default_coin = $this->coin_names[$amountCurrency];
$default_show = true;
}
// GoUrl Payments
// --------------------------
$all_keys = array();
// Your payment boxes public / private keys from GoUrl.io
$available_coins = array();
// List of coins that you accept for payments
$cryptobox_private_keys = array();
// List Of your private keys
$box_width = $this->options["box_width"];
$box_height = $this->options["box_height"];
$box_style = $this->payment_box_style();
$message_style = $this->payment_message_style();
foreach ($this->coin_names as $k => $v) {
$public_key = $this->options[$v . 'public_key'];
$private_key = $this->options[$v . 'private_key'];
if ($public_key && !strpos($public_key, "PUB")) {
return array("error" => sprintf(__('Invalid %s Public Key - %s', GOURL), $v, $public_key));
}
if ($private_key && !strpos($private_key, "PRV")) {
return array("error" => sprintf(__('Invalid %s Private Key', GOURL), $v));
}
if ($private_key) {
$cryptobox_private_keys[] = $private_key;
}
if ($private_key && $public_key && (!$default_show || $v == $default_coin)) {
$all_keys[$v] = array("public_key" => $public_key, "private_key" => $private_key);
$available_coins[] = $v;
}
}
if (!defined("CRYPTOBOX_PRIVATE_KEYS")) {
define("CRYPTOBOX_PRIVATE_KEYS", implode("^", $cryptobox_private_keys));
}
if (!$available_coins) {
return array("error" => sprintf(__("Error. Please enter Payment Private/Public Keys on GoUrl Options page for %s", GOURL), $default_coin));
}
if (!in_array($default_coin, $available_coins)) {
$vals = array_values($available_coins);
$default_coin = array_shift($vals);
}
/// GoUrl Payment Class
// --------------------------
include_once plugin_dir_path(__FILE__) . "includes/cryptobox.class.php";
// Current selected coin by user
$coinName = cryptobox_selcoin($available_coins, $default_coin);
// Current Coin public/private keys
$public_key = $all_keys[$coinName]["public_key"];
$private_key = $all_keys[$coinName]["private_key"];
// PAYMENT BOX CONFIG
$options = array("public_key" => $public_key, "private_key" => $private_key, "webdev_key" => $affiliate_key, "orderID" => $pluginName . "." . $orderID, "userID" => $userID == "guest" ? $pluginName . "." . $userID : "user" . $userID, "userFormat" => "MANUAL", "amount" => $amountCoin, "amountUSD" => $amountUSD, "period" => $period, "language" => $default_language);
// Initialise Payment Class
$box = new Cryptobox($options);
// Coin name
$coinName = $box->coin_name();
// Paid or not
$is_paid = $box->is_paid();
// page anchor
$anchor = "go" . $this->icrc32($pluginName . "." . $orderID);
// Coins selection list (html code)
$coins_list = count($available_coins) > 1 ? display_currency_box($available_coins, $default_coin, $default_language, $icon_width, "margin:10px 0 30px 0;text-align:center;font-weight:normal;", plugins_url('/images', __FILE__), $anchor) : "";
// Language selection list for payment box (html code)
$languages_list = display_language_box($default_language, $anchor);
// Payment Box
$box_html = $box->display_cryptobox(true, $box_width, $box_height, $box_style, $message_style, $anchor);
$html = "";
if (!$is_paid) {
$html .= "<a id='" . $anchor . "' name='" . $anchor . "'></a>";
}
if ($is_paid) {
$html .= "<br>";
} else {
$html .= $coins_list;
}
// Cryptocoin Payment Box
if ($languages_list) {
$html .= "<table cellspacing='0' cellpadding='0' border='0' width='100%' style='border:0;box-shadow:none;margin:0;padding:0;background-color:transparent'>";
$html .= "<tr style='background-color:transparent'><td style='border:0;margin:0;padding:0;background-color:transparent'><div style='margin:" . ($coins_list ? 25 : 50) . "px 0 5px " . ($this->options['box_width'] / 2 - 115) . "px;min-width:100%;text-align:center;font-size:13px;color:#666;font-weight:normal;white-space:nowrap;'>" . __('Language', GOURL) . ": " . $this->space(1) . $languages_list . "</div></td></tr>";
$html .= "<tr style='background-color:transparent'><td style='border:0;margin:0;padding:0;background-color:transparent'>" . $box_html . "</td></tr>";
$html .= "</table>";
} else {
$html .= $box_html;
}
// Result
$obj = $is_paid ? $box->payment_info() : "";
$arr = array("status" => $is_paid ? "payment_received" : "payment_not_received", "error" => "", "is_paid" => $is_paid, "paymentID" => $is_paid ? $obj->paymentID : 0, "paymentDate" => $is_paid ? $obj->txDate : "", "paymentLink" => $is_paid ? GOURL_ADMIN . GOURL . "payments&s=payment_" . $obj->paymentID : "", "addr" => $is_paid ? $obj->addr : "", "tx" => $is_paid ? $obj->txID : "", "is_confirmed" => $is_paid ? $obj->txConfirmed : "", "amount" => $is_paid ? $obj->amount : "", "amountusd" => $amountUSD, "coinlabel" => $is_paid ? $obj->coinLabel : "", "coinname" => $is_paid ? strtolower($coinName) : "", "boxID" => $is_paid ? $obj->boxID : 0, "boxtype" => $is_paid ? $obj->boxType : "", "boxLink" => $is_paid ? "https://gourl.io/view/coin_boxes/" . $obj->boxID . "/statistics.html" : "", "orderID" => $orderID, "userID" => $userID, "usercountry" => $is_paid ? $obj->countryID : "", "userLink" => $userID == "guest" ? "" : admin_url("user-edit.php?user_id=" . $userID), "is_processed" => $is_paid ? $obj->processed : "", "processedDate" => $is_paid && $obj->processed ? $obj->processedDate : "", "callback_function" => $orderID . "_gourlcallback", "available_payments" => $this->payments, "html_payment_box" => $html);
if ($is_paid && !$obj->processed) {
$box->set_status_processed();
}
return $arr;
}