本文整理汇总了PHP中oos_var_prep_for_os函数的典型用法代码示例。如果您正苦于以下问题:PHP oos_var_prep_for_os函数的具体用法?PHP oos_var_prep_for_os怎么用?PHP oos_var_prep_for_os使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了oos_var_prep_for_os函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set
function set($sLang = '')
{
if (!empty($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']));
}
}
示例2: payment
function payment($module = '')
{
global $aLang;
if (defined('MODULE_PAYMENT_INSTALLED') && !empty($_SESSION['member']->group['payment'])) {
$this->modules = explode(';', $_SESSION['member']->group['payment']);
$include_modules = array();
if (!empty($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']);
$nArrayCountModules = count($include_modules);
for ($i = 0, $n = $nArrayCountModules; $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 (!empty($module) && in_array($module, $this->modules) && isset($GLOBALS[$module]->form_action_url)) {
$this->form_action_url = $GLOBALS[$module]->form_action_url;
}
}
}
示例3: __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'];
}
}
}
示例4: smarty_outputfilter_highlight
function smarty_outputfilter_highlight($source, &$smarty)
{
$highlight = $_REQUEST['highlight'];
if (isset($_GET['keywords'])) {
$highlight .= oos_var_prep_for_os($_GET['keywords']);
}
$highlight = strip_tags($highlight);
$sStrSize = strlen($highlight);
if ($sStrSize <= 5) {
return $source;
}
if (eregi(oos_server_get_var('HTTP_HOST'), oos_server_get_var('HTTP_REFERER'))) {
if (!isset($highlight) || empty($highlight)) {
return $source;
}
} else {
MyOOS_CoreApi::requireOnce('classes/class_referrer.php');
$referrer = new referrer();
$highlight .= $referrer->getKeywords();
}
$words = $highlight;
if (!isset($highlight) || empty($highlight)) {
return $source;
}
// Pull out the script blocks
preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
$_script_blocks = $match[0];
$source = preg_replace("!<script[^>]+>.*?</script>!is", '@@@=====@@@', $source);
preg_match_all("!<a onmouseo[^>]+>.*!is", $source, $match);
$_onmouse_block = $match[0];
$source = preg_replace("!<a onmouseo[^>]+>.*!is", '@@@#=====#@@@', $source);
// pull out all html tags
preg_match_all("'<[\\/\\!]*?[^<>]*'si", $source, $match);
$_tag_blocks = $match[0];
$source = preg_replace("'<[\\/\\!]*?[^<>]*'si", '@@@:=====:@@@', $source);
// This array is used to choose colors for supplied highlight terms
$colorArr = array('#ffff66', '#ff9999', '#A0FFFF', '#ff66ff', '#99ff99');
// Wrap all the highlight words with tags bolding them and changing
// their background colors
$wordArr = split(" ", addslashes($words));
$i = 0;
foreach ($wordArr as $word) {
$word = preg_quote($word);
$source = preg_replace('~(' . $word . ')~si', '<span style="color:black;background-color:' . $colorArr[$i] . ';">$1</span>', $source);
$i++;
}
// replace script blocks
foreach ($_script_blocks as $curr_block) {
$source = preg_replace("!@@@=====@@@!", $curr_block, $source, 1);
}
foreach ($_onmouse_block as $curr_block) {
$source = preg_replace("!@@@#=====#@@@!", $curr_block, $source, 1);
}
foreach ($_tag_blocks as $curr_block) {
$source = preg_replace("!@@@:=====:@@@!", $curr_block, $source, 1);
}
return $source;
}
示例5: create_plugin_instance
function create_plugin_instance()
{
$aFilename = oos_get_filename();
$aModules = oos_get_modules();
if ($_GET['file'] != $aFilename['login'] && !isset($_SESSION['customer_id'])) {
$cookie_url_array = parse_url((ENABLE_SSL == true ? OOS_HTTPS_SERVER : OOS_HTTP_SERVER) . substr(OOS_SHOP, 0, -1));
$cookie_path = $cookie_url_array['path'];
if (isset($_COOKIE['email_address']) && isset($_COOKIE['password'])) {
// Get database information
$dbconn =& oosDBGetConn();
$oostable =& oosDBGetTables();
$customerstable = $oostable['customers'];
$sql = "SELECT customers_id, customers_gender, customers_firstname, customers_lastname,\n customers_password, customers_wishlist_link_id, customers_language,\n customers_vat_id_status, customers_email_address, customers_default_address_id,\n customers_max_order\n FROM {$customerstable}\n WHERE customers_login = '1'\n AND customers_email_address = '" . oos_db_input($_COOKIE['email_address']) . "'";
$check_customer_result = $dbconn->Execute($sql);
if ($check_customer_result->RecordCount()) {
$check_customer = $check_customer_result->fields;
if (oos_validate_password($_COOKIE['password'], $check_customer['customers_password'])) {
$address_booktable = $oostable['address_book'];
$sql = "SELECT entry_country_id, entry_zone_id\n FROM {$address_booktable}\n WHERE customers_id = '" . $check_customer['customers_id'] . "'\n AND address_book_id = '1'";
$check_country = $dbconn->GetRow($sql);
if ($check_customer['customers_language'] == '') {
$sLanguage = oos_var_prep_for_os($_SESSION['language']);
$customerstable = $oostable['customers'];
$dbconn->Execute("UPDATE {$customerstable}\n SET customers_language = '" . oos_db_input($sLanguage) . "'\n WHERE customers_id = '" . intval($check_customer['customers_id']) . "'");
}
$_SESSION['customer_wishlist_link_id'] = $check_customer['customers_wishlist_link_id'];
$_SESSION['customer_id'] = $check_customer['customers_id'];
$_SESSION['customer_default_address_id'] = $check_customer['customers_default_address_id'];
if (ACCOUNT_GENDER == '1') {
$_SESSION['customer_gender'] = $check_customer['customers_gender'];
}
$_SESSION['customer_first_name'] = $check_customer['customers_firstname'];
$_SESSION['customer_lastname'] = $check_customer['customers_lastname'];
$_SESSION['customer_max_order'] = $check_customer['customers_max_order'];
$_SESSION['customer_country_id'] = $check_country['entry_country_id'];
$_SESSION['customer_zone_id'] = $check_country['entry_zone_id'];
if (ACCOUNT_VAT_ID == '1') {
$_SESSION['customers_vat_id_status'] = $check_customer['customers_vat_id_status'];
}
$_SESSION['member']->restore_group();
setcookie('email_address', $email_address, time() + 365 * 24 * 3600, $cookie_path, '', getenv('HTTPS') == 'on' ? 1 : 0);
setcookie('password', $check_customer['customers_password'], time() + 365 * 24 * 3600, $cookie_path, '', getenv('HTTPS') == 'on' ? 1 : 0);
$customers_infotable = $oostable['customers_info'];
$dbconn->Execute("UPDATE {$customers_infotable}\n SET customers_info_date_of_last_logon = '" . date("Y-m-d H:i:s", time()) . "',\n customers_info_number_of_logons = customers_info_number_of_logons+1\n WHERE customers_info_id = '" . intval($_SESSION['customer_id']) . "'");
$_SESSION['cart']->restore_contents();
// restore cart contents
}
}
}
}
return true;
}
示例6: smarty_function_swap_product_image
/**
* Smarty {swap_product_image} function plugin
*
* Type: function<br>
* Name: swap_product_image<br>
* Date: Oct 09, 2006<br>
* Purpose: format HTML tags for the image<br>
* Input:<br>
* - image = image width (optional, default actual width)
* - border = border width (optional, default 0)
* - height = image height (optional, default actual height)
*
* Examples: {swap_product_image id="featured" image=$random.products_image alt=$random.products_name|strip_tags}
* Output: <img id="featured" src="images/product_image.jpg" border="0" alt="products_name" onmouseover="imgSwap(this)" onmouseout="imgSwap(this)"/>
* @author r23 <info@r23.de>
* @version 1.0
* @param array
* @param Smarty
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_swap_product_image($params, &$smarty)
{
MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');
$basedir = OOS_IMAGES;
$height = SMALL_IMAGE_HEIGHT;
$width = SMALL_IMAGE_WIDTH;
$border = 0;
$alt = '';
$image = '';
$extra = '';
$sLanguage = oos_var_prep_for_os($_SESSION['language']);
foreach($params as $_key => $_val) {
switch($_key) {
case 'id':
case 'image':
case 'border':
case 'height':
case 'width':
case 'basedir':
case 'alt':
if (!is_array($_val)) {
$$_key = smarty_function_escape_special_chars($_val);
} else {
$smarty->trigger_error("small_product_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
default:
if (!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("small_product_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
$image = $basedir . $image;
if ((empty($image) || ($image == OOS_IMAGES)) && (IMAGE_REQUIRED == '0')) {
return false;
}
return '<img id="'.$id.'" src="'.$image.'" alt="'.$alt.'" border="'.$border.'" width="'.$width.'" height="'.$height.'"'.$extra.' onmouseover="imgSwap(this)" onmouseout="imgSwap(this)" />';
}
示例7: create_plugin_instance
function create_plugin_instance()
{
global $oCurrencies;
MyOOS_CoreApi::requireOnce('classes/class_currencies.php');
$oCurrencies = new currencies();
// currency
if (!isset($_SESSION['currency']) || isset($_GET['currency']) || USE_DEFAULT_LANGUAGE_CURRENCY == '1' && LANGUAGE_CURRENCY != $_SESSION['currency']) {
if (isset($_GET['currency']) && oos_currency_exits($_GET['currency'])) {
$_SESSION['currency'] = oos_var_prep_for_os($_GET['currency']);
} else {
$_SESSION['currency'] = USE_DEFAULT_LANGUAGE_CURRENCY == '1' ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;
}
}
return true;
}
示例8: smarty_function_html_iframe
/**
* Smarty {html_iframe} function plugin
*
* Type: function<br>
* Name: html_image_button<br>
* Date: September 15, 2003
* Input:<br>
* - button = button (and path) of image (required)
* - border = border width (optional, default 0)
* - height = image height (optional, default actual height)
* - basedir = base directory
*
* Examples: {html_iframe doc="gpl.html" class="license" frameborder="0" scrolling="auto"}
* @author r23 <info@r23.de>
* @version 1.0
* @param array
* @param Smarty
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_iframe($params, &$smarty)
{
MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');
$doc = '';
$class = 'license';
$frameborder = 0;
$height = '';
$scrolling = 'auto';
$extra = '';
// $sTheme = oos_var_prep_for_os($_SESSION['theme']);
$sLanguage = oos_var_prep_for_os($_SESSION['language']);
$dir = OOS_SHOP . OOS_MEDIA . $sLanguage . '/';
foreach($params as $_key => $_val) {
switch($_key) {
case 'doc':
case 'class':
case 'frameborder':
case 'scrolling':
if(!is_array($_val)) {
$$_key = smarty_function_escape_special_chars($_val);
} else {
$smarty->trigger_error("html_iframe: attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
default:
if(!is_array($_val)) {
$extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
} else {
$smarty->trigger_error("html_iframe: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
}
break;
}
}
if (empty($doc)) {
$smarty->trigger_error("html_iframe: missing 'doc' parameter", E_USER_NOTICE);
return;
}
return '<iframe src="'.$dir.$doc.'" class="'.$class.'" frameborder="'.$frameborder.'" scrolling="'.$scrolling.'"'.$extra.' /></iframe>';
}
示例9: credit_selection
function credit_selection()
{
global $aLang;
global $oCurrencies;
$sTheme = oos_var_prep_for_os($_SESSION['theme']);
$sLanguage = oos_var_prep_for_os($_SESSION['language']);
$image_submit = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . 'themes/' . $sTheme . '/images/buttons/' . $sLanguage . '/redeem.gif" border="0" alt="' . $aLang['image_button_redeem_voucher'] . '" title = "' . $aLang['image_button_redeem_voucher'] . '">';
$selection_string = '';
$selection_string .= '<tr>' . "\n";
$selection_string .= ' <td width="10"></td>';
$selection_string .= ' <td class="main">' . "\n";
$selection_string .= $aLang['text_enter_coupon_code'] . oos_draw_input_field('gv_redeem_code') . '</td>';
$selection_string .= ' <td align="right">' . $image_submit . '</td>';
$selection_string .= ' <td width="10"></td>';
$selection_string .= '</tr>' . "\n";
return $selection_string;
}
示例10: create_plugin_instance
function create_plugin_instance()
{
global $categories, $aCategoryPath, $nCurrentCategoryId;
$categories = '';
$aCategoryPath = array();
$nCurrentCategoryId = 0;
if (isset($_GET['categories'])) {
$categories = oos_var_prep_for_os($_GET['categories']);
} elseif (isset($_GET['products_id']) && !isset($_GET['manufacturers_id'])) {
$categories = oos_get_product_path($_GET['products_id']);
}
if (!empty($categories)) {
$aCategoryPath = array_unique(array_filter(explode('_', $categories), 'is_numeric'));
$categories = implode('_', $aCategoryPath);
$nCurrentCategoryId = end($aCategoryPath);
}
return true;
}
示例11: 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;
}
示例12: create_plugin_instance
function create_plugin_instance()
{
global $categories, $aCategoryPath, $nCurrentCategoryId;
MyOOS_CoreApi::requireOnce('classes/class_category_tree.php');
if (isset($_GET['categories'])) {
$categories = oos_var_prep_for_os($_GET['categories']);
} elseif (isset($_GET['products_id']) && !isset($_GET['manufacturers_id'])) {
$categories = oos_get_product_path($_GET['products_id']);
} else {
$categories = '';
}
if (!empty($categories)) {
$aCategoryPath = oos_parse_category_path($categories);
$categories = implode('_', $aCategoryPath);
$nCurrentCategoryId = end($aCategoryPath);
} else {
$nCurrentCategoryId = 0;
}
return true;
}
示例13: load_plugin
function load_plugin($sInstance, $sPluginPath = '')
{
$sName = 'oos_event_' . $sInstance;
if (!class_exists($sName)) {
if (empty($sPluginPath)) {
$sPluginPath = $sName;
}
$sPluginPath = oos_var_prep_for_os($sPluginPath);
$sName = oos_var_prep_for_os($sName);
if (is_readable('includes/plugins/' . $sPluginPath . '/' . $sName . '.php')) {
MyOOS_CoreApi::requireOnce('plugins/' . $sPluginPath . '/' . $sName . '.php');
}
if (!class_exists($sName)) {
return false;
}
}
if (@call_user_func(array('oos_event_' . $sInstance, 'create_plugin_instance'))) {
$this->aPlugins[] = $sName;
}
return true;
}
示例14: smarty_function_html_image_submit
/**
* Smarty {html_image_submit} function plugin
*
* Type: function<br>
* Name: html_image_submit<br>
* Date: September 15, 2003
* Input:<br>
* - button = button (and path) of image (required)
* - border = border width (optional, default 0)
* - height = image height (optional, default actual height)
* - basedir = base directory
*
* Examples: {html_image_submit image="masthead.gif"}
* @author r23 <info@r23.de>
* @author credits to Monte Ohrt <monte@ispi.net>
* @author credits to Duda <duda@big.hu> - wrote first image function
* in repository, helped with lots of functionality
* @version 1.0
* @param array
* @param Smarty
* @return string
* @uses smarty_function_escape_special_chars()
*/
function smarty_function_html_image_submit($params, &$smarty)
{
MyOOS_CoreApi::requireOnce('lib/smarty/libs/plugins/shared.escape_special_chars.php');
$image = '';
$alt = '';
$border = 0;
$extra = '';
$sTheme = oos_var_prep_for_os($_SESSION['theme']);
$sLanguage = oos_var_prep_for_os($_SESSION['language']);
$basedir = STATIC1_HTTP_SERVER . '/themes/' . $sTheme . '/images/buttons/' . $sLanguage . '/';
foreach ($params as $_key => $_val) {
switch ($_key) {
case 'image':
case 'basedir':
${$_key} = $_val;
break;
case 'alt':
if (!is_array($_val)) {
${$_key} = smarty_function_escape_special_chars($_val);
} else {
$smarty->trigger_error("html_image_submit: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
default:
if (!is_array($_val)) {
$extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
} else {
$smarty->trigger_error("html_image_submit: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
}
break;
}
}
if (empty($image)) {
$smarty->trigger_error("html_image_submit: missing 'button' parameter", E_USER_NOTICE);
return;
}
$sSlash = defined('OOS_XHTML') && OOS_XHTML == '1' ? ' /' : '';
return '<input type="image" src="' . $basedir . $image . '" alt="' . $alt . '" ' . $extra . $sSlash . '>';
}
示例15: intval
}
// optional Product List Filter
$product_filter_select = '';
if (PRODUCT_LIST_FILTER > 0) {
$filterlist_result = $dbconn->Execute($filterlist_sql);
if ($filterlist_result->RecordCount() > 1) {
$product_filter_select .= ' <td align="center" class="main">' . $aLang['text_show'] . '<select size="1" onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">';
if (isset($_GET['manufacturers_id'])) {
$manufacturers_id = intval($_GET['manufacturers_id']);
$arguments = 'manufacturers_id=' . intval($manufacturers_id);
} else {
$arguments = 'categories=' . $categories;
}
$arguments .= '&sort=' . oos_var_prep_for_os($_GET['sort']);
$option_url = oos_href_link($aPages['shop'], $arguments);
if (!isset($_GET['filter_id'])) {
$product_filter_select .= '<option value="' . $option_url . '" selected="selected">' . $aLang['text_all'] . '</option>';
} else {
$product_filter_select .= '<option value="' . $option_url . '">' . $aLang['text_all'] . '</option>';
}
$product_filter_select .= '<option value="">---------------</option>';
while ($filterlist = $filterlist_result->fields)
{
$option_url = oos_href_link($aPages['shop'], $arguments . '&filter_id=' . $filterlist['id']);
if (isset($_GET['filter_id']) && ($_GET['filter_id'] == $filterlist['id'])) {
$product_filter_select .= '<option value="' . $option_url . '" selected="selected">' . $filterlist['name'] . '</option>';