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


PHP xtc_not_null函数代码示例

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


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

示例1: xtc_href_link

function xtc_href_link($page = '', $parameters = '', $connection = 'NONSSL')
{
    //BOF - DokuMan - 2011-01-07 - Sanitize parameters
    $page = xtc_output_string($page);
    //EOF - DokuMan - 2011-01-07 - Sanitize parameters
    if (!xtc_not_null($page)) {
        die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine the page link!<br /><br />Function used:<br /><br />xtc_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</strong>');
    }
    if ($connection == 'NONSSL') {
        $link = HTTP_SERVER . DIR_WS_ADMIN;
    } elseif ($connection == 'SSL') {
        if (defined('ENABLE_SSL') && ENABLE_SSL == 'true') {
            $link = (defined('HTTPS_SERVER') ? HTTPS_SERVER : HTTPS_CATALOG_SERVER) . DIR_WS_ADMIN;
        } else {
            $link = HTTP_SERVER . DIR_WS_ADMIN;
        }
    } else {
        die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL<br /><br />Function used:<br /><br />xtc_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</strong>');
    }
    if ($parameters == '') {
        $link = $link . $page . '?' . SID;
    } else {
        //BOF - DokuMan - 2011-01-07 - Sanitize parameters
        //$link = $link . $page . '?' . $parameters . '&' . SID;
        $link = $link . $page . '?' . xtc_output_string($parameters) . '&' . SID;
        //EOF - DokuMan - 2011-01-07 - Sanitize parameters
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    return $link;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:32,代码来源:html_output.php

示例2: xtc_draw_pull_down_menuNote

function xtc_draw_pull_down_menuNote($data, $values, $default = '', $parameters = '', $required = false)
{
    $field = '<select name="' . xtc_parse_input_field_data($data['name'], array('"' => '&quot;')) . '"';
    if (USE_BOOTSTRAP == "true") {
        $field .= ' class="form-control"';
    }
    if (xtc_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= '>';
    if (empty($default) && isset($GLOBALS[$data['name']])) {
        $default = $GLOBALS[$data['name']];
    }
    for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
        $field .= '<option value="' . xtc_parse_input_field_data($values[$i]['id'], array('"' => '&quot;')) . '"';
        # New $values parameter disabled
        if (isset($values[$i]['disabled'])) {
            if ($values[$i]['disabled'] == "disabled") {
                $field .= ' disabled="disabled"';
            }
        }
        if ($default == $values[$i]['id']) {
            $field .= ' selected="selected"';
        }
        $field .= '>' . xtc_parse_input_field_data($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
    }
    $field .= '</select>' . $data['text'];
    if ($required == true) {
        $field .= TEXT_FIELD_REQUIRED;
    }
    return $field;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:32,代码来源:xtc_draw_pull_down_menu.inc.php

示例3: quote

 function quote($method = '')
 {
     global $order, $shipping_weight, $shipping_num_boxes, $xtPrice;
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $order_total = $xtPrice->xtcRemoveCurr($_SESSION['cart']->show_total());
     } else {
         $order_total = $shipping_weight;
     }
     $table_cost = preg_split("/[:,]/", MODULE_SHIPPING_TABLE_COST);
     // Hetfield - 2009-08-18 - replaced deprecated function split with preg_split to be ready for PHP >= 5.3
     $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_TABLE_MODE == 'weight') {
         $shipping = $shipping * $shipping_num_boxes;
     }
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_TABLE_TEXT_WAY, 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (xtc_not_null($this->icon)) {
         $this->quotes['icon'] = xtc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:29,代码来源:table.php

示例4: xtc_get_path

function xtc_get_path($current_category_id = '')
{
    global $cPath_array;
    if (xtc_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 = '" . xtc_db_input((int) $cPath_array[$cp_size - 1]) . "'";
            $last_category_query = xtDBquery($last_category_query);
            $last_category = xtc_db_fetch_array($last_category_query, true);
            $current_category_query = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . xtc_db_input((int) $current_category_id) . "'";
            $current_category_query = xtDBquery($current_category_query);
            $current_category = xtc_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 = xtc_not_null($cPath_array) ? implode('_', $cPath_array) : '';
    }
    return 'cPath=' . $cPath_new;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:34,代码来源:xtc_get_path.inc.php

示例5: xtc_hide_session_id

function xtc_hide_session_id()
{
    global $session_started;
    if ($session_started == true && defined('SID') && xtc_not_null(SID)) {
        return xtc_draw_hidden_field(xtc_session_name(), xtc_session_id());
    }
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:7,代码来源:xtc_hide_session_id.inc.php

示例6: xtc_address_format

function xtc_address_format($address_format_id, $address, $html, $boln, $eoln)
{
    $address_format_query = xtc_db_query("select address_format as format from " . TABLE_ADDRESS_FORMAT . " where address_format_id = '" . xtc_db_input((int) $address_format_id) . "'");
    $address_format = xtc_db_fetch_array($address_format_query);
    $company = addslashes($address['company']);
    $firstname = addslashes($address['firstname']);
    $lastname = addslashes($address['lastname']);
    $street = addslashes($address['street_address']);
    $suburb = addslashes($address['suburb']);
    $city = addslashes($address['city']);
    $state = addslashes($address['state']);
    $country_id = $address['country_id'];
    $zone_id = $address['zone_id'];
    $postcode = addslashes($address['postcode']);
    $zip = $postcode;
    $country = xtc_get_country_name($country_id);
    $state = xtc_get_zone_code($country_id, $zone_id, $state);
    if ($html) {
        // HTML Mode
        $HR = '<hr />';
        $hr = '<hr />';
        if ($boln == '' && $eoln == "\n") {
            // Values not specified, use rational defaults
            $CR = '<br />';
            $cr = '<br />';
            $eoln = $cr;
        } else {
            // Use values supplied
            $CR = $eoln . $boln;
            $cr = $CR;
        }
    } else {
        // Text Mode
        $CR = $eoln;
        $cr = $CR;
        $HR = '----------------------------------------';
        $hr = '----------------------------------------';
    }
    $statecomma = '';
    $streets = $street;
    if ($suburb != '') {
        $streets = $street . $cr . $suburb;
    }
    if ($firstname == '') {
        $firstname = addslashes($address['name']);
    }
    if ($country == '') {
        $country = addslashes($address['country']);
    }
    if ($state != '') {
        $statecomma = $state . ', ';
    }
    $fmt = $address_format['format'];
    eval("\$address = \"{$fmt}\";");
    if (ACCOUNT_COMPANY == 'true' && xtc_not_null($company)) {
        $address = $company . $cr . $address;
    }
    $address = stripslashes($address);
    return $address;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:60,代码来源:xtc_address_format.inc.php

示例7: xtc_display_banner

function xtc_display_banner($action, $identifier)
{
    if ($action == 'dynamic') {
        $banners_query = xtc_db_query("select count(*) as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . xtc_db_input($identifier) . "'");
        $banners = xtc_db_fetch_array($banners_query);
        if ($banners['count'] > 0) {
            $banner = xtc_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . xtc_db_input($identifier) . "'");
        } else {
            return '<strong>XTC ERROR! (xtc_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</strong>';
        }
    } elseif ($action == 'static') {
        if (is_array($identifier)) {
            $banner = $identifier;
        } else {
            $banner_query = xtc_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . xtc_db_input($identifier) . "'");
            if (xtc_db_num_rows($banner_query)) {
                $banner = xtc_db_fetch_array($banner_query);
            } else {
                return '<strong>XTC ERROR! (xtc_display_banner(' . $action . ', ' . $identifier . ') -> Banner with ID \'' . $identifier . '\' not found, or status inactive</strong>';
            }
        }
    } else {
        return '<strong>XTC ERROR! (xtc_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'</strong>';
    }
    if (xtc_not_null($banner['banners_html_text'])) {
        $banner_string = $banner['banners_html_text'];
    } else {
        $banner_string = '<a href="' . xtc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" onclick="window.open(this.href); return false;">' . xtc_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . '</a>';
    }
    xtc_update_banner_display_count($banner['banners_id']);
    return $banner_string;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:32,代码来源:xtc_display_banner.inc.php

示例8: xtc_href_link_from_admin

function xtc_href_link_from_admin($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)
{
    global $request_type, $session_started, $http_domain, $https_domain;
    require_once DIR_FS_INC . 'xtc_check_agent.inc.php';
    if (!xtc_not_null($page)) {
        die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine the page link (' . $page . ')!<br /><br />');
    }
    if ($connection == 'NONSSL') {
        $link = HTTP_SERVER . DIR_WS_CATALOG;
    } elseif ($connection == 'SSL') {
        //BOF - DokuMan - 2011-12-20 - fix ticket #88
        if (defined('ENABLE_SSL_CATALOG') && ENABLE_SSL_CATALOG == 'true') {
            $link = (defined('HTTPS_CATALOG_SERVER') ? HTTPS_CATALOG_SERVER : HTTP_CATALOG_SERVER) . DIR_WS_CATALOG;
            //EOF - DokuMan - 2011-12-20 - fix ticket #88
        } else {
            $link = HTTP_SERVER . DIR_WS_CATALOG;
        }
    } else {
        die('</td></tr></table></td></tr></table><br /><br /><font color="#ff0000"><strong>Error!</strong></font><br /><br /><strong>Unable to determine connection method on a link!<br /><br />Known methods: NONSSL SSL</strong><br /><br />');
    }
    if (xtc_not_null($parameters)) {
        $link .= $page . '?' . $parameters;
        $separator = '&';
    } else {
        $link .= $page;
        $separator = '?';
    }
    while (substr($link, -1) == '&' || substr($link, -1) == '?') {
        $link = substr($link, 0, -1);
    }
    // Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
    if ($add_session_id == true && $session_started == true && SESSION_FORCE_COOKIE_USE == 'False') {
        if (defined('SID') && xtc_not_null(SID)) {
            $sid = SID;
        } elseif ($request_type == 'NONSSL' && $connection == 'SSL' && ENABLE_SSL == true || $request_type == 'SSL' && $connection == 'NONSSL') {
            if ($http_domain != $https_domain) {
                $sid = session_name() . '=' . session_id();
            }
        }
    }
    //--- SEO Hartmut König -----------------------------------------//
    if ($_REQUEST['test'] || SEARCH_ENGINE_FRIENDLY_URLS == 'true' && $search_engine_safe == true) {
        require_once DIR_FS_INC . 'shopstat_functions.inc.php';
        $seolink = shopstat_getSEO($page, $parameters, $connection, $add_session_id, $search_engine_safe, 'admin');
        if ($seolink) {
            $link = $seolink;
            $elements = parse_url($link);
            isset($elements['query']) ? $separator = '&' : ($separator = '?');
        }
    }
    //--- SEO Hartmut König -----------------------------------------//
    if (xtc_check_agent() == 1) {
        $sid = NULL;
    }
    if (isset($sid)) {
        $link .= $separator . $sid;
    }
    return $link;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:59,代码来源:xtc_href_link_from_admin.inc.php

示例9: xtc_draw_form

function xtc_draw_form($name, $action, $method = 'post', $parameters = '')
{
    $form = '<form id="' . xtc_parse_input_field_data($name, array('"' => '&quot;')) . '" action="' . xtc_parse_input_field_data($action, array('"' => '&quot;')) . '" method="' . xtc_parse_input_field_data($method, array('"' => '&quot;')) . '"';
    if (xtc_not_null($parameters)) {
        $form .= ' ' . $parameters;
    }
    $form .= '>';
    return $form;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:9,代码来源:xtc_draw_form.inc.php

示例10: quote

 function quote($method = '')
 {
     $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_SELFPICKUP_TEXT_TITLE);
     $this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_SELFPICKUP_TEXT_WAY, 'cost' => 0));
     if (xtc_not_null($this->icon)) {
         $this->quotes['icon'] = xtc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:9,代码来源:selfpickup.php

示例11: xtc_get_product_path

function xtc_get_product_path($products_id)
{
    $cPath = '';
    $category_query = "select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id != 0";
    $category_query = xtDBquery($category_query);
    if (xtc_db_num_rows($category_query, true)) {
        #Default category( first picked from table)
        $category = xtc_db_fetch_array($category_query);
        $p_path_full = $_SERVER['REQUEST_URI'];
        $p_path = $_SERVER['QUERY_STRING'];
        #If we display product check linked categories
        if (strpos($p_path, 'products_id') !== false) {
            while ($categoryies = xtc_db_fetch_array($category_query)) {
                $cat_name = xtc_get_categories_name($categoryies['categories_id']);
                $cat_name_slug = shopstat_hrefSmallmask($cat_name);
                $p_path_full_array = explode('/', $p_path_full);
                if ($p_path_full_array[count($p_path_full_array) - 2] === $cat_name_slug) {
                    $category = $categoryies;
                    break;
                }
            }
        }
        # Check if current categorie or its children have linked product
        $c_path = $_SERVER['QUERY_STRING'];
        if (strpos($c_path, 'cPath') !== false) {
            $category_path = substr($c_path, strpos($c_path, '=') + 1);
            $categorie_previous = end(explode('_', $category_path));
            $cat_children = array();
            $cat_children = xtc_get_categories_children($categorie_previous);
            foreach ($cat_children as $linked_cat) {
                $category_query_check = "select p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = '" . (int) $products_id . "' and p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id != 0 and p2c.categories_id = '" . $linked_cat . "'";
                $category_query_check = xtDBquery($category_query_check);
                if (xtc_db_num_rows($category_query_check, true)) {
                    $category = xtc_db_fetch_array($category_query_check);
                    break;
                }
            }
        }
        $categories = array();
        xtc_get_parent_categories($categories, $category['categories_id']);
        $categories = array_reverse($categories);
        $cPath = implode('_', $categories);
        if (xtc_not_null($cPath)) {
            $cPath .= '_';
        }
        $cPath .= $category['categories_id'];
    }
    //BOF - Dokuman - 2009-10-02 - removed feature, due to wrong links in category on "last viewed"
    /*
      if($_SESSION['lastpath']!=''){
        $cPath = $_SESSION['lastpath'];
      }
    */
    //EOF - Dokuman - 2009-10-02 - removed feature, due to wrong links in category on "last viewed"
    return $cPath;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:56,代码来源:xtc_get_product_path.inc.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'] = xtc_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }
     if (xtc_not_null($this->icon)) {
         $this->quotes['icon'] = xtc_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:12,代码来源:item.php

示例13: xtc_draw_hidden_field

function xtc_draw_hidden_field($name, $value = '', $parameters = '')
{
    $field = '<input type="hidden" name="' . xtc_parse_input_field_data($name, array('"' => '&quot;')) . '" value="';
    if (xtc_not_null($value)) {
        $field .= xtc_parse_input_field_data($value, array('"' => '&quot;'));
    } else {
        $field .= xtc_parse_input_field_data(array_key_exists($name, $GLOBALS) ? $GLOBALS[$name] : NULL, array('"' => '&quot;'));
    }
    $field .= xtc_not_null($parameters) ? '" ' . $parameters : '"';
    $field .= ' />';
    return $field;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:12,代码来源:xtc_draw_hidden_field.inc.php

示例14: xtc_get_category_path

function xtc_get_category_path($cID)
{
    $cPath = '';
    $category = $cID;
    $categories = array();
    xtc_get_parent_categories($categories, $cID);
    $categories = array_reverse($categories);
    $cPath = implode('_', $categories);
    if (xtc_not_null($cPath)) {
        $cPath .= '_';
    }
    $cPath .= $cID;
    return $cPath;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:14,代码来源:xtc_get_category_path.inc.php

示例15: xtc_draw_input_fieldNote

function xtc_draw_input_fieldNote($data, $value = '', $parameters = '', $type = 'text', $reinsert_value = true)
{
    $field = '<input type="' . xtc_parse_input_field_data($type, array('"' => '&quot;')) . '" name="' . xtc_parse_input_field_data($data['name'], array('"' => '&quot;')) . '"';
    if (isset($GLOBALS[$data['name']]) && $reinsert_value == true) {
        $field .= ' value="' . xtc_parse_input_field_data($GLOBALS[$data['name']], array('"' => '&quot;')) . '"';
    } elseif (xtc_not_null($value)) {
        $field .= ' value="' . xtc_parse_input_field_data($value, array('"' => '&quot;')) . '"';
    }
    if (xtc_not_null($parameters)) {
        $field .= ' ' . $parameters;
    }
    $field .= ' />' . $data['text'];
    return $field;
}
开发者ID:shophelfer,项目名称:shophelfer.com-shop,代码行数:14,代码来源:xtc_draw_input_field.inc.php


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