本文整理汇总了PHP中mgm_stripslashes_deep函数的典型用法代码示例。如果您正苦于以下问题:PHP mgm_stripslashes_deep函数的具体用法?PHP mgm_stripslashes_deep怎么用?PHP mgm_stripslashes_deep使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mgm_stripslashes_deep函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_field_subscription_options_html
/**
* get subscription options html
*/
function _get_field_subscription_options_html($subs_enc, $opt_id, $selected, $checked, $pack, $dispaly_as_selectbox, $pack_desc, &$options, &$html)
{
//issue #1234
if ($dispaly_as_selectbox) {
$options .= '<option value="' . $subs_enc . '" id="' . $opt_id . '" ' . $selected . '>' . $pack_desc . '</option>';
} else {
// html
//NOTE: Do not change the mgm_subs_wrapper class. It is being used in payment_gateways Custom field
$input = sprintf('<input type="radio" %s class="mgm_subs_radio" name="mgm_subscription" id="mgm_subscription_%d" value="%s" rel="mgm_subscription_options"/>', $checked, $pack['id'], $subs_enc);
//Refer to : function field_payment_gateways_callback()
$html .= '<div class="mgm_subs_wrapper ' . $pack['membership_type'] . ' ">
<div class="mgm_subs_option ' . $pack['membership_type'] . '">
' . $input . '
</div>
<div class="mgm_subs_pack_desc ' . $pack['membership_type'] . '">
' . $pack_desc . '
</div>
<div class="clearfix ' . $pack['membership_type'] . '"></div>
<div class="mgm_subs_desc ' . $pack['membership_type'] . '">
' . mgm_stripslashes_deep($pack['description']) . '
</div>
</div>';
}
}
示例2: _e
</div>
<div class="row">
<div class="cell">
<p><b><?php
_e('Description', 'mgm');
?>
:</b></p>
</div>
</div>
<div class="row">
<div class="cell">
<textarea name="description" id="setting_description_<?php
echo $data['module']->code;
?>
" rows='4' cols='75' class="width750px height100px"><?php
echo mgm_stripslashes_deep(esc_html($data['module']->description));
?>
</textarea>
<div class="clearfix"></div>
<p><div class="tips"><?php
_e('Description shown on payment page.', 'mgm');
?>
</div></p>
</div>
</div>
<div class="row">
<div class="cell">
<p><b><?php
_e('Test/Live Switch', 'mgm');
?>
:</b></p>
示例3: _get_button_code
function _get_button_code($pack, $tran_id = NULL)
{
// get data
$data = $this->_get_button_data($pack, $tran_id);
// log
// mgm_log($data, $this->module . '_' .__FUNCTION__);
// strip
$data = mgm_stripslashes_deep($data);
// init
$return = '';
// create return
foreach ($data as $key => $value) {
$return .= '<input type="hidden" name="' . $key . '" value="' . esc_html($value) . '" />' . "\n";
}
// return
return $return;
}
示例4: _e
?>
</div></p>
</div>
</div>
<div class="row">
<div class="cell">
<p><b><?php
_e('Worldpay Gateway Transaction Failed Page Contents', 'mgm');
?>
:</b></p>
</div>
</div>
<div class="row">
<div class="cell">
<textarea name="gateway_failedpage" id="setting_gateway_errorpage" rows='4' cols='75' class="width750px height100px"><?php
echo mgm_stripslashes_deep(esc_html($data['module']->setting['gateway_failedpage']));
?>
</textarea>
<div class="clearfix"></div>
<p><div class="tips"><?php
_e('Contents to be displayed on Wordlpay Gateway failed page.<br/>The default thankyou page on Merchant gateway needs to be replaced by this html.<br/>Copy and paste the html into <strong>resultC.html</strong> on Merchant Gateway', 'mgm');
?>
</div></p>
</div>
</div>
<div class="row">
<div class="cell">
<p><b><?php
_e('Test/Live Switch', 'mgm');
?>
示例5: array
}
$temp = array();
foreach ($subscription_packs as $i => $pack) {
if ($pack['membership_type'] != $type_code) {
continue;
}
$temp[] = $pack;
}
$cost = $temp[0]['cost'];
if (trim($cost) > 0) {
if (isset($data[0]['member_type'])) {
if ($data[0]['member_type'] == $type_code) {
$strTypes .= '<option value="' . $type_code . '" SELECTED>' . __(mgm_stripslashes_deep($type_name), 'mgm') . '</option>';
}
}
$strTypes .= '<option value="' . $type_code . '">' . __(mgm_stripslashes_deep($type_name), 'mgm') . '</option>';
}
}
echo $strTypes;
?>
</select>
<input type="button"
name="reload"
class="button"
value="<?php
_e('Generate Report', 'mgm');
?>
"
onclick="search_earnings()" />
</div>
示例6: _get_button_code
/**
* Button code wrapper
*
* @param unknown_type $pack
* @param unknown_type $tran_id
* @return unknown
*/
function _get_button_code($pack, $tran_id = NULL)
{
// get data
$data = $this->_get_button_data($pack, $tran_id);
// strip
$data = mgm_stripslashes_deep($data);
// log
mgm_log($data, __FUNCTION__);
// return
return mgm_http_build_query($data);
}
示例7: delete
function delete()
{
extract($_POST);
// object
$cf_obj = mgm_get_class('member_custom_fields');
// label
$label = $cf_obj->get_field_attr($id, 'label');
// set sort
$success = $cf_obj->unset_custom_field($id);
// success
if ($success) {
// update on success
$cf_obj->save();
// message
$message = sprintf(__('Successfully removed custom field: <b>%s</b>', 'mgm'), mgm_stripslashes_deep($label));
$status = 'success';
} else {
// message
$message = sprintf(__('Error while removing custom field: <b>%s</b>', 'mgm'), mgm_stripslashes_deep($label));
$status = 'error';
}
// return response
echo json_encode(array('status' => $status, 'message' => $message));
exit;
}
示例8: mgm_get_members_with_customfiled
/**
* find members with selected custom filed critera
* @param string $field
* @return mixed array|int
*/
function mgm_get_members_with_customfiled($field, $value)
{
global $wpdb;
$start = 0;
$limit = 1000;
//user meta fields
$fields = array('user_id', 'meta_value');
// sql
$sql = "SELECT count(*) FROM `{$wpdb->usermeta}` WHERE `meta_key` = 'mgm_member_options' AND `user_id` <> 1";
$count = $wpdb->get_var($sql);
// init
$members = array();
//count
if ($count) {
//for
for ($i = $start; $i < $count; $i = $i + $limit) {
//users
$users = mgm_patch_partial_user_member_options($i, $limit, $fields);
// check
if ($users) {
// loop
foreach ($users as $user) {
// vlid
$valid = false;
//name
$name = '';
$user_id = $user->user_id;
$member = unserialize($user->meta_value);
// convert
$member = mgm_convert_array_to_memberobj($member, $user_id);
// check
if (!empty($value) && isset($member->status) && $member->status == 'Active') {
// from custom field
if (isset($member->custom_fields->{$field}) && !empty($member->custom_fields->{$field})) {
$name = $member->custom_fields->{$field};
}
// clean
$value = mgm_stripslashes_deep($value);
// if there is a match
if (!empty($name) && strpos(strtolower($name), strtolower($value)) !== false) {
$valid = true;
} else {
$valid = false;
}
}
// store
if ($valid) {
$members[] = $user_id;
}
// unset object
unset($member);
unset($user);
}
}
}
}
// return
return $members;
}
示例9: array_merge
?>
" class="width25;">
<?php
$arr_options = $data['roles'];
if ($data['role_type'] == 'others') {
$arr_options = array_merge($data['default_roles'], $arr_options);
}
foreach ($arr_options as $rn => $arr_role) {
if (!in_array($arr_role['role'], array($role['role'], $data['admin_role']))) {
?>
<option value="<?php
echo mgm_stripslashes_deep($arr_role['role']);
?>
">
<?php
echo mgm_stripslashes_deep($arr_role['name']);
?>
</option>
<?php
}
}
?>
</select>
<input class="button" type="button"
id="move_users"
onclick="move_users_<?php
echo $data['role_type'];
?>
('<?php
echo $role['role'];
?>
示例10: mgm_get_purchase_another_subscription_button
//.........这里部分代码省略.........
// duration
if ($pack['duration'] == 1) {
$dur_str = rtrim($duration_str[$pack['duration_type']], 's');
} else {
$dur_str = $duration_str[$pack['duration_type']];
}
$css_group = mgm_get_css_group();
// encode pack
$subs_opt_enc = mgm_encode_package($pack);
// set
$pack_modules[$subs_opt_enc] = $pack['modules'];
//issue #867
if ($css_group != 'none') {
//expand this if needed
$css_link_format = '<link rel="stylesheet" href="%s" type="text/css" media="all" />';
$css_file = MGM_ASSETS_URL . 'css/' . $css_group . '/mgm.form.fields.css';
$upgrade_packages .= sprintf($css_link_format, $css_file);
}
// free
if (($pack['cost'] == 0 || strtolower($pack['membership_type']) == 'free') && in_array('mgm_free', $a_payment_modules) && mgm_get_module('mgm_free')->enabled == 'Y') {
// input
$input = sprintf('<input type="radio" %s class="checkbox" name="subs_opt" value="%s" rel="mgm_subscription_options"/>', $checked, $subs_opt_enc);
// html
$upgrade_packages .= '
<div class="mgm_subs_wrapper ' . $pack['membership_type'] . '">
<div class="mgm_subs_option ' . $pack['membership_type'] . '">
' . $input . '
</div>
<div class="mgm_subs_pack_desc ' . $pack['membership_type'] . '">
' . $packs_obj->get_pack_desc($pack) . '
</div>
<div class="clearfix"></div>
<div class="mgm_subs_desc ' . $pack['membership_type'] . '">
' . mgm_stripslashes_deep($pack['description']) . '
</div>
</div>';
} else {
// input
$input = sprintf('<input type="radio" %s class="checkbox" name="subs_opt" value="%s" rel="mgm_subscription_options"/>', $checked, $subs_opt_enc);
// html
$upgrade_packages .= '
<div class="mgm_subs_wrapper ' . $pack['membership_type'] . '">
<div class="mgm_subs_option ' . $pack['membership_type'] . '">
' . $input . '
</div>
<div class="mgm_subs_pack_desc ' . $pack['membership_type'] . '">
' . $packs_obj->get_pack_desc($pack) . '
</div>
<div class="clearfix"></div>
<div class="mgm_subs_desc ' . $pack['membership_type'] . '">
' . mgm_stripslashes_deep($pack['description']) . '
</div>
</div>';
}
}
// add pack_modules as json data, may consider jquery data later
if (!empty($pack_modules)) {
$html .= sprintf('<script language="javascript">var mgm_pack_modules = %s</script>', json_encode($pack_modules));
}
// show error
if (!$upgrade_packages) {
// html
$html .= '<div class="mgm_subs_wrapper">
<div class="mgm_subs_pack_desc">
' . __('Sorry, no packages available.', 'mgm') . '
</div>
示例11: posts
//.........这里部分代码省略.........
}
}
// check
if ($wp_posts) {
// loop
foreach ($wp_posts as $post_id) {
// get object
$post_obj = mgm_get_post($post_id);
//Issue #838
if (isset($purchasable) == 'Y') {
// set
$post_obj->purchasable = $purchasable;
}
// check
if (isset($purchase_cost) && isset($purchasable) == 'Y') {
// check
if (!empty($purchase_cost) && $purchase_cost > 0) {
// set
$post_obj->purchase_cost = $purchase_cost;
}
}
// apply filter
$post_obj = apply_filters('mgm_post_update', $post_obj, $post_id);
// save meta
$post_obj->save();
// if access set
if (is_array($access_membership_types)) {
// set
$post_obj->access_membership_types = $access_membership_types;
// apply filter
$post_obj = apply_filters('mgm_post_update', $post_obj, $post_id);
// save meta
$post_obj->save();
// unset
unset($post_obj);
// check duplicate
if (!mgm_is_duplicate(TBL_MGM_POST_PROTECTED_URL, array('post_id'), '', array('post_id' => $post_id))) {
// add
$affected = $wpdb->insert(TBL_MGM_POST_PROTECTED_URL, array('url' => get_permalink($post_id), 'post_id' => $post_id, 'membership_types' => $membership_types));
} else {
$affected = $wpdb->update(TBL_MGM_POST_PROTECTED_URL, array('membership_types' => $membership_types), array('post_id' => $post_id));
}
}
// make private, add [private] tag
if (mgm_protect_content($content_protection)) {
// get post
$wp_post = wp_get_single_post($post_id);
// Check private tag on/off Issue #720
if (bool_from_yn($system_obj->setting['add_private_tags'])) {
// double check, not already added
if (preg_match('/\\[private\\](.*)\\[\\/private\\]/', $wp_post->post_content) == FALSE) {
// make content private
$post_content = sprintf('[private]%s[/private]', $wp_post->post_content);
// update
wp_update_post(array('post_content' => $post_content, 'ID' => $wp_post->ID));
}
}
}
// update counter
$updated++;
}
}
// response
if ($updated) {
$response = array('status' => 'success', 'message' => sprintf(__('Post protection successfully updated. %d Post/Page(s) updated.', 'mgm'), $updated));
} else {
$response = array('status' => 'error', 'message' => sprintf(__('Post protection failed. %d Post/Page(s) selected.', 'mgm'), $updated));
}
// print
echo json_encode($response);
// return
return;
}
// data
$data = array();
// member types
$arr_membershiptypes = array();
// loop
foreach (mgm_get_class('membership_types')->membership_types as $code => $name) {
$arr_membershiptypes[$code] = mgm_stripslashes_deep($name);
}
// set
$data['membership_types'] = $arr_membershiptypes;
// posts
$data['posts'] = mgm_field_values($wpdb->posts, 'ID', 'post_title', "AND (post_content NOT LIKE '%[private]%' OR post_content LIKE '[private]%') AND post_type = 'post' AND post_status = 'publish'");
// pages
$data['pages'] = mgm_field_values($wpdb->posts, 'ID', 'post_title', "AND (post_content NOT LIKE '%[private]%' OR post_content LIKE '[private]%') AND post_type = 'page' AND post_status = 'publish'");
// custom post types
if ($post_types = mgm_get_post_types(true, array('page', 'post'))) {
$data['custom_post_types'] = mgm_field_values($wpdb->posts, 'ID', "CONCAT(post_title, ' ( ', post_type, ' )') AS post_title", "AND (post_content NOT LIKE '%[private]%' OR post_content LIKE '[private]%') AND post_type IN ({$post_types}) AND post_status = 'publish'", 'post_title');
} else {
$data['custom_post_types'] = array();
}
// posts access
$data['posts_access'] = $wpdb->get_results(sprintf("SELECT * FROM %s WHERE `post_id` IS NOT NULL ORDER BY id ASC", TBL_MGM_POST_PROTECTED_URL));
// direct urls access
$data['direct_urls_access'] = $wpdb->get_results(sprintf("SELECT * FROM %s WHERE `post_id` IS NULL ORDER BY id ASC", TBL_MGM_POST_PROTECTED_URL));
// load template view
$this->load->template('settings/posts', array('data' => $data));
}
示例12: _get_button_data
function _get_button_data($pack, $tran_id = NULL)
{
// system setting
$system_obj = mgm_get_class('system');
$user_id = $pack['user_id'];
$user = get_userdata($user_id);
// item
$item = $this->get_pack_item($pack);
//pack currency over rides genral setting currency - issue #1602
if (!isset($pack['currency']) || empty($pack['currency'])) {
$pack['currency'] = $this->setting['currency'];
}
// setup data array
$data = array('invnum' => $tran_id, 'description' => $item['name'], 'currencycode' => $pack['currency'], 'notifyurl' => $this->setting['notify_url'], 'email' => $user->user_email, 'amount' => $pack['cost']);
// additional fields
$this->_set_address_fields($user, $data);
// subscription purchase with ongoing/limited
if (!isset($pack['buypost']) && isset($pack['duration_type']) && $pack['num_cycles'] != 1) {
// does not support one-time recurring
// if ($pack['num_cycles'] != 1 && $pack['duration_type']) { // old style
// recurring
$data['recurring_billing'] = 'TRUE';
// types
$bp_types = array('d' => 'Day', 'm' => 'Month', 'y' => 'Year');
// start date
$data['start_date'] = date(DATE_ATOM);
// Mon, 15 Aug 2005 15:12:46 UTC
// billing period
$data['billing_period'] = $bp_types[$pack['duration_type']];
// Day|Month|Year
$data['billing_frequency'] = $pack['duration'];
// 3|12 etc.
// greater than 0, limited
if ((int) $pack['num_cycles'] > 0) {
$data['total_billing_cycles'] = $pack['num_cycles'];
}
// trial
if ($pack['trial_on']) {
$data['trial_billing_period'] = $bp_types[$pack['trial_duration_type']];
$data['trial_billing_frequency'] = $pack['trial_duration'];
// greated than 0, limited cycle
if ((int) $pack['trial_num_cycles'] > 0) {
// need this checked
$data['trial_total_billing_cycles'] = $pack['trial_num_cycles'];
}
// cost
$data['trial_amt'] = $pack['trial_cost'];
}
} else {
// post purchase/one time billing
$data['recurring_billing'] = 'FALSE';
}
// custom passthrough
$data['custom'] = $tran_id;
// update currency - issue #1602
/* if($pack['currency'] != $this->setting['currency']){
$pack['currency'] = $this->setting['currency'];
}*/
// strip
$data = mgm_stripslashes_deep($data);
// add filter @todo test
$data = apply_filters('mgm_payment_button_data', $data, $tran_id, $this->module, $pack);
// update pack/transaction
mgm_update_transaction(array('data' => json_encode($pack), 'module' => $this->module), $tran_id);
// return data
return $data;
}
示例13: mgm_check_expiring_member
/**
* recursively check each member object of a user
*
* @param object $user
* @param object $member
* @param array $packs
* @param array $data
* @return bool $has_sent
*/
function mgm_check_expiring_member($user, $member, $spacks_obj, $data, $system_obj)
{
// only check for Active members
if ($member->status != MGM_STATUS_ACTIVE) {
return;
}
// flag
$has_sent = false;
// check pack
$subs_pack = null;
// get pack
if ($member->pack_id) {
$subs_pack = $spacks_obj->get_pack($member->pack_id);
}
/*else{
$subs_pack = $spacks_obj->validate_pack($member->amount, $member->duration, $member->duration_type, $member->membership_type);
}*/
// check empty
if (empty($subs_pack)) {
$subs_pack = $spacks_obj->validate_pack($member->amount, $member->duration, $member->duration_type, $member->membership_type);
}
// log
// mgm_log('subs_pack'. mgm_pr($subs_pack, true), ($user->ID.'_'.__FUNCTION__));
// check on going
if (isset($subs_pack['id'])) {
// issue#: 478
$num_cycles = isset($member->active_num_cycles) && !empty($member->active_num_cycles) ? $member->active_num_cycles : $subs_pack['num_cycles'];
// ongoing / lifetime
if ($num_cycles == 0) {
// never send mail
return false;
} elseif ($num_cycles > 1 || $member->duration_type == 'l') {
// why lifetime included here?
// allow onetime subscriptions
// if already unsubscribed
if (isset($member->status_reset_as) && in_array($member->status_reset_as, array(MGM_STATUS_AWAITING_CANCEL, MGM_STATUS_CANCELLED))) {
// set expire date
if (empty($member->expire_date)) {
$member->expire_date = $member->status_reset_on;
}
// fishy @todo check
// let it send
} elseif ($member->duration_type == 'l' || (!isset($member->rebilled) || $member->rebilled <= $num_cycles - 1)) {
// send email at the end of the subscription
return false;
}
}
}
// expire date
$expire_date = $member->expire_date;
$date_diff = strtotime($expire_date) - $data['current_timestamp'];
$days_to_expire = floor($date_diff / (60 * 60 * 24));
// log
/*mgm_log(sprintf('reminder email: user: %d, days_to_expire: %d, expire_date: %s, current_date: %s',
$user->ID, $days_to_expire, $expire_date, date('Y-m-d H:i:s', $data['current_timestamp'])), __FUNCTION__);*/
$email_data = array();
$email_data['expire_date'] = $expire_date;
$email_data['subscription_type'] = mgm_stripslashes_deep($data['subscription_types'][$member->membership_type]);
$email_data['template_subject'] = $data['template_subject'];
$email_data['template_body'] = $data['template_body'];
// days match
if ($days_to_expire == $data['days_to_start']) {
// send mail
$has_sent = mgm_send_reminder_mail($user, $email_data, $system_obj);
} else {
// incremental
if (bool_from_yn($data['days_incremental']) && is_array($data['days_incremental_ranges'])) {
// loop
foreach ($data['days_incremental_ranges'] as $range) {
// get int
$range = (int) $range;
// if days match
if ($range > 0) {
// match
if ($days_to_expire == $range) {
// send mail
$has_sent = mgm_send_reminder_mail($user, $email_data, $system_obj);
}
}
}
}
}
// return
return $has_sent;
}
示例14: mgm_stripslashes_deep
][<?php
echo $member_oth->membership_type;
?>
]" id="user_mem_index_<?php
echo $user->ID;
?>
_<?php
echo $key;
?>
" value="<?php
echo $key;
?>
" />
</td>
<td width="15%"><?php
echo mgm_stripslashes_deep($m_types->get_type_name($member_oth->membership_type));
?>
</td>
<td width="15%"><?php
echo $pack_desc_oth;
?>
</td>
<td width="15%"><?php
echo $register_date_oth;
?>
</td>
<td width="15%"><?php
echo $expire_date_oth;
?>
</td>
<td width="25%"><?php
示例15: _get_membership_types
/**
* API helper method get membership types, used in field mapping
*
* @param none
* @return array $membership_types
*/
function _get_membership_types()
{
// member types
$membership_types = array();
// loop
foreach (mgm_get_class('membership_types')->membership_types as $code => $name) {
$membership_types[$code] = mgm_stripslashes_deep($name);
}
// set
return $membership_types;
}