本文整理汇总了PHP中xos_session_name函数的典型用法代码示例。如果您正苦于以下问题:PHP xos_session_name函数的具体用法?PHP xos_session_name怎么用?PHP xos_session_name使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xos_session_name函数的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: xos_session_start
function xos_session_start()
{
$sane_session_id = true;
if (isset($_GET[xos_session_name()])) {
if (preg_match('/^[a-zA-Z0-9,-]+$/', $_GET[xos_session_name()]) == false) {
unset($_GET[xos_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_POST[xos_session_name()])) {
if (preg_match('/^[a-zA-Z0-9,-]+$/', $_POST[xos_session_name()]) == false) {
unset($_POST[xos_session_name()]);
$sane_session_id = false;
}
} elseif (isset($_COOKIE[xos_session_name()])) {
if (preg_match('/^[a-zA-Z0-9,-]+$/', $_COOKIE[xos_session_name()]) == false) {
$session_data = session_get_cookie_params();
setcookie(xos_session_name(), '', time() - 42000, $session_data['path'], $session_data['domain']);
unset($_COOKIE[xos_session_name()]);
$sane_session_id = false;
}
}
if ($sane_session_id == false) {
xos_redirect(xos_href_link(FILENAME_DEFAULT, '', 'SSL', false));
}
register_shutdown_function('session_write_close');
return session_start();
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:27,代码来源:sessions.php
示例2: array_shift
}
$popup_img = DIR_WS_IMAGES . 'products/large/' . $products_img_name['name'];
$pop_size = @GetImageSize("{$popup_img}");
if ($pop_size[0] > $pop_width) {
$pop_width = $pop_size[0];
}
if ($pop_size[1] > $pop_height) {
$pop_height = $pop_size[1];
}
}
if ($small_width_total > $pop_width) {
$pop_width = $small_width_total;
}
$product_image = array_shift($products_image_name);
$smarty->assign(array('box_width' => (int) ($pop_width + 50), 'box_height' => (int) ($pop_height + $small_height + 55), 'link_product_img' => xos_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . '&img_name=' . rawurlencode($product_image['name']), $request_type), 'link_product_img_noscript' => xos_href_link(FILENAME_IMAGES_WINDOW, 'pID=' . $product_info['products_id'], 'NONSSL', true, false, false, false, false), 'product_img' => xos_image(DIR_WS_IMAGES . 'products/medium/' . rawurlencode($product_image['name']), addslashes($product_info['products_name']), '', '', 'style="margin: 5px;"')));
}
$back = sizeof($_SESSION['navigation']->path) - 2;
if (!empty($_SESSION['navigation']->path[$back])) {
$get_params_array = $_SESSION['navigation']->path[$back]['get'];
$get_params_array['rmp'] = '0';
$back_link = xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']);
} else {
$back_link = 'javascript:history.go(-1)';
}
$smarty->assign(array('form_begin' => xos_draw_form('product_reviews_write', xos_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, xos_get_all_get_params(array('lnc', 'cur', 'tpl', 'action')) . 'action=process', 'SSL'), 'post', 'onsubmit="return checkForm();"', true), 'form_end' => '</form>', 'radio_fields' => xos_draw_radio_field('rating', '1') . ' ' . xos_draw_radio_field('rating', '2') . ' ' . xos_draw_radio_field('rating', '3') . ' ' . xos_draw_radio_field('rating', '4') . ' ' . xos_draw_radio_field('rating', '5'), 'textarea_field' => xos_draw_textarea_field('review', '60', '15'), 'customers_name' => xos_output_string_protected($customer['customers_firstname'] . ' ' . $customer['customers_lastname']), 'products_name' => $product_info['products_name'], 'products_p_unit' => $product_info['products_p_unit'], 'products_model' => $product_info['products_model'], 'products_price' => $product_price, 'products_price_special' => $product_price_special, 'products_price_breaks' => $price_breaks_array, 'products_tax_description' => xos_get_products_tax_description($product_info['products_tax_class_id'], $products_tax_rate), 'td_width_img' => MEDIUM_PRODUCT_IMAGE_MAX_WIDTH + 10, 'link_back' => $back_link, 'link_buy_now' => xos_href_link(basename($_SERVER['PHP_SELF']), xos_get_all_get_params(array('action')) . 'action=buy_now')));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_reviews_write');
$output_product_reviews_write = $smarty->fetch(SELECTED_TPL . '/product_reviews_write.tpl');
$smarty->assign('central_contents', $output_product_reviews_write);
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:product_reviews_write.php
示例3: urlencode
$onclick_link = 'info=' . urlencode($contents[$i]['name']);
}
if ($contents[$i]['is_dir']) {
if ($contents[$i]['name'] == '..') {
$icon = xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/previous_level.gif', ICON_TITLE_PREVIOUS_LEVEL);
} else {
$icon = isset($fInfo) && is_object($fInfo) && $contents[$i]['name'] == $fInfo->name ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/current_folder.gif', ICON_TITLE_CURRENT_FOLDER) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/folder.gif', ICON_TITLE_FOLDER);
}
$link = xos_href_link(FILENAME_FILE_MANAGER, 'goto=' . $goto_link);
} else {
$icon = $contents[$i]['is_image'] ? xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/image_download.gif', ICON_TITLE_FILE_DOWNLOAD) : xos_image(DIR_WS_ADMIN_IMAGES . ADMIN_TPL . '/icons/file_download.gif', ICON_TITLE_FILE_DOWNLOAD);
$link = xos_href_link(FILENAME_FILE_MANAGER, 'action=download&filename=' . urlencode($contents[$i]['name']));
}
if ($contents[$i]['name'] != '..') {
$link_delete = xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name']) . '&action=delete');
}
$folders_and_files_array[] = array('selected' => $selected, 'link_onclick' => xos_href_link(FILENAME_FILE_MANAGER, $onclick_link), 'link' => $link, 'icon' => $icon, 'name' => $contents[$i]['name'], 'size' => $contents[$i]['is_dir'] ? ' ' : $contents[$i]['size'], 'permissions' => $contents[$i]['permissions'], 'user' => $contents[$i]['user'], 'group' => $contents[$i]['group'], 'last_modified' => $contents[$i]['last_modified'], 'link_delete' => $link_delete, 'link_filename_file_manager_info' => xos_href_link(FILENAME_FILE_MANAGER, 'info=' . urlencode($contents[$i]['name'])));
}
$smarty->assign(array('folders_and_files' => $folders_and_files_array, 'link_filename_file_manager_reset' => xos_href_link(FILENAME_FILE_MANAGER, 'action=reset'), 'link_filename_file_manager_upload' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=upload'), 'link_filename_file_manager_new_file' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_file'), 'link_filename_file_manager_new_folder' => xos_href_link(FILENAME_FILE_MANAGER, (isset($_GET['info']) ? 'info=' . urlencode($_GET['info']) . '&' : '') . 'action=new_folder')));
require DIR_WS_BOXES . 'infobox_file_manager.php';
}
if (SESSID) {
$smarty->assign('hidden_field_session', xos_draw_hidden_field(xos_session_name(), xos_session_id()));
}
$smarty->assign(array('form_begin_goto' => xos_draw_form('goto', FILENAME_FILE_MANAGER, '', 'get'), 'current_path' => $_SESSION['current_path'], 'pull_down_goto' => xos_draw_pull_down_menu('goto', $goto_array, $_SESSION['current_path'], 'onchange="this.form.submit();"'), 'form_end' => '</form>'));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'file_manager');
$output_file_manager = $smarty->fetch(ADMIN_TPL . '/file_manager.tpl');
$smarty->assign('central_contents', $output_file_manager);
$smarty->display(ADMIN_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:file_manager.php
示例4: xos_date_long
$smarty->assign('products_date_added', xos_date_long($product_info['products_date_added']));
}
if (PRODUCT_REVIEWS_ENABLED == 'true') {
$smarty->assign('link_filename_product_reviews', xos_href_link(FILENAME_PRODUCT_REVIEWS, xos_get_all_get_params(array('lnc', 'cur', 'tpl'))));
}
$smarty->assign(array('input_products_quantity' => xos_draw_input_field('products_quantity', '1', 'id="products_quantity" style="text-align: center; width: 60px;" class="form-control" maxlength="5"'), 'hidden_field_products_id' => xos_draw_hidden_field('p', $product_info['products_id']), 'javascript' => $jscript_op, 'form_begin' => xos_draw_form('cart_quantity', xos_href_link(FILENAME_PRODUCT_INFO, xos_get_all_get_params(array('action')) . 'action=add_product')), 'form_end' => '</form>'));
$smarty->caching = 0;
include DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS;
include DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS;
if (CACHE_LEVEL > 2 && (isset($_COOKIE[session_name()]) && !isset($_GET[session_name()]) || SESSION_FORCE_COOKIE_USE == 'true') && !isset($_GET['noscript'])) {
$smarty->caching = 1;
}
}
$smarty->assign('link_filename_default', xos_href_link(FILENAME_DEFAULT));
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'product_info');
}
// link_back will not be cached (nocache)
$back = sizeof($_SESSION['navigation']->path) - 2;
if (!empty($_SESSION['navigation']->path[$back])) {
$get_params_array = $_SESSION['navigation']->path[$back]['get'];
$get_params_array['rmp'] = '0';
$smarty->assign('link_back', xos_href_link($_SESSION['navigation']->path[$back]['page'], xos_array_to_query_string($get_params_array, array('action', xos_session_name())), $_SESSION['navigation']->path[$back]['mode']), true);
} else {
$smarty->assign('link_back', 'javascript:history.go(-1)', true);
}
$output_product_info = $smarty->fetch(SELECTED_TPL . '/product_info.tpl', $cache_id);
$smarty->assign('central_contents', $output_product_info);
$smarty->caching = 0;
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
return 'overwrite_all';
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:product_info.php
示例5: xos_address_label
}
require DIR_WS_INCLUDES . 'html_header.php';
require DIR_WS_INCLUDES . 'boxes.php';
require DIR_WS_INCLUDES . 'header.php';
require DIR_WS_INCLUDES . 'footer.php';
if ($messageStack->size('addressbook') > 0) {
$smarty->assign('message_stack', $messageStack->output('addressbook'));
$smarty->assign('message_stack_error', $messageStack->output('addressbook', 'error'));
$smarty->assign('message_stack_warning', $messageStack->output('addressbook', 'warning'));
$smarty->assign('message_stack_success', $messageStack->output('addressbook', 'success'));
}
if (isset($_GET['delete'])) {
$smarty->assign(array('delete_address' => true, 'address_label' => xos_address_label($_SESSION['customer_id'], $_GET['delete'], true, ' ', '<br />'), 'link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'link_filename_address_book_process_delete' => xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, 'delete=' . $_GET['delete'] . '&action=deleteconfirm&formid=' . md5($_SESSION['sessiontoken']), 'SSL')));
} elseif (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
$smarty->assign(array('edit_address' => true, 'form_begin' => xos_draw_form('addressbook', xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'link_filename_address_book' => xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL'), 'hidden_field_update' => xos_draw_hidden_field('action', 'update'), 'hidden_field_edit' => xos_draw_hidden_field('edit', $_GET['edit']), 'form_end' => '</form>'));
include DIR_WS_MODULES . 'address_book_details.php';
} else {
if (sizeof($_SESSION['navigation']->snapshot) > 0) {
$back_link = xos_href_link($_SESSION['navigation']->snapshot['page'], xos_array_to_query_string($_SESSION['navigation']->snapshot['get'], array(xos_session_name())), $_SESSION['navigation']->snapshot['mode']);
} else {
$back_link = xos_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL');
}
$smarty->assign(array('form_begin' => xos_draw_form('addressbook', xos_href_link(FILENAME_ADDRESS_BOOK_PROCESS, isset($_GET['edit']) ? 'edit=' . $_GET['edit'] : '', 'SSL'), 'post', 'onsubmit="return true;"', true), 'link_back' => $back_link, 'hidden_field_process' => xos_draw_hidden_field('action', 'process'), 'form_end' => '</form>'));
include DIR_WS_MODULES . 'address_book_details.php';
}
$smarty->configLoad('languages/' . $_SESSION['language'] . '.conf', 'address_book_process');
$output_address_book_process = $smarty->fetch(SELECTED_TPL . '/address_book_process.tpl');
$smarty->assign('central_contents', $output_address_book_process);
$smarty->display(SELECTED_TPL . '/frame.tpl');
require DIR_WS_INCLUDES . 'application_bottom.php';
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:address_book_process.php
示例6: reset
case 'PRODUCT_LIST_IMAGE':
$order_str .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$order_str .= " order by p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$order_str .= " order by final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name";
break;
}
}
if ($session_started) {
$hidden_get_variables = '';
reset($_GET);
while (list($key, $value) = each($_GET)) {
if ($key != 'mdsr' && $key != xos_session_name() && $key != 'page') {
$hidden_get_variables .= xos_draw_hidden_field($key, $value);
}
}
$pull_down_menu_display_search_results = xos_draw_form('display_search_results', xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, '', 'NONSSL', false, true, false, false, false), 'get');
$pull_down_menu_display_search_results_noscript = xos_draw_form('display_search_results', xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, '', 'NONSSL', false, false, false, false, false), 'get') . xos_hide_session_id();
$pull_down_menu_display_search_results_noscript .= $hidden_get_variables;
$max_display_search_results_array = array();
$max_display_search_results_array_noscript = array();
$set = false;
for ($i = 10; $i <= 50; $i = $i + 10) {
if (MAX_DISPLAY_SEARCH_RESULTS <= $i && $set == false) {
$max_display_search_results_array[] = array('id' => xos_href_link(FILENAME_ADVANCED_SEARCH_AND_RESULTS, xos_get_all_get_params(array('mdsr', 'page')) . 'mdsr=' . MAX_DISPLAY_SEARCH_RESULTS, 'NONSSL', true, true, false, false, false), 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
$max_display_search_results_array_noscript[] = array('id' => MAX_DISPLAY_SEARCH_RESULTS, 'text' => MAX_DISPLAY_SEARCH_RESULTS . TEXT_MAX_PRODUCTS);
$set = true;
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:advanced_search_and_results.php
示例7: before_process
function before_process()
{
if ($_POST['valid'] == 'true') {
if ($remote_host = getenv('REMOTE_HOST')) {
if ($remote_host != 'secpay.com') {
$remote_host = gethostbyaddr($remote_host);
}
if ($remote_host != 'secpay.com') {
xos_redirect(xos_href_link(FILENAME_CHECKOUT_PAYMENT, xos_session_name() . '=' . $_POST[xos_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
}
} else {
xos_redirect(xos_href_link(FILENAME_CHECKOUT_PAYMENT, xos_session_name() . '=' . $_POST[xos_session_name()] . '&payment_error=' . $this->code, 'SSL', false, false));
}
}
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:15,代码来源:secpay.php
示例8: xos_get_all_get_params
function xos_get_all_get_params($exclude_array = '')
{
if (!is_array($exclude_array)) {
$exclude_array = array();
}
$get_url = '';
if (is_array($_GET) && sizeof($_GET) > 0) {
reset($_GET);
while (list($key, $value) = each($_GET)) {
if (is_string($value) && strlen($value) > 0 && $key != xos_session_name() && $key != 'error' && !in_array($key, $exclude_array) && $key != 'x' && $key != 'y') {
$get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&';
}
}
}
return $get_url;
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:16,代码来源:general.php
示例9: xos_get_all_get_params
function xos_get_all_get_params($exclude_array = '')
{
if ($exclude_array == '') {
$exclude_array = array();
}
$get_url = '';
reset($_GET);
while (list($key, $value) = each($_GET)) {
if ($key != xos_session_name() && $key != 'error' && !in_array($key, $exclude_array)) {
$get_url .= $key . '=' . $value . '&';
}
}
return $get_url;
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:14,代码来源:general.php
示例10: xos_create_random_value
if ($check_admin['check_firstname'] != $firstname) {
$_GET['login'] = 'fail';
} else {
$_GET['login'] = 'success';
$makePassword = xos_create_random_value(7);
@(require DIR_FS_SMARTY . 'admin/languages/' . $_SESSION['language'] . '/' . FILENAME_LOGIN);
$email_to_admin = new mailer($check_admin['check_firstname'] . ' ' . $check_admin['admin_lastname'], $check_admin['check_email_address'], ADMIN_EMAIL_SUBJECT, '', sprintf(ADMIN_EMAIL_TEXT, $check_admin['check_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $check_admin['check_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
if (!$email_to_admin->send()) {
$mailer_error_message = sprintf(ERROR_PHPMAILER, $email_to_admin->ErrorInfo);
} else {
xos_db_query("update " . TABLE_ADMIN . " set admin_password = '" . xos_encrypt_password($makePassword) . "' where admin_id = '" . $check_admin['check_id'] . "'");
}
}
}
}
$javascript = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'function center() {' . "\n" . ' var height = document.getElementById("text").offsetHeight;' . "\n" . ' var marg = (height / 2);' . "\n" . ' document.getElementById("spacer").style.margin = "-" + marg + "px" + " 0px" + " 0px" + " 0px";' . "\n" . '}' . "\n\n" . '$(function(){' . "\n" . ' if (document.cookie.indexOf("' . xos_session_name() . '=' . xos_session_id() . '") != -1) {' . "\n" . ' $("#cookie_error").css("visibility", "hidden");' . "\n" . ' }' . "\n" . '});' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
require DIR_WS_INCLUDES . 'html_header_with_special_stylesheet.php';
require DIR_WS_INCLUDES . 'footer.php';
if (SESSION_FORCE_COOKIE_USE == 'true' && !isset($_COOKIE[session_name()])) {
$smarty->assign('cookie_not_accepted', true);
}
if ($_GET['login'] == 'success') {
$smarty->assign('login_success', true);
} elseif ($_GET['login'] == 'fail') {
$smarty->assign('login_fail', true);
}
if (isset($_SESSION['password_forgotten'])) {
$smarty->assign('try_over_3_times', true);
} elseif (isset($mailer_error_message)) {
$smarty->assign(array('mailer_error_message' => $mailer_error_message, 'link_filename_password_forgotten' => xos_href_link(FILENAME_PASSWORD_FORGOTTEN)));
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:password_forgotten.php
示例11: Option
$output_string .= ' ' . $form . '.' . $field . '.options[' . $num_option_value . '] = new Option("' . $values['products_options_values_name'] . '", "' . $values['products_options_values_id'] . '");' . "\n";
$num_option_value++;
}
$num_option_name++;
}
$output_string .= ' }' . "\n";
return $output_string;
}
$javascript = '<script type="text/javascript">' . "\n" . '/* <![CDATA[ */' . "\n" . 'var tax_rates = new Array();' . "\n";
for ($i = 0, $n = sizeof($tax_rates_final_array); $i < $n; $i++) {
if ($tax_rates_final_array[$i]['id'] > 0) {
$javascript .= 'tax_rates["' . $tax_rates_final_array[$i]['id'] . '"] = ' . $tax_rates_final_array[$i]['value'] . ';' . "\n";
}
}
$javascript .= "\n" . 'function doRound(x, places) {' . "\n" . ' return Math.round(x * Math.pow(10, places)) / Math.pow(10, places);' . "\n" . '}' . "\n\n" . 'function getTaxRate() {' . "\n" . ' var selected_value = document.getElementById("tax_rates_final_id").selectedIndex;' . "\n" . ' var parameterVal = document.getElementById("tax_rates_final_id")[selected_value].value;' . "\n\n" . ' if ( (parameterVal > 0) && (tax_rates[parameterVal] > 0) ) {' . "\n" . ' return tax_rates[parameterVal];' . "\n" . ' } else {' . "\n" . ' return 0;' . "\n" . ' }' . "\n" . '}' . "\n\n" . 'function updateGross(inField, setField) {' . "\n" . ' var taxRate = getTaxRate();' . "\n" . ' if (document.forms["attribute"].elements[inField]) {' . "\n" . ' var grossValue = document.forms["attribute"].elements[inField].value;' . "\n\n" . ' if (taxRate > 0) {' . "\n" . ' grossValue = grossValue * ((taxRate / 100) + 1);' . "\n" . ' }' . "\n\n" . ' document.forms["attribute"].elements[setField].value = doRound(grossValue, 4);' . "\n" . ' } else if (document.getElementById(inField)) {' . "\n" . ' var grossValue = document.getElementById(inField).innerHTML;' . "\n\n" . ' if (taxRate > 0) {' . "\n" . ' grossValue = grossValue * ((taxRate / 100) + 1);' . "\n" . ' }' . "\n\n" . ' document.getElementById(setField).innerHTML = doRound(grossValue, 4);' . "\n" . ' }' . "\n" . '}' . "\n\n" . 'function updateNet(inField, setField) {' . "\n" . ' var taxRate = getTaxRate();' . "\n" . ' if (document.forms["attribute"].elements[inField]) {' . "\n" . ' var netValue = document.forms["attribute"].elements[inField].value;' . "\n\n" . ' if (taxRate > 0) {' . "\n" . ' netValue = netValue / ((taxRate / 100) + 1);' . "\n" . ' }' . "\n\n" . ' document.forms["attribute"].elements[setField].value = doRound(netValue, 4);' . "\n" . ' } else if (document.getElementById(inField)) {' . "\n" . ' var netValue = document.getElementById(inField).innerHTML;' . "\n\n" . ' if (taxRate > 0) {' . "\n" . ' netValue = netValue / ((taxRate / 100) + 1);' . "\n" . ' }' . "\n\n" . ' document.getElementById(setField).innerHTML = doRound(netValue, 4);' . "\n" . ' }' . "\n" . '}' . "\n\n" . 'function updatePrices(net, gross) {' . "\n\n" . ' if (gross) {' . "\n" . ' ' . $update_gross_string . "\n" . ' }' . "\n\n" . ' if (net) {' . "\n" . ' ' . $update_net_string . "\n" . ' }' . "\n\n" . '}' . "\n\n" . 'function update_option_values(the_form) {' . "\n" . ' var num_value = the_form.values_id.options.length;' . "\n" . ' var selected_options_name = "";' . "\n\n" . ' while(num_value > 0) {' . "\n" . ' num_value--;' . "\n" . ' the_form.values_id.options[num_value] = null;' . "\n" . ' }' . "\n\n" . ' selected_options_name = the_form.options_id.options[the_form.options_id.selectedIndex].value;' . "\n\n" . xos_js_option_values_list('selected_options_name', 'the_form', 'values_id') . "\n" . '}' . "\n\n" . 'function toggle_box_sort(box_id) {' . "\n" . ' var divTag = document.forms["attribute"].getElementsByTagName("div");' . "\n\n" . ' for (var i = 0; i < divTag.length; ++i){' . "\n" . ' divTag[i].style.display="none";' . "\n" . ' }' . "\n\n" . ' if (document.getElementById(box_id+"_1")) {' . "\n" . ' document.getElementById(box_id+"_1").style.display="";' . "\n" . ' document.getElementById(box_id+"_2").style.display="";' . "\n" . ' }' . "\n\n" . '}' . "\n\n" . 'function update_action(product_id, option_id, action) {' . "\n" . ' document.forms["attribute"].action="' . xos_href_link(FILENAME_PRODUCTS_ATTRIBUTES) . (SESSID ? '&' : '?') . 'action=" + action + "&products_id=" + product_id + "&options_id=" + option_id + "&' . $parameter_string . '";' . "\n" . '}' . "\n\n" . 'function get_attribute_lists(url, box_id_combs) {' . "\n\n" . ' box_id = box_id_combs;' . "\n\n" . ' http_request = false;' . "\n\n" . ' if (window.XMLHttpRequest) { // Mozilla, Safari,...' . "\n" . ' http_request = new XMLHttpRequest();' . "\n" . ' if (http_request.overrideMimeType) {' . "\n" . ' http_request.overrideMimeType("text/html");' . "\n" . ' }' . "\n" . ' } else if (window.ActiveXObject) { // IE' . "\n" . ' try {' . "\n" . ' http_request = new ActiveXObject("Msxml2.XMLHTTP");' . "\n" . ' } catch (e) {' . "\n" . ' try {' . "\n" . ' http_request = new ActiveXObject("Microsoft.XMLHTTP");' . "\n" . ' } catch (e) {}' . "\n" . ' }' . "\n" . ' }' . "\n\n" . ' if (!http_request) {' . "\n" . ' alert("Ende : Kann keine XMLHTTP-Instanz erzeugen");' . "\n" . ' return false;' . "\n" . ' }' . "\n" . ' http_request.onreadystatechange = response_processing_list;' . "\n" . ' http_request.open("GET", url, true);' . "\n" . ' http_request.send(null);' . "\n\n" . '}' . "\n\n" . 'function response_processing_list() {' . "\n" . ' if (http_request.readyState == 1) {' . "\n" . ' } else if (http_request.readyState == 4) {' . "\n" . ' if (http_request.status == 200) {' . "\n" . ' document.getElementById(box_id+"_2").innerHTML = http_request.responseText;' . "\n" . ' } else {' . "\n" . ' alert("Bei dem Request ist ein Problem aufgetreten.");' . "\n" . ' }' . "\n" . ' }' . "\n" . '}' . "\n\n" . '/* ]]> */' . "\n" . '</script>' . "\n";
$smarty->assign(array('form_begin_tax_rates' => xos_draw_form('tax_rates', FILENAME_PRODUCTS_ATTRIBUTES, '', 'get'), 'pull_down_tax_rates' => xos_draw_pull_down_menu('selected_tax_rate_id', $tax_rates_final_array, $_GET['selected_tax_rate_id'], 'id="tax_rates_final_id" class="smallText" onchange="this.form.submit();"'), 'hidden_fields' => xos_draw_hidden_field('pID', $pID) . xos_draw_hidden_field('cPath', $cPath) . xos_draw_hidden_field('categories_or_pages_id', $categories_or_pages_id) . xos_draw_hidden_field('manufacturers_id', $manufacturers_id) . xos_draw_hidden_field('max_rows', $_GET['max_rows']) . xos_draw_hidden_field('max_products_in_pullwown', $_GET['max_products_in_pullwown']) . xos_draw_hidden_field('option_page', $_GET['option_page']) . xos_draw_hidden_field('value_page', $_GET['value_page']) . xos_draw_hidden_field('attribute_page', $_GET['attribute_page']) . (SESSID ? xos_draw_hidden_field(xos_session_name(), xos_session_id()) : ''), 'form_begin_attributes' => '<form name="attribute" action="' . xos_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=' . $form_action . '&' . $parameter_string) . '" method="post">', 'previous_product_the_same' => $previous_product_is_the_same, 'next_product_the_same' => $next_product_is_the_same, 'javascript' => $javascript, 'update_prices' => 'updatePrices(true, true)', 'split_page' => $attributes_split->display_links($attributes_query_numrows, $_GET['max_rows'] ? $_GET['max_rows'] : MAX_ROW_LISTS_OPTIONS, MAX_DISPLAY_PAGE_LINKS, $attribute_page, $cmm_parameter_string . '&option_page=' . $option_page . '&value_page=' . $value_page, 'attribute_page'), 'attributes' => $attributes_value));
if ($action != 'update_attribute') {
$smarty->assign('insert_new_attribute', true);
$products = xos_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where" . ($pID ? " pd.products_id ='" . $pID . "' and" : "") . " pd.products_id = p.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int) $_SESSION['used_lng_id'] . "'" . ($categories_or_pages_id ? " and (" . $includes_categories . ")" : "") . ($manufacturers_id ? " and p.manufacturers_id ='" . $manufacturers_id . "'" : "") . " order by pd.products_name LIMIT " . ($_GET['max_products_in_pullwown'] ? $_GET['max_products_in_pullwown'] : MAX_PRODUCTS_IN_PULLDOWN) . "");
if (xos_db_num_rows($products) > 0) {
$inputs_products_name = '<select name="products_id" class="smallText">';
while ($products_values = xos_db_fetch_array($products)) {
$inputs_products_name .= '<option value="' . $products_values['products_id'] . '">' . $products_values['products_name'] . '</option>';
}
$inputs_products_name .= '</select>';
} else {
$smarty->assign('no_products', true);
}
$inputs_options_name = '<select name="options_id" class="smallText" onchange="update_option_values(this.form);">';
$options = xos_db_query("select distinct po.* from " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po where po.products_options_id = pov2po.products_options_id and po.language_id = '" . (int) $_SESSION['used_lng_id'] . "' order by po.products_options_id");
while ($options_values = xos_db_fetch_array($options)) {
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:attributes_products.php
示例12: xos_hide_session_id
function xos_hide_session_id()
{
global $session_started;
if ($session_started == true && SESSID) {
return xos_draw_hidden_field(xos_session_name(), xos_session_id());
}
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:7,代码来源:html_output.php
示例13: header
} else {
if (isset($_GET[session_name()])) {
header("HTTP/1.1 404 Not Found");
header("Status: 404 Not Found");
die('<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1>The requested document was not found on this server.<p></p><hr /><address>Web Server at ' . HTTP_SERVER . '</address></body></html>');
}
}
} else {
if (!isset($_COOKIE[session_name()]) && isset($_GET[session_name()]) || isset($_COOKIE[session_name()]) && isset($_GET[session_name()]) && $request_type == 'SSL' && ENABLE_SSL == 'true' && $_COOKIE[session_name()] != $_GET[session_name()] && HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
setcookie(session_name(), $_GET[session_name()], 0, $cookie_path, $cookie_domain);
}
xos_session_start();
$session_started = true;
}
// Define the SESSID
define('SESSID', empty($_COOKIE[session_name()]) ? xos_session_name() . '=' . xos_session_id() : '');
// if ($session_started && !preg_match('/^(?:(?:[a-zA-Z0-9,-]{26})|(?:[a-zA-Z0-9,-]{32}))$/i', session_id())) session_regenerate_id(true);
if ($session_started && !preg_match('/^[a-zA-Z0-9,-]{22,40}$/i', session_id())) {
session_regenerate_id(true);
}
// initialize a session token
if (!isset($_SESSION['sessiontoken'])) {
$_SESSION['sessiontoken'] = md5(xos_rand() . xos_rand() . xos_rand() . xos_rand());
}
// verify the ssl_session_id if the feature is enabled
if ($request_type == 'SSL' && SESSION_CHECK_SSL_SESSION_ID == 'true' && ENABLE_SSL == 'true' && $session_started == true) {
$ssl_session_id = getenv('SSL_SESSION_ID');
if (!isset($_SESSION['SESSION_SSL_ID'])) {
$_SESSION['SESSION_SSL_ID'] = $ssl_session_id;
}
if ($_SESSION['SESSION_SSL_ID'] != $ssl_session_id) {
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:application_top.php
示例14: debug
function debug()
{
for ($i = 0, $n = sizeof($this->path); $i < $n; $i++) {
echo $this->path[$i]['page'];
$get_string = '';
reset($this->path[$i]['get']);
while (list($key, $value) = each($this->path[$i]['get'])) {
$get_string .= $key . '=' . $value . '&';
}
if ($get_string != '') {
$get_string = '?' . $get_string;
}
echo substr($get_string, 0, -1);
if (sizeof($this->path[$i]['post']) > 0) {
reset($this->path[$i]['post']);
while (list($key, $value) = each($this->path[$i]['post'])) {
echo ' / <b>' . $key . '=' . $value . '</b>';
}
}
echo '<br />';
}
if (sizeof($this->snapshot) > 0) {
echo '<br /><br />';
echo $this->snapshot['mode'] . ' ' . $this->snapshot['page'] . '?' . xos_array_to_query_string($this->snapshot['get'], array(xos_session_name())) . '<br />';
}
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:26,代码来源:navigation_history.php
示例15: xos_create_random_value
if ($check_admin['check_firstname'] != $firstname) {
$_GET['login'] = 'fail';
} else {
$_GET['login'] = 'success';
$makePassword = xos_create_random_value(7);
@(require DIR_FS_SMARTY . 'admin/languages/' . $_SESSION['language'] . '/' . FILENAME_LOGIN);
$email_to_admin = new mailer($check_admin['check_firstname'] . ' ' . $check_admin['admin_lastname'], $check_admin['check_email_address'], ADMIN_EMAIL_SUBJECT, '', sprintf(ADMIN_EMAIL_TEXT, $check_admin['check_firstname'], HTTP_SERVER . DIR_WS_ADMIN, $check_admin['check_email_address'], $makePassword, STORE_OWNER), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
if (!$email_to_admin->send()) {
$mailer_error_message = sprintf(ERROR_PHPMAILER, $email_to_admin->ErrorInfo);
} else {
xos_db_query("update " . TABLE_ADMIN . " set admin_password = '" . xos_encrypt_password($makePassword) . "' where admin_id = '" . $check_admin['check_id'] . "'");
}
}
}
}
$javascript = '<script>' . "\n" . '$(function(){' . "\n" . ' if (document.cookie.indexOf("' . xos_session_name() . '=' . xos_session_id() . '") != -1) {' . "\n" . ' $("#cookie_error").css("display", "none");' . "\n" . ' }' . "\n" . '});' . "\n" . '</script>' . "\n";
require DIR_WS_INCLUDES . 'html_header.php';
require DIR_WS_INCLUDES . 'footer.php';
if (SESSION_FORCE_COOKIE_USE == 'true' && !isset($_COOKIE[session_name()])) {
$smarty->assign('cookie_not_accepted', true);
}
if ($_GET['login'] == 'success') {
$smarty->assign('login_success', true);
} elseif ($_GET['login'] == 'fail') {
$smarty->assign('login_fail', true);
}
if (isset($_SESSION['password_forgotten'])) {
$smarty->assign('try_over_3_times', true);
} elseif (isset($mailer_error_message)) {
$smarty->assign(array('mailer_error_message' => $mailer_error_message, 'link_filename_password_forgotten' => xos_href_link(FILENAME_PASSWORD_FORGOTTEN)));
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:31,代码来源:password_forgotten.php
示例16: display_links
function display_links($query_numrows, $max_rows_per_page, $max_page_links, $current_page_number, $parameters = '', $page_name = 'page')
{
if (xos_not_null($parameters) && substr($parameters, -1) != '&') {
$parameters .= '&';
}
// calculate number of pages needing links
$num_pages = ceil($query_numrows / $max_rows_per_page);
$pages_array = array();
for ($i = 1; $i <= $num_pages; $i++) {
$pages_array[] = array('id' => $i, 'text' => $i);
}
if ($num_pages > 1) {
$display_links = xos_draw_form('pages', basename($_SERVER['PHP_SELF']), '', 'get');
if ($current_page_number > 1) {
$display_links .= '<a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number - 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_PREV . '</a> ';
} else {
$display_links .= PREVNEXT_BUTTON_PREV . ' ';
}
$display_links .= sprintf(TEXT_RESULT_PAGE, xos_draw_pull_down_menu($page_name, $pages_array, $current_page_number, 'onchange="this.form.submit();"'), $num_pages);
if ($current_page_number < $num_pages && $num_pages != 1) {
$display_links .= ' <a href="' . xos_href_link(basename($_SERVER['PHP_SELF']), $parameters . $page_name . '=' . ($current_page_number + 1)) . '" class="splitPageLink">' . PREVNEXT_BUTTON_NEXT . '</a>';
} else {
$display_links .= ' ' . 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 .= xos_draw_hidden_field(rawurldecode($key), rawurldecode($value));
}
}
if (SESSID) {
$display_links .= xos_draw_hidden_field(xos_session_name(), xos_session_id());
}
$display_links .= '</form>';
} else {
$display_links = sprintf(TEXT_RESULT_PAGE, $num_pages, $num_pages);
}
return $display_links;
}
开发者ID:bamper,项目名称:xos_shop_system,代码行数:43,代码来源:split_page_results.php
注:本文中的xos_session_name函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论