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


PHP oos_is_not_null函数代码示例

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


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

示例1: oos_random_select

/**
 * Return a random row from a database query
 *
 * @param $query
 * @param $limit
 * @return string
 */
function oos_random_select($query, $limit = '')
{
    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    $random_product = '';
    if (oos_is_not_null($limit)) {
        if (USE_DB_CACHE == '1') {
            $random_result = $dbconn->CacheSelectLimit(15, $query, $limit);
        } else {
            $random_result = $dbconn->SelectLimit($query, $limit);
        }
    } else {
        if (USE_DB_CACHE == '1') {
            $random_result = $dbconn->CacheExecute(15, $query);
        } else {
            $random_result = $dbconn->Execute($query);
        }
    }
    $num_rows = $random_result->RecordCount();
    if ($num_rows > 0) {
        $random_row = oos_rand(0, $num_rows - 1);
        $random_result->Move($random_row);
        $random_product = $random_result->fields;
    }
    return $random_product;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:34,代码来源:function_kernel.php

示例2: set

 function set($sLang = '')
 {
     if (oos_is_not_null($sLang) && $this->exists($sLang) === true) {
         $this->language = $this->get($sLang);
     } else {
         $this->language = $this->get(DEFAULT_LANGUAGE);
     }
     /*
             if (!isset($_COOKIE['language']) || (isset($_COOKIE['language']) && ($_COOKIE['language'] != $this->language['iso_639_2']))) {
               oos_setcookie('language', $this->language['iso_639_2'], time()+60*60*24*90);
             }
     */
     $_SESSION['language'] = $this->language['iso_639_2'];
     $_SESSION['language_id'] = $this->language['id'];
     $_SESSION['iso_639_1'] = $this->language['iso_639_1'];
     $_SESSION['languages_name'] = $this->language['name'];
     if (isset($_SESSION['customer_id'])) {
         $dbconn =& oosDBGetConn();
         $oostable =& oosDBGetTables();
         $sLanguage = oos_var_prep_for_os($this->language['iso_639_2']);
         $customerstable = $oostable['customers'];
         $query = "UPDATE {$customerstable} SET customers_language =? WHERE customers_id =?";
         $result =& $dbconn->Execute($query, array($sLanguage, (int) $_SESSION['customer_id']));
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:25,代码来源:class_language.php

示例3: process

    function process()
    {
        $order_total_array = array();
        if (is_array($this->modules)) {
            reset($this->modules);
            while (list(, $value) = each($this->modules)) {
                $class = substr($value, 0, strrpos($value, '.'));
                if ($GLOBALS[$class]->enabled) {
                    $GLOBALS[$class]->output = array();
                    $GLOBALS[$class]->process();

                    $nArrayCountClass = count($GLOBALS[$class]->output);
                    for ($i=0, $n=$nArrayCountClass; $i<$n; $i++) {
                        if (oos_is_not_null($GLOBALS[$class]->output[$i]['title']) && oos_is_not_null($GLOBALS[$class]->output[$i]['text'])) {
                            $order_total_array[] = array('code' => $GLOBALS[$class]->code,
                                                         'title' => $GLOBALS[$class]->output[$i]['title'],
                                                         'text' => $GLOBALS[$class]->output[$i]['text'],
                                                         'value' => $GLOBALS[$class]->output[$i]['value'],
                                                         'sort_order' => $GLOBALS[$class]->sort_order);
                        }
                    }
                }
            }
        }

        return $order_total_array;
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:27,代码来源:class_order_total.php

示例4: __construct

    public function __construct($module = '')
    {
        global $aLang;

        if (defined('MODULE_SHIPPING_INSTALLED') && oos_is_not_null(MODULE_SHIPPING_INSTALLED)) {
            $this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

            $include_modules = array();

            if ( (!empty($module)) && (in_array(substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($_SERVER['PHP_SELF'], (strrpos($_SERVER['PHP_SELF'], '.')+1)), $this->modules)) ) {
                $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($_SERVER['PHP_SELF'], (strrpos($_SERVER['PHP_SELF'], '.')+1)));
            } else {
                reset($this->modules);
                while (list(, $value) = each($this->modules)) {
                    $class = substr($value, 0, strrpos($value, '.'));
                    $include_modules[] = array('class' => $class, 'file' => $value);
                }
            }

            $sLanguage = oos_var_prep_for_os($_SESSION['language']);

            $nArrayCountModules = count($include_modules);
            for ($i=0, $n=$nArrayCountModules; $i<$n; $i++) {
                include 'includes/languages/' . $sLanguage . '/modules/shipping/' . $include_modules[$i]['file'];
                include 'includes/modules/shipping/' . $include_modules[$i]['file'];

                $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class'];
            }
        }
    }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:30,代码来源:class_shipping.php

示例5: payment

 function payment($module = '')
 {
     global $aLang;
     if (defined('MODULE_PAYMENT_INSTALLED') && oos_is_not_null($_SESSION['member']->group['payment'])) {
         $this->modules = explode(';', $_SESSION['member']->group['payment']);
         $include_modules = array();
         if (oos_is_not_null($module) && in_array($module . '.' . substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '.') + 1), $this->modules)) {
             $this->selected_module = $module;
             $include_modules[] = array('class' => $module, 'file' => $module . '.php');
         } else {
             reset($this->modules);
             while (list(, $value) = each($this->modules)) {
                 $class = substr($value, 0, strrpos($value, '.'));
                 $include_modules[] = array('class' => $class, 'file' => $value);
             }
         }
         $sLanguage = oos_var_prep_for_os($_SESSION['language']);
         for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
             include 'includes/languages/' . $sLanguage . '/modules/payment/' . $include_modules[$i]['file'];
             include 'includes/modules/payment/' . $include_modules[$i]['file'];
             $GLOBALS[$include_modules[$i]['class']] = new $include_modules[$i]['class']();
         }
         // if there is only one payment method, select it as default because in
         // checkout_confirmation.php the $payment variable is being assigned the
         if (oos_count_payment_modules() == 1 && !is_object($_SESSION['payment'])) {
             $_SESSION['payment'] = $include_modules[0]['class'];
         }
         if (oos_is_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
             $this->form_action_url = $GLOBALS[$module]->form_action_url;
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:32,代码来源:class_payment.php

示例6: quote

 function quote($method = '')
 {
     global $oOrder, $aLang, $shipping_weight, $shipping_num_boxes;
     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
         $oOrder_total = $_SESSION['cart']->show_total();
     } else {
         $oOrder_total = $shipping_weight;
     }
     $table_cost = split("[:,]", MODULE_SHIPPING_TABLE_COST);
     $size = count($table_cost);
     for ($i = 0, $n = $size; $i < $n; $i += 2) {
         if ($oOrder_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' => $aLang['module_shipping_table_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_table_text_way'], 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
     }
     if (oos_is_not_null($this->icon)) {
         $this->quotes['icon'] = oos_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:28,代码来源:table.php

示例7: quote

 function quote($method = '')
 {
     global $oOrder, $aLang, $total_count;
     $this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_selfpickup_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_selfpickup_text_way'], 'cost' => 0)));
     if (oos_is_not_null($this->icon)) {
         $this->quotes['icon'] = oos_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:9,代码来源:selfpickup.php

示例8: quote

 function quote($method = '')
 {
     global $aLang, $oOrder;
     $this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_flat_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_flat_text_way'], 'cost' => MODULE_SHIPPING_FLAT_COST)));
     if ($this->tax_class > 0) {
         $this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
     }
     if (oos_is_not_null($this->icon)) {
         $this->quotes['icon'] = oos_image($this->icon, $this->title);
     }
     return $this->quotes;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:12,代码来源:flat.php

示例9: format

 function format($number, $calculate_currency_value = true, $currency_type = '', $currency_value = '')
 {
     if (empty($currency_type) || $this->exists($currency_type) == false) {
         $currency_type = isset($_SESSION['currency']) ? $_SESSION['currency'] : DEFAULT_CURRENCY;
     }
     if ($calculate_currency_value == true) {
         $rate = oos_is_not_null($currency_value) ? $currency_value : $this->currencies[$currency_type]['value'];
         $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number * $rate, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
     } else {
         $format_string = $this->currencies[$currency_type]['symbol_left'] . number_format($number, $this->currencies[$currency_type]['decimal_places'], $this->currencies[$currency_type]['decimal_point'], $this->currencies[$currency_type]['thousands_point']) . ' ' . $this->currencies[$currency_type]['symbol_right'];
     }
     return $format_string;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:13,代码来源:class_currencies.php

示例10: trail

 function trail($separator = ' - ')
 {
     $trail_string = '';
     for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
         if (isset($this->_trail[$i]['link']) && oos_is_not_null($this->_trail[$i]['link'])) {
             $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" title="' . $this->_trail[$i]['title'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';
         } else {
             $trail_string .= $this->_trail[$i]['title'];
         }
         if ($i + 1 < $n) {
             $trail_string .= $separator;
         }
     }
     return $trail_string;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:15,代码来源:class_breadcrumb.php

示例11: display_links

 function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
 {
     if (oos_is_not_null($parameters) && substr($parameters, -1) != '&') {
         $parameters .= '&';
     }
     // calculate number of pages needing links
     $num_pages = intval($query_numrows / $max_rows_per_page);
     // $num_pages now contains int of pages needed unless there is a remainder from division
     if ($query_numrows % $max_rows_per_page) {
         $num_pages++;
     }
     // has remainder so add one page
     $pages_array = array();
     for ($i = 1; $i <= $num_pages; $i++) {
         $pages_array[] = array('id' => $i, 'text' => $i);
     }
     if ($num_pages > 1) {
         $display_links = oos_draw_form('pages', basename($_SERVER['PHP_SELF']), '', 'get');
         if ($current_page_number > 1) {
             $display_links .= '<a href="' . oos_href_link_admin(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number - 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a>&nbsp;&nbsp;';
         } else {
             $display_links .= PREVNEXT_BUTTON_PREV . '&nbsp;&nbsp;';
         }
         $display_links .= sprintf(TEXT_RESULT_PAGE, oos_draw_pull_down_menu($page_name, $pages_array, '', 'onChange="this.form.submit();"'), $num_pages);
         if ($current_page_number < $num_pages && $num_pages != 1) {
             $display_links .= '&nbsp;&nbsp;<a href="' . oos_href_link_admin(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number + 1), 'NONSSL') . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
         } else {
             $display_links .= '&nbsp;&nbsp;' . PREVNEXT_BUTTON_NEXT;
         }
         if ($parameters != '') {
             if (substr($parameters, -1) == '&') {
                 $parameters = substr($parameters, 0, -1);
             }
             $pairs = explode('&', $parameters);
             while (list(, $pair) = each($pairs)) {
                 list($key, $value) = explode('=', $pair);
                 $display_links .= oos_draw_hidden_field(rawurldecode($key), rawurldecode($value));
             }
         }
         if (SID) {
             $display_links .= oos_draw_hidden_field(oos_session_name(), oos_session_id());
         }
         $display_links .= '</form>';
     } else {
         $display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
     }
     return $display_links;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:48,代码来源:class_split_page_results.php

示例12: trail

 function trail($separator = ' - ')
 {
     $trail_string = '<ol>' . "\n";
     for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
         if (isset($this->_trail[$i]['link']) && oos_is_not_null($this->_trail[$i]['link'])) {
             if (isset($this->_trail[$i]['rel'])) {
                 $trail_string .= '<li><a class="page_item-' . $i . '" href="' . $this->_trail[$i]['link'] . '" rel="bookmark" title="Permalink zu ' . $this->_trail[$i]['title'] . '"><strong>' . $this->_trail[$i]['title'] . '</strong></a></li>' . "\n";
             } else {
                 $trail_string .= '<li><a class="page_item-' . $i . '" href="' . $this->_trail[$i]['link'] . '" title="' . $this->_trail[$i]['title'] . '"><span>' . $this->_trail[$i]['title'] . '</span></a></li>' . "\n";
             }
         } else {
             $trail_string .= '<li><strong>' . $this->_trail[$i]['title'] . '</strong></li>' . "\n";
         }
     }
     $trail_string .= '</ol>' . "\n";
     return $trail_string;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:17,代码来源:class_breadcrumb.php

示例13: process

 function process()
 {
     global $oOrder, $oCurrencies;
     if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == '1') {
         switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
             case 'national':
                 if ($oOrder->delivery['country_id'] == STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'international':
                 if ($oOrder->delivery['country_id'] != STORE_COUNTRY) {
                     $pass = true;
                 }
                 break;
             case 'both':
                 $pass = true;
                 break;
             default:
                 $pass = false;
                 break;
         }
         if ($pass == true && $oOrder->info['total'] - $oOrder->info['shipping_cost'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
             $oOrder->info['shipping_method'] = $this->title;
             $oOrder->info['total'] -= $oOrder->info['shipping_cost'];
             $oOrder->info['shipping_cost'] = 0;
         }
     }
     $module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));
     if (oos_is_not_null($oOrder->info['shipping_method'])) {
         if ($GLOBALS[$module]->tax_class > 0) {
             $shipping_tax = oos_get_tax_rate($GLOBALS[$module]->tax_class, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
             $shipping_tax_description = oos_get_tax_rate($GLOBALS[$module]->tax_class, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
             $tax = oos_calculate_tax($oOrder->info['shipping_cost'], $shipping_tax);
             if ($_SESSION['member']->group['show_price_tax'] == 1) {
                 $oOrder->info['shipping_cost'] += $tax;
             }
             $oOrder->info['tax'] += $tax;
             $oOrder->info['tax_groups']["{$shipping_tax_description}"] += $tax;
             $oOrder->info['total'] += $tax;
         }
         $this->output[] = array('title' => $oOrder->info['shipping_method'] . ':', 'text' => $oCurrencies->format($oOrder->info['shipping_cost'], true, $oOrder->info['currency'], $oOrder->info['currency_value']), 'value' => $oOrder->info['shipping_cost']);
     }
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:44,代码来源:ot_shipping.php

示例14: oos_validate_password

/**
 * This funstion validates a plain text password with an
 * encrpyted password
 *
 * @param $sPlain
 * @param $sEncrypted
 * @return boolean
 */
function oos_validate_password($sPlain, $sEncrypted)
{
    if (!empty($sPlain) && !empty($sEncrypted)) {
        // split apart the hash / salt
        $aStack = explode(':', $sEncrypted);
        if (count($aStack) != 2) {
            return false;
        }
        if (md5($aStack[1] . $sPlain) == $aStack[0]) {
            return true;
        }
    }
    if (oos_is_not_null($_COOKIE['password']) && oos_is_not_null($sEncrypted)) {
        if ($_COOKIE['password'] == $sEncrypted) {
            return true;
        }
    }
    return false;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:27,代码来源:function_password.php

示例15: create_plugin_instance

 function create_plugin_instance()
 {
     global $oLang, $aLang;
     $dbconn =& oosDBGetConn();
     $oostable =& oosDBGetTables();
     $aPages = oos_get_pages();
     if (!isset($_SESSION['language']) || isset($_GET['language'])) {
         MyOOS_CoreApi::requireOnce('classes/class_language.php');
         $oLang = new language();
         if (isset($_GET['language']) && oos_is_not_null($_GET['language'])) {
             $oLang->set($_GET['language']);
         } else {
             $oLang->get_browser_language();
         }
     }
     $sLanguage = oos_var_prep_for_os($_SESSION['language']);
     include 'includes/languages/' . $sLanguage . '.php';
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:19,代码来源:oos_event_language.php


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