当前位置: 首页>>代码示例>>PHP>>正文


PHP vam_not_null函数代码示例

本文整理汇总了PHP中vam_not_null函数的典型用法代码示例。如果您正苦于以下问题:PHP vam_not_null函数的具体用法?PHP vam_not_null怎么用?PHP vam_not_null使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了vam_not_null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: vam_hide_session_id

function vam_hide_session_id()
{
    global $session_started;
    if ($session_started == true && defined('SID') && vam_not_null(SID)) {
        return vam_draw_hidden_field(vam_session_name(), vam_session_id());
    }
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:7,代码来源:vam_hide_session_id.inc.php

示例2: vam_get_image_size

function vam_get_image_size($src, $width, $height)
{
    if (CONFIG_CALCULATE_IMAGE_SIZE == 'true') {
        if ($image_size = @getimagesize($src)) {
            if (vam_not_null($width) && vam_not_null($height)) {
                $ratio = $width / $height;
                $src_ratio = $image_size[0] / $image_size[1];
                if ($ratio < $src_ratio) {
                    $height = $width / $src_ratio;
                } else {
                    $width = $height * $src_ratio;
                }
            } elseif (!vam_not_null($width) && vam_not_null($height)) {
                $ratio = $height / $image_size[1];
                $width = $image_size[0] * $ratio;
            } elseif (vam_not_null($width) && !vam_not_null($height)) {
                $ratio = $width / $image_size[0];
                $height = $image_size[1] * $ratio;
            } elseif (!vam_not_null($width) && !vam_not_null($height) or $width > $image_size[0] or $height > $image_size[1]) {
                $width = $image_size[0];
                $height = $image_size[1];
            }
        }
    }
    return array((int) $width, (int) $height);
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:26,代码来源:trumbnails_add_funcs.php

示例3: vam_get_path

function vam_get_path($current_category_id = '')
{
    global $cPath_array;
    if (vam_not_null($current_category_id)) {
        $cp_size = sizeof($cPath_array);
        if ($cp_size == 0) {
            $cPath_new = $current_category_id;
        } else {
            $cPath_new = '';
            $last_category_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $cPath_array[$cp_size - 1] . "'";
            $last_category_query = vamDBquery($last_category_query);
            $last_category = vam_db_fetch_array($last_category_query, true);
            $current_category_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . $current_category_id . "'";
            $current_category_query = vamDBquery($current_category_query);
            $current_category = vam_db_fetch_array($current_category_query, true);
            if ($last_category['parent_id'] == $current_category['parent_id']) {
                for ($i = 0; $i < $cp_size - 1; $i++) {
                    $cPath_new .= '_' . $cPath_array[$i];
                }
            } else {
                for ($i = 0; $i < $cp_size; $i++) {
                    $cPath_new .= '_' . $cPath_array[$i];
                }
            }
            $cPath_new .= '_' . $current_category_id;
            if (substr($cPath_new, 0, 1) == '_') {
                $cPath_new = substr($cPath_new, 1);
            }
        }
    } else {
        $cPath_new = vam_not_null($cPath_array) ? implode('_', $cPath_array) : '';
    }
    return 'cPath=' . $cPath_new;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:34,代码来源:vam_get_path.inc.php

示例4: vam_display_banner

function vam_display_banner($action, $identifier)
{
    if ($action == 'dynamic') {
        $banners_query = vam_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
        $banners = vam_db_fetch_array($banners_query);
        if ($banners['count'] > 0) {
            $banner = vam_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . "'");
        } else {
            return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
        }
    } elseif ($action == 'static') {
        if (is_array($identifier)) {
            $banner = $identifier;
        } else {
            $banner_query = vam_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . $identifier . "'");
            if (vam_db_num_rows($banner_query)) {
                $banner = vam_db_fetch_array($banner_query);
            } else {
                return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</b>';
            }
        }
    } else {
        return '<b>VaM Shop ERROR! (vam_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</b>';
    }
    if (vam_not_null($banner['banners_html_text'])) {
        $banner_string = $banner['banners_html_text'];
    } else {
        $banner_string = '<a href="' . vam_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" onclick="window.open(this.href); return false;">' . vam_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . '</a>';
    }
    vam_update_banner_display_count($banner['banners_id']);
    return $banner_string;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:32,代码来源:vam_display_banner.inc.php

示例5: quote

 function quote($method = '')
 {
     global $order, $shipping_weight, $shipping_num_boxes, $vamPrice;
     if (MODULE_SHIPPING_NEWPOST_MODE == 'price') {
         $order_total = $vamPrice->RemoveCurr($_SESSION['cart']->show_total());
     } else {
         $order_total = $shipping_weight;
     }
     $table_cost = preg_split("/[:,]/", MODULE_SHIPPING_NEWPOST_COST);
     $size = sizeof($table_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($order_total <= $table_cost[$i]) {
             $shipping = $table_cost[$i + 1];
             break;
         }
     }
     if (MODULE_SHIPPING_NEWPOST_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_NEWPOST_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_NEWPOST_TEXT_WAY, 'cost' => $shipping + MODULE_SHIPPING_NEWPOST_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = vam_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (vam_not_null($this->icon)) {
         $this->quotes['icon'] = vam_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:28,代码来源:newpost.php

示例6: parse

 function parse()
 {
     global $message;
     if (isset($_FILES[$this->file])) {
         $file = array('name' => $_FILES[$this->file]['name'], 'type' => $_FILES[$this->file]['type'], 'size' => $_FILES[$this->file]['size'], 'tmp_name' => $_FILES[$this->file]['tmp_name']);
     } elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {
         global $_FILES;
         $file = array('name' => $_FILES[$this->file]['name'], 'type' => $_FILES[$this->file]['type'], 'size' => $_FILES[$this->file]['size'], 'tmp_name' => $_FILES[$this->file]['tmp_name']);
     } else {
         $file = array('name' => isset($GLOBALS[$this->file . '_name']) ? $GLOBALS[$this->file . '_name'] : '', 'type' => isset($GLOBALS[$this->file . '_type']) ? $GLOBALS[$this->file . '_type'] : '', 'size' => isset($GLOBALS[$this->file . '_size']) ? $GLOBALS[$this->file . '_size'] : '', 'tmp_name' => isset($GLOBALS[$this->file]) ? $GLOBALS[$this->file] : '');
     }
     if (vam_not_null($file['tmp_name']) && $file['tmp_name'] != 'none' && is_uploaded_file($file['tmp_name'])) {
         if (sizeof($this->extensions) > 0) {
             if (!in_array(strtolower(substr($file['name'], strrpos($file['name'], '.') + 1)), $this->extensions)) {
                 $message->add('<b>' . $this->filename . '</b> ' . ERROR_FILETYPE_NOT_ALLOWED, 'error');
                 return false;
             }
         }
         $this->file = $file;
         $this->filename = $file['name'];
         $this->tmp_filename = $file['tmp_name'];
         return $this->check_destination();
     } else {
         $message->add(WARNING_NO_FILE_UPLOADED, 'warning');
         return false;
     }
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:27,代码来源:ci_upload_cip.class.php

示例7: confirmation

 function confirmation()
 {
     $confirmation = array('title' => $this->title . ': ' . $this->cc_card_type, 'fields' => array(array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER, 'field' => $_POST['ipayment_cc_owner']), array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER, 'field' => substr($_POST['ipayment_cc_number'], 0, 4) . str_repeat('X', strlen($_POST['ipayment_cc_number']) - 8) . substr($_POST['ipayment_cc_number'], -4)), array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES, 'field' => strftime('%B, %Y', mktime(0, 0, 0, $_POST['ipayment_cc_expires_month'], 1, '20' . $_POST['ipayment_cc_expires_year'])))));
     if (vam_not_null($_POST['ipayment_cc_checkcode'])) {
         $confirmation['fields'][] = array('title' => MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER, 'field' => $_POST['ipayment_cc_checkcode']);
     }
     return $confirmation;
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:8,代码来源:ipayment.php

示例8: vam_draw_form

function vam_draw_form($name, $action, $method = 'post', $parameters = '')
{
    $form = '<form id="' . vam_parse_input_field_data($name, array('"' => '&quot;')) . '" action="' . vam_parse_input_field_data($action, array('"' => '&quot;')) . '" method="' . vam_parse_input_field_data($method, array('"' => '&quot;')) . '"';
    if (vam_not_null($parameters)) {
        $form .= ' ' . $parameters;
    }
    $form .= '>';
    return $form;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:9,代码来源:vam_draw_form.inc.php

示例9: selection

 function selection()
 {
     global $order;
     if (vam_not_null($this->icon)) {
         $icon = vam_image($this->icon, $this->title);
     }
     //$person_query = vam_db_query("select * from ".TABLE_PERSONS." where customers_id = '" . (int)$order->customer['id'] . "'");
     //$person_data = vam_db_fetch_array($payment_query);
     $selection = array('id' => $this->code, 'module' => $this->title, 'icon' => $icon, 'description' => $this->info, 'fields' => array(array('title' => '<div id="kvitancia">' . MODULE_PAYMENT_KVITANCIA_NAME_TITLE, 'field' => MODULE_PAYMENT_KVITANCIA_NAME_DESC), array('title' => MODULE_PAYMENT_KVITANCIA_NAME, 'field' => vam_draw_input_field('kvit_name', $order->customer['firstname'] . ' ' . $order->customer['lastname'])), array('title' => MODULE_PAYMENT_KVITANCIA_ADDRESS, 'field' => vam_draw_input_field('kvit_address', $order->customer['city'] . ' ' . $order->customer['street_address']) . MODULE_PAYMENT_KVITANCIA_ADDRESS_HELP . '</div>')));
     return $selection;
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:11,代码来源:kvitancia.php

示例10: quote

 function quote($method = '')
 {
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_SOGL_TEXT_TITLE);
     $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_SOGL_TEXT_WAY, 'cost' => 0));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = vam_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (vam_not_null($this->icon)) {
         $this->quotes['icon'] = vam_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:12,代码来源:sogl.php

示例11: process

 function process()
 {
     global $order, $vamPrice;
     if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
         switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
             case 'national':
                 if ($order->delivery['country_id'] == STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'international':
                 if ($order->delivery['country_id'] != STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'both':
                 $pass = true;
                 break;
             default:
                 $pass = false;
                 break;
         }
         if ($pass == true && $order->info['total'] - $order->info['shipping_cost'] >= $vamPrice->Format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER, false, 0, true)) {
             $order->info['shipping_method'] = $this->title;
             $order->info['total'] -= $order->info['shipping_cost'];
             $order->info['shipping_cost'] = 0;
         }
     }
     $module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));
     if (vam_not_null($order->info['shipping_method'])) {
         if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 1) {
             // price with tax
             $shipping_tax = vam_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
             $shipping_tax_description = vam_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
             $tax = $vamPrice->Format(vam_add_tax($order->info['shipping_cost'], $shipping_tax), false, 0, false) - $order->info['shipping_cost'];
             $tax = $vamPrice->Format($tax, false, 0, true);
             $order->info['shipping_cost'] = vam_add_tax($order->info['shipping_cost'], $shipping_tax);
             $order->info['tax'] += $tax;
             $order->info['tax_groups'][TAX_ADD_TAX . "{$shipping_tax_description}"] += $tax;
             $order->info['total'] += $tax;
         } else {
             if ($_SESSION['customers_status']['customers_status_show_price_tax'] == 0 && $_SESSION['customers_status']['customers_status_add_tax_ot'] == 1) {
                 $shipping_tax = vam_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                 $shipping_tax_description = vam_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
                 $tax = $vamPrice->Format(vam_add_tax($order->info['shipping_cost'], $shipping_tax), false, 0, false) - $order->info['shipping_cost'];
                 $tax = $vamPrice->Format($tax, false, 0, true);
                 $order->info['tax'] = $order->info['tax'] += $tax;
                 $order->info['tax_groups'][TAX_NO_TAX . "{$shipping_tax_description}"] = $order->info['tax_groups'][TAX_NO_TAX . "{$shipping_tax_description}"] += $tax;
             }
         }
         $this->output[] = array('title' => $order->info['shipping_method'] . ':', 'text' => $vamPrice->Format($order->info['shipping_cost'], true, 0, true), 'value' => $vamPrice->Format($order->info['shipping_cost'], false, 0, true));
     }
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:53,代码来源:ot_shipping.php

示例12: quote

 function quote($method = '')
 {
     global $order, $total_count;
     $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 * $total_count + MODULE_SHIPPING_ITEM_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = vam_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (vam_not_null($this->icon)) {
         $this->quotes['icon'] = vam_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:12,代码来源:item.php

示例13: payment

 function payment()
 {
     if (defined('MODULE_PAYMENT_INSTALLED') && vam_not_null(MODULE_PAYMENT_INSTALLED)) {
         $allmods = explode(';', MODULE_PAYMENT_INSTALLED);
         $this->modules = array();
         for ($i = 0, $n = sizeof($allmods); $i < $n; $i++) {
             $file = $allmods[$i];
             $class = substr($file, 0, strrpos($file, '.'));
             $this->modules[$i]['class'] = $class;
             $this->modules[$i]['file'] = $file;
         }
     }
 }
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:13,代码来源:payment.php

示例14: vam_get_category_path

function vam_get_category_path($cID)
{
    $cPath = '';
    $category = $cID;
    $categories = array();
    vam_get_parent_categories($categories, $cID);
    $categories = array_reverse($categories);
    $cPath = implode('_', $categories);
    if (vam_not_null($cPath)) {
        $cPath .= '_';
    }
    $cPath .= $cID;
    return $cPath;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:14,代码来源:vam_get_category_path.inc.php

示例15: vam_draw_hidden_field

function vam_draw_hidden_field($name, $value = '', $parameters = '')
{
    $field = '<input type="hidden" name="' . vam_parse_input_field_data($name, array('"' => '&quot;')) . '" value="';
    if (vam_not_null($value)) {
        $field .= vam_parse_input_field_data($value, array('"' => '&quot;')) . '"';
    } else {
        $field .= vam_parse_input_field_data($GLOBALS[$name], array('"' => '&quot;')) . '"';
    }
    if (vam_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= ' />';
    return $field;
}
开发者ID:nomadcomanche,项目名称:zdorov_shop,代码行数:14,代码来源:vam_draw_hidden_field.inc.php


注:本文中的vam_not_null函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。