本文整理汇总了PHP中smn_not_null函数的典型用法代码示例。如果您正苦于以下问题:PHP smn_not_null函数的具体用法?PHP smn_not_null怎么用?PHP smn_not_null使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smn_not_null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: quote
function quote($method = '')
{
global $order, $cart, $shipping_weight, $shipping_num_boxes, $store_id;
if (MODULE_SHIPPING_TABLE_MODE == 'price') {
$order_total = $cart->show_total($store_id);
} else {
$order_total = $shipping_weight;
}
$table_cost = split("[:,]", MODULE_SHIPPING_TABLE_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_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'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (smn_not_null($this->icon)) {
$this->quotes['icon'] = smn_image($this->icon, $this->title);
}
return $this->quotes;
}
示例2: getConfigValue
function getConfigValue($gID, $cID)
{
global $filter;
$configuration_query = smn_db_query("select configuration_value, use_function from " . TABLE_CONFIGURATION . " where configuration_id = '" . $cID . "' and configuration_group_id = '" . (int) $gID . "'" . $filter . " order by sort_order");
$configuration = smn_db_fetch_array($configuration_query);
if (smn_not_null($configuration['use_function'])) {
$use_function = $configuration['use_function'];
if (ereg('->', $use_function)) {
$class_method = explode('->', $use_function);
if (!is_object(${$class_method[0]})) {
include DIR_WS_CLASSES . $class_method[0] . '.php';
${$class_method[0]} = new $class_method[0]();
}
$cfgValue = smn_call_function($class_method[1], $configuration['configuration_value'], ${$class_method[0]});
} else {
$cfgValue = smn_call_function($use_function, $configuration['configuration_value']);
}
} else {
$cfgValue = $configuration['configuration_value'];
}
if (empty($cfgValue) && !is_numeric($cfgValue)) {
$cfgValue = ' ';
}
return $cfgValue;
}
示例3: set_language
function set_language($language)
{
if (smn_not_null($language) && isset($this->catalog_languages[$language])) {
$this->language = $this->catalog_languages[$language];
} else {
$this->language = $this->catalog_languages[DEFAULT_LANGUAGE];
}
}
示例4: is_set
function is_set($code)
{
if (isset($this->currencies[$code]) && smn_not_null($this->currencies[$code])) {
return true;
} else {
return false;
}
}
示例5: smn_draw_form
function smn_draw_form($name, $action, $method = 'post', $parameters = '')
{
$form = '<form name="' . smn_parse_input_field_data($name, array('"' => '"')) . '" action="' . smn_parse_input_field_data($action, array('"' => '"')) . '" method="' . smn_parse_input_field_data($method, array('"' => '"')) . '"';
if (smn_not_null($parameters)) {
$form .= ' ' . $parameters;
}
$form .= '>';
return $form;
}
示例6: quote
function quote($method = '')
{
global $order;
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PICK_UP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PICK_UP_TEXT_WAY, 'cost' => MODULE_SHIPPING_PICK_UP_COST)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (smn_not_null($this->icon)) {
$this->quotes['icon'] = smn_image($this->icon, $this->title);
}
return $this->quotes;
}
示例7: 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' => '<FONT COLOR=FF0000><B>' . MODULE_SHIPPING_FREESHIPPER_TEXT_WAY . '</B></FONT>', 'cost' => SHIPPING_HANDLING + MODULE_SHIPPING_FREESHIPPER_COST)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = smn_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (smn_not_null($this->icon)) {
$this->quotes['icon'] = smn_image($this->icon, $this->title);
}
return $this->quotes;
}
示例8: smn_validate_password
function smn_validate_password($plain, $encrypted)
{
if (smn_not_null($plain) && smn_not_null($encrypted)) {
// split apart the hash / salt
$stack = explode(':', $encrypted);
if (sizeof($stack) != 2) {
return false;
}
if (md5($stack[1] . $plain) == $stack[0]) {
return true;
}
}
return false;
}
示例9: trail
function trail($separator = ' - ')
{
$trail_string = '';
for ($i = 0, $n = sizeof($this->_trail); $i < $n; $i++) {
if (isset($this->_trail[$i]['link']) && smn_not_null($this->_trail[$i]['link'])) {
$trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>';
} else {
$trail_string .= $this->_trail[$i]['title'];
}
if ($i + 1 < $n) {
$trail_string .= $separator;
}
}
return $trail_string;
}
示例10: SetSize
function SetSize($length = '', $width = '', $height = '', $units = '')
{
if (smn_not_null($length)) {
$this->Length = $length;
}
if (smn_not_null($width)) {
$this->Width = $width;
}
if (smn_not_null($height)) {
$this->Height = $height;
}
if (smn_not_null($units)) {
$this->DimUnit = $units;
}
}
示例11: payment
function payment($module = '')
{
global $payment, $language, $PHP_SELF, $store_id, $cart;
if (defined('MODULE_PAYMENT_INSTALLED') && smn_not_null(MODULE_PAYMENT_INSTALLED)) {
$this->modules = explode(';', MODULE_PAYMENT_INSTALLED);
$include_modules = array();
$prepare_module_string = str_replace('.php', '', MODULE_PAYMENT_INSTALLED);
$initial_module_string = str_replace(";", "' or page_name= '", $prepare_module_string);
$text_contents_conditions = " and page_name= '" . $initial_module_string . "'";
$content_query = smn_db_query("select text_key, text_content from " . TABLE_WEB_SITE_CONTENT . " where store_id = '" . $store_id . "' " . $text_contents_conditions);
while ($text_contents = smn_db_fetch_array($content_query)) {
define($text_contents['text_key'], $text_contents['text_content']);
}
if (smn_not_null($module) && in_array($module . '.' . substr($PHP_SELF, strrpos($PHP_SELF, '.') + 1), $this->modules)) {
$this->selected_module = $module;
$include_modules[] = array('class' => $module, 'file' => $module . '.php');
$text_contents_conditions = " and page_name= '" . $module . "'";
} else {
reset($this->modules);
if (smn_get_configuration_key_value('MODULE_PAYMENT_FREECHARGER_STATUS') and ($cart->show_total() == 0 and $cart->show_weight == 0)) {
$this->selected_module = $module;
$include_modules[] = array('class' => 'freecharger', 'file' => 'freecharger.php');
} else {
// All Other Payment Modules
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
// Don't show Free Payment Module
if ($class != 'freecharger') {
$include_modules[] = array('class' => $class, 'file' => $value);
}
}
}
}
for ($i = 0, $n = sizeof($include_modules); $i < $n; $i++) {
include DIR_WS_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
// $_POST['payment'] value which will be empty (no radio button selection possible)
if (smn_count_payment_modules() == 1 && (!isset($GLOBALS[$payment]) || isset($GLOBALS[$payment]) && !is_object($GLOBALS[$payment]))) {
$payment = $include_modules[0]['class'];
}
if (smn_not_null($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
}
}
示例12: saveSiteText
function saveSiteText()
{
global $messageStack, $jQuery;
$text_key = smn_db_prepare_input($_POST['text_key']);
$page_name = smn_db_prepare_input($_POST['page_name']);
$hiddenAction = smn_db_prepare_input($_POST['hidden_action']);
if ($hiddenAction == 'new' && smn_not_null($_POST['new_page_name'])) {
$page_name = smn_db_prepare_input($_POST['new_page_name']);
}
$text_content = smn_db_prepare_input($_POST['text_content']);
$error = false;
$textExists = $this->exists($page_name, $text_key);
if ($textExists && $hiddenAction == 'new') {
$this->setJsonResponse('{
success: false,
error: "Duplicate Page/Key Combination Exsist."
}');
return false;
}
for ($i = 0, $n = sizeof($this->langArray); $i < $n; $i++) {
$sql_data_array = array('store_id' => $this->storeID, 'page_name' => $page_name, 'text_key' => $text_key, 'language_id' => $this->langArray[$i]['id'], 'text_content' => $text_content[$this->langArray[$i]['id']], 'date_modified' => 'now()');
if ($textExists === true) {
smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array, 'update', 'page_name = "' . $page_name . '" and text_key = "' . $text_key . '" and language_id = "' . $this->langArray[$i]['id'] . '" and store_id = "' . $this->storeID . '"');
if (mysql_affected_rows() < 0) {
smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array);
}
} else {
smn_db_perform(TABLE_WEB_SITE_CONTENT, $sql_data_array);
}
}
$Qcontent = smn_db_query('select page_name, text_key, date_modified from ' . TABLE_WEB_SITE_CONTENT . ' where language_id = "' . $this->languageID . '" and store_id = "' . $this->storeID . '" and page_name = "' . $page_name . '" and text_key = "' . $text_key . '"');
$content = smn_db_fetch_array($Qcontent);
$multiLanguage = array();
for ($i = 0, $n = sizeof($this->langArray); $i < $n; $i++) {
$multiLanguage[] = 'text_content_' . $this->langArray[$i]['id'] . ': "' . $jQuery->jsonHtmlPrepare($text_content[$this->langArray[$i]['id']]) . '"';
}
$this->setJsonResponse('{
success: true,
page_name: "' . $content['page_name'] . '",
text_key: "' . $content['text_key'] . '",
date_modified: "' . $content['date_modified'] . '",
' . implode(',', $multiLanguage) . '
}');
return true;
}
示例13: process
function process()
{
global $order, $currencies;
global $store;
if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {
switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
case 'national':
if ($order->delivery['country_id'] == $store->get_store_country()) {
$pass = true;
}
break;
case 'international':
if ($order->delivery['country_id'] != $store->get_store_country()) {
$pass = true;
}
break;
case 'both':
$pass = true;
break;
default:
$pass = false;
break;
}
if ($pass == true && $order->info['total'] - $order->info['shipping_cost'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
$order->info['shipping_method'] = FREE_SHIPPING_TITLE;
$order->info['total'] -= $order->info['shipping_cost'];
$order->info['shipping_cost'] = 0;
}
}
$module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));
if (smn_not_null($order->info['shipping_method'])) {
if ($GLOBALS[$module]->tax_class > 0) {
$shipping_tax = smn_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$shipping_tax_description = smn_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
$order->info['tax'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
$order->info['tax_groups']["{$shipping_tax_description}"] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
$order->info['total'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$order->info['shipping_cost'] += smn_calculate_tax($order->info['shipping_cost'], $shipping_tax);
}
}
$this->output[] = array('title' => $order->info['shipping_method'] . ':', 'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']), 'value' => $order->info['shipping_cost']);
}
}
示例14: display_links
function display_links($max_page_links, $parameters = '')
{
global $PHP_SELF, $request_type;
$display_links_string = '';
$class = 'class="pageResults"';
if (smn_not_null($parameters) && substr($parameters, -1) != '&') {
$parameters .= '&';
}
// previous button - not displayed on first page
if ($this->current_page_number > 1) {
$display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($this->current_page_number - 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a> ';
}
// check if number_of_pages > $max_page_links
$cur_window_num = intval($this->current_page_number / $max_page_links);
if ($this->current_page_number % $max_page_links) {
$cur_window_num++;
}
$max_window_num = intval($this->number_of_pages / $max_page_links);
if ($this->number_of_pages % $max_page_links) {
$max_window_num++;
}
// previous window of pages
if ($cur_window_num > 1) {
$display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($cur_window_num - 1) * $max_page_links, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PREV_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a>';
}
// page nn button
for ($jump_to_page = 1 + ($cur_window_num - 1) * $max_page_links; $jump_to_page <= $cur_window_num * $max_page_links && $jump_to_page <= $this->number_of_pages; $jump_to_page++) {
if ($jump_to_page == $this->current_page_number) {
$display_links_string .= ' <b>' . $jump_to_page . '</b> ';
} else {
$display_links_string .= ' <a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . $jump_to_page, $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_PAGE_NO, $jump_to_page) . ' "><u>' . $jump_to_page . '</u></a> ';
}
}
// next window of pages
if ($cur_window_num < $max_window_num) {
$display_links_string .= '<a href="' . smn_href_link(basename($PHP_SELF), $parameters . $this->page_name . '=' . ($cur_window_num * $max_page_links + 1), $request_type) . '" class="pageResults" title=" ' . sprintf(PREVNEXT_TITLE_NEXT_SET_OF_NO_PAGE, $max_page_links) . ' ">...</a> ';
}
// next button
if ($this->current_page_number < $this->number_of_pages && $this->number_of_pages != 1) {
$display_links_string .= ' <a href="' . smn_href_link(basename($PHP_SELF), $parameters . 'page=' . ($this->current_page_number + 1), $request_type) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> ';
}
return $display_links_string;
}
示例15: 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();
for ($i = 0, $n = sizeof($GLOBALS[$class]->output); $i < $n; $i++) {
if (smn_not_null($GLOBALS[$class]->output[$i]['title']) && smn_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;
}