本文整理汇总了PHP中cw_include函数的典型用法代码示例。如果您正苦于以下问题:PHP cw_include函数的具体用法?PHP cw_include怎么用?PHP cw_include使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cw_include函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cw_fbauth_user_login
function cw_fbauth_user_login($user)
{
global $tables, $current_area;
cw_load('crypt', 'user', 'mail');
$user_data = cw_query_first("SELECT customer_id, email, password\n\t\t\t\t\t\t\t\t\tFROM {$tables['customers']} \n\t\t\t\t\t\t\t\t\tWHERE oauth_uid='" . $user['id'] . "' AND oauth_type='F' \n\t\t\t\t\t\t\t\t\t\tAND usertype='" . $current_area . "' \n\t\t\t\t\t\t\t\t\t\tAND status='Y'");
if (!empty($user_data)) {
// login user
global $email, $password, $action;
$email = $user_data['email'];
$password = text_decrypt($user_data['password']);
$action = 'login';
cw_include('include/login.php');
} else {
// create user
$register = array();
$register['email'] = $user['email'];
if (strpos($user['email'], "proxymail.facebook.com") !== FALSE) {
cw_header_location("index.php?target=fb_auth_get_email", TRUE);
}
$register['password'] = $register['password2'] = md5(uniqid('cw_', TRUE), TRUE);
$register['usertype'] = $current_area;
$partner_membership =& cw_session_register('partner_membership');
$register['membership_id'] = $partner_membership;
$customer_id = cw_user_create_profile($register);
$identifiers =& cw_session_register('identifiers', array());
$identifiers[$current_area] = array('customer_id' => $customer_id);
$customer = array('oauth_uid' => $user['id']);
cw_array2update('customers', $customer, "customer_id='{$customer_id}'");
$address = array('main' => 1, 'firstname' => $user['first_name'], 'lastname' => $user['last_name']);
$additional_info = array('sex' => $user['gender'] == 'male' ? 1 : 0);
$userinfo = array('addresses' => $address, 'additional_info' => $additional_info);
cw_user_update($userinfo, $customer_id, $customer_id);
cw_user_send_modification_mail($customer_id, TRUE);
}
}
示例2: cw_google_base_cron
function cw_google_base_cron()
{
global $domain_id;
cw_include('addons/google_base/gb_attributes_map.php');
$log = array();
$domains = cw_func_call('cw_md_get_domains');
foreach ($domains as $domain) {
$domain_id = $domain['domain_id'];
$count = cw_include('addons/google_base/create_gb_xml.php');
$log[] = $count . ' records were exported to feed';
}
return join("\n", $log);
}
示例3: cw_checkout_login_prepare
function cw_checkout_login_prepare()
{
global $smarty, $user_account, $customer_id, $user_address;
$customer_id =& cw_session_register('customer_id', 0);
$fields_area = cw_profile_fields_get_area($customer_id, $salesman_membership, 1);
list($profile_sections, $profile_fields, $additional_fields) = cw_profile_fields_get_sections('U', true, $fields_area);
# kornev, the login information is not required here.
if ($customer_id) {
unset($profile_sections['web']);
}
$smarty->assign('profile_fields', $profile_fields);
$smarty->assign('profile_sections', $profile_sections);
cw_include('include/check_userdata.php');
cw_include('include/check_usercart.php');
$userinfo = cw_call('cw_checkout_userinfo', array($user_account));
$smarty->assign('userinfo', $userinfo);
$smarty->assign('user_account', $user_account);
}
示例4: cw_googleplus_on_logout
function cw_googleplus_on_logout()
{
$googleplus_login_info =& cw_session_register('googleplus_login_info');
unset($googleplus_login_info['token']);
$google_client_id = '376787991969-2c127o3n2vollhqfla26q1mfu1qi7n8s.apps.googleusercontent.com';
$google_client_secret = '25mdbO_DAlPE_aST_hErSzDN';
$google_redirect_url = 'http://dev.cartworks.com/product_stages/index.php';
//path to your script
$google_developer_key = 'AIzaSyAOCvjaVfFFiL4OnlI8du8pHHNZGPsY3iU';
cw_include('addons/googleplus_login/include/src/Google_Client.php');
cw_include('addons/googleplus_login/include/src/contrib/Google_Oauth2Service.php');
$gClient = new Google_Client();
$gClient->setApplicationName('Test Google+ Login CW');
$gClient->setClientId($google_client_id);
$gClient->setClientSecret($google_client_secret);
$gClient->setRedirectUri($google_redirect_url);
$gClient->setDeveloperKey($google_developer_key);
$gClient->revokeToken();
}
示例5: cw_include
<?php
/*
* Vendor: cw
* addon: twitter_login
*/
/*
* init.php
* this file only defines constants, variables, functinos, hooks and event hanlers
* no real routine must be here on init stage
*/
// Use namespace for your own addon as vendor\addon_name
//namespace cw\twitter_login;
// Constants definition
// these constants are defined in scope of addon's namespace
//const addon_name = 'twitter_login';
// Include functions
cw_include('addons/twitter_login/include/func.php');
if (APP_AREA == 'customer') {
cw_set_controller('include/check_useraccount.php', 'addons/twitter_login/post_init.php', EVENT_POST);
cw_set_controller(APP_AREA . '/twitter_login_verified.php', 'addons/twitter_login/customer/twitter_login_verified.php', EVENT_REPLACE);
cw_event_listen('on_logout', 'cw_twitter_on_logout');
cw_addons_set_template(array('post', 'buttons/social_media_panel.tpl', 'addons/twitter_login/customer/auth-button.tpl'));
}
示例6: array
$product_list_template = 2;
}
$identifiers[$current_area == 'R' ? 'C' : $current_area] = array('customer_id' => $user_data['customer_id']);
$customer_id = $user_data['customer_id'];
if (in_array($current_area, array("C", "R"))) {
cw_session_register("login_redirect");
$login_redirect = 1;
}
// Update addresses in session from database
$user_address =& cw_session_register('user_address', array());
$user_address['current_address'] = cw_user_get_address($customer_id, 'current');
$user_address['main_address'] = cw_user_get_address($customer_id, 'main');
db_query("update {$tables['customers_system_info']} set last_login='" . cw_core_get_time() . "' where customer_id='{$customer_id}'");
$current_language = $user_data['language'];
$items_per_page_targets = cw_core_restore_navigation($customer_id);
cw_include('init/lng.php');
$cart =& cw_session_register('cart', array());
if ($current_area == "C" && cw_is_cart_empty($cart)) {
$cart = cw_user_get_stored_cart($customer_id);
}
$userinfo = cw_user_get_info($customer_id);
$products = cw_call('cw_products_in_cart', array($cart, $userinfo));
$cart = cw_func_call('cw_cart_calc', array('cart' => $cart, 'products' => $products, 'userinfo' => $userinfo));
cw_event('on_login', array($customer_id, $current_area, 0));
if (!empty($instagram_login_info['return_url'])) {
cw_header_location($instagram_login_info['return_url']);
} else {
cw_header_location($instagram_redirect_url);
}
}
} else {
示例7: cw_include
<?php
if ($mode == 'add' || !empty($contentsection_id)) {
cw_include('addons/cms/cs_banner.php');
} else {
cw_include('addons/cms/cs_banners.php');
}
示例8: cw_query_column
}
$disabled = cw_query_column("select addon from {$tables['addons']} where active = 0");
db_query("update {$tables['addons']} set active=0 where parent in ('" . implode("', '", $disabled) . "')");
cw_header_location("index.php?target={$target}&mode=addons");
}
if ($action == 'ajax_update') {
db_query("update {$tables['addons']} set active=abs(active-1) where addon='{$addon}' and status>'" . constant('ADDON_TYPE_CORE') . "'");
$active = cw_query_first_cell("select active from {$tables['addons']} where addon='{$addon}'");
cw_add_ajax_block(array('id' => 'script', 'content' => '$("#' . $addon . '").removeClass("on").removeClass("off").addClass("' . ($active == 1 ? 'on' : 'off') . '");'));
cw_add_ajax_block(array('id' => 'script', 'content' => '$("[parent=' . $addon . ']").parent().removeClass("addon_locked")' . ($active == 1 ? '' : '.addClass("addon_locked")') . ';'));
}
$addon = $_GET['addon'];
if (!empty($addon) && $mode == 'addons') {
# kornev, TOFIX generally this should be removed
if (is_file($app_main_dir . '/addons/' . $addon . '/admin/settings.php')) {
cw_include('addons/' . $addon . '/admin/settings.php');
}
if ($REQUEST_METHOD == 'POST') {
cw_header_location("index.php?target={$target}&mode=addons&addon={$addon}");
}
$smarty->assign('addon', $addon);
$smarty->assign('addon_name', cw_get_langvar_by_name('addon_name_' . $addon));
$location[] = array(cw_get_langvar_by_name('lbl_addons'), 'index.php?target=' . $target);
$location[] = array($addon, '');
$smarty->assign('main', 'addon_settings');
} elseif (empty($addon)) {
$addons = cw_addons_get();
if (!isset($status) || empty($status)) {
$status = constant('ADDON_TYPE_GENERAL');
}
foreach ($addons as $k => $v) {
示例9: array
<?php
/*
* Vendor: CW
* addon: ebay
*/
namespace CW\ebay;
const addon_name = 'ebay';
const addon_target = 'ebay_export';
const addon_version = '0.1';
const addon_files_location_path = 'files/ebay/';
const addon_conditions_data_file_name = 'ConditionIDs_by_Category.csv';
if (APP_AREA == 'admin' && $target == addon_target && !empty($addons[addon_name])) {
$ebay_config = array('ebay_action' => 'Add', 'ebay_category' => 1, 'ebay_condition_id' => 1000, 'ebay_duration' => 1, 'ebay_format' => 'Auction (default)', 'ebay_immediate_pay_required' => 0, 'ebay_location' => '', 'ebay_paypal_accepted' => 0, 'ebay_paypal_email_address' => '', 'ebay_dispatch_time_max' => 1, 'ebay_returns_accepted_option' => 'ReturnsAccepted');
cw_addons_set_controllers(array('replace', 'admin/' . addon_target . '.php', 'addons/' . addon_name . '/' . addon_target . '.php'));
cw_include('addons/' . addon_name . '/func.php');
cw_addons_set_template(array('replace', 'admin/main/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'), array('replace', 'admin/import_export/ebay_export.tpl', 'addons/ebay/ebay_export.tpl'));
}
if (APP_AREA == 'admin') {
cw_set_controller('admin/ajax_ebay_category_select.php', 'addons/ebay/ebay_attributes_modify.php', EVENT_REPLACE);
cw_addons_set_template(array('post', 'main/attributes/default_types.tpl', 'addons/ebay/types/ebay_category_selector.tpl'));
cw_addons_add_js('jquery/dynatree-1.2.4/jquery.dynatree.min.js');
cw_addons_add_css('jquery/dynatree-1.2.4/ui.dynatree.css');
}
示例10: cw_include
<?php
global $self_modification;
$self_modification = 1;
cw_include('include/users/info.php');
示例11: cw_header_location
case 'add_new_content_section':
if ($action == 'update_content_section' && empty($contentsection_id)) {
cw_header_location('index.php?target=cms&mode=add');
}
if (!empty($content_section) && is_array($content_section)) {
//$content_section = array_map('trim', $content_section);
cw_core_process_date_fields($content_section, array(0 => array('start_date' => 0, 'end_date' => 1)));
$content_section['orderby'] = intval($content_section['orderby']);
$content_section['display_on_404'] = empty($content_section['display_on_404']) ? 'N' : 'Y';
$content_section['active'] = empty($content_section['active']) ? 'N' : 'Y';
$content_section['parse_smarty_tags'] = !empty($content_section['parse_smarty_tags']);
$presaved_content_section = $content_section;
/*
* Validation
*/
cw_include('include/lib/formvalidator/formvalidator.php', INCLUDE_NO_GLOBALS);
// Errors
$validator = new FormValidator();
$validator->addValidation("service_code", "req", cw_get_langvar_by_name('msg_ab_err_servicecode_is_empty'));
$validator->addValidation("service_code", "varname", cw_get_langvar_by_name('msg_ab_err_wrong_servicecode_format'));
if (!$validator->ValidateForm($content_section)) {
cw_add_top_message($validator->GetErrors(), 'E');
cw_header_location('index.php?target=cms&edit=Y&mode=' . ($action == 'add_new_content_section' ? 'add' : 'update&contentsection_id=' . $contentsection_id));
}
// Warnings
$validator = new FormValidator();
$validator->addValidation("name", "req", cw_get_langvar_by_name('msg_ab_warn_empty_contentsection_name'));
if ($content_section['type'] == 'html' || $content_section['type'] == 'image') {
$validator->addValidation("url", "req", cw_get_langvar_by_name('msg_ab_warn_empty_contentsection_url'));
}
// $validator->addValidation("url","url",'Invalid URL');
示例12: cw_include
<?php
cw_include('include/login.php');
示例13: define
<?php
$tables['flexible_import_profiles'] = 'cw_flexible_import_profiles';
$tables['flexible_import_files'] = 'cw_flexible_import_files';
$var_dirs['flex_import_test'] = $app_dir . '/files/flex_import_test';
define("fi_files_path", "./files/flexible_import/");
global $csvxc_field_types;
$csvxc_field_types = array('PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'PRICE_MODIFIER' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'DESCR' => "text NOT NULL DEFAULT ''", 'FULLDESCR' => "text NOT NULL DEFAULT ''", 'PRODUCTID' => "int(11) NOT NULL DEFAULT '0'", 'PRODUCTID_TO' => "int(11) NOT NULL DEFAULT '0'", 'OPTIONID' => "int(11) NOT NULL DEFAULT '0'", 'CLASSID' => "int(11) NOT NULL DEFAULT '0'", 'ADD_DATE' => "int(11) NOT NULL DEFAULT '0'", 'WEIGHT' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'LIST_PRICE' => "decimal(12,2) NOT NULL DEFAULT '0.00'", 'AVAIL' => "int(11) NOT NULL DEFAULT '0'", 'MIN_AMOUNT' => "int(11) NOT NULL DEFAULT '0'", 'LOW_AVAIL_LIMIT' => "int(11) NOT NULL DEFAULT '0'", 'default' => "varchar(255) NOT NULL DEFAULT ''");
global $tmp_load_tables;
$tmp_load_tables = array('CATEGORIES' => array('CATEGORYID' => array('type' => 'int', 'key' => true), 'CATEGORY' => array('type' => 'text', 'key' => true), 'DESCR' => array('type' => 'longtext'), 'META_DESCR' => array('type' => 'longtext'), 'AVAIL' => array('type' => 'bool'), 'ORDERBY' => array('type' => 'int'), 'META_KEYWORDS' => array('type' => 'text'), 'ICON' => array('type' => 'text', 'file_path' => true)), 'PRODUCTS' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'WEIGHT' => array('type' => 'text'), 'LIST_PRICE' => array('type' => 'text'), 'DESCR' => array('type' => 'longtext'), 'FULLDESCR' => array('type' => 'longtext'), 'KEYWORDS' => array('type' => 'text'), 'AVAIL' => array('type' => 'text'), 'RATING' => array('type' => 'text'), 'FORSALE' => array('type' => 'text'), 'SHIPPING_FREIGHT' => array('type' => 'text'), 'FREE_SHIPPING' => array('type' => 'text'), 'DISCOUNT_AVAIL' => array('type' => 'text'), 'MIN_AMOUNT' => array('type' => 'text'), 'DIM_X' => array('type' => 'text'), 'DIM_Y' => array('type' => 'text'), 'DIM_Z' => array('type' => 'text'), 'LOW_AVAIL_LIMIT' => array('type' => 'text'), 'FREE_TAX' => array('type' => 'text'), 'CATEGORYID' => array('type' => 'int', 'grouped_key' => array('CATEGORY')), 'CATEGORY' => array('type' => 'text', 'grouped_key' => array('CATEGORYID')), 'MEMBERSHIP' => array('type' => 'text', 'grouped_key' => array('MEMBERSHIPID')), 'PRICE' => array('type' => 'text'), 'THUMBNAIL' => array('type' => 'text'), 'IMAGE' => array('type' => 'text'), 'TAXES' => array('type' => 'text'), 'ADD_DATE' => array('type' => 'text'), 'MANUFACTURERID' => array('type' => 'int', 'grouped_key' => array('MANUFACTURER')), 'MANUFACTURER' => array('type' => 'text', 'grouped_key' => array('MANUFACTURERID')), 'MEMBERSHIPID' => array('type' => 'int', 'grouped_key' => array('MEMBERSHIP')), 'SUPPLIERID' => array('type' => 'text'), 'COST' => array('type' => 'text')), 'PRODUCTS_EXTRA_FIELD_VALUES' => array('PRODUCTID' => array('type' => 'int', 'key' => true), 'PRODUCTCODE' => array('type' => 'text', 'key' => true), 'PRODUCT' => array('type' => 'text', 'key' => true), 'dynamic_field_set' => array('query' => "select field from {$tables['attributes']} where item_type='P' and addon in ('', 'custom_saratogawine_magazines','custom_saratogawine_backorder','clean_urls')")));
if (APP_AREA == 'admin') {
cw_include('addons/flexible_import/include/func.flexible_import.php');
cw_include('addons/flexible_import/include/func.import.csvxcart.php');
cw_include('addons/flexible_import/include/csv_def_arrays.php');
cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import.php', EVENT_POST);
cw_set_controller('admin/import.php', 'addons/flexible_import/admin/flexible_import_profile.php', EVENT_POST);
cw_addons_set_template(array('replace', 'admin/import_export/flexible_import.tpl', 'addons/flexible_import/flexible_import.tpl'), array('replace', 'admin/import_export/flexible_import_profile.tpl', 'addons/flexible_import/add_modify_import_profile.tpl'));
cw_addons_add_js('addons/flexible_import/flexible_import.js');
cw_addons_add_css('addons/flexible_import/flexible_import.css');
cw_set_hook('cw_error_check', 'cw_flexible_import_validate_import_file', EVENT_POST);
}
示例14: cw_header_location
if (!$addons['Gift_Registry']) {
cw_header_location('index.php');
}
$access_status =& cw_session_register("access_status", array());
if ($mode == "preview") {
$html_content = cw_query_first_cell("SELECT html_content FROM {$tables['giftreg_events']} WHERE event_id='{$eventid}'");
if (!empty($html_content)) {
echo $html_content;
} else {
echo "<br /><br /><br /><br /><h3 align=\"center\">" . cw_get_langvar_by_name("lbl_no_html_content", false, false, true) . "</h3>";
}
exit;
}
if (!empty($cc)) {
# Confirm/Decline the participation by recipient
# $cc - is a confirmation code passed via GET request
cw_include('addons/Gift_Registry/giftreg_confirm.php');
}
if (!empty($eventid)) {
if (!empty($wlid)) {
if (cw_query_first_cell("SELECT event_id FROM {$tables['wishlist']} WHERE wishlist_id='{$wild}'") == $eventid) {
$wlid_eventid =& cw_session_register("wlid_eventid");
$wlid_eventid = $eventid;
cw_session_save("wlid_eventid");
}
}
cw_include('addons/Gift_Registry/event_guestbook.php');
cw_include('addons/Gift_Registry/giftreg_display.php');
} else {
cw_include('addons/Gift_Registry/giftreg_search.php');
}
示例15: cw_load
<?php
global $docs_type;
$docs_type = 'O';
cw_load('doc');
if ($action == 'add') {
$doc_id = cw_doc_create_empty($docs_type . '_');
// Create temporary doc_type until first POST request
cw_header_location("index.php?target={$target}&doc_id={$doc_id}&mode=edit");
} elseif ($doc_id) {
cw_include('include/orders/order.php');
} else {
cw_include('include/orders/orders.php');
}
$smarty->assign('page_acl', '__18');