本文整理汇总了PHP中olc_not_null函数的典型用法代码示例。如果您正苦于以下问题:PHP olc_not_null函数的具体用法?PHP olc_not_null怎么用?PHP olc_not_null使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了olc_not_null函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: olc_image_submit
function olc_image_submit($src, $alt = '', $parameters = '', $Ajax_reset_cart_data_dirty = false)
{
$rep = array(QUOTE => '"');
$src = olc_parse_input_field_data($src, $rep);
if (IS_ADMIN_FUNCTION) {
$src = CURRENT_TEMPLATE_ADMIN_BUTTONS . $src;
} else {
$src = CURRENT_TEMPLATE_BUTTONS . $src;
}
/*
if (IS_MULTI_SHOP)
{
$src=olc_set_multi_shop_dir_info($src);
}
*/
$src = '<input type="image" class="image" src="' . $src . '" style="border:0px"';
if (olc_not_null($alt)) {
$alt = olc_parse_input_field_data($alt, $rep);
$src .= ' title="' . $alt . QUOTE;
}
$src .= ' alt="' . $alt . QUOTE;
//W. Kaiser - AJAX
if ($Ajax_reset_cart_data_dirty) {
//Reset "cart_data_dirty"-flag, if form is submitted
$parameters .= ' onclick="javascript:sticky_cart_data_dirty=false;"';
}
if (olc_not_null($parameters)) {
$src .= BLANK . $parameters;
}
$src .= '/>';
return $src;
}
示例2: quote
function quote($method = '')
{
global $order, $shipping_weight, $shipping_num_boxes;
if (!$order) {
$order = new order();
$shipping_weight = $_SESSION['cart']->show_weight();
}
$order_delivery_country = $order->delivery['country'];
if (MODULE_SHIPPING_TABLE_MODE == 'price') {
$order_total = $_SESSION['cart']->show_total();
} 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'] = olc_get_tax_rate($this->tax_class, $order_delivery_country['id'], $order->delivery['zone_id']);
}
if (olc_not_null($this->icon)) {
$this->quotes['icon'] = olc_image($this->icon, $this->title);
}
return $this->quotes;
}
示例3: olc_draw_pull_down_menu
function olc_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false, $AJAX_validation = false)
{
$field = '<select name="' . $name . '" id="' . $name . QUOTE;
if ($AJAX_validation) {
$field .= '" onchange="pull_down_menu_change(this);"';
}
//W. Kaiser - AJAX
if (olc_not_null($parameters)) {
$field .= BLANK . $parameters;
}
$field .= '>';
if (empty($default) && isset($GLOBALS[$name])) {
$default = $GLOBALS[$name];
}
$special = array(QUOTE => '"', '\'' => ''', '<' => '<', '>' => '>');
for ($i = 0, $n = sizeof($values); $i < $n; $i++) {
$id = $values[$i]['id'];
$field .= '<option value="' . htmlentities(olc_parse_input_field_data($id, array(QUOTE => '"'))) . QUOTE;
if ($default == $id) {
$field .= ' selected="selected"';
}
//$field .= '>' . htmlentities(olc_parse_input_field_data($values[$i]['text'],$special)) . '</option>';
$field .= '>' . olc_parse_input_field_data($values[$i]['text'], $special) . '</option>';
}
$field .= '</select>';
//W. Kaiser - AJAX
if (USE_AJAX) {
$field = "<span id=\"" . $name . "_select\">" . $field . "</span>";
}
//W. Kaiser - AJAX
if ($required) {
$field .= TEXT_FIELD_REQUIRED;
}
return $field;
}
示例4: olc_get_countries
function olc_get_countries($countries_id = '', $with_iso_codes = false)
{
$countries_id_text = 'countries_id';
$countries_name_text = 'countries_name';
$select = "select countries_name";
$select_countries_id = $select . ", " . $countries_id_text;
$from = " from " . TABLE_COUNTRIES;
$countries_array = array();
if (olc_not_null($countries_id)) {
$where = $from . " where countries_id = '" . $countries_id . APOS;
if ($with_iso_codes) {
$countries_iso_code_text = 'countries_iso_code_';
$countries_iso_code_2_text = $countries_iso_code_text . '2';
$countries_iso_code_3_text = $countries_iso_code_text . '3';
$countries = olc_db_query($select_countries_id . ", " . $countries_iso_code_2_text . $where);
$countries_values = olc_db_fetch_array($countries);
$countries_array = array($countries_name_text => $countries_values[$countries_name_text], $countries_iso_code_2_text => $countries_values[$countries_iso_code_2_text], $countries_iso_code_3_text => $countries_values[$countries_iso_code_3_text]);
} else {
$countries = olc_db_query($select . $where);
$countries_values = olc_db_fetch_array($countries);
$countries_array = array($countries_name_text => $countries_values[$countries_name_text]);
}
} else {
$countries = olc_db_query($select_countries_id . $from . " order by " . $countries_name_text);
while ($countries_values = olc_db_fetch_array($countries)) {
$countries_array[] = array($countries_id_text => $countries_values[$countries_id_text], $countries_name_text => $countries_values[$countries_name_text]);
}
}
return $countries_array;
}
示例5: quote
function quote($method = '')
{
// W. Kaiser - Show missing amount for free shipping
$CurrentAmount = $_SESSION['cart']->show_total();
// W. Kaiser - Free shipping national/international
require_once DIR_FS_INC . 'olc_get_free_shipping_amount.inc.php';
olc_get_free_shipping_amount();
if (FREE_AMOUNT > 0) {
$MissingAmount = FREE_AMOUNT - $CurrentAmount;
if ($MissingAmount > 0 && MODULE_SHIPPING_FREECOUNT_DISPLAY == FALSE_STRING_L) {
return;
}
// W. Kaiser - Free shipping national/international
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREECOUNT_TEXT_TITLE);
if ($MissingAmount > 0) {
$this->quotes['error'] = MODULE_SHIPPING_FREECOUNT_TEXT_WAY . HTML_B_START . olc_format_price($MissingAmount, 1, 1, 1) . '</b>)';
} else {
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREECOUNT_TEXT_WAY, 'cost' => 0));
if (olc_not_null($this->icon)) {
$this->quotes['icon'] = olc_image($this->icon, $this->title);
}
}
}
return $this->quotes;
//W. Kaiser - Show missing amount for free shippin
}
示例6: olc_display_banner
function olc_display_banner($action, $identifier)
{
if ($action == 'dynamic') {
$banners_query = olc_db_query(SELECT_COUNT . " as count from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
$banners = olc_db_fetch_array($banners_query);
if ($banners['count'] > 0) {
$banner = olc_random_select("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_group = '" . $identifier . APOS);
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> No banners with group \'' . $identifier . '\' found!</b>';
}
} elseif ($action == 'static') {
if (is_array($identifier)) {
$banner = $identifier;
} else {
$banner_query = olc_db_query("select banners_id, banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where status = '1' and banners_id = '" . $identifier . APOS);
if (olc_db_num_rows($banner_query)) {
$banner = olc_db_fetch_array($banner_query);
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Banner with id \'' . $identifier . '\' not found, or status inactive</b>';
}
}
} else {
return '<b>OLC ERROR! (olc_display_banner(' . $action . ', ' . $identifier . ') -> Unknown $action parameter value - it must be either \'dynamic\' or \'static\'' . HTML_B_END;
}
if (olc_not_null($banner['banners_html_text'])) {
$banner_string = $banner['banners_html_text'];
} else {
$banner_string = HTML_A_START . olc_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . olc_image(DIR_WS_IMAGES . 'banner/' . $banner['banners_image'], $banner['banners_title']) . HTML_A_END;
}
olc_update_banner_display_count($banner['banners_id']);
return $banner_string;
}
示例7: olc_get_path
function olc_get_path($current_category_id = EMPTY_STRING)
{
global $cPath_array;
if (olc_not_null($current_category_id)) {
$cp_size = sizeof($cPath_array);
if ($cp_size == 0) {
$cPath_new = $current_category_id;
} else {
$cPath_new = EMPTY_STRING;
$sql0 = "select parent_id from " . TABLE_CATEGORIES . " where categories_id = '#'";
$sql = str_replace(HASH, $cPath_array[$cp_size - 1], $sql0);
$last_category_query = olc_db_query($sql);
$last_category = olc_db_fetch_array($last_category_query);
$sql = str_replace(HASH, $current_category_id, $sql0);
$current_category_query = olc_db_query($sql);
$current_category = olc_db_fetch_array($current_category_query);
if ($last_category['parent_id'] == $current_category['parent_id']) {
for ($i = 0, $n = $cp_size - 1; $i < $n; $i++) {
$cPath_new .= UNDERSCORE . $cPath_array[$i];
}
} else {
for ($i = 0; $i < $cp_size; $i++) {
$cPath_new .= UNDERSCORE . $cPath_array[$i];
}
}
$cPath_new .= UNDERSCORE . $current_category_id;
if (substr($cPath_new, 0, 1) == UNDERSCORE) {
$cPath_new = substr($cPath_new, 1);
}
}
} else {
$cPath_new = implode(UNDERSCORE, $cPath_array);
}
return 'cPath=' . $cPath_new;
}
示例8: paypal_payment_status
function paypal_payment_status($order_id)
{
include_once PAYPAL_IPN_DIR . 'inc.php';
$paypal_payment_status_query = olc_db_query("select p.payment_status from " . TABLE_PAYPAL . " p left join " . TABLE_ORDERS . " o on p.paypal_id = o.payment_id where o.orders_id ='" . (int) $order_id . APOS);
$paypal_payment_status = olc_db_fetch_array($paypal_payment_status_query);
//quick work around for unkown order status id
return $paypal_payment_status_value = olc_not_null($paypal_payment_status['payment_status']) ? $paypal_payment_status['payment_status'] : '';
}
示例9: olc_validate_password
function olc_validate_password($plain, $encrypted)
{
if (olc_not_null($plain) && olc_not_null($encrypted)) {
// split apart the hash / salt
return $encrypted == md5($plain);
} else {
return false;
}
}
示例10: quote
function quote($method = '')
{
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_VERSANDMAIL_TEXT_TITLE);
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => MODULE_SHIPPING_VERSANDMAIL_TEXT_WAY, 'cost' => 0));
if (olc_not_null($this->icon)) {
$this->quotes['icon'] = olc_image($this->icon, $this->title);
}
return $this->quotes;
}
示例11: olc_draw_textarea_field
function olc_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true)
{
$field = '<textarea name="' . olc_parse_input_field_data($name, array('"' => '"')) . '" wrap="' . olc_parse_input_field_data($wrap, array('"' => '"')) . '" cols="' . olc_parse_input_field_data($width, array('"' => '"')) . '" rows="' . olc_parse_input_field_data($height, array('"' => '"')) . '"';
if (olc_not_null($parameters)) {
$field .= BLANK . $parameters;
}
$field .= '>' . $text . '</textarea>';
return $field;
}
示例12: olc_hide_session_id
function olc_hide_session_id()
{
global $session_started;
if ($session_started) {
if (defined('SID')) {
if (olc_not_null(SID)) {
return olc_draw_hidden_field(olc_session_name(), olc_session_id());
}
}
}
}
示例13: olc_validate_password_enc
function olc_validate_password_enc($enc, $enc_org)
{
if (olc_not_null($enc) && olc_not_null($enc_org)) {
$stack = explode(':', $enc_org);
if ($enc == $stack[0]) {
return true;
} else {
return false;
}
}
return false;
}
示例14: checkdnsrr
function checkdnsrr($host, $type)
{
if (olc_not_null($host) && olc_not_null($type)) {
@exec("nslookup -type={$type} {$host}", $output);
while (list($k, $line) = each($output)) {
if (eregi("^{$host}", $line)) {
return true;
}
}
}
return false;
}
示例15: vat_validation
function vat_validation($vat_id = '', $customers_id = '', $customers_status = '', $country_id = '', $guest = false)
{
$this->vat_info = array();
$this->live_check = ACCOUNT_COMPANY_VAT_LIVE_CHECK;
if (olc_not_null($vat_id)) {
$this->getInfo($vat_id, $customers_id, $customers_status, $country_id, $guest);
} else {
if ($guest) {
$this->vat_info = array('status' => DEFAULT_CUSTOMERS_STATUS_ID_GUEST);
} else {
$this->vat_info = array('status' => DEFAULT_CUSTOMERS_STATUS_ID);
}
}
}