本文整理汇总了PHP中zen_image函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_image函数的具体用法?PHP zen_image怎么用?PHP zen_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quote
function quote($method = '')
{
global $order;
if ($this->enabled) {
$excluded_array = explode(',', MODULE_SHIPPING_PREFERRED_SHIPPING_EXCLUDED_PRODUCTS);
$products_in_cart_array = explode(',', $_SESSION['cart']->get_product_id_list());
echo var_dump($products_in_cart_array);
foreach ($products_in_cart_array as $product_in_cart) {
$base_product_in_cart = substr($product_in_cart, 0, strpos($product_in_cart, ':'));
if (in_array($base_product_in_cart, $excluded_array)) {
$this->enabled = false;
}
}
if ($_SESSION['cart']->show_total() < MODULE_SHIPPING_PREFERRED_SHIPPING_MIN_ORDER) {
$this->enabled = false;
}
}
if ($this->enabled) {
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_WAY, 'cost' => '0.00')));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
}
return $this->quotes;
}
示例2: send
function send($newsletter_id)
{
global $db;
$audience_select = get_audience_sql_query($this->query_name, 'newsletters');
$audience = $db->Execute($audience_select['query_string']);
$records = $audience->RecordCount();
if ($records == 0) {
return 0;
}
$i = 0;
while (!$audience->EOF) {
$i++;
$html_msg['EMAIL_FIRST_NAME'] = $audience->fields['customers_firstname'];
$html_msg['EMAIL_LAST_NAME'] = $audience->fields['customers_lastname'];
$html_msg['EMAIL_GREET'] = EMAIL_GREET;
$html_msg['EMAIL_MESSAGE_HTML'] = $this->content_html;
zen_mail($audience->fields['customers_firstname'] . ' ' . $audience->fields['customers_lastname'], $audience->fields['customers_email_address'], $this->title, $this->content, STORE_NAME, EMAIL_FROM, $html_msg, 'newsletters');
echo zen_image(DIR_WS_ICONS . 'tick.gif', $audience->fields['customers_email_address']);
//force output to the screen to show status indicator each time a message is sent...
if (function_exists('ob_flush')) {
@ob_flush();
}
@flush();
$audience->MoveNext();
}
$newsletter_id = zen_db_prepare_input($newsletter_id);
$db->Execute("update " . TABLE_NEWSLETTERS . "\r\n set date_sent = now(), status = '1'\r\n where newsletters_id = '" . zen_db_input($newsletter_id) . "'");
return $records;
//return number of records processed whether successful or not
}
示例3: zen_check_quantity
function zen_check_quantity($which)
{
global $db;
$which_query = $db->Execute("select sesskey, value\r\n from " . TABLE_SESSIONS . "\r\n where sesskey= '" . $which . "'");
$who_query = $db->Execute("select session_id, time_entry, time_last_click, host_address, user_agent\r\n from " . TABLE_WHOS_ONLINE . "\r\n where session_id='" . $which . "'");
// longer than 2 minutes light color
$xx_mins_ago_long = time() - WHOIS_TIMER_INACTIVE;
switch (true) {
case $which_query->RecordCount() == 0:
if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
} else {
return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
}
break;
case strstr($which_query->fields['value'], '"contents";a:0:'):
if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
return zen_image(DIR_WS_IMAGES . 'icon_status_red_light.gif');
} else {
return zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
}
break;
case !strstr($which_query->fields['value'], '"contents";a:0:'):
if ($who_query->fields['time_last_click'] < $xx_mins_ago_long) {
return zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
} else {
return zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
}
break;
}
}
示例4: quote
function quote($method = '')
{
global $order, $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT') && MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT > 0) {
//hkpost weight as gram g.
$shipping_cost = MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT * $shipping_weight;
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE') && MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE > 0) {
$shipping_cost += MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE;
}
//$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' ('.number_format($shipping_weight,2).MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_UNITS.')';
$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY;
//############################for better calculate with currency#########################
//modified by john 2010-06-30 2/3
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
示例5: quote
function quote($method = '')
{
global $order, $shipping_weight;
$calc_weight = $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE') && MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE > 0) {
if ($calc_weight <= MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT) {
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
} else {
$calc_weight = $calc_weight - MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT;
$shipping_cost = ceil($calc_weight / MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT) * MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE;
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + $shipping_cost + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
}
$shipping_method = MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' (' . number_format($shipping_weight, 2) . MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_UNITS . ') ';
//modified by john 2010-06-30
//for better calculate with currency
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
示例6: add
function add($class, $message, $type = 'error')
{
global $template, $current_page_base;
$message = trim($message);
$duplicate = false;
if (strlen($message) > 0) {
if ($type == 'error') {
$theAlert = array('params' => 'class="messageStackError larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_ERROR, DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . ICON_IMAGE_ERROR, ICON_ERROR_ALT) . ' ' . $message);
} elseif ($type == 'warning') {
$theAlert = array('params' => 'class="messageStackWarning larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_WARNING, DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . ICON_IMAGE_WARNING, ICON_WARNING_ALT) . ' ' . $message);
} elseif ($type == 'success') {
$theAlert = array('params' => 'class="messageStackSuccess larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_SUCCESS, DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . ICON_IMAGE_SUCCESS, ICON_SUCCESS_ALT) . ' ' . $message);
} elseif ($type == 'caution') {
$theAlert = array('params' => 'class="messageStackCaution larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_WARNING, DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . ICON_IMAGE_WARNING, ICON_WARNING_ALT) . ' ' . $message);
} else {
$theAlert = array('params' => 'class="messageStackError larger"', 'class' => $class, 'text' => $message);
}
for ($i = 0, $n = sizeof($this->messages); $i < $n; $i++) {
if ($theAlert['text'] == $this->messages[$i]['text'] && $theAlert['class'] == $this->messages[$i]['class']) {
$duplicate = true;
}
}
if (!$duplicate) {
$this->messages[] = $theAlert;
}
}
}
示例7: average_product_reviews_image
/**
* @param $average
* @return string
*/
function average_product_reviews_image($average)
{
$stars_image_suffix = str_replace('.', '_', zen_round($average * 2, 0) / 2);
// for stars_0_5.gif, stars_1.gif, stars_1_5.gif etc.
$average_rating = zen_round($average, 2);
$reviews_string = zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $stars_image_suffix . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $average_rating));
return $reviews_string;
}
示例8: quote
function quote()
{
global $shipping_weight, $shipping_num_boxes;
global $order;
global $a_sagawaex_time;
global $cart;
global $db;
$this->quotes = array('id' => $this->code, 'module' => $this->title);
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
$country_id = $order->delivery['country']['id'];
$zone_id = $order->delivery['zone_id'];
if (in_array($country_id, $this->sagawaex_countries_nbr)) {
$zoneinfo = $db->Execute("SELECT zone_code FROM " . TABLE_ZONES . " WHERE zone_id = '" . $zone_id . "'");
$a_zonevalues = $zoneinfo->fields;
$s_zone_code = $a_zonevalues['zone_code'];
// 送料が条件によって無料になってしまう(ここではtotalではなくsubtotalを確認すべき)
if (MODULE_SHIPPING_SAGAWAEX_FREE_SHIPPING != 'True' || (int) $order->info['subtotal'] < (int) MODULE_SHIPPING_SAGAWAEX_OVER) {
include DIR_WS_CLASSES . '_sagawaex.php';
$rate = new _SagawaEx($this->code, MODULE_SHIPPING_SAGAWAEX_TEXT_WAY_NORMAL, zen_get_zone_code(STORE_COUNTRY, STORE_ZONE, 0), STORE_COUNTRY);
//STORE_ORIGIN_ZONE, STORE_ORIGIN_COUNTRY);
$rate->SetDest($s_zone_code, $this->sagawaex_countries[$country_id]);
$rate->SetWeight($shipping_weight);
$tmpQuote = $rate->GetQuote();
// id, title, cost | error
if (isset($tmpQuote['error'])) {
$this->quotes['error'] = $tmpQuote['error'];
} else {
$this->quotes['module'] = $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'kg)';
$tmpQuote['cost'] *= $shipping_num_boxes;
// 送料ディスカウント
if (defined('MODULE_SHIPPING_SAGAWAEX_DISCOUNT') && 0 < (int) MODULE_SHIPPING_SAGAWAEX_DISCOUNT) {
$tmpQuote['cost'] -= (int) ($tmpQuote['cost'] * MODULE_SHIPPING_SAGAWAEX_DISCOUNT / 100);
}
// 手数料
$tmpQuote['cost'] += MODULE_SHIPPING_SAGAWAEX_HANDLING;
}
} else {
$tmpQuote = array('id' => $this->code, 'title' => MODULE_SHIPPING_SAGAWAEX_TEXT_WAY_NORMAL, 'cost' => 0);
}
if (!isset($tmpQuote['error'])) {
// 配送時刻指定
$timespec = $this->get_timespec();
$tmpQuote['option'] = TEXT_TIME_SPECIFY . zen_draw_pull_down_menu('sagawaex_timespec', $a_sagawaex_time, $timespec);
$tmpQuote['timespec'] = $timespec;
}
$this->quotes['methods'][] = $tmpQuote;
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $country_id, $zone_id);
}
} else {
$this->quotes['error'] = MODULE_SHIPPING_SAGAWAEX_TEXT_NOTAVAILABLE;
}
return $this->quotes;
}
示例9: zen_quickupdates_table_head
function zen_quickupdates_table_head($sort_field, $head_text, $cols=1) {
$str = '';
$str .= '<td class="dataTableHeadingContent" align="center" valign="middle"' . ($cols > 1 ? ' colspan="' . $cols . '"' : '') . '>';
if($sort_field != '') {
$str .= '<a href="' . zen_href_link(FILENAME_QUICK_UPDATES, 'sort_by=' . trim($sort_field) . ' ASC') . '">' . zen_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . $head_text . ' ' . TEXT_ASCENDINGLY) . '</a>';
$str .= '<a href="' . zen_href_link(FILENAME_QUICK_UPDATES, 'sort_by=' . trim($sort_field) . ' DESC') . '">' . zen_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . $head_text . ' ' . TEXT_DESCENDINGLY) . '</a><br />';
}
$str .= $head_text . '</td>';
return $str;
}
示例10: zen_link_info_image
function zen_link_info_image($image, $alt, $width = '', $height = '')
{
global $db;
if (zen_not_null($image)) {
$image = zen_image($image, $alt, $width, $height);
} else {
$image = TEXT_IMAGE_NONEXISTENT;
}
return $image;
}
示例11: getIcon
public function getIcon($type)
{
if (in_array($type, array('error', 'warn', 'success'))) {
if ('warn' == $type) {
$type = 'warning';
}
$image = $type . '.gif';
return zen_image(DIR_WS_ICONS . $image, $type);
}
return '';
}
示例12: quote
function quote($method = '')
{
global $order;
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREESHIPPER_TEXT_WAY, 'cost' => MODULE_SHIPPING_FREESHIPPER_COST + MODULE_SHIPPING_FREESHIPPER_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
return $this->quotes;
}
示例13: quote
function quote($method = '')
{
global $order, $total_count;
// adjusted count for free shipping
$item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEM_TEXT_WAY, 'cost' => MODULE_SHIPPING_ITEM_COST * $item_total_count + MODULE_SHIPPING_ITEM_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
return $this->quotes;
}
示例14: add
function add($message, $type = 'error')
{
if ($type == 'error') {
$this->errors[] = array('params' => 'class="messageStackError"', 'text' => zen_image(DIR_WS_ICONS . 'error.gif', ICON_ERROR) . ' ' . $message);
} elseif ($type == 'warning') {
$this->errors[] = array('params' => 'class="messageStackWarning"', 'text' => zen_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message);
} elseif ($type == 'success') {
$this->errors[] = array('params' => 'class="messageStackSuccess"', 'text' => zen_image(DIR_WS_ICONS . 'success.gif', ICON_SUCCESS) . ' ' . $message);
} elseif ($type == 'caution') {
$this->errors[] = array('params' => 'class="messageStackCaution"', 'text' => zen_image(DIR_WS_ICONS . 'warning.gif', ICON_WARNING) . ' ' . $message);
} else {
$this->errors[] = array('params' => 'class="messageStackError"', 'text' => $message);
}
$this->size++;
}
示例15: add
function add($class, $message, $type = 'error')
{
global $template;
if ($type == 'error') {
$this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => zen_image($template->get_template_dir('error.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'error.gif', ICON_ERROR) . ' ' . $message);
} elseif ($type == 'warning') {
$this->messages[] = array('params' => 'class="messageStackWarning"', 'class' => $class, 'text' => zen_image($template->get_template_dir('warning.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'warning.gif', ICON_WARNING) . ' ' . $message);
} elseif ($type == 'success') {
$this->messages[] = array('params' => 'class="messageStackSuccess"', 'class' => $class, 'text' => zen_image($template->get_template_dir('success.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'success.gif', ICON_SUCCESS) . ' ' . $message);
} elseif ($type == 'caution') {
$this->messages[] = array('params' => 'class="messageStackCaution"', 'class' => $class, 'text' => zen_image($template->get_template_dir('warning.gif', DIR_WS_TEMPLATE, $current_page_base, 'images/icons') . '/' . 'warning.gif', ICON_WARNING) . ' ' . $message);
} else {
$this->messages[] = array('params' => 'class="messageStackError"', 'class' => $class, 'text' => $message);
}
}