• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP oos_is_not_null函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: quote

 function quote($method = '', $module = '')
 {
     global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
     $quotes_array = array();
     if (is_array($this->modules)) {
         $shipping_quoted = '';
         $shipping_num_boxes = 1;
         $shipping_weight = $total_weight;
         if ($total_weight > SHIPPING_MAX_WEIGHT) {
             // Split into many boxes
             $shipping_num_boxes = ceil($total_weight / SHIPPING_MAX_WEIGHT);
             $shipping_weight = $total_weight / $shipping_num_boxes;
         }
         if (SHIPPING_BOX_WEIGHT >= $shipping_weight * SHIPPING_BOX_PADDING / 100) {
             $shipping_weight = $shipping_weight + SHIPPING_BOX_WEIGHT;
         } else {
             $shipping_weight = $shipping_weight + $shipping_weight * SHIPPING_BOX_PADDING / 100;
         }
         $include_quotes = array();
         reset($this->modules);
         while (list(, $value) = each($this->modules)) {
             $class = substr($value, 0, strrpos($value, '.'));
             if (oos_is_not_null($module)) {
                 if ($module == $class && $GLOBALS[$class]->enabled) {
                     $include_quotes[] = $class;
                 }
             } elseif ($GLOBALS[$class]->enabled) {
                 $include_quotes[] = $class;
             }
         }
         $size = count($include_quotes);
         for ($i = 0; $i < $size; $i++) {
             $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
             if (is_array($quotes)) {
                 $quotes_array[] = $quotes;
             }
         }
     }
     return $quotes_array;
 }
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:40,代码来源:class_shipping.php


示例17: quote

 function quote($method = '')
 {
     global $oOrder, $aLang, $shipping_weight;
     $weight_cost = split("[:,]", MODULE_SHIPPING_WEIGHT_COST);
     if ($shipping_weight > $weight_cost[count($weight_cost) - 2]) {
         $shipping = ($shipping_weight - $weight_cost[count($weight_cost) - 2]) * MODULE_SHIPPING_WEIGHT_STEP + $weight_cost[count($weight_cost) - 1];
     }
     for ($i = 0; $i < count($weight_cost); $i += 2) {
         if ($shipping_weight <= $weight_cost[$i]) {
             $shipping = $weight_cost[$i + 1];
             break;
         }
     }
     $this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_weight_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_weight_text_way'], 'cost' => $shipping + MODULE_SHIPPING_WEIGHT_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,代码行数:22,代码来源:weight.php


示例18: oos_get_path

/**
 * Generate a path to categories
 *
 * @param $current_category_id
 * @return string
 */
function oos_get_path($current_category_id = '', $parent_id = '', $gparent_id = '')
{
    global $aCategoryPath;
    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    if (oos_is_not_null($current_category_id)) {
        $cp_size = count($aCategoryPath);
        if ($cp_size == 0) {
            $categories_new = $current_category_id;
        } else {
            $categories_new = '';
            if (oos_empty($parent_id) || oos_empty($gparent_id)) {
                $categoriestable = $oostable['categories'];
                $query = "SELECT c.parent_id, p.parent_id as gparent_id\n                      FROM {$categoriestable} AS c,\n                           {$categoriestable} AS p\n                     WHERE c.categories_id = '" . intval($aCategoryPath[$cp_size - 1]) . "'\n                       AND p.categories_id = '" . intval($current_category_id) . "'";
                $parent_categories = $dbconn->GetRow($query);
                $gparent_id = $parent_categories['gparent_id'];
                $parent_id = $parent_categories['parent_id'];
            }
            if ($parent_id == $gparent_id) {
                for ($i = 0; $i < $cp_size - 1; $i++) {
                    $categories_new .= '_' . $aCategoryPath[$i];
                }
            } else {
                for ($i = 0; $i < $cp_size; $i++) {
                    $categories_new .= '_' . $aCategoryPath[$i];
                }
            }
            $categories_new .= '_' . $current_category_id;
            if (substr($categories_new, 0, 1) == '_') {
                $categories_new = substr($categories_new, 1);
            }
        }
    } else {
        $categories_new = implode('_', $aCategoryPath);
    }
    return 'categories=' . $categories_new;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:44,代码来源:function_default.php


示例19: oos_generate_news_category_path

/**
 * Return Category Path
 *
 * @param $id
 * @param $from
 * @param $news_categories_array
 * @param $index
 * @return string
 */
function oos_generate_news_category_path($id, $from = 'news_category', $news_categories_array = '', $index = 0)
{
    if (!is_array($news_categories_array)) {
        $news_categories_array = array();
    }
    // Get database information
    $dbconn =& oosDBGetConn();
    $oostable =& oosDBGetTables();
    if ($from == 'news') {
        $news_categories_query = "SELECT news_categories_id\n                                FROM " . $oostable['news_to_categories'] . "\n                                WHERE news_id = '" . $id . "'";
        $news_categories_result =& $dbconn->Execute($news_categories_query);
        while ($news_categories = $news_categories_result->fields) {
            if ($news_categories['news_categories_id'] == '0') {
                $news_categories_array[$index][] = array('id' => '0', 'text' => TEXT_TOP);
            } else {
                $news_category_query = "SELECT ncd.news_categories_name, nc.parent_id\n                                  FROM " . $oostable['news_categories'] . " nc,\n                                       " . $oostable['news_categories_description'] . " ncd\n                                 WHERE nc.news_categories_id = '" . $news_categories['news_categories_id'] . "' \n                                   AND nc.news_categories_id = ncd.news_categories_id\n                                   AND ncd.news_categories_languages_id = '" . intval($_SESSION['language_id']) . "'";
                $news_category_result =& $dbconn->Execute($news_categories_query);
                $news_category = $news_category_result->fields;
                $news_categories_array[$index][] = array('id' => $news_categories['news_categories_id'], 'text' => $news_category['news_categories_name']);
                if (oos_is_not_null($news_category['parent_id']) && $news_category['parent_id'] != '0') {
                    $news_categories_array = oos_generate_news_category_path($news_category['parent_id'], 'news_category', $news_categories_array, $index);
                }
                $news_categories_array[$index] = array_reverse($news_categories_array[$index]);
            }
            $index++;
            // Move that ADOdb pointer!
            $news_categories_result->MoveNext();
        }
        // Close result set
        $news_categories_result->Close();
    } elseif ($from == 'news_category') {
        $news_category_query = "SELECT ncd.news_categories_name, nc.parent_id\n                              FROM " . $oostable['news_categories'] . " nc,\n                                   " . $oostable['news_categories_description'] . " ncd\n                              WHERE nc.news_categories_id = '" . $id . "'\n                                AND nc.news_categories_id = ncd.news_categories_id\n                                AND ncd.news_categories_languages_id = '" . intval($_SESSION['language_id']) . "'";
        $news_category_result =& $dbconn->Execute($news_category_query);
        $news_category = $news_category_result->fields;
        // Close result set
        $news_category_result->Close();
        $news_categories_array[$index][] = array('id' => $id, 'text' => $news_category['news_categories_name']);
        if (oos_is_not_null($news_category['parent_id']) && $news_category['parent_id'] != '0') {
            $news_categories_array = oos_generate_news_category_path($news_category['parent_id'], 'news_category', $news_categories_array, $index);
        }
    }
    return $news_categories_array;
}
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:52,代码来源:function_news.php


示例20: array

        $contents = array('form' => oos_draw_form('manufacturers', $aFilename['manufacturers'], 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=deleteconfirm'));
        $contents[] = array('text' => TEXT_DELETE_INTRO);
        $contents[] = array('text' => '<br /><b>' . $mInfo->manufacturers_name . '</b>');
        $contents[] = array('text' => '<br />' . oos_draw_checkbox_field('delete_image', '', true) . ' ' . TEXT_DELETE_IMAGE);
        if ($mInfo->products_count > 0) {
            $contents[] = array('text' => '<br />' . oos_draw_checkbox_field('delete_products') . ' ' . TEXT_DELETE_PRODUCTS);
            $contents[] = array('text' => '<br />' . sprintf(TEXT_DELETE_WARNING_PRODUCTS, $mInfo->products_count));
        }
        $contents[] = array('align' => 'center', 'text' => '<br />' . oos_image_swap_submits('delete', 'delete_off.gif', IMAGE_DELETE) . ' <a href="' . oos_href_link_admin($aFilename['manufacturers'], 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id) . '">' . oos_image_swap_button('cancel', 'cancel_off.gif', IMAGE_CANCEL) . '</a>');
        break;
    default:
        if (isset($mInfo) && is_object($mInfo)) {
            $heading[] = array('text' => '<b>' . $mInfo->manufacturers_name . '</b>');
            $contents[] = array('align' => 'center', 'text' => '<a href="' . oos_href_link_admin($aFilename['manufacturers'], 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=edit') . '">' . oos_image_swap_button('edit', 'edit_off.gif', IMAGE_EDIT) . '</a> <a href="' . oos_href_link_admin($aFilename['manufacturers'], 'page=' . $_GET['page'] . '&mID=' . $mInfo->manufacturers_id . '&action=delete') . '">' . oos_image_swap_button('delete', 'delete_off.gif', IMAGE_DELETE) . '</a>');
            $contents[] = array('text' => '<br />' . TEXT_DATE_ADDED . ' ' . oos_date_short($mInfo->date_added));
            if (oos_is_not_null($mInfo->last_modified)) {
                $contents[] = array('text' => TEXT_LAST_MODIFIED . ' ' . oos_date_short($mInfo->last_modified));
            }
            $contents[] = array('text' => '<br />' . oos_info_image($mInfo->manufacturers_image, $mInfo->manufacturers_name));
            $contents[] = array('text' => '<br />' . TEXT_PRODUCTS . ' ' . $mInfo->products_count);
        }
        break;
}
if (!empty($heading) && !empty($contents)) {
    echo '            <td width="25%" valign="top">' . "\n";
    $box = new box();
    echo $box->infoBox($heading, $contents);
    echo '            </td>' . "\n";
}
?>
          </tr>
开发者ID:BackupTheBerlios,项目名称:oos-svn,代码行数:31,代码来源:manufacturers.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP oos_mail函数代码示例发布时间:2022-05-15
下一篇:
PHP oos_image_swap_submits函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap