本文整理汇总了PHP中fn_get_translation_languages函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_get_translation_languages函数的具体用法?PHP fn_get_translation_languages怎么用?PHP fn_get_translation_languages使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fn_get_translation_languages函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: fn_settings_actions_addons_access_restrictions_admin_reverse_ip_access
/**
* Reverse IP filter
*/
function fn_settings_actions_addons_access_restrictions_admin_reverse_ip_access(&$new_value, $old_value)
{
$ip = fn_get_ip(true);
if ($new_value == 'Y') {
$ip_data = db_get_row("SELECT item_id, status FROM ?:access_restriction WHERE ip_from = ?i AND ip_to = ?i AND type IN ('aas', 'aab', 'aar')", $ip['host'], $ip['host']);
if (empty($ip_data) || empty($ip_data['item_id'])) {
// Add IP
$restrict_ip = array('ip_from' => $ip['host'], 'ip_to' => $ip['host'], 'type' => 'aas', 'timestamp' => TIME, 'expires' => '0', 'status' => 'A');
$__data = array();
$__data['item_id'] = db_query("REPLACE INTO ?:access_restriction ?e", $restrict_ip);
$__data['type'] = 'aas';
foreach (fn_get_translation_languages() as $__data['lang_code'] => $_v) {
$__data['reason'] = __('store_admin', '', $__data['lang_code']);
db_query("REPLACE INTO ?:access_restriction_reason_descriptions ?e", $__data);
}
fn_set_notification('W', __('warning'), __('your_ip_added', array('[ip]' => long2ip($ip['host']))));
} elseif (empty($ip_data['status']) || $ip_data['status'] != 'A') {
// Change IP status to available
db_query("UPDATE ?:access_restriction SET ?u WHERE item_id = ?i", array('status' => 'A'), $ip_data['item_id']);
fn_set_notification('W', __('warning'), __('your_ip_enabled', array('[ip]' => long2ip($ip['host']))));
}
} else {
// Delete IP
$ips_data = db_get_array("SELECT item_id, type FROM ?:access_restriction WHERE ip_from <= ?i AND ip_to >= ?i AND type IN ('aas', 'aab', 'aar')", $ip['host'], $ip['host']);
if (!empty($ips_data)) {
foreach ($ips_data as $ip_data) {
db_query("DELETE FROM ?:access_restriction WHERE item_id = ?i", $ip_data['item_id']);
db_query("DELETE FROM ?:access_restriction_reason_descriptions WHERE item_id = ?i AND type = ?s", $ip_data['item_id'], $ip_data['type']);
}
fn_set_notification('W', __('warning'), __('your_ip_removed', array('[ip]' => long2ip($ip['host']))));
}
}
return true;
}
开发者ID:askzap,项目名称:ultimate,代码行数:37,代码来源:actions.functions.post.php
示例2: rub_create
public static function rub_create()
{
$currencies = Registry::get('currencies');
$symbol = SYMBOL_RUBL;
if (empty($currencies[CURRENCY_RUB])) {
$rub = array('currency_code' => CURRENCY_RUB, 'after' => 'Y', 'symbol' => $symbol, 'coefficient' => '1', 'is_primary' => 'Y', 'position' => '0', 'decimals_separator' => '', 'thousands_separator' => '', 'decimals' => '0', 'status' => 'A');
db_query("UPDATE ?:currencies SET is_primary = 'N' WHERE is_primary = 'Y'");
$rub_id = db_query('INSERT INTO ?:currencies ?e', $rub);
if (!empty($rub_id)) {
$rub_array = $rub;
$rub_array['currency_id'] = $rub_id;
Registry::set('currencies.RUB', $rub_array);
foreach (fn_get_translation_languages() as $lang_code => $v) {
db_query("REPLACE INTO ?:currency_descriptions (`currency_code`, `description`, `lang_code`) VALUES (?s, 'Рубли', ?s)", CURRENCY_RUB, $lang_code);
}
fn_set_notification('N', __('notice'), __('rus_ruble.symbol_rub_created'));
}
} else {
if ($currencies[CURRENCY_RUB]['is_primary'] == 'N') {
db_query("UPDATE ?:currencies SET is_primary = 'N' WHERE is_primary = 'Y'");
db_query("UPDATE ?:currencies SET is_primary = 'Y', coefficient = 1 WHERE currency_code = ?s", CURRENCY_RUB);
}
if ($currencies[CURRENCY_RUB]['symbol'] != $symbol) {
self::symbol_update($symbol);
}
}
return true;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:28,代码来源:RusCurrency.php
示例3: fn_polls_update_page_post
/**
* Update poll
*
* @param array $page_data page data
* @param int $page_id ID of the page, poll attached to
* @param string $lang_code language code
* @return bool always true
*/
function fn_polls_update_page_post(&$page_data, &$page_id, &$lang_code)
{
if (empty($page_id) || empty($page_data['page_type']) || $page_data['page_type'] != PAGE_TYPE_POLL) {
return false;
}
$exists = db_get_field('SELECT COUNT(*) FROM ?:polls WHERE page_id = ?i', $page_id) ? true : false;
$data = $page_data['poll_data'];
$types = array('H' => 'header', 'F' => 'footer', 'R' => 'results');
if (empty($exists)) {
$data['page_id'] = $page_id;
db_query('INSERT INTO ?:polls ?e', $data);
foreach ($types as $type => $elm) {
$_data = array('description' => $data[$elm], 'object_id' => $page_id, 'type' => $type, 'page_id' => $page_id);
foreach (fn_get_translation_languages() as $_data['lang_code'] => $v) {
db_query("INSERT INTO ?:poll_descriptions ?e", $_data);
}
}
} else {
db_query('UPDATE ?:polls SET ?u WHERE page_id = ?i', $data, $page_id);
foreach ($types as $type => $elm) {
$_data = array('description' => $data[$elm]);
db_query('UPDATE ?:poll_descriptions SET ?u WHERE object_id = ?i AND lang_code = ?s AND type = ?s', $_data, $page_id, $lang_code, $type);
}
}
return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:34,代码来源:func.php
示例4: fn_buy_together_update_chain
function fn_buy_together_update_chain($item_id, $product_id, $item_data, $auth, $lang_code = CART_LANGUAGE)
{
if (empty($product_id) || $product_id == 0) {
return false;
}
SecurityHelper::sanitizeObjectData('buy_together_chain', $item_data);
$show_notice = true;
$item_data['product_id'] = $product_id;
if (!empty($item_data['products'])) {
foreach ($item_data['products'] as $key => $product) {
// Delete products with empty amount
if (empty($product['amount']) || intval($product['amount']) == 0) {
unset($item_data['products'][$key]);
continue;
}
$item_data['products'][$key]['modifier'] = floatval($item_data['products'][$key]['modifier']);
$is_restricted = false;
fn_set_hook('buy_together_restricted_product', $product['product_id'], $auth, $is_restricted, $show_notice);
if ($is_restricted) {
unset($item_data['products'][$key]);
}
}
$item_data['products'] = serialize($item_data['products']);
} else {
$item_data['products'] = array();
}
if (!empty($item_data['date_from'])) {
$item_data['date_from'] = fn_parse_date($item_data['date_from']);
}
if (!empty($item_data['date_to'])) {
$item_data['date_to'] = fn_parse_date($item_data['date_to']);
}
if (empty($item_id) || $item_id == 0) {
//Create a new chain
$item_id = db_query("INSERT INTO ?:buy_together ?e", $item_data);
if (empty($item_id)) {
return false;
}
$_data = array();
$_data['chain_id'] = $item_id;
$_data['name'] = !empty($item_data['name']) ? $item_data['name'] : '';
$_data['description'] = !empty($item_data['description']) ? $item_data['description'] : '';
foreach (fn_get_translation_languages() as $_data['lang_code'] => $v) {
db_query("INSERT INTO ?:buy_together_descriptions ?e", $_data);
}
} else {
//Update already existing chain
$_data = array();
$_data['chain_id'] = $item_id;
$_data['name'] = !empty($item_data['name']) ? $item_data['name'] : '';
$_data['description'] = !empty($item_data['description']) ? $item_data['description'] : '';
db_query("UPDATE ?:buy_together SET ?u WHERE chain_id = ?i", $item_data, $item_id);
db_query("UPDATE ?:buy_together_descriptions SET ?u WHERE chain_id = ?i AND lang_code = ?s", $_data, $item_id, $lang_code);
}
return $item_id;
}
开发者ID:askzap,项目名称:ultimate,代码行数:56,代码来源:func.php
示例5: fn_get_image
function fn_get_image($image_id, $object_type, $lang_code = CART_LANGUAGE, $get_all_alts = false)
{
$path = $object_type;
if (!empty($image_id) && !empty($object_type)) {
$image_data = db_get_row("SELECT ?:images.image_id, ?:images.image_path, ?:common_descriptions.description as alt, ?:images.image_x, ?:images.image_y FROM ?:images LEFT JOIN ?:common_descriptions ON ?:common_descriptions.object_id = ?:images.image_id AND ?:common_descriptions.object_holder = 'images' AND ?:common_descriptions.lang_code = ?s WHERE ?:images.image_id = ?i", $lang_code, $image_id);
if ($get_all_alts && count(fn_get_translation_languages()) > 1) {
$image_data['alt'] = db_get_hash_single_array('SELECT description, lang_code FROM ?:common_descriptions WHERE object_id = ?i AND object_holder = ?s', array('lang_code', 'description'), $image_data['image_id'], 'images');
}
}
fn_attach_absolute_image_paths($image_data, $object_type);
return !empty($image_data) ? $image_data : false;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:12,代码来源:fn.images.php
示例6: fn_update_state
function fn_update_state($state_data, $state_id = 0, $lang_code = DESCR_SL)
{
if (empty($state_id)) {
if (!empty($state_data['code']) && !empty($state_data['state'])) {
$state_data['state_id'] = $state_id = db_query("REPLACE INTO ?:states ?e", $state_data);
foreach (fn_get_translation_languages() as $state_data['lang_code'] => $_v) {
db_query('REPLACE INTO ?:state_descriptions ?e', $state_data);
}
}
} else {
db_query("UPDATE ?:state_descriptions SET ?u WHERE state_id = ?i AND lang_code = ?s", $state_data, $state_id, $lang_code);
}
return $state_id;
}
开发者ID:askzap,项目名称:ultimate,代码行数:14,代码来源:states.php
示例7: fn_update_attachments
function fn_update_attachments($attachment_data, $attachment_id, $object_type, $object_id, $type = 'M', $files = null, $lang_code = DESCR_SL)
{
$object_id = intval($object_id);
$directory = $object_type . '/' . $object_id;
if ($files != null) {
$uploaded_data = $files;
} else {
$uploaded_data = fn_filter_uploaded_data('attachment_files');
}
if (!empty($attachment_id)) {
$rec = array('usergroup_ids' => empty($attachment_data['usergroup_ids']) ? '0' : implode(',', $attachment_data['usergroup_ids']), 'position' => $attachment_data['position']);
db_query("UPDATE ?:attachment_descriptions SET description = ?s WHERE attachment_id = ?i AND lang_code = ?s", $attachment_data['description'], $attachment_id, $lang_code);
db_query("UPDATE ?:attachments SET ?u WHERE attachment_id = ?i AND object_type = ?s AND object_id = ?i AND type = ?s", $rec, $attachment_id, $object_type, $object_id, $type);
fn_set_hook('attachment_update_file', $attachment_data, $attachment_id, $object_type, $object_id, $type, $files, $lang_code, $uploaded_data);
} elseif (!empty($uploaded_data)) {
$rec = array('object_type' => $object_type, 'object_id' => $object_id, 'usergroup_ids' => empty($attachment_data['usergroup_ids']) ? '0' : implode(',', $attachment_data['usergroup_ids']), 'position' => $attachment_data['position']);
if ($type !== null) {
$rec['type'] = $type;
} elseif (!empty($attachment_data['type'])) {
$rec['type'] = $attachment_data['type'];
}
$attachment_id = db_query("INSERT INTO ?:attachments ?e", $rec);
if ($attachment_id) {
// Add file description
foreach (fn_get_translation_languages() as $lang_code => $v) {
$rec = array('attachment_id' => $attachment_id, 'lang_code' => $lang_code, 'description' => is_array($attachment_data['description']) ? $attachment_data['description'][$lang_code] : $attachment_data['description']);
db_query("INSERT INTO ?:attachment_descriptions ?e", $rec);
}
$uploaded_data[$attachment_id] = $uploaded_data[0];
unset($uploaded_data[0]);
}
fn_set_hook('attachment_add_file', $attachment_data, $object_type, $object_id, $type, $files, $attachment_id, $uploaded_data);
}
if ($attachment_id && !empty($uploaded_data[$attachment_id]) && $uploaded_data[$attachment_id]['size']) {
$filename = $uploaded_data[$attachment_id]['name'];
$old_filename = db_get_field("SELECT filename FROM ?:attachments WHERE attachment_id = ?i", $attachment_id);
if ($old_filename) {
Storage::instance('attachments')->delete($directory . '/' . $old_filename);
}
list($filesize, $filename) = Storage::instance('attachments')->put($directory . '/' . $filename, array('file' => $uploaded_data[$attachment_id]['path']));
if ($filesize) {
$filename = fn_basename($filename);
db_query("UPDATE ?:attachments SET filename = ?s, filesize = ?i WHERE attachment_id = ?i", $filename, $filesize, $attachment_id);
}
}
return $attachment_id;
}
开发者ID:ambient-lounge,项目名称:site,代码行数:47,代码来源:func.php
示例8: up
public function up()
{
fn_print_r('Hello world!');
$addons = array('ak_union_web');
$updater = array();
foreach (fn_get_translation_languages() as $lang_code => $_data) {
foreach ($addons as $addon) {
$addon_scheme = @simplexml_load_file('app/addons/' . $addon . '/addon.xml', '\\Tygh\\ExSimpleXmlElement', LIBXML_NOCDATA);
$current_langvars = $addon_scheme->xpath("//language_variables/item[@lang='{$lang_code}']");
foreach ($current_langvars as $key => $value) {
if (!empty($value) && !empty($value['id']) && !empty($value['lang'])) {
$updater[] = array('value' => (string) $value, 'name' => (string) $value['id'], 'lang_code' => (string) $value['lang']);
fn_print_r((string) $value['lang'] . ' --> ' . (string) $value['id'] . ' --> ' . (string) $value);
}
}
}
}
db_query('REPLACE INTO ?:language_values ?m', $updater);
die;
}
开发者ID:askzap,项目名称:ultimate,代码行数:20,代码来源:20251127223411_lang_vars_updater.php
示例9: fn_update_mailing_list
function fn_update_mailing_list($mailing_list_data, $list_id, $lang_code = DESCR_SL)
{
if (empty($list_id)) {
$list_id = db_query("INSERT INTO ?:mailing_lists ?e", $mailing_list_data);
$_data = $mailing_list_data;
$_data['object_id'] = $list_id;
$_data['object_holder'] = 'mailing_lists';
$_data['object'] = $_data['name'];
foreach (fn_get_translation_languages() as $_data['lang_code'] => $v) {
db_query("REPLACE INTO ?:common_descriptions ?e", $_data);
}
} else {
db_query("UPDATE ?:mailing_lists SET ?u WHERE list_id = ?i", $mailing_list_data, $list_id);
$_data = $mailing_list_data;
$_data['object_id'] = $list_id;
$_data['object_holder'] = 'mailing_lists';
$_data['object'] = $_data['name'];
$_where = array('object_id' => $list_id, 'object_holder' => 'mailing_lists', 'lang_code' => $lang_code);
db_query("UPDATE ?:common_descriptions SET ?u WHERE ?w", $_data, $_where);
}
if (!empty($mailing_list_data['add_subscribers'])) {
foreach ($mailing_list_data['add_subscribers'] as $subscriber) {
$exists = db_get_field("SELECT subscriber_id FROM ?:subscribers WHERE email=?s", $subscriber['email']);
// check if subscriber exists already
if (!$exists) {
$_data = $subscriber;
$_data['timestamp'] = TIME;
$subscriber_id = db_query("INSERT INTO ?:subscribers ?e", $_data);
}
// mark mailing list as active for this subscriber
$_data = array('subscriber_id' => $subscriber_id, 'list_id' => $list_id, 'lang_code' => $subscriber['lang_code'], 'confirmed' => $subscriber['confirmed'], 'timestamp' => TIME);
db_query("REPLACE INTO ?:user_mailing_lists ?e", $_data);
}
}
return $list_id;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:36,代码来源:mailing_lists.php
示例10: fn_update_abandoned_cart_settings
function fn_update_abandoned_cart_settings($data, $lang_code = CART_LANGUAGE)
{
$data_1 = $data[0];
$data_1['number'] = 1;
$check_exist = db_get_row('SELECT * FROM ?:abandoned_cart_reminder_notifications WHERE lang_code=?s AND number=?i', $lang_code, 1);
if (empty($check_exist)) {
foreach (fn_get_translation_languages() as $data_1['lang_code'] => $v) {
db_query("INSERT INTO ?:abandoned_cart_reminder_notifications ?e", $data_1);
}
} else {
db_query('UPDATE ?:abandoned_cart_reminder_notifications SET ?u WHERE lang_code=?s AND number=?i', $data_1, $lang_code, 1);
}
$data_2 = $data[1];
$data_2['number'] = 2;
$check_exist = db_get_row('SELECT * FROM ?:abandoned_cart_reminder_notifications WHERE lang_code=?s AND number=?i', $lang_code, 2);
if (empty($check_exist)) {
foreach (fn_get_translation_languages() as $data_2['lang_code'] => $v) {
db_query("INSERT INTO ?:abandoned_cart_reminder_notifications ?e", $data_2);
}
} else {
db_query('UPDATE ?:abandoned_cart_reminder_notifications SET ?u WHERE lang_code=?s AND number=?i', $data_2, $lang_code, 2);
}
return true;
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:24,代码来源:func.php
示例11: _getSettingItem
/**
* Returns array of setting item data from xml node
* @param $xml_node
* @return array
*/
protected function _getSettingItem($xml_node)
{
$addon_id = (string) $this->_xml->id;
$default_language = $this->getDefaultLanguage();
foreach (fn_get_translation_languages() as $lang_code => $_v) {
$items[$lang_code] = $this->getPoValues($lang_code, 'SettingsOptions');
}
if (isset($xml_node['id'])) {
$_types = $this->_getTypes();
$translations = $this->_getTranslations($xml_node, 'SettingsOptions', $addon_id);
$tooltip_translations = $this->_getTranslations($xml_node, 'SettingsTooltips', $addon_id, 'tooltip');
$setting = array('edition_type' => $this->_getEditionType($xml_node), 'id' => (string) $xml_node['id'], 'name' => isset($items[$default_language][(string) $xml_node['id']]) ? $items[$default_language][(string) $xml_node['id']] : (string) $xml_node->name, 'type' => isset($_types[(string) $xml_node->type]) ? $_types[(string) $xml_node->type] : '', 'translations' => fn_array_merge($translations, $tooltip_translations), 'default_value' => isset($xml_node->default_value) ? (string) $xml_node->default_value : '', 'variants' => $this->_getVariants($xml_node), 'handler' => isset($xml_node->handler) ? (string) $xml_node->handler : '', 'parent_id' => isset($xml_node['parent_id']) ? (string) $xml_node['parent_id'] : '');
return $setting;
} else {
return array();
}
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:22,代码来源:XmlScheme3.php
示例12: fn_update_localization
function fn_update_localization($data, $localization_id = 0, $lang_code = DESCR_SL)
{
fn_define('POSITIONS_STEP', 10);
if (!empty($localization_id)) {
db_query('UPDATE ?:localizations SET ?u WHERE localization_id = ?i', $data, $localization_id);
db_query('UPDATE ?:localization_descriptions SET ?u WHERE localization_id = ?i AND lang_code = ?s', $data, $localization_id, $lang_code);
db_query("DELETE FROM ?:localization_elements WHERE localization_id = ?i", $localization_id);
} else {
$exist = db_get_field("SELECT COUNT(*) FROM ?:localizations");
if (empty($exist)) {
$data['is_default'] = 'Y';
}
$localization_id = $data['localization_id'] = db_query("REPLACE INTO ?:localizations ?e", $data);
foreach (fn_get_translation_languages() as $data['lang_code'] => $_v) {
db_query("REPLACE INTO ?:localization_descriptions ?e", $data);
}
}
$_data = array('localization_id' => $localization_id);
if (!empty($data['countries'])) {
$_data['element_type'] = 'C';
foreach ($data['countries'] as $key => $value) {
$_data['element'] = $value;
$_data['position'] = POSITIONS_STEP * $key;
db_query('INSERT INTO ?:localization_elements ?e', $_data);
}
}
if (!empty($data['currencies'])) {
$_data['element_type'] = 'M';
foreach ($data['currencies'] as $key => $value) {
$_data['element'] = $value;
$_data['position'] = POSITIONS_STEP * $key;
db_query('INSERT INTO ?:localization_elements ?e', $_data);
}
}
if (!empty($data['languages'])) {
$_data['element_type'] = 'L';
foreach ($data['languages'] as $key => $value) {
$_data['element'] = $value;
$_data['position'] = POSITIONS_STEP * $key;
db_query('INSERT INTO ?:localization_elements ?e', $_data);
}
}
return $localization_id;
}
开发者ID:askzap,项目名称:ultimate,代码行数:44,代码来源:localizations.php
示例13: die
use Tygh\Mailer;
if (!defined('BOOTSTRAP')) {
die('Access denied');
}
if ($_SERVER['REQUEST_METHOD'] == "POST") {
fn_trusted_vars('settings_data');
if ($mode == "update_settings") {
if (!empty($_REQUEST['settings_data'])) {
if (!empty($_REQUEST['settings_data']['statuses'])) {
$_REQUEST['settings_data']['statuses'] = implode(',', $_REQUEST['settings_data']['statuses']);
}
$check = db_get_row("SELECT * FROM ?:orders_feedback WHERE feedback_id = ?i AND lang_code=?s", $_REQUEST['feedback_id'], DESCR_SL);
if (!empty($check)) {
db_query("UPDATE ?:orders_feedback SET ?u WHERE feedback_id = ?i AND lang_code=?s", $_REQUEST['settings_data'], $_REQUEST['feedback_id'], DESCR_SL);
} else {
foreach (fn_get_translation_languages() as $_REQUEST['settings_data']['lang_code'] => $v) {
$_REQUEST['settings_data']['feedback_id'] = db_query("INSERT INTO ?:orders_feedback ?e", $_REQUEST['settings_data']);
}
return array(CONTROLLER_STATUS_OK, "orders_feedback.update?feedback_id=" . $_REQUEST['settings_data']['feedback_id']);
}
}
return array(CONTROLLER_STATUS_OK, "orders_feedback.update?feedback_id=" . $_REQUEST['feedback_id']);
}
if ($mode == "test_send") {
$test_email = $_REQUEST['test_email'];
$remind = $_REQUEST['settings_data'];
$remind['lang_code'] = DESCR_SL;
if (fn_validate_email($test_email)) {
$statuses = $remind['statuses'];
$remind_orders = db_get_array("SELECT * FROM ?:orders WHERE status in (?a) AND lang_code=?s", $statuses, $remind['lang_code']);
if (!empty($remind_orders)) {
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:orders_feedback.php
示例14: fn_access_restrictions_user_init
function fn_access_restrictions_user_init(&$auth, &$user_info)
{
$iplong = fn_get_ip(true);
$acc_r = Registry::get('addons.access_restrictions');
if (AREA == 'A' && $acc_r['unsuccessful_attempts_login'] == 'Y' || AREA != 'A' && $acc_r['unsuccessful_attempts_login_customer'] == 'Y') {
$block = db_get_row("SELECT * FROM ?:access_restriction_block WHERE ip >= ?i", $iplong['host']);
$failed_atempts = AREA == 'A' ? $acc_r['number_unsuccessful_attempts'] : $acc_r['number_unsuccessful_attempts_customer'];
if (!empty($block) && $block['tries'] >= $failed_atempts) {
$time_block = AREA == 'A' ? $acc_r['time_block'] : $acc_r['time_block_customer'];
$restrict_ip = array('ip_from' => $iplong['host'], 'ip_to' => $iplong['host'], 'type' => AREA == 'A' ? 'aab' : 'ipb', 'timestamp' => TIME, 'expires' => TIME + round($time_block * 3600), 'status' => 'A');
$__data['item_id'] = db_query("REPLACE INTO ?:access_restriction ?e", $restrict_ip);
$__data['type'] = AREA == 'A' ? 'aab' : 'ipb';
foreach (fn_get_translation_languages() as $__data['lang_code'] => $v) {
$__data['reason'] = str_replace("[number]", $failed_atempts, __('text_ip_blocked_failed_login', '', $__data['lang_code']));
db_query("REPLACE INTO ?:access_restriction_reason_descriptions ?e", $__data);
}
db_query("DELETE FROM ?:access_restriction_block WHERE ip = ?i", $block['ip']);
}
}
db_query("DELETE FROM ?:access_restriction_block WHERE expires < ?i", TIME);
db_query("DELETE FROM ?:access_restriction WHERE (type = 'ipb' OR type = 'aab') AND expires < ?i", TIME);
$ar_type = AREA != 'A' ? "a.type IN ('ips', 'ipr', 'ipb')" : "a.type IN ('aas', 'aar', 'aab')";
$restricted = db_get_row("SELECT a.item_id, b.reason FROM ?:access_restriction as a LEFT JOIN ?:access_restriction_reason_descriptions as b ON a.item_id = b.item_id AND a.type = b.type AND lang_code = ?s WHERE ip_from <= ?i AND ip_to >= ?i AND {$ar_type} AND status = 'A'", CART_LANGUAGE, $iplong['host'], $iplong['host']);
if ($restricted && (AREA != 'A' || $acc_r['admin_reverse_ip_access'] != 'Y')) {
die(!empty($restricted['reason']) ? $restricted['reason'] : __('text_ip_is_blocked'));
} elseif (!$restricted && $acc_r['admin_reverse_ip_access'] == 'Y' && AREA == 'A') {
die(__('text_ips_denied'));
}
$is_domain_restricted = db_get_field("SELECT COUNT(*) FROM ?:access_restriction WHERE type='d' AND status = 'A'");
if ($is_domain_restricted && empty($_SESSION['access_domain'])) {
$ip = fn_get_ip();
$domain = gethostbyaddr($ip['host']);
fn_domain_is_blocked($domain);
$_SESSION['access_domain'] = $domain;
}
}
开发者ID:Technollland,项目名称:afa,代码行数:36,代码来源:func.php
示例15: fn_data_feeds_update_feed
function fn_data_feeds_update_feed($feed_data, $feed_id = 0, $lang_code = CART_LANGUAGE)
{
if (!empty($feed_data['fields'])) {
$_fields = array();
foreach ($feed_data['fields'] as $key => $field) {
if (empty($field['export_field_name'])) {
unset($feed_data['fields'][$key]);
} else {
$_fields[intval($field['position'])][] = $field;
}
}
}
if (!empty($_fields)) {
ksort($_fields);
unset($feed_data['fields']);
foreach ($_fields as $fields) {
if (is_array($fields)) {
foreach ($fields as $field) {
$feed_data['fields'][] = $field;
}
}
}
}
$feed_data['fields'] = serialize($feed_data['fields']);
$feed_data['export_options'] = serialize(!empty($feed_data['export_options']) ? $feed_data['export_options'] : array());
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
$feed_data['company_id'] = Registry::get('runtime.company_id');
}
if (empty($feed_id)) {
$feed_id = db_query("INSERT INTO ?:data_feeds ?e", $feed_data);
if (!empty($feed_id)) {
$_data = array();
$_data['datafeed_id'] = $feed_id;
$_data['datafeed_name'] = $feed_data['datafeed_name'];
foreach (fn_get_translation_languages() as $_data['lang_code'] => $_v) {
db_query("INSERT INTO ?:data_feed_descriptions ?e", $_data);
}
}
} else {
db_query("UPDATE ?:data_feeds SET ?u WHERE datafeed_id = ?i", $feed_data, $feed_id);
unset($feed_data['lang_code']);
db_query("UPDATE ?:data_feed_descriptions SET ?u WHERE datafeed_id = ?i AND lang_code = ?s", $feed_data, $feed_id, $lang_code);
}
return $feed_id;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:45,代码来源:data_feeds.php
示例16: content_55dc7db6ede751_81542503
//.........这里部分代码省略.........
<?php
} else {
?>
<?php
$_smarty_tpl->tpl_vars['hidden'] = new Smarty_variable(true, null, 0);
?>
<?php
}
?>
<?php
echo $_smarty_tpl->getSubTemplate("common/select_status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('obj' => $_smarty_tpl->tpl_vars['lang_data']->value, 'display' => "radio", 'input_name' => "language_data[status]", 'hidden' => $_smarty_tpl->tpl_vars['hidden']->value), 0);
?>
<?php
if (!$_smarty_tpl->tpl_vars['id']->value) {
?>
<div class="control-group">
<label for="elm_from_lang_code_<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
?>
" class="control-label cm-required"><?php
echo $_smarty_tpl->__("clone_from");
?>
:</label>
<div class="controls">
<select name="language_data[from_lang_code]" id="elm_from_lang_code_<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['id']->value, ENT_QUOTES, 'UTF-8');
?>
">
<?php
$_smarty_tpl->tpl_vars["language"] = new Smarty_Variable();
$_smarty_tpl->tpl_vars["language"]->_loop = false;
$_from = fn_get_translation_languages('');
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars["language"]->key => $_smarty_tpl->tpl_vars["language"]->value) {
$_smarty_tpl->tpl_vars["language"]->_loop = true;
?>
<option value="<?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['language']->value['lang_code'], ENT_QUOTES, 'UTF-8');
?>
"><?php
echo htmlspecialchars($_smarty_tpl->tpl_vars['language']->value['name'], ENT_QUOTES, 'UTF-8');
?>
</option>
<?php
}
?>
</select>
</div>
</div>
<?php
}
?>
<?php
$_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "languages:update"));
$_block_repeat = true;
echo smarty_block_hook(array('name' => "languages:update"), null, $_smarty_tpl, $_block_repeat);
while ($_block_repeat) {
ob_start();
$_block_content = ob_get_clean();
$_block_repeat = false;
echo smarty_block_hook(array('name' => "languages:update"), $_block_content, $_smarty_tpl, $_block_repeat);
开发者ID:AlanIsrael0,项目名称:market,代码行数:67,代码来源:64e681c12a98f8718a821d65999d162a7868d4a0.tygh.update.tpl.php
示例17: fn_add_field_values
function fn_add_field_values($values = array(), $field_id = 0)
{
if (empty($values) || empty($field_id)) {
return false;
}
foreach ($values as $_v) {
if (empty($_v['description'])) {
continue;
}
// Insert main data
$_v['field_id'] = $field_id;
$value_id = db_query("INSERT INTO ?:profile_field_values ?e", $_v);
// Insert descriptions
$_data = array('object_id' => $value_id, 'object_type' => 'V', 'description' => $_v['description']);
foreach (fn_get_translation_languages() as $_data['lang_code'] => $_v) {
db_query("INSERT INTO ?:profile_field_descriptions ?e", $_data);
}
}
return true;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:20,代码来源:profile_fields.php
示例18: fn_update_sitemap_links
/**
* Create/Update sitemap links
*
* @param array $links_data Links update data
* @param int $section_id Section identifier
*/
function fn_update_sitemap_links($links_data, $section_id)
{
$link_ids = array();
foreach ($links_data as $link_data) {
if (!empty($link_data['link'])) {
fn_set_hook('sitemap_update_object', $link_data);
if (empty($link_data['link_id'])) {
$link_data['section_id'] = $section_id;
$link_id = db_query("INSERT INTO ?:sitemap_links ?e", $link_data);
$link_ids[] = $link_id;
if (!empty($link_id)) {
$_data = array();
foreach (fn_get_translation_languages() as $lang_code => $_lang_data) {
$_data[] = array('object' => $link_data['link'], 'object_id' => $link_id, 'object_holder' => 'sitemap_links', 'lang_code' => $lang_code);
}
db_query("INSERT INTO ?:common_descriptions ?m", $_data);
}
} else {
$link_data['section_id'] = $section_id;
$link_ids[] = $link_data['link_id'];
db_query("UPDATE ?:sitemap_links SET ?u WHERE link_id = ?i", $link_data, $link_data['link_id']);
db_query("UPDATE ?:common_descriptions SET object=?s WHERE object_id = ?i AND lang_code = ?s AND object_holder = 'sitemap_links'", $link_data['link'], $link_data['link_id'], DESCR_SL);
}
}
}
$obsolete_ids = db_get_fields("SELECT link_id FROM ?:sitemap_links WHERE section_id = ?i AND link_id NOT IN (?n)", $section_id, $link_ids);
if (!empty($obsolete_ids)) {
fn_delete_sitemap_links($obsolete_ids);
}
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:36,代码来源:fn.cms.php
示例19: fn_update_product_filter
function fn_update_product_filter($filter_data, $filter_id, $lang_code = DESCR_SL)
{
if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) {
if (!empty($filter_id) && !fn_check_company_id('product_filters', 'filter_id', $filter_id)) {
fn_company_access_denied_notification();
return false;
}
if (!empty($filter_id)) {
unset($filter_data['company_id']);
}
}
// Parse filter type
if (strpos($filter_data['filter_type'], 'FF-') === 0 || strpos($filter_data['filter_type'], 'RF-') === 0 || strpos($filter_data['filter_type'], 'DF-') === 0) {
$filter_data['feature_id'] = str_replace(array('RF-', 'FF-', 'DF-'), '', $filter_data['filter_type']);
$filter_data['feature_type'] = db_get_field("SELECT feature_type FROM ?:product_features WHERE feature_id = ?i", $filter_data['feature_id']);
} else {
$filter_data['field_type'] = str_replace(array('R-', 'B-'), '', $filter_data['filter_type']);
$filter_fields = fn_get_product_filter_fields();
}
if (isset($filter_data['display_more_count']) && isset($filter_data['display_count']) && $filter_data['display_more_count'] < $filter_data['display_count']) {
$filter_data['display_more_count'] = $filter_data['display_count'];
}
if (!empty($filter_id)) {
db_query('UPDATE ?:product_filters SET ?u WHERE filter_id = ?i', $filter_data, $filter_id);
db_query('UPDATE ?:product_filter_descriptions SET ?u WHERE filter_id = ?i AND lang_code = ?s', $filter_data, $filter_id, $lang_code);
} else {
$filter_data['filter_id'] = $filter_id = db_query('INSERT INTO ?:product_filters ?e', $filter_data);
foreach (fn_get_translation_languages() as $filter_data['lang_code'] => $_d) {
db_query("INSERT INTO ?:product_filter_descriptions ?e", $filter_data);
}
}
$delete_all_ranges = false;
// if filter has ranges
if (!empty($filter_data['feature_type']) && strpos('ODN', $filter_data['feature_type']) !== false || !empty($filter_data['field_type']) && !empty($filter_fields[$filter_data['field_type']]['is_range'])) {
$range_ids = array();
foreach ($filter_data['ranges'] as $k => $range) {
if (!empty($filter_data['feature_type']) && $filter_data['feature_type'] == 'D') {
$range['to'] = fn_parse_date($filter_data['dates_ranges'][$k]['to']);
$range['from'] = fn_parse_date($filter_data['dates_ranges'][$k]['from']);
}
$range['filter_id'] = $filter_id;
if (!empty($filter_data['feature_id'])) {
$range['feature_id'] = $filter_data['feature_id'];
}
if (!empty($range['range_id'])) {
db_query("UPDATE ?:product_filter_ranges SET ?u WHERE range_id = ?i", $range, $range['range_id']);
db_query('UPDATE ?:product_filter_ranges_descriptions SET ?u WHERE range_id = ?i AND lang_code = ?s', $range, $range['range_id'], $lang_code);
} elseif ((!empty($range['from']) || !empty($range['to'])) && !empty($range['range_name'])) {
$range['range_id'] = db_query("INSERT INTO ?:product_filter_ranges ?e", $range);
foreach (fn_get_translation_languages() as $range['lang_code'] => $_d) {
db_query("INSERT INTO ?:product_filter_ranges_descriptions ?e", $range);
}
}
if (!empty($range['range_id'])) {
$range_ids[] = $range['range_id'];
}
}
if (!empty($range_ids)) {
$deleted_ranges = db_get_fields("SELECT range_id FROM ?:product_filter_ranges WHERE filter_id = ?i AND range_id NOT IN (?n)", $filter_id, $range_ids);
if (!empty($deleted_ranges)) {
db_query("DELETE FROM ?:product_filter_ranges WHERE rang
|
请发表评论