本文整理汇总了PHP中Meta::sprintf2方法的典型用法代码示例。如果您正苦于以下问题:PHP Meta::sprintf2方法的具体用法?PHP Meta::sprintf2怎么用?PHP Meta::sprintf2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Meta
的用法示例。
在下文中一共展示了Meta::sprintf2方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
//.........这里部分代码省略.........
$customer_thread->id_contact = 0;
$customer_thread->id_customer = (int) $order->id_customer;
$customer_thread->id_shop = (int) $this->context->shop->id;
$customer_thread->id_order = (int) $order->id;
$customer_thread->id_lang = (int) $this->context->language->id;
$customer_thread->email = $customer->email;
$customer_thread->status = 'open';
$customer_thread->token = Tools::passwdGen(12);
$customer_thread->add();
} else {
$customer_thread = new CustomerThread((int) $id_customer_thread);
}
$customer_message = new CustomerMessage();
$customer_message->id_customer_thread = $customer_thread->id;
$customer_message->id_employee = (int) $this->context->employee->id;
$customer_message->message = Tools::getValue('message');
$customer_message->private = Tools::getValue('visibility');
if (!$customer_message->add()) {
$this->errors[] = Tools::displayError('An error occurred while saving the message.');
} elseif ($customer_message->private) {
Tools::redirectAdmin(self::$currentIndex . '&id_order=' . (int) $order->id . '&vieworder&conf=11&token=' . $this->token);
} else {
$message = $customer_message->message;
if (Configuration::get('PS_MAIL_TYPE', null, null, $order->id_shop) != Mail::TYPE_TEXT) {
$message = Tools::nl2br($customer_message->message);
}
$varsTpl = array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{id_order}' => $order->id, '{order_name}' => $order->getUniqReference(), '{message}' => $message);
if (@Mail::Send((int) $order->id_lang, 'order_merchant_comment', Mail::l('New message regarding your order', (int) $order->id_lang), $varsTpl, $customer->email, $customer->firstname . ' ' . $customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int) $order->id_shop)) {
$address = new Address((int) $order->id_address_delivery);
$phone = trim($address->phone) == "" ? $address->phone_mobile : $address->phone;
$max_sms = 6;
$sms = Configuration::get('EGCALLME_SMS_REQUEST', null, $order->id_shop_group, $order->id_shop);
$phone = preg_replace('#\\D+#', '', $phone);
$sms = Meta::sprintf2($sms, array('sendto' => $phone, 'message' => substr($message, 0, 70 * $max_sms)));
if (trim($sms) != "") {
if (!substr_count($_SERVER['DOCUMENT_ROOT'], "home/matras-house.ru/www")) {
$result = file_get_contents($sms);
}
}
Tools::redirectAdmin(self::$currentIndex . '&id_order=' . $order->id . '&vieworder&conf=11' . '&token=' . $this->token);
}
}
$this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.');
}
}
} else {
$this->errors[] = Tools::displayError('You do not have permission to delete this.');
}
} elseif (Tools::isSubmit('partialRefund') && isset($order)) {
if ($this->tabAccess['edit'] == '1') {
if (Tools::isSubmit('partialRefundProduct') && ($refunds = Tools::getValue('partialRefundProduct')) && is_array($refunds)) {
$amount = 0;
$order_detail_list = array();
foreach ($refunds as $id_order_detail => $amount_detail) {
$quantity = Tools::getValue('partialRefundProductQuantity');
if (!$quantity[$id_order_detail]) {
continue;
}
$order_detail_list[$id_order_detail] = array('quantity' => (int) $quantity[$id_order_detail], 'id_order_detail' => (int) $id_order_detail);
$order_detail = new OrderDetail((int) $id_order_detail);
if (empty($amount_detail)) {
$order_detail_list[$id_order_detail]['unit_price'] = !Tools::getValue('TaxMethod') ? $order_detail->unit_price_tax_excl : $order_detail->unit_price_tax_incl;
$order_detail_list[$id_order_detail]['amount'] = $order_detail->unit_price_tax_incl * $order_detail_list[$id_order_detail]['quantity'];
} else {
$order_detail_list[$id_order_detail]['unit_price'] = (double) str_replace(',', '.', $amount_detail / $order_detail_list[$id_order_detail]['quantity']);
$order_detail_list[$id_order_detail]['amount'] = (double) str_replace(',', '.', $amount_detail);
示例2: replaceCity
public static function replaceCity($ret)
{
$ceo_word = Meta::getCitys();
if (is_array($ret)) {
if (isset($ceo_word) && is_array($ceo_word)) {
//$ret[]= 'description';
$ret['meta_title'] = Meta::sprintf2($ret['meta_title'], $ceo_word);
$ret['meta_description'] = Meta::sprintf2($ret['meta_description'], $ceo_word);
$ret['meta_keywords'] = Meta::sprintf2($ret['meta_keywords'], $ceo_word);
$ret['description'] = Meta::sprintf2($ret['description'], $ceo_word);
}
} else {
$ret = Meta::sprintf2($ret, $ceo_word);
}
return $ret;
}
示例3: SendSMS
public static function SendSMS($phone, $message)
{
$context = Context::getContext();
$id_shop = $context->shop->id;
$id_shop_group = $context->shop->id_shop_group;
$max_sms = 6;
$sms = Configuration::get('EGCALLME_SMS_REQUEST', null, $id_shop_group, $id_shop);
$phone = preg_replace('#\\D+#', '', $phone);
$sms = Meta::sprintf2($sms, array('sendto' => $phone, 'message' => substr($message, 0, 70 * $max_sms)));
if (trim($sms) != "") {
$result = file_get_contents($sms);
}
}
示例4: hookDisplayTop
public function hookDisplayTop($params)
{
$this->context->controller->addJS($this->_path . 'views/js/egmarketing.js', 'all');
if (egmarketing::isMarketingSite() > 0) {
$this->context->controller->addCSS($this->_path . 'views/css/messager.css', 'all');
$this->context->controller->addCSS($this->_path . 'views/css/sbm.css', 'all');
}
if (egmarketing::isMarketingSite() > 0) {
$context = Context::getContext();
$id_shop = $context->shop->id;
$sql = 'select i.*
from `' . _DB_PREFIX_ . 'eginvate` i
where i.id_shop=' . (int) $id_shop . '
and i.deleted = 0
and \'' . $_SERVER['REQUEST_URI'] . '\' like rules';
if (Tools::getValue('id_product', false) !== false) {
$sql .= ' and i.id_product=' . Tools::getValue('id_product');
}
if (Tools::getValue('id_category', false) !== false) {
$sql .= ' and i.id_category=' . Tools::getValue('id_category');
}
if (!($link = Db::getInstance()->executeS($sql))) {
return "";
}
$row = $link[0];
if (1 == 1 && !$this->context->cookie->__isset($row['id_eginvate'])) {
$this->context->cookie->__set($row['id_eginvate'], 'shown');
$ceo_word = Meta::getCitysAddr();
$this->smarty->assign(array('mname' => $row['mname'], 'mtiz' => $row['mtiz'], 'message' => Meta::sprintf2($row['message'], $ceo_word), 'message2' => Meta::sprintf2($row['message2'], $ceo_word), 'delay' => $row['delay'], 'oimg' => $this->_path . 'views/img/' . $row['mphoto']));
return $this->display(__FILE__, 'displaytop.tpl');
}
}
}
示例5: sendSMS
private function sendSMS($message, $phone, $max_sms = 1)
{
$sms = Configuration::get('EGCALLME_SMS_REQUEST');
$phone = preg_replace('#\\D+#', '', $phone);
$sms = Meta::sprintf2($sms, array('sendto' => $phone, 'message' => substr($message, 0, 70 * $max_sms)));
if (trim($sms) != "" && (bool) Configuration::get('EGCALLME_SMS_NOYIFY')) {
if (!substr_count($_SERVER['DOCUMENT_ROOT'], "home/matras-house.ru/www")) {
$result = file_get_contents($sms);
}
}
}