| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if ( ! defined( 'ABSPATH' ) ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
include("base_variables.php"); |
| 8 |
if( !class_exists('PieReg_Base') ){ |
| 9 |
class PieReg_Base extends PieRegisterBaseVariables |
| 10 |
{ |
| 11 |
/* |
| 12 |
* Move Variable PieReg_Base to PieRegisterBaseVariables (01-09-2014) |
| 13 |
*/ |
| 14 |
|
| 15 |
function __construct() |
| 16 |
{ |
| 17 |
/* |
| 18 |
* Execute Parent construct |
| 19 |
*/ |
| 20 |
parent::__construct(); |
| 21 |
|
| 22 |
$this->plugin_dir = dirname(dirname(__FILE__)); |
| 23 |
$this->plugin_url = plugins_url() .'/'. basename(dirname(dirname(__FILE__))) .'/'; |
| 24 |
$this->admin_path = $this->pie_get_admin_path(); |
| 25 |
} |
| 26 |
|
| 27 |
/* |
| 28 |
* GET PR_GLOBAL_OPTIONS |
| 29 |
* return PR global option |
| 30 |
* |
| 31 |
*/ |
| 32 |
function get_pr_global_options($option_name = NULL){ |
| 33 |
switch($option_name){ |
| 34 |
case OPTION_PIE_REGISTER: |
| 35 |
global $PR_GLOBAL_OPTIONS; |
| 36 |
$options = $PR_GLOBAL_OPTIONS; |
| 37 |
break; |
| 38 |
default: |
| 39 |
global $PR_GLOBAL_OPTIONS; |
| 40 |
$options = $PR_GLOBAL_OPTIONS; |
| 41 |
break; |
| 42 |
} |
| 43 |
return $options; |
| 44 |
} |
| 45 |
/* |
| 46 |
* set PR global option and return true and false |
| 47 |
*/ |
| 48 |
function set_pr_global_options($value, $option_name = NULL){ |
| 49 |
switch($option_name){ |
| 50 |
case OPTION_PIE_REGISTER: |
| 51 |
if(!empty($value)) |
| 52 |
{ |
| 53 |
global $PR_GLOBAL_OPTIONS; |
| 54 |
$PR_GLOBAL_OPTIONS = $value; |
| 55 |
} |
| 56 |
break; |
| 57 |
default: |
| 58 |
return false; |
| 59 |
break; |
| 60 |
} |
| 61 |
return true; |
| 62 |
} |
| 63 |
|
| 64 |
function getPieMeta() |
| 65 |
{ |
| 66 |
global $wpdb; |
| 67 |
$this->user_table = $wpdb->prefix . "users"; |
| 68 |
$this->user_meta_table = $wpdb->prefix . "usermeta"; |
| 69 |
$result = $wpdb->get_results( $wpdb->prepare("SELECT distinct(meta_key) FROM $this->user_meta_table WHERE `meta_key` like %s", 'pie_%') ); #WPS |
| 70 |
if(isset($wpdb->last_error) && !empty($wpdb->last_error)){ |
| 71 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 72 |
} |
| 73 |
|
| 74 |
if(sizeof($result) > 0) |
| 75 |
{ |
| 76 |
return $result; |
| 77 |
} |
| 78 |
return false; |
| 79 |
} |
| 80 |
function replaceMetaKeys($text,$user_id, $form_fields) |
| 81 |
{ |
| 82 |
if($result = $this->getPieMeta()) |
| 83 |
{ |
| 84 |
foreach($result as $meta) |
| 85 |
{ |
| 86 |
$key = "%".$meta->meta_key."%"; |
| 87 |
$value = get_user_meta($user_id, $meta->meta_key, true ); |
| 88 |
$get_value = ""; |
| 89 |
if(is_array($value)){ |
| 90 |
foreach($value as $val){ |
| 91 |
if(is_array($val)){ |
| 92 |
if(array_filter($val)) |
| 93 |
$get_value .= implode(", ",$val)."<br />"; |
| 94 |
}else{ |
| 95 |
$get_value = (is_array($value))? implode(", ",$value) : $value; |
| 96 |
} |
| 97 |
} |
| 98 |
}else{ |
| 99 |
if( ( !empty($form_fields) ) && preg_match("'pie_terms_(\d+?)'si", $meta->meta_key, $meta->meta_key) ){ |
| 100 |
|
| 101 |
foreach($form_fields as $form_field){ |
| 102 |
if($form_field['type'] == 'terms'){ |
| 103 |
$val = (!empty($value))? $value : ""; |
| 104 |
$get_value .= '<input '. checked($val == '1', true, false) .' type="checkbox" value="'.esc_attr($val).'" >'; |
| 105 |
|
| 106 |
$page_id = $form_field['cont']; |
| 107 |
$page_url = get_the_permalink($page_id); |
| 108 |
|
| 109 |
// Translators: %s is the URL that will be linked in the message. |
| 110 |
$get_value .= sprintf(__('Click <a target="_blank" href="%s">here</a> to view.','pie-register'), $page_url); |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 114 |
}else{ |
| 115 |
$get_value .= (!empty($value))? $value : ""; |
| 116 |
} |
| 117 |
} |
| 118 |
$text = str_replace($key,$get_value,$text); |
| 119 |
} |
| 120 |
} |
| 121 |
return $text; |
| 122 |
} |
| 123 |
function getCurrentFields($id="") |
| 124 |
{ |
| 125 |
if(((int)$id) != 0 and $id != "" ) |
| 126 |
{ |
| 127 |
$data = get_option("piereg_form_fields_".((int)$id)); |
| 128 |
} |
| 129 |
else if(isset($_GET['form_id']) and ((int)$_GET['form_id']) != 0 ){ |
| 130 |
|
| 131 |
$data = get_option("piereg_form_fields_".((int)sanitize_key($_GET['form_id']))); |
| 132 |
} |
| 133 |
|
| 134 |
else{ |
| 135 |
$data = get_option("pie_fields_default"); |
| 136 |
} |
| 137 |
|
| 138 |
$data = maybe_unserialize($data ); |
| 139 |
|
| 140 |
if(!$data) |
| 141 |
{ |
| 142 |
return false; |
| 143 |
} |
| 144 |
return $data; |
| 145 |
} |
| 146 |
|
| 147 |
function update_email_template_unverified_grace(){ |
| 148 |
|
| 149 |
// Update Email Types |
| 150 |
$pie_user_email_types = get_option('pie_user_email_types'); |
| 151 |
$pie_user_email_types['user_perm_blocked_notice'] = __("Notice: User removed because email address was not verfied.","pie-register"); |
| 152 |
update_option("pie_user_email_types", $pie_user_email_types); |
| 153 |
|
| 154 |
|
| 155 |
$update_options = get_option(OPTION_PIE_REGISTER); |
| 156 |
foreach ($pie_user_email_types as $val=>$type) |
| 157 |
{ |
| 158 |
if( $val == 'user_perm_blocked_notice' ) |
| 159 |
{ |
| 160 |
$update_options['user_subject_email_'.$val] = $type; |
| 161 |
} |
| 162 |
} |
| 163 |
|
| 164 |
// Update Email Template |
| 165 |
$update_options['user_message_email_user_perm_blocked_notice'] = '<p>Dear %user_login%,</p><p>You were required to verify your account, but you failed to do so within grace period. So, your account is being removed from %blogname%. You need to register again. </p><p>Kind Regards,</p><p>Team %blogname%</p>'; |
| 166 |
update_option(OPTION_PIE_REGISTER, $update_options); |
| 167 |
|
| 168 |
|
| 169 |
update_option('pie_email_template_updated_blocked_unverified_users', 'yes'); |
| 170 |
} |
| 171 |
|
| 172 |
function updated_countries_list() |
| 173 |
{ |
| 174 |
$country = array("Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Democratic Republic of the Congo","Republic of theCongo","Costa Rica","Côte d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Greenland","Grenada","Guam","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","North Korea","South Korea","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Northern Mariana Islands","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Republic of North Macedonia","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Sudan, South","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Virgin Islands, British","Virgin Islands, U.S.","Yemen","Zambia","Zimbabwe"); |
| 175 |
update_option("pie_countries",$country); |
| 176 |
update_option("pie_countries_v3811","yes"); |
| 177 |
} |
| 178 |
function install_settings() |
| 179 |
{ |
| 180 |
// Add transient to trigger redirect to the Welcome screen. |
| 181 |
set_transient( 'pieregister_activation_redirect', true, 300 ); |
| 182 |
|
| 183 |
$this->activate_pieregister_license_key(); |
| 184 |
|
| 185 |
/*Get old settings from options*/ |
| 186 |
$old_options = get_option("pie_register_2"); |
| 187 |
$new_options = get_option(OPTION_PIE_REGISTER); |
| 188 |
|
| 189 |
if($new_options == "" and $old_options != "") |
| 190 |
{ |
| 191 |
update_option(OPTION_PIE_REGISTER,$old_options); |
| 192 |
unset($old_options); |
| 193 |
unset($new_options); |
| 194 |
} |
| 195 |
|
| 196 |
//Alternate Pages |
| 197 |
$get_pie_pages_from_db = get_option("pie_pages"); |
| 198 |
$piereg_registration_create_new_page = false; |
| 199 |
if(is_array($get_pie_pages_from_db)) |
| 200 |
{ |
| 201 |
$piereg_login = (isset($get_pie_pages_from_db[0]) and $get_pie_pages_from_db != "")? get_post_status($get_pie_pages_from_db[0]) : false; |
| 202 |
$piereg_registrtion = (isset($get_pie_pages_from_db[1]) and $get_pie_pages_from_db != "")? get_post_status($get_pie_pages_from_db[1]) : false; |
| 203 |
$piereg_forgot_pass = (isset($get_pie_pages_from_db[2]) and $get_pie_pages_from_db != "")? get_post_status($get_pie_pages_from_db[2]) : false; |
| 204 |
$piereg_profile = (isset($get_pie_pages_from_db[3]) and $get_pie_pages_from_db != "")? get_post_status($get_pie_pages_from_db[3]) : false; |
| 205 |
} |
| 206 |
else |
| 207 |
{ |
| 208 |
$piereg_login = $piereg_registrtion = $piereg_forgot_pass = $piereg_profile = false; |
| 209 |
} |
| 210 |
|
| 211 |
$pie_pages = get_option("pie_pages"); |
| 212 |
|
| 213 |
if(($piereg_login) === false && !isset($pie_pages[0]))//Login |
| 214 |
{ |
| 215 |
$_p = array(); |
| 216 |
$_p['post_title'] = __("Login","pie-register"); |
| 217 |
$_p['post_content'] = "[pie_register_login]"; |
| 218 |
$_p['post_status'] = 'publish'; |
| 219 |
$_p['post_type'] = 'page'; |
| 220 |
$_p['comment_status'] = 'closed'; |
| 221 |
$_p['ping_status'] = 'closed'; |
| 222 |
$login_page_id = wp_insert_post( $_p ); |
| 223 |
$pie_pages[0] = $login_page_id; |
| 224 |
} |
| 225 |
|
| 226 |
if(($piereg_registrtion) === false && !isset($pie_pages[1]) )//Registration |
| 227 |
{ |
| 228 |
$_p = array(); |
| 229 |
$_p['post_title'] = __("Registration","pie-register"); |
| 230 |
$_p['post_content'] = '[pie_register_form id="0" title="true" description="true" ]'; |
| 231 |
$_p['post_status'] = 'publish'; |
| 232 |
$_p['post_type'] = 'page'; |
| 233 |
$_p['comment_status'] = 'closed'; |
| 234 |
$_p['ping_status'] = 'closed'; |
| 235 |
$reg_page_id = wp_insert_post( $_p ); |
| 236 |
$pie_pages[1] = $reg_page_id; |
| 237 |
$piereg_registration_create_new_page = true; |
| 238 |
} |
| 239 |
|
| 240 |
if(($piereg_forgot_pass) === false && !isset($pie_pages[2]) )//Forgot Password |
| 241 |
{ |
| 242 |
$_p = array(); |
| 243 |
$_p['post_title'] = __("Forgot Password","pie-register"); |
| 244 |
$_p['post_content'] = "[pie_register_forgot_password]"; |
| 245 |
$_p['post_status'] = 'publish'; |
| 246 |
$_p['post_type'] = 'page'; |
| 247 |
$_p['comment_status'] = 'closed'; |
| 248 |
$_p['ping_status'] = 'closed'; |
| 249 |
$forPas_page_id = wp_insert_post( $_p ); |
| 250 |
$pie_pages[2] = $forPas_page_id; |
| 251 |
} |
| 252 |
|
| 253 |
if(($piereg_profile) === false && !isset($pie_pages[3]) )//Profile Page |
| 254 |
{ |
| 255 |
$_p = array(); |
| 256 |
$_p['post_title'] = __("Profile","pie-register"); |
| 257 |
$_p['post_content'] = "[pie_register_profile]"; |
| 258 |
$_p['post_status'] = 'publish'; |
| 259 |
$_p['post_type'] = 'page'; |
| 260 |
$_p['comment_status'] = 'closed'; |
| 261 |
$_p['ping_status'] = 'closed'; |
| 262 |
$Profile_page_id = wp_insert_post( $_p ); |
| 263 |
$pie_pages[3] = $Profile_page_id; |
| 264 |
update_option("Profile_page_id",$Profile_page_id); |
| 265 |
} |
| 266 |
update_option("pie_pages",$pie_pages); |
| 267 |
|
| 268 |
//Countries |
| 269 |
$country = array("Afghanistan","Albania","Algeria","American Samoa","Andorra","Angola","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brazil","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Central African Republic","Chad","Chile","China","Colombia","Comoros","Democratic Republic of the Congo","Republic of theCongo","Costa Rica","Côte d'Ivoire","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","East Timor","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Fiji","Finland","France","Gabon","Gambia","Georgia","Germany","Ghana","Greece","Greenland","Grenada","Guam","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kenya","Kiribati","North Korea","South Korea","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","Niger","Nigeria","Norway","Northern Mariana Islands","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Puerto Rico","Qatar","Republic of North Macedonia","Romania","Russia","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","Spain","Sri Lanka","Sudan","Sudan, South","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Tanzania","Thailand","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Virgin Islands, British","Virgin Islands, U.S.","Yemen","Zambia","Zimbabwe"); |
| 270 |
update_option("pie_countries",$country); |
| 271 |
|
| 272 |
//USA States |
| 273 |
$us_states = array(__("Alabama","pie-register"),__("Alaska","pie-register"),__("Arizona","pie-register"),__("Arkansas","pie-register"),__("California","pie-register"),__("Colorado","pie-register"),__("Connecticut","pie-register"),__("Delaware","pie-register"),__("District of Columbia","pie-register"),__("Florida","pie-register"),__("Georgia","pie-register"),__("Hawaii","pie-register"),__("Idaho","pie-register"),__("Illinois","pie-register"),__("Indiana","pie-register"),__("Iowa","pie-register"),__("Kansas","pie-register"),__("Kentucky","pie-register"),__("Louisiana","pie-register"),__("Maine","pie-register"),__("Maryland","pie-register"),__("Massachusetts","pie-register"),__("Michigan","pie-register"),__("Minnesota","pie-register"),__("Mississippi","pie-register"),__("Missouri","pie-register"),__("Montana","pie-register"),__("Nebraska","pie-register"),__("Nevada","pie-register"),__("New Hampshire", "pie-register"),__("New Jersey", "pie-register"),__("New Mexico", "pie-register"),__("New York", "pie-register"),__("North Carolina", "pie-register"),__("North Dakota", "pie-register"),__("Ohio","pie-register"),__("Oklahoma","pie-register"),__("Oregon","pie-register"),__("Pennsylvania","pie-register"),__("Rhode Island", "pie-register"),__("South Carolina", "pie-register"),__("South Dakota", "pie-register"),__("Tennessee","pie-register"),__("Texas","pie-register"),__("Utah","pie-register"),__("Vermont","pie-register"),__("Virginia","pie-register"),__("Washington","pie-register"),__("West Virginia", "pie-register"),__("Wisconsin","pie-register"),__("Wyoming","pie-register"),__("Armed Forces Americas","pie-register"),__("Armed Forces Europe","pie-register"),__("Armed Forces Pacific","pie-register")); |
| 274 |
update_option("pie_us_states",$us_states); |
| 275 |
|
| 276 |
//Canadian States |
| 277 |
$can_states = array(__("Alberta","pie-register"),__("British Columbia","pie-register"),__("Manitoba","pie-register"),__("New Brunswick","pie-register"),__("Newfoundland and Labrador","pie-register"),__("Northwest Territories","pie-register"),__("Nova Scotia","pie-register"),__("Nunavut","pie-register"),__("Ontario","pie-register"),__("Prince Edward Island","pie-register"),__("Quebec","pie-register"),__("Saskatchewan","pie-register"),__("Yukon","pie-register")); |
| 278 |
update_option("pie_can_states",$can_states); |
| 279 |
|
| 280 |
|
| 281 |
//E-Mail TYpes |
| 282 |
$email_type = array( |
| 283 |
"default_template" => __("Your account is ready.","pie-register"), |
| 284 |
"admin_verification" => __("Your account is being processed.","pie-register"), |
| 285 |
"email_verification" => __("Email verification.","pie-register"), |
| 286 |
"email_edit_verification" => __("Email address change verification.","pie-register"), |
| 287 |
"current_email_verification" => __("Current Email address change verification.","pie-register"), |
| 288 |
"email_thankyou" => __("Your account has been activated.","pie-register"), |
| 289 |
"forgot_password_notification" => __("Password Reset Request.","pie-register"), |
| 290 |
"pending_payment" => __("Overdue Payment.","pie-register"), |
| 291 |
"payment_success" => __("Payment Processed.","pie-register"), |
| 292 |
"payment_faild" => __("Payment Failed.","pie-register"), |
| 293 |
"pending_payment_reminder" => __("Payment Pending.","pie-register"), |
| 294 |
"email_verification_reminder" => __("Email Verification Reminder.","pie-register"), |
| 295 |
"user_expiry_notice" => __("Final Email Verification Reminder.","pie-register"), |
| 296 |
"user_temp_blocked_notice" => __("User Temporarily Blocked Notice","pie-register"), |
| 297 |
"user_renew_temp_blocked_account_notice" => __("Payment Failed.","pie-register"), |
| 298 |
"user_perm_blocked_notice" => __("Notice: User removed because email address was not verfied.","pie-register"), |
| 299 |
"user_verification_rejected" => __("User verification has been rejected.","pie-register"), |
| 300 |
"user_subscription_activated" => __("User Subscription Activated","pie-register"), |
| 301 |
"user_subscription_cancelled" => __("Your subscription has been cancelled.","pie-register") |
| 302 |
); |
| 303 |
|
| 304 |
update_option("pie_user_email_types",$email_type); |
| 305 |
|
| 306 |
// add installation time |
| 307 |
add_option('pie_install_date', current_time('mysql')); |
| 308 |
|
| 309 |
global $PR_Bot_List; |
| 310 |
$current = get_option(OPTION_PIE_REGISTER); |
| 311 |
$update = $current; |
| 312 |
|
| 313 |
$update["paypal_butt_id"] = (isset($current["paypal_butt_id"]) && !empty($current["paypal_butt_id"]))?$current["paypal_butt_id"]:""; |
| 314 |
$update["paypal_pdt"] = (isset($current["paypal_pdt"]) && $current["paypal_pdt"])?$current["paypal_pdt"]:""; |
| 315 |
$update["paypal_sandbox"] = (isset($current["paypal_sandbox"]) && $current["paypal_sandbox"])?$current["paypal_sandbox"]:""; |
| 316 |
$update["payment_success_msg"] = (isset($current["payment_success_msg"]) && $current["payment_success_msg"])?$current["payment_success_msg"]:__("Payment was successful.","pie-register"); |
| 317 |
$update["payment_faild_msg"] = (isset($current["payment_faild_msg"]) && $current["payment_faild_msg"])?$current["payment_faild_msg"]:__("Payment failed.","pie-register"); |
| 318 |
$update["payment_renew_msg"] = (isset($current["payment_renew_msg"]) && $current["payment_renew_msg"])?$current["payment_renew_msg"]:__("Account needs to be activated.","pie-register"); |
| 319 |
$update["payment_already_activate_msg"] = (isset($current["payment_already_activate_msg"]) && $current["payment_already_activate_msg"])?$current["payment_already_activate_msg"]:__("Account is already active.","pie-register"); |
| 320 |
$update['enable_admin_notifications'] = (isset($current["enable_admin_notifications"]) && $current['enable_admin_notifications'] !== "")?$current['enable_admin_notifications']:1; |
| 321 |
$update['enable_admin_notifications_profile_update'] = (isset($current["enable_admin_notifications_profile_update"]) && $current['enable_admin_notifications_profile_update'] !== "")?$current['enable_admin_notifications_profile_update']:1; |
| 322 |
$update['enable_paypal'] = (isset($current["enable_paypal"]) && $current['enable_paypal'])?$current['enable_paypal']:0; |
| 323 |
$update['enable_blockedips'] = (isset($current["enable_blockedips"]) && $current['enable_blockedips'])?$current['enable_blockedips']:0; |
| 324 |
$update['enable_blockedusername'] = (isset($current["enable_blockedusername"]) && $current['enable_blockedusername'])?$current['enable_blockedusername']:0; |
| 325 |
$update['enable_blockedemail'] = (isset($current["enable_blockedemail"]) && $current['enable_blockedemail'])?$current['enable_blockedemail']:0; |
| 326 |
|
| 327 |
$update['admin_sendto_email'] = (isset($current["admin_sendto_email"]) && $current['admin_sendto_email'])?$current['admin_sendto_email']:get_option( 'admin_email' ); |
| 328 |
$update['admin_from_name'] = (isset($current["admin_from_name"]) && $current['admin_from_name'])?$current['admin_from_name']:"Administrator"; |
| 329 |
$update['admin_from_email'] = (isset($current["admin_from_email"]) && $current['admin_from_email'])?$current['admin_from_email']:get_option( 'admin_email' ); |
| 330 |
$update['admin_to_email'] = (isset($current["admin_to_email"]) && $current['admin_to_email'])?$current['admin_to_email']:get_option( 'admin_email' ); |
| 331 |
$update['admin_bcc_email'] = (isset($current["admin_bcc_email"]) && $current['admin_bcc_email'])?$current['admin_bcc_email']:get_option( 'admin_email' ); |
| 332 |
$update['admin_subject_email'] = (isset($current["admin_subject_email"]) && $current['admin_subject_email'])?$current['admin_subject_email']:__("New User Registration","pie-register"); |
| 333 |
$update['admin_message_email_formate'] = (isset($current["admin_message_email_formate"]) && $current['admin_message_email_formate'])?$current['admin_message_email_formate']:1; |
| 334 |
|
| 335 |
// Admin Notification On Cancel Subscription |
| 336 |
$update['enable_admin_notifications_cancel_subscription'] = (isset($current["enable_admin_notifications_cancel_subscription"]) && $current['enable_admin_notifications_cancel_subscription'] !== "")?$current['enable_admin_notifications_cancel_subscription']:1; |
| 337 |
$update['admin_sendto_email_cancel_subscription'] = (isset($current["admin_sendto_email_cancel_subscription"]) && $current['admin_sendto_email_cancel_subscription'])?$current['admin_sendto_email_cancel_subscription']:get_option( 'admin_email' ); |
| 338 |
$update['admin_from_name_cancel_subscription'] = (isset($current["admin_from_name_cancel_subscription"]) && $current['admin_from_name_cancel_subscription'])?$current['admin_from_name_cancel_subscription']:"Administrator"; |
| 339 |
$update['admin_from_email_cancel_subscription'] = (isset($current["admin_from_email_cancel_subscription"]) && $current['admin_from_email_cancel_subscription'])?$current['admin_from_email_cancel_subscription']:get_option( 'admin_email' ); |
| 340 |
$update['admin_to_email_cancel_subscription'] = (isset($current["admin_to_email_cancel_subscription"]) && $current['admin_to_email_cancel_subscription'])?$current['admin_to_email_cancel_subscription']:get_option( 'admin_email' ); |
| 341 |
$update['admin_bcc_email_cancel_subscription'] = (isset($current["admin_bcc_email_cancel_subscription"]) && $current['admin_bcc_email_cancel_subscription'])?$current['admin_bcc_email_cancel_subscription']:get_option( 'admin_email' ); |
| 342 |
$update['admin_subject_email_cancel_subscription'] = (isset($current["admin_subject_email_cancel_subscription"]) && $current['admin_subject_email_cancel_subscription'])?$current['admin_subject_email_cancel_subscription']:__("User Subscription Cancelled","pie-register"); |
| 343 |
$update['admin_message_email_cancel_subscription'] = (isset($current["admin_message_email_cancel_subscription"]) && $current['admin_message_email_cancel_subscription'])?$current['admin_message_email_cancel_subscription']:'<p>Hello Admin,</p><p>The subscription has been cancelled by a user. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 344 |
$update['admin_message_email_formate_cancel_subscription'] = (isset($current["admin_message_email_formate_cancel_subscription"]) && $current['admin_message_email_formate_cancel_subscription'])?$current['admin_message_email_formate_cancel_subscription']:1; |
| 345 |
|
| 346 |
// Admin Notification On Profile Update |
| 347 |
$update['admin_sendto_email_profile_update'] = (isset($current["admin_sendto_email_profile_update"]) && $current['admin_sendto_email_profile_update'])?$current['admin_sendto_email_profile_update']:get_option( 'admin_email' ); |
| 348 |
$update['admin_from_name_profile_update'] = (isset($current["admin_from_name_profile_update"]) && $current['admin_from_name_profile_update'])?$current['admin_from_name_profile_update']:"Administrator"; |
| 349 |
$update['admin_from_email_profile_update'] = (isset($current["admin_from_email_profile_update"]) && $current['admin_from_email_profile_update'])?$current['admin_from_email_profile_update']:get_option( 'admin_email' ); |
| 350 |
$update['admin_to_email_profile_update'] = (isset($current["admin_to_email_profile_update"]) && $current['admin_to_email_profile_update'])?$current['admin_to_email_profile_update']:get_option( 'admin_email' ); |
| 351 |
$update['admin_bcc_email_profile_update'] = (isset($current["admin_bcc_email_profile_update"]) && $current['admin_bcc_email_profile_update'])?$current['admin_bcc_email_profile_update']:get_option( 'admin_email' ); |
| 352 |
$update['admin_subject_email_profile_update'] = (isset($current["admin_subject_email_profile_update"]) && $current['admin_subject_email_profile_update'])?$current['admin_subject_email_profile_update']:__("User Profile Updated","pie-register"); |
| 353 |
$update['admin_message_email_formate_profile_update'] = (isset($current["admin_message_email_formate_profile_update"]) && $current['admin_message_email_formate_profile_update'])?$current['admin_message_email_formate_profile_update']:1; |
| 354 |
|
| 355 |
$update['user_formate_email_default_template'] = (isset($current["user_formate_email_default_template"]) && $current['user_formate_email_default_template'])?$current['user_formate_email_default_template']:1; |
| 356 |
$update['user_enable_default_template'] = (isset($current["user_enable_default_template"]) && $current['user_enable_default_template'])?$current['user_enable_default_template']:1; |
| 357 |
$update['admin_message_email'] = (isset($current["admin_message_email"]) && $current['admin_message_email'])?$current['admin_message_email']:'<p>Hello Admin,</p><p>A new user has been registered on your Website,. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 358 |
$update['admin_message_email_profile_update'] = (isset($current["admin_message_email_profile_update"]) && $current['admin_message_email_profile_update'])?$current['admin_message_email_profile_update']:'<p>Hello Admin,</p><p>The user has been updated on your Website. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 359 |
$update['display_hints'] = (isset($current["display_hints"]) && $current['display_hints'])?$current['display_hints']:0; // (1) - 090415 |
| 360 |
$update['redirect_user'] = (isset($current["redirect_user"]) && $current['redirect_user'] !== "")?$current['redirect_user']:1; |
| 361 |
$update['subscriber_login'] = (isset($current["subscriber_login"]) && $current['subscriber_login'])?$current['subscriber_login']:0; |
| 362 |
$update['login_form_in_website'] = (isset($current["login_form_in_website"]) && $current['login_form_in_website'] !== "")?$current['login_form_in_website']:1; |
| 363 |
$update['registration_in_website'] = (isset($current["registration_in_website"]) && $current['registration_in_website'] !== "")?$current['registration_in_website']:1; |
| 364 |
$update['block_WP_profile'] = (isset($current["block_WP_profile"]) && $current['block_WP_profile'])?$current['block_WP_profile']:0; |
| 365 |
$update['allow_pr_edit_wplogin'] = (isset($current["allow_pr_edit_wplogin"]) && $current['allow_pr_edit_wplogin'])?$current['allow_pr_edit_wplogin']:0; |
| 366 |
$update['modify_avatars'] = (isset($current["modify_avatars"]) && $current['modify_avatars'])?$current['modify_avatars']:0; |
| 367 |
$update['show_admin_bar'] = (isset($current["show_admin_bar"]) && $current['show_admin_bar'] !== "")?$current['show_admin_bar']:1; |
| 368 |
$update['block_wp_login'] = (isset($current["block_wp_login"]) && $current['block_wp_login'] !== "")?$current['block_wp_login']:1; |
| 369 |
$update['alternate_login'] = $pie_pages[0]; |
| 370 |
$update['alternate_register'] = $pie_pages[1]; |
| 371 |
$update['alternate_forgotpass'] = $pie_pages[2]; |
| 372 |
$update['alternate_profilepage'] = $pie_pages[3]; |
| 373 |
|
| 374 |
////// Date Starting/Ending Variables//////////// |
| 375 |
//////////////// Since 2.0.12 /////////////////// |
| 376 |
$update['piereg_startingDate'] = (isset($current["piereg_startingDate"]) && $current['piereg_startingDate'])?$current['piereg_startingDate']:'1901'; |
| 377 |
$update['piereg_endingDate'] = (isset($current["piereg_endingDate"]) && $current['piereg_endingDate'])?$current['piereg_endingDate']:date_i18n("Y"); |
| 378 |
|
| 379 |
$update['after_login'] = (isset($current["after_login"]) && $current['after_login'])?$current['after_login']:-1; |
| 380 |
$update['alternate_logout'] = (isset($current["alternate_logout"]) && $current['alternate_logout'])?$current['alternate_logout']:-1; |
| 381 |
$update['alternate_logout_url'] = (isset($current["alternate_logout"]) && $current['alternate_logout'])?$current['alternate_logout_url']:""; |
| 382 |
$update['outputcss'] = (isset($current["outputcss"]) && $current['outputcss'] !== "")?$current['outputcss']:1; |
| 383 |
$update['outputjquery_ui'] = (isset($current["outputjquery_ui"]) && $current['outputjquery_ui'] !== "")?$current['outputjquery_ui']:1; |
| 384 |
$update['login_after_register'] = (isset($current["login_after_register"]) && $current['login_after_register'])?$current['login_after_register']:0; |
| 385 |
|
| 386 |
$update['pass_strength_indicator_label'] = (isset($current["pass_strength_indicator_label"]) && $current['pass_strength_indicator_label'])? $current['pass_strength_indicator_label'] : "Strength Meter"; |
| 387 |
$update['pass_very_weak_label'] = (isset($current["pass_very_weak_label"]) && $current['pass_very_weak_label'])? $current['pass_very_weak_label'] : "Very weak"; |
| 388 |
$update['pass_weak_label'] = (isset($current["pass_weak_label"]) && $current['pass_weak_label'])? $current['pass_weak_label'] : "Weak"; |
| 389 |
$update['pass_medium_label'] = (isset($current["pass_medium_label"]) && $current['pass_medium_label'])? $current['pass_medium_label'] : "Medium"; |
| 390 |
$update['pass_strong_label'] = (isset($current["pass_strong_label"]) && $current['pass_strong_label'])? $current['pass_strong_label'] : "Strong"; |
| 391 |
$update['pass_mismatch_label'] = (isset($current["pass_mismatch_label"]) && $current['pass_mismatch_label'])? $current['pass_mismatch_label'] : "Mismatch"; |
| 392 |
$update['pr_theme'] = (isset($current["pr_theme"]) && $current['pr_theme'])? $current['pr_theme'] : "0"; |
| 393 |
|
| 394 |
/* Bot Settings */ |
| 395 |
$update['restrict_bot_enabel'] = (isset($current["restrict_bot_enabel"]) && $current['restrict_bot_enabel'])?$current['restrict_bot_enabel']:0; |
| 396 |
$update['restrict_bot_content'] = (isset($current["restrict_bot_content"]) && $current['restrict_bot_content'])?$current['restrict_bot_content']: $PR_Bot_List; |
| 397 |
$update['restrict_bot_content_message'] = (isset($current["restrict_bot_content_message"]) && $current['restrict_bot_content_message'])?$current['restrict_bot_content_message']:"Restricted Post: You are not allowed to view the content of this Post"; |
| 398 |
|
| 399 |
$update['outputhtml'] = (isset($current["outputhtml"]) && $current['outputhtml'] !== "")?$current['outputhtml']:1; |
| 400 |
$update['no_conflict'] = (isset($current["no_conflict"]) && $current['no_conflict'])?$current['no_conflict']:0; |
| 401 |
$update['currency'] = (isset($current["currency"]) && $current['currency'])?$current['currency']:"USD"; |
| 402 |
$update['verification'] = (isset($current["verification"]) && $current['verification'])?$current['verification']:0; |
| 403 |
$update['email_edit_verification_step'] = (isset($current["email_edit_verification_step"]) && $current['email_edit_verification_step'] !== "")?$current['email_edit_verification_step']:1; |
| 404 |
|
| 405 |
$update['grace_period'] = (isset($current["grace_period"]) && $current['grace_period'])?$current['grace_period']:0; |
| 406 |
$update['piereg_recaptcha_type'] = (isset($current["piereg_recaptcha_type"]) && $current['piereg_recaptcha_type'])? $current['piereg_recaptcha_type'] : "v2"; |
| 407 |
$update['captcha_publc'] = (isset($current["captcha_publc"]) && $current['captcha_publc'])?$current['captcha_publc']:""; |
| 408 |
$update['captcha_private'] = (isset($current["captcha_private"]) && $current['captcha_private'])?$current['captcha_private']:""; |
| 409 |
$update['captcha_publc_v3'] = (isset($current["captcha_publc_v3"]) && $current['captcha_publc_v3'])?$current['captcha_publc_v3']:""; |
| 410 |
$update['captcha_private_v3'] = (isset($current["captcha_private_v3"]) && $current['captcha_private_v3'])?$current['captcha_private_v3']:""; |
| 411 |
$update['piereg_recaptcha_language'] = (isset($current["piereg_recaptcha_language"]) && $current['piereg_recaptcha_language'])?$current['piereg_recaptcha_language']:"en"; |
| 412 |
$update['paypal_button_id'] = (isset($current["paypal_button_id"]) && $current['paypal_button_id'])?$current['paypal_button_id']:""; |
| 413 |
$update['paypal_pdt_token'] = (isset($current["paypal_pdt_token"]) && $current['paypal_pdt_token'])?$current['paypal_pdt_token']:""; |
| 414 |
$update['custom_css'] = (isset($current["custom_css"]) && $current['custom_css'])?$current['custom_css']:""; |
| 415 |
$update['tracking_code'] = (isset($current["tracking_code"]) && $current['tracking_code'])?$current['tracking_code']:""; |
| 416 |
$update['enable_invitation_codes'] = (isset($current["enable_invitation_codes"]) && $current['enable_invitation_codes'])?$current['enable_invitation_codes']:0; |
| 417 |
$update['invitation_codes'] = (isset($current["invitation_codes"]) && $current['invitation_codes'])?$current['invitation_codes']:""; |
| 418 |
|
| 419 |
// Invitation Code Send Invitation Settings |
| 420 |
$update['pie_email_linkpage'] = (isset($current["pie_email_linkpage"]) && $current['pie_email_linkpage'])?$current['pie_email_linkpage']: $pie_pages[1]; |
| 421 |
$update['pie_email_invitecode'] = (isset($current["pie_email_invitecode"]) && $current['pie_email_invitecode'])?$current['pie_email_invitecode']: 0; |
| 422 |
$update['pie_name_from'] = (isset($current["pie_name_from"]) && $current['pie_name_from'])?$current['pie_name_from']: "Admin"; |
| 423 |
$update['pie_email_from'] = (isset($current["pie_email_from"]) && $current['pie_email_from'])?$current['pie_email_from']: get_option( 'admin_email' ); |
| 424 |
$update['pie_email_subject'] = (isset($current["pie_email_subject"]) && $current['pie_email_subject'])?$current['pie_email_subject']: "Invitation to create an account on %blogname%"; |
| 425 |
$update['pie_email_content'] = (isset($current["pie_email_content"]) && $current['pie_email_content'])?$current['pie_email_content']: 'Hi there,'.PHP_EOL.PHP_EOL.'You are invited to create an account on our website: %blogname%'.PHP_EOL.'Click the link below to begin.'.PHP_EOL.PHP_EOL.'<a href="%invitation_link%">%invitation_link%</a>'.PHP_EOL.PHP_EOL.'Thank you.'; |
| 426 |
|
| 427 |
// Payment Setting |
| 428 |
$update['payment_setting_amount'] = (isset($current["payment_setting_amount"]) && $current['payment_setting_amount'])?$current['payment_setting_amount']:"10"; |
| 429 |
|
| 430 |
// Role setting |
| 431 |
$update['pie_regis_set_user_role_'] = (isset($current["pie_regis_set_user_role_"]) && $current['pie_regis_set_user_role_'])?$current['pie_regis_set_user_role_']:"subscriber"; |
| 432 |
$update['pie_regis_set_user_role_1'] = (isset($current["pie_regis_set_user_role_1"]) && $current['pie_regis_set_user_role_1'])?$current['pie_regis_set_user_role_1']:"subscriber"; |
| 433 |
|
| 434 |
$update['custom_logo_url'] = (isset($current["custom_logo_url"]) && $current['custom_logo_url'])? $current['custom_logo_url'] : ""; |
| 435 |
$update['reg_form_submission_time_enable'] = (isset($current["reg_form_submission_time_enable"]) && $current['reg_form_submission_time_enable'])? $current['reg_form_submission_time_enable'] : "0"; |
| 436 |
$update['reg_form_submission_time'] = (isset($current["reg_form_submission_time"]) && $current['reg_form_submission_time'])? $current['reg_form_submission_time'] : "0"; |
| 437 |
$update['custom_logo_tooltip'] = (isset($current["custom_logo_tooltip"]) && $current['custom_logo_tooltip'])? $current['custom_logo_tooltip'] : ""; |
| 438 |
$update['custom_logo_link'] = (isset($current["custom_logo_link"]) && $current['custom_logo_link'])? $current['custom_logo_link'] : ""; |
| 439 |
$update['show_custom_logo'] = (isset($current["show_custom_logo"]) && $current['show_custom_logo'] !== "")? $current['show_custom_logo'] : 1; |
| 440 |
// Login form |
| 441 |
$update['login_username_label'] = (isset($current["login_username_label"]) && $current['login_username_label'])? $current['login_username_label'] : "Username"; |
| 442 |
$update['login_username_placeholder'] = (isset($current["login_username_placeholder"]) && $current['login_username_placeholder'])? $current['login_username_placeholder'] : ""; |
| 443 |
$update['login_password_label'] = (isset($current["login_password_label"]) && $current['login_password_label'])? $current['login_password_label'] : "Password"; |
| 444 |
$update['login_password_placeholder'] = (isset($current["login_password_placeholder"]) && $current['login_password_placeholder'])? $current['login_password_placeholder'] : ""; |
| 445 |
$update['capthca_in_login_label'] = (isset($current["capthca_in_login_label"]) && $current['capthca_in_login_label'])? $current['capthca_in_login_label'] : ""; |
| 446 |
$update['capthca_in_login'] = (isset($current["capthca_in_login"]) && $current['capthca_in_login'])? $current['capthca_in_login'] : "0"; |
| 447 |
|
| 448 |
//New Settings |
| 449 |
$update['captcha_in_login_value'] = (isset($current["captcha_in_login_value"]) && $current['captcha_in_login_value']) ? $current['captcha_in_login_value'] : 0; |
| 450 |
$update['piereg_security_attempts_login_value'] = (isset($current["piereg_security_attempts_login_value"]) && $current['piereg_security_attempts_login_value']) ? $current['piereg_security_attempts_login_value'] : '0'; |
| 451 |
$update['captcha_in_forgot_value'] = (isset($current["capthca_in_forgot_pass"]) && $current['capthca_in_forgot_pass']) ? $current['capthca_in_forgot_pass'] : 0; |
| 452 |
$update['piereg_security_attempts_forgot_value'] = (isset($current["piereg_security_attempts_forgot_value"]) && $current['piereg_security_attempts_forgot_value'])? $current['piereg_security_attempts_forgot_value'] : "0"; |
| 453 |
|
| 454 |
//security_attempts_login |
| 455 |
$update['security_captcha_attempts_login'] = (isset($current["security_captcha_attempts_login"]) && $current['security_captcha_attempts_login'])? $current['security_captcha_attempts_login'] : "0"; |
| 456 |
$update['security_captcha_login'] = (isset($current["security_captcha_login"]) && $current['security_captcha_login'] !== "")? $current['security_captcha_login'] : "2"; |
| 457 |
$update['security_attempts_login'] = (isset($current["security_attempts_login"]) && $current['security_attempts_login'])? $current['security_attempts_login'] : "0"; |
| 458 |
$update['security_attempts_login_time'] = (isset($current["security_attempts_login_time"]) && $current['security_attempts_login_time'] !== "")? $current['security_attempts_login_time'] : "1"; |
| 459 |
|
| 460 |
// Forgot Password form |
| 461 |
$update['forgot_pass_username_label'] = (isset($current["forgot_pass_username_label"]) && $current['forgot_pass_username_label'])? $current['forgot_pass_username_label'] : "Username or Email:"; |
| 462 |
$update['forgot_pass_username_placeholder'] = (isset($current["forgot_pass_username_placeholder"]) && $current['forgot_pass_username_placeholder'])? $current['forgot_pass_username_placeholder'] : ""; |
| 463 |
$update['forgot_pass_username_placeholder'] = (isset($current["forgot_pass_username_placeholder"]) && $current['forgot_pass_username_placeholder'])? $current['forgot_pass_username_placeholder'] : ""; |
| 464 |
$update['capthca_in_forgot_pass_label'] = (isset($current["capthca_in_forgot_pass_label"]) && $current['capthca_in_forgot_pass_label'])? $current['capthca_in_forgot_pass_label'] : ""; |
| 465 |
$update['capthca_in_forgot_pass'] = (isset($current["capthca_in_forgot_pass"]) && $current['capthca_in_forgot_pass'])? $current['capthca_in_forgot_pass'] : "0"; |
| 466 |
|
| 467 |
$pie_user_email_types = get_option( 'pie_user_email_types'); |
| 468 |
foreach ($pie_user_email_types as $val=>$type) |
| 469 |
{ |
| 470 |
$update['enable_user_notifications'] = (isset($current["enable_user_notifications"]) && $current['enable_user_notifications'])?$current['enable_user_notifications']:0; |
| 471 |
$update['user_from_name_'.$val] = (isset($current['user_from_name_'.$val]) && $current['user_from_name_'.$val])?$current['user_from_name_'.$val]:"Admin"; |
| 472 |
$update['user_from_email_'.$val] = (isset($current['user_from_email_'.$val]) && $current['user_from_email_'.$val])?$current['user_from_email_'.$val]:get_option( 'admin_email' ); |
| 473 |
$update['user_to_email_'.$val] = (isset($current['user_to_email_'.$val]) && $current['user_to_email_'.$val])?$current['user_to_email_'.$val]:get_option( 'admin_email' ); |
| 474 |
$update['user_subject_email_'.$val] = (isset($current['user_subject_email_'.$val]) && $current['user_subject_email_'.$val])?$current['user_subject_email_'.$val]:$type; |
| 475 |
$update['user_formate_email_'.$val] = (isset($current['user_formate_email_'.$val]) && $current['user_formate_email_'.$val] !== "")?$current['user_formate_email_'.$val]:1; |
| 476 |
$update['user_enable_'.$val] = (isset($current['user_enable_'.$val]) && $current['user_enable_'.$val] !== "")?$current['user_enable_'.$val]:1; |
| 477 |
} |
| 478 |
$update['user_message_email_admin_verification'] = (isset($current["user_message_email_admin_verification"]) && $current['user_message_email_admin_verification'])?$current['user_message_email_admin_verification']: '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>A site administrator will review your request. Once approved, you will be notified via email.</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 479 |
$update['user_message_email_email_verification'] = (isset($current["user_message_email_email_verification"]) && $current['user_message_email_email_verification'])?$current['user_message_email_email_verification']:'<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>Please use the link below to verify your email address. </p><p>%activationurl%</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 480 |
$update['user_message_email_email_thankyou'] = (isset($current["user_message_email_email_thankyou"]) && $current['user_message_email_email_thankyou'])?$current['user_message_email_email_thankyou']:'<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>You are ready to enjoy the benefits of our products and services by signing in to your personalized account.</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 481 |
|
| 482 |
$update['user_message_email_payment_success'] = (isset($current["user_message_email_payment_success"]) && $current['user_message_email_payment_success'])?$current['user_message_email_payment_success']:'<p>Dear %user_login%,</p><p>Congratulations, your payment has been successfully processed. <br/>Please enjoy the benefits of your membership on %blogname% </p><p>Thank You,</p><p>Team %blogname%</p>'; |
| 483 |
$update['user_message_email_payment_faild'] = (isset($current["user_message_email_payment_faild"]) && $current['user_message_email_payment_faild'])?$current['user_message_email_payment_faild']:'<p>Dear %user_login%,</p><p>Our last attempt to charge the membership payment for your account has failed. </p><p>You are requested to log in to your account at %blogname% to provide a different payment method, or contact your bank/credit-card company to resolve this issue.</p><p>Kind Regards,</p><p>Team %blogname%<br/></p>'; |
| 484 |
$update['user_message_email_pending_payment'] = (isset($current["user_message_email_pending_payment"]) && $current['user_message_email_pending_payment'])?$current['user_message_email_pending_payment']:'<p>Dear %user_login%,</p><p>This is a reminder that membership payment is overdue for your account on %blogname%. Please process your payment immediately to keep membership previlages active. </p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 485 |
$update['user_message_email_default_template'] = (isset($current["user_message_email_default_template"]) && $current['user_message_email_default_template'])?$current['user_message_email_default_template']: '<p>Dear %user_login%,</p><p>Thank You for registering with our website.</p><p>You are ready to enjoy the benefits of our products and services by signing in to your personalized account.</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 486 |
|
| 487 |
$update['user_message_email_pending_payment_reminder'] = (isset($current["user_message_email_pending_payment_reminder"]) && $current['user_message_email_pending_payment_reminder'])?$current['user_message_email_pending_payment_reminder']: '<p>Dear %user_login%,</p><p>We have noticed that you created an account on %blogname% a few days ago, but have not completed the payment. Please use the link below to complete the payment. <br/>Your account will be activated once the payment is received.</p><p>%pending_payment_url%</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 488 |
$update['user_message_email_email_verification_reminder'] = (isset($current["user_message_email_email_verification_reminder"]) && $current['user_message_email_email_verification_reminder'])?$current['user_message_email_email_verification_reminder']: '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>We noticed that you created an account on %blogname% but have not completed the email verification process. </p><p>Please use the link below to verify your email address. </p><p>%activationurl%</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 489 |
$update['user_message_email_forgot_password_notification'] = (isset($current["user_message_email_forgot_password_notification"]) && $current['user_message_email_forgot_password_notification'])?$current['user_message_email_forgot_password_notification']: '<p>Dear %user_login%,</p><p>We have received a request to reset your account password on %blogname%. Please use the link below to reset your password. If you did not request a new password, please ignore this email and the change will not be made.</p><p>( %reset_password_url% )</p><p>Best Regards,</p><p>Team %user_login%</p>'; |
| 490 |
$update['user_message_email_user_expiry_notice'] = (isset($current["user_message_email_user_expiry_notice"]) && $current['user_message_email_user_expiry_notice'])? $current['user_message_email_user_expiry_notice']: '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>We noticed that you created an account on %blogname% but have not completed the email verification process. Failure to do so will result in your account being removed.</p><p>Please use the link below to verify your email address. </p><p>%activationurl%</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 491 |
$update['user_message_email_user_temp_blocked_notice'] = (isset($current["user_message_email_user_temp_blocked_notice"]) && $current['user_message_email_user_temp_blocked_notice'])?$current['user_message_email_user_temp_blocked_notice'] :__("You are temporarily blocked at","pie-register")." %blogname%"; |
| 492 |
$update['user_message_email_user_renew_temp_blocked_account_notice'] = (isset($current["user_message_email_user_renew_temp_blocked_account_notice"]) && $current['user_message_email_user_renew_temp_blocked_account_notice'])?$current['user_message_email_user_renew_temp_blocked_account_notice'] : '<p>Dear %user_login%,</p><p>Our last attempt to charge the membership payment for your account has failed. </p><p>You are requested to log in to your account at %blogname% to provide a different payment method, or contact your bank/credit-card company to resolve this issue. </p><p>Access to your account has been temporarily disabled until this issue is resolved.</p><p>Kind Regards,</p><p>Team %blogname%</p>'; |
| 493 |
$update['user_message_email_user_perm_blocked_notice'] = (isset($current["user_message_email_user_perm_blocked_notice"]) && $current['user_message_email_user_perm_blocked_notice'])? $current['user_message_email_user_perm_blocked_notice']: '<p>Dear %user_login%,</p><p>You were required to verify your account, but you failed to do so within grace period. So, your account is being removed from %blogname%. You need to register again. </p><p>Kind Regards,</p><p>Team %blogname%</p>'; # Change since 3.0.9 |
| 494 |
|
| 495 |
$update['user_message_email_email_edit_verification'] = (isset($current["user_message_email_email_edit_verification"]) && $current['user_message_email_email_edit_verification'])?$current['user_message_email_email_edit_verification']: '<p>Hello %user_login%,</p><p>We have received a request to change the email address for your account on %blogname%.</p><p>Old Email Address: %user_email%<br/>New Email Address: %user_new_email%. </p><p>Please use the link below to complete this change.</p><p>(%reset_email_url%)</p><p>Thanks</p><p>%blogname%<br/></p>'; |
| 496 |
$update['user_message_email_current_email_verification'] = (isset($current["user_message_email_current_email_verification"]) && $current['user_message_email_current_email_verification'])?$current['user_message_email_current_email_verification']: '<p>Hello %user_login%,</p><p>We have received a request to change the email address for your account on %blogname%.</p><p>Old Email Address: %user_email%<br/> New Email Address: %user_new_email%. </p><p>If you requested this change, please use the link below to complete the action. Otherwise please ignore this email and the change will not be made.</p><p>(%confirm_current_email_url%)</p><p>Thanks</p><p>%blogname%<br/></p>'; |
| 497 |
$update['user_message_email_user_verification_rejected'] = (isset($current["user_message_email_user_verification_rejected"]) && $current['user_message_email_user_verification_rejected'])?$current['user_message_email_user_verification_rejected']: '<p>Dear %user_login%,</p><p>We noticed that you created an account on %blogname% but your account has not been verified. </p><p>Please contact site administrator.</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 498 |
$update['user_message_email_user_subscription_activated'] = (isset($current["user_message_email_user_subscription_activated"]) && $current['user_message_email_user_subscription_activated'])?$current['user_message_email_user_subscription_activated']: '<p>Dear %user_login%,</p><p>Your subscription has been activated. </p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 499 |
$update['user_message_email_user_subscription_cancelled'] = (isset($current["user_message_email_user_subscription_cancelled"]) && $current['user_message_email_user_subscription_cancelled'])?$current['user_message_email_user_subscription_cancelled']: '<p>Dear %user_login%,</p><p>Your subscription has been cancelled, and your card will no longer be charged!</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 500 |
|
| 501 |
update_option(OPTION_PIE_REGISTER, $update ); |
| 502 |
|
| 503 |
$current_fields = maybe_unserialize(get_option( 'pie_fields' )); |
| 504 |
$fields = array(); |
| 505 |
|
| 506 |
$fields['form']['label'] = __("Registration Form","pie-register"); |
| 507 |
$fields['form']['desc'] = __("Please fill in the form below to register.","pie-register"); |
| 508 |
$fields['form']['label_alignment'] = (isset($current_fields['form']['label_alignment']) && $current_fields['form']['label_alignment'])?$current_fields['form']['label_alignment']:"left"; |
| 509 |
$fields['form']['css'] = (isset($current_fields['form']['css']) && $current_fields['form']['css'])?$current_fields['form']['css']:""; |
| 510 |
$fields['form']['type'] = (isset($current_fields['form']['type']) && $current_fields['form']['type'])?$current_fields['form']['type']:"form"; |
| 511 |
$fields['form']['meta'] = (isset($current_fields['form']['meta']) && $current_fields['form']['meta'])?$current_fields['form']['meta']:0; |
| 512 |
$fields['form']['reset'] = (isset($current_fields['form']['reset']) && $current_fields['form']['reset'])?$current_fields['form']['reset']:0; |
| 513 |
|
| 514 |
$fields[0]['label'] = (isset($current_fields[0]['label']) && $current_fields[0]['label'])?$current_fields[0]['label']:__("Username","pie-register"); |
| 515 |
$fields[0]['type'] = (isset($current_fields[0]['type']) && $current_fields[0]['type'])?$current_fields[0]['type']:"username"; |
| 516 |
$fields[0]['id'] = (isset($current_fields[0]['id']) && $current_fields[0]['id'])?$current_fields[0]['id']:0; |
| 517 |
$fields[0]['remove'] = (isset($current_fields[0]['remove']) && $current_fields[0]['remove'])?$current_fields[0]['remove']:0; |
| 518 |
$fields[0]['required'] = (isset($current_fields[0]['required']) && $current_fields[0]['required'])?$current_fields[0]['required']:1; |
| 519 |
$fields[0]['desc'] = (isset($current_fields[0]['desc']) && $current_fields[0]['desc'])?$current_fields[0]['desc']:""; |
| 520 |
$fields[0]['length'] = (isset($current_fields[0]['length']) && $current_fields[0]['length'])?$current_fields[0]['length']:""; |
| 521 |
$fields[0]['default_value'] = (isset($current_fields[0]['default_value']) && $current_fields[0]['default_value'])?$current_fields[0]['default_value']:""; |
| 522 |
$fields[0]['placeholder'] = (isset($current_fields[0]['placeholder']) && $current_fields[0]['placeholder'])?$current_fields[0]['placeholder']:""; |
| 523 |
$fields[0]['css'] = (isset($current_fields[0]['css']) && $current_fields[0]['css'])?$current_fields[0]['css']:""; |
| 524 |
$fields[0]['meta'] = (isset($current_fields[0]['meta']) && $current_fields[0]['meta'])?$current_fields[0]['meta']:0; |
| 525 |
|
| 526 |
$fields[1]['label'] = (isset($current_fields[1]['label']) && $current_fields[1]['label'])?$current_fields[1]['label']:__("Email","pie-register"); |
| 527 |
$fields[1]['label2'] = (isset($current_fields[1]['label2']) && $current_fields[1]['label2'])?$current_fields[1]['label2']:__("Confirm Email","pie-register"); |
| 528 |
$fields[1]['type'] = (isset($current_fields[1]['type']) && $current_fields[1]['type'])?$current_fields[1]['type']:"email"; |
| 529 |
$fields[1]['id'] = (isset($current_fields[1]['id']) && $current_fields[1]['id'])?$current_fields[1]['id']:1; |
| 530 |
$fields[1]['remove'] = (isset($current_fields[1]['required']) && $current_fields[1]['remove'])?$current_fields[1]['remove']:0; |
| 531 |
$fields[1]['required'] = (isset($current_fields[1]['required']) && $current_fields[1]['required'])?$current_fields[1]['required']:1; |
| 532 |
$fields[1]['desc'] = (isset($current_fields[1]['desc']) && $current_fields[1]['desc'])?$current_fields[1]['desc']:""; |
| 533 |
$fields[1]['length'] = (isset($current_fields[1]['length']) && $current_fields[1]['length'])?$current_fields[1]['length']:""; |
| 534 |
$fields[1]['default_value'] = (isset($current_fields[1]['default_value']) && $current_fields[1]['default_value'])?$current_fields[1]['default_value']:""; |
| 535 |
$fields[1]['placeholder'] = (isset($current_fields[1]['placeholder']) && $current_fields[1]['placeholder'])?$current_fields[1]['placeholder']:""; |
| 536 |
$fields[1]['placeholder2'] = (isset($current_fields[1]['placeholder2']) && $current_fields[1]['placeholder2'])?$current_fields[1]['placeholder2']:""; |
| 537 |
$fields[1]['css'] = (isset($current_fields[1]['css']) && $current_fields[1]['css'])?$current_fields[1]['css']:""; |
| 538 |
$fields[1]['validation_rule'] = (isset($current_fields[1]['validation_rule']) && $current_fields[1]['validation_rule'])?$current_fields[1]['validation_rule']:"email"; |
| 539 |
$fields[1]['meta'] = (isset($current_fields[1]['meta']) && $current_fields[1]['meta'])?$current_fields[1]['meta']:0; |
| 540 |
|
| 541 |
$fields[2]['label'] = (isset($current_fields[2]['label']) && $current_fields[2]['label'])?$current_fields[2]['label']:__("Password","pie-register"); |
| 542 |
$fields[2]['label2'] = (isset($current_fields[2]['label2']) && $current_fields[2]['label2'])?$current_fields[2]['label2']:__("Confirm Password","pie-register"); |
| 543 |
$fields[2]['type'] = (isset($current_fields[2]['type']) && $current_fields[2]['type'])?$current_fields[2]['type']:"password"; |
| 544 |
$fields[2]['id'] = (isset($current_fields[2]['id']) && $current_fields[2]['id'])?$current_fields[2]['id']:2; |
| 545 |
$fields[2]['remove'] = (isset($current_fields[2]['remove']) && $current_fields[2]['remove'])?$current_fields[2]['remove']:0; |
| 546 |
$fields[2]['required'] = (isset($current_fields[2]['required']) && $current_fields[2]['required'])?$current_fields[2]['required']:1; |
| 547 |
$fields[2]['desc'] = (isset($current_fields[2]['desc']) && $current_fields[2]['desc'])?$current_fields[2]['desc']:""; |
| 548 |
$fields[2]['length'] = (isset($current_fields[2]['length']) && $current_fields[2]['length'])?$current_fields[2]['length']:""; |
| 549 |
$fields[2]['default_value'] = (isset($current_fields[2]['default_value']) && $current_fields[2]['default_value'])?$current_fields[2]['default_value']:""; |
| 550 |
$fields[2]['placeholder'] = (isset($current_fields[2]['placeholder']) && $current_fields[2]['placeholder'])?$current_fields[2]['placeholder']:""; |
| 551 |
$fields[2]['placeholder2'] = (isset($current_fields[2]['placeholder2']) && $current_fields[2]['placeholder2'])?$current_fields[2]['placeholder2']:""; |
| 552 |
$fields[2]['css'] = (isset($current_fields[2]['css']) && $current_fields[2]['css'])?$current_fields[2]['css']:""; |
| 553 |
$fields[2]['validation_rule'] = (isset($current_fields[2]['validation_rule']) && $current_fields[2]['validation_rule'])?$current_fields[2]['validation_rule']:""; |
| 554 |
$fields[2]['meta'] = (isset($current_fields[2]['meta']) && $current_fields[2]['meta'])?$current_fields[2]['meta']:0; |
| 555 |
$fields[2]['show_meter'] = (isset($current_fields[2]['show_meter']) && $current_fields[2]['show_meter'])?$current_fields[2]['show_meter']:1; |
| 556 |
|
| 557 |
//Getting data from old plugins |
| 558 |
$num = 3; |
| 559 |
if( ( isset($current['firstname']) && $current['firstname'] ) || ( isset($current['lastname']) && $current['lastname'] ) ) |
| 560 |
{ |
| 561 |
$fields[$num]['type'] = "name"; |
| 562 |
$fields[$num]['label'] = __("First Name","pie-register"); |
| 563 |
$fields[$num]['label2'] = __("Last Name","pie-register"); |
| 564 |
$fields[$num]['field_name'] = "first_name"; |
| 565 |
$fields[$num]['id'] = $num; |
| 566 |
$num++; |
| 567 |
} |
| 568 |
|
| 569 |
if( isset($current['website']) && $current['website'] ) |
| 570 |
{ |
| 571 |
$fields[$num]['type'] = "default"; |
| 572 |
$fields[$num]['label'] = __("Website","pie-register"); |
| 573 |
$fields[$num]['field_name'] = "url"; |
| 574 |
$fields[$num]['id'] = $num; |
| 575 |
$num++; |
| 576 |
} |
| 577 |
if( isset($current['aim']) && $current['aim'] ) |
| 578 |
{ |
| 579 |
$fields[$num]['type'] = "default"; |
| 580 |
$fields[$num]['label'] = __("AIM","pie-register"); |
| 581 |
$fields[$num]['field_name'] = "aim"; |
| 582 |
$fields[$num]['id'] = $num; |
| 583 |
$num++; |
| 584 |
} |
| 585 |
if( isset($current['yahoo']) && $current['yahoo'] ) |
| 586 |
{ |
| 587 |
$fields[$num]['type'] = "default"; |
| 588 |
$fields[$num]['label'] = __("Yahoo IM","pie-register"); |
| 589 |
$fields[$num]['field_name'] = "yim"; |
| 590 |
$fields[$num]['id'] = $num; |
| 591 |
$num++; |
| 592 |
} |
| 593 |
if( isset($current['jabber']) && $current['jabber'] ) |
| 594 |
{ |
| 595 |
$fields[$num]['type'] = "default"; |
| 596 |
$fields[$num]['label'] = __("Jabber / Google Talk","pie-register"); |
| 597 |
$fields[$num]['field_name'] = "jabber"; |
| 598 |
$fields[$num]['id'] = $num; |
| 599 |
$num++; |
| 600 |
} |
| 601 |
if( isset($current['about']) && $current['about'] ) |
| 602 |
{ |
| 603 |
$fields[$num]['type'] = "default"; |
| 604 |
$fields[$num]['label'] = __("About Yourself","pie-register"); |
| 605 |
$fields[$num]['field_name'] = "description"; |
| 606 |
$fields[$num]['id'] = $num; |
| 607 |
$num++; |
| 608 |
} |
| 609 |
|
| 610 |
$piereg_custom = get_option( 'pie_register_custom' ); |
| 611 |
if( is_array($piereg_custom )) |
| 612 |
{ |
| 613 |
foreach( $piereg_custom as $k=>$v) |
| 614 |
{ |
| 615 |
|
| 616 |
if($v['fieldtype']=="select" || $v['fieldtype']=="checkbox" || $v['fieldtype']=="radio")//Populating values |
| 617 |
{ |
| 618 |
$ops = explode(',',$v['extraoptions']); |
| 619 |
foreach( $ops as $op ) |
| 620 |
{ |
| 621 |
$fields[$num]['value'][] = $op; |
| 622 |
$fields[$num]['display'][] = $op; |
| 623 |
} |
| 624 |
} |
| 625 |
else |
| 626 |
{ |
| 627 |
$fields[$num]['default_value'] = $v['extraoptions']; |
| 628 |
} |
| 629 |
|
| 630 |
$fields[$num]['type'] = $v['fieldtype']; |
| 631 |
$fields[$num]['label'] = $v['label']; |
| 632 |
$fields[$num]['id'] = $num; |
| 633 |
$fields[$num]['required'] = $v['required']; |
| 634 |
|
| 635 |
if($fields[$num]['type']=="select") |
| 636 |
{ |
| 637 |
$fields[$num]['type'] = "dropdown"; |
| 638 |
} |
| 639 |
|
| 640 |
if($fields[$num]['type']=="date") |
| 641 |
{ |
| 642 |
$fields[$num]['date_type'] = "datepicker"; |
| 643 |
$fields[$num]['date_format'] = $current["dateformat"]; |
| 644 |
$fields[$num]['firstday'] = $current["firstday"]; |
| 645 |
$fields[$num]['startdate'] = $current["startdate"]; |
| 646 |
$fields[$num]['calyear'] = $current["calyear"]; |
| 647 |
$fields[$num]['calmonth'] = $current["calmonth"]; |
| 648 |
} |
| 649 |
|
| 650 |
$num++; |
| 651 |
} |
| 652 |
} |
| 653 |
|
| 654 |
$fields['submit']['message'] = __("Thank you for registering","pie-register"); |
| 655 |
$fields['submit']['confirmation'] = "text"; |
| 656 |
$fields['submit']['text'] = "Submit"; |
| 657 |
$fields['submit']['reset'] = 0; |
| 658 |
$fields['submit']['reset_text'] = "Reset"; |
| 659 |
$fields['submit']['type'] = "submit"; |
| 660 |
$fields['submit']['meta'] = 0; |
| 661 |
$fields['submit']['redirect_url'] = ""; |
| 662 |
|
| 663 |
|
| 664 |
update_option( 'pie_fields_default', $fields ); |
| 665 |
|
| 666 |
$structure = $this->getDefaultMeta(); |
| 667 |
|
| 668 |
|
| 669 |
update_option( 'pie_fields_meta', $structure ); |
| 670 |
|
| 671 |
|
| 672 |
/* |
| 673 |
* Get old form or create default form |
| 674 |
*/ |
| 675 |
$created_form_id = $this->install_default_reg_form(); |
| 676 |
|
| 677 |
//Alternate Pages |
| 678 |
$get_pie_pages_from_db = get_option("pie_pages"); |
| 679 |
if(is_array($get_pie_pages_from_db)) |
| 680 |
{ |
| 681 |
$piereg_registrtion = (isset($get_pie_pages_from_db[1]) and $get_pie_pages_from_db != "")? get_post_status($get_pie_pages_from_db[1]) : "null"; |
| 682 |
} |
| 683 |
|
| 684 |
$pie_pages = get_option("pie_pages"); |
| 685 |
|
| 686 |
if($piereg_registration_create_new_page && isset($pie_pages[1]) && !empty($pie_pages[1]) )//Registration |
| 687 |
{ |
| 688 |
$_p = array(); |
| 689 |
$_p['ID'] = intval($pie_pages[1]); |
| 690 |
$_p['post_title'] = __("Registration","pie-register"); |
| 691 |
$_p['post_content'] = '[pie_register_form id="' . ( (intval($created_form_id) > 0) ? intval($created_form_id) : "0" ) . '" title="true" description="true" ]'; |
| 692 |
$_p['post_status'] = 'publish'; |
| 693 |
$_p['post_type'] = 'page'; |
| 694 |
$_p['comment_status'] = 'closed'; |
| 695 |
$_p['ping_status'] = 'closed'; |
| 696 |
wp_update_post( $_p ); |
| 697 |
} |
| 698 |
|
| 699 |
global $wpdb; |
| 700 |
$prefix=$wpdb->prefix."pieregister_"; |
| 701 |
$codetable=$prefix."code"; |
| 702 |
|
| 703 |
if(!$wpdb->query("CREATE TABLE IF NOT EXISTS `{$codetable}` (`id` INT( 5 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `created` DATE NOT NULL , `modified` DATE NOT NULL , `name` TEXT NOT NULL , `count` INT( 5 ) NOT NULL , `status` INT( 2 ) NOT NULL , `code_usage` INT( 5 ) NOT NULL, `expiry_date` DATE NOT NULL, `code_description` VARCHAR(255) NULL) ENGINE = MYISAM ;")) |
| 704 |
{ |
| 705 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 706 |
} |
| 707 |
|
| 708 |
$status = $wpdb->get_results( "SHOW COLUMNS FROM {$codetable}" ); #WPS |
| 709 |
if(isset($wpdb->last_error) && !empty($wpdb->last_error)){ |
| 710 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 711 |
} |
| 712 |
$check = 0; |
| 713 |
$check_expiry = 0; |
| 714 |
$add_desc_columns = true; |
| 715 |
$add_role_columns = true; |
| 716 |
foreach($status as $key=>$val) |
| 717 |
{ |
| 718 |
if(trim(strtolower($val->Field)) == "code_usage") |
| 719 |
{ |
| 720 |
$check = 1; |
| 721 |
} |
| 722 |
if(trim(strtolower($val->Field)) == "usage") |
| 723 |
{ |
| 724 |
$check = 2; |
| 725 |
} |
| 726 |
if(trim(strtolower($val->Field)) == "expiry_date") |
| 727 |
{ |
| 728 |
$check_expiry = 1; |
| 729 |
} |
| 730 |
if(trim(strtolower($val->Field)) == "code_description") |
| 731 |
{ |
| 732 |
$add_desc_columns = false; |
| 733 |
} |
| 734 |
if(trim(strtolower($val->Field)) == "code_user_role") |
| 735 |
{ |
| 736 |
$add_role_columns = false; |
| 737 |
} |
| 738 |
} |
| 739 |
|
| 740 |
if($check === 2) |
| 741 |
{ |
| 742 |
if ( ! $wpdb->query( $wpdb->prepare( "ALTER TABLE `{$wpdb->prefix}pieregister_code` CHANGE `usage` `code_usage` int(11) NULL", array() ) ) ) { |
| 743 |
$this->pr_error_log( $wpdb->last_error . ( $this->get_error_log_info( __FUNCTION__, __LINE__, __FILE__ ) ) ); |
| 744 |
} |
| 745 |
} |
| 746 |
|
| 747 |
if($check === 0) |
| 748 |
{ |
| 749 |
if ( ! $wpdb->query( $wpdb->prepare( "ALTER TABLE `{$wpdb->prefix}pieregister_code` ADD COLUMN `code_usage` int(11) NULL", array() ) ) ) { |
| 750 |
$this->pr_error_log( $wpdb->last_error . ( $this->get_error_log_info( __FUNCTION__, __LINE__, __FILE__ ) ) ); |
| 751 |
} |
| 752 |
} |
| 753 |
|
| 754 |
if( $check_expiry === 0 && PIEREG_DB_VERSION > "3.0" ) |
| 755 |
{ |
| 756 |
if ( ! $wpdb->query( $wpdb->prepare( "ALTER TABLE `{$wpdb->prefix}pieregister_code` ADD COLUMN `expiry_date` DATE NOT NULL", array() ) ) ) { |
| 757 |
$this->pr_error_log( $wpdb->last_error . ( $this->get_error_log_info( __FUNCTION__, __LINE__, __FILE__ ) ) ); |
| 758 |
} |
| 759 |
} |
| 760 |
if( $add_desc_columns ) |
| 761 |
{ |
| 762 |
if ( ! $wpdb->query( $wpdb->prepare( "ALTER TABLE `{$wpdb->prefix}pieregister_code` ADD COLUMN `code_description` varchar(255) NULL", array() ) ) ) { |
| 763 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 764 |
} |
| 765 |
} |
| 766 |
|
| 767 |
if( $add_role_columns ) |
| 768 |
{ |
| 769 |
if ( ! $wpdb->query( $wpdb->prepare( "ALTER TABLE `{$wpdb->prefix}pieregister_code` ADD COLUMN `code_user_role` varchar(255) NULL", array() ) ) ) { |
| 770 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 771 |
} |
| 772 |
} |
| 773 |
$redirect_settings_table_name = $wpdb->prefix."pieregister_redirect_settings"; |
| 774 |
|
| 775 |
if ( ! $wpdb->query( $wpdb->prepare( "CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}pieregister_redirect_settings` ( |
| 776 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
| 777 |
`user_role` varchar(100) NOT NULL, |
| 778 |
`logged_in_url` text NOT NULL, |
| 779 |
`logged_in_page_id` int(11) NOT NULL, |
| 780 |
`log_out_url` text NOT NULL, |
| 781 |
`log_out_page_id` int(11) NOT NULL, |
| 782 |
`status` bit(1) NOT NULL DEFAULT b'1', |
| 783 |
PRIMARY KEY (`user_role`), |
| 784 |
UNIQUE KEY `id` (`id`) |
| 785 |
) ENGINE=MYISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;", array() ) ) ) |
| 786 |
{ |
| 787 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 788 |
} |
| 789 |
|
| 790 |
// email count |
| 791 |
$invite_code_emails_table_name = $wpdb->prefix."pieregister_invite_code_emails"; |
| 792 |
|
| 793 |
if(!$wpdb->query($wpdb->prepare("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}pieregister_invite_code_emails` ( |
| 794 |
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT, |
| 795 |
`code_id` int NOT NULL, |
| 796 |
`email_address` varchar(150) NOT NULL, |
| 797 |
FOREIGN KEY (`code_id`) REFERENCES `{$wpdb->prefix}pieregister_code`(`id`) |
| 798 |
) ENGINE=MYISAM;", array() ))) |
| 799 |
{ |
| 800 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 801 |
} |
| 802 |
// ver 3.5.4 |
| 803 |
$custom_role_table_name = $wpdb->prefix."pieregister_custom_user_roles"; |
| 804 |
|
| 805 |
if(!$wpdb->query("CREATE TABLE IF NOT EXISTS `{$custom_role_table_name}` ( |
| 806 |
`id` int NOT NULL PRIMARY KEY AUTO_INCREMENT, |
| 807 |
`role_key` varchar(150) NOT NULL UNIQUE, |
| 808 |
`role_name` varchar(150) NOT NULL, |
| 809 |
`wp_role_name` varchar(150) NOT NULL |
| 810 |
) ENGINE=MYISAM;")) |
| 811 |
{ |
| 812 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 813 |
} |
| 814 |
$lockdowns_table_name = $wpdb->prefix."pieregister_lockdowns"; |
| 815 |
|
| 816 |
if(!$wpdb->query($wpdb->prepare("CREATE TABLE IF NOT EXISTS `{$wpdb->prefix}pieregister_lockdowns` ( |
| 817 |
`id` int(11) NOT NULL AUTO_INCREMENT, |
| 818 |
`user_id` int(11) NOT NULL, |
| 819 |
`login_attempt` int(11) NOT NULL, |
| 820 |
`attempt_from` varchar(56) NOT NULL, |
| 821 |
`is_security_captcha` tinyint(4) NOT NULL DEFAULT '0', |
| 822 |
`attempt_time` datetime NOT NULL, |
| 823 |
`release_time` datetime NOT NULL, |
| 824 |
`user_ip` varchar(30) NOT NULL, |
| 825 |
PRIMARY KEY (`id`) |
| 826 |
) ENGINE=MYISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; |
| 827 |
", array() ))) |
| 828 |
{ |
| 829 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 830 |
} |
| 831 |
|
| 832 |
$lockdowns_get_columns = $wpdb->get_results($wpdb->prepare("SHOW COLUMNS FROM `{$wpdb->prefix}pieregister_lockdowns` LIKE %s", 'attempt_from')); |
| 833 |
if(empty($lockdowns_get_columns)){ |
| 834 |
$wpdb->query($wpdb->prepare("ALTER TABLE `{$wpdb->prefix}pieregister_lockdowns` ADD attempt_from varchar(56) NOT NULL AFTER login_attempt", array())); |
| 835 |
} |
| 836 |
|
| 837 |
/* |
| 838 |
* Create Pie Register Stats array If Do not Exist |
| 839 |
*/ |
| 840 |
$piereg_stats = get_option(PIEREG_STATS_OPTION); |
| 841 |
|
| 842 |
$new_piereg_stats = array(); |
| 843 |
$new_piereg_stats['login']['view'] = (isset($piereg_stats['login']['view'])?$piereg_stats['login']['view']:0); |
| 844 |
$new_piereg_stats['login']['used'] = (isset($piereg_stats['login']['used'])?$piereg_stats['login']['used']:0); |
| 845 |
|
| 846 |
$new_piereg_stats['forgot']['view'] = (isset($piereg_stats['forgot']['view'])?$piereg_stats['forgot']['view']:0); |
| 847 |
$new_piereg_stats['forgot']['used'] = (isset($piereg_stats['forgot']['view'])?$piereg_stats['forgot']['view']:0); |
| 848 |
|
| 849 |
$new_piereg_stats['register']['view'] = (isset($piereg_stats['register']['view'])?$piereg_stats['register']['view']:0); |
| 850 |
$new_piereg_stats['register']['used'] = (isset($piereg_stats['register']['used'])?$piereg_stats['register']['used']:0); |
| 851 |
|
| 852 |
update_option(PIEREG_STATS_OPTION,$new_piereg_stats); |
| 853 |
unset($new_piereg_stats); |
| 854 |
unset($piereg_stats); |
| 855 |
|
| 856 |
/* |
| 857 |
* Save Currency name and array |
| 858 |
*/ |
| 859 |
$this->piereg_save_currency(); |
| 860 |
|
| 861 |
/* |
| 862 |
* Removed in v 3.0.10 |
| 863 |
* |
| 864 |
* |
| 865 |
//Adding active meta to existing users |
| 866 |
$blogusers = get_users(); |
| 867 |
foreach ($blogusers as $user) |
| 868 |
{ |
| 869 |
update_user_meta( $user->ID, 'active', 1); |
| 870 |
} |
| 871 |
*/ |
| 872 |
// From 3.7.0.5 - Updating Firebase API Key for PR Android App |
| 873 |
update_option('pie_app_firebase_api_key', 'AAAAn4vZc1A:APA91bH8vNDyZZMqu1UsZii2EGEGrdmDwTg4rqvCzfJ1jSkd28sl_NUelOPg2JqPKC8r3lK2j082xnsFerOwrX_-1524KmqeDUECZbxPPTojt4Uzp-d2ZbQsRiega3-zDm3PKypp_B6P' ); |
| 874 |
|
| 875 |
# updating pieregister db version |
| 876 |
update_option('piereg_plugin_db_version',PIEREG_DB_VERSION); |
| 877 |
|
| 878 |
// Create error directory for pieregister error logs |
| 879 |
// $upload_dir = wp_upload_dir(); |
| 880 |
// $temp_dir = realpath($upload_dir['basedir'])."/pie-logs/"; |
| 881 |
// wp_mkdir_p($temp_dir); |
| 882 |
|
| 883 |
$secure_log_dir = WP_CONTENT_DIR . "/pie-logs"; // Secure directory |
| 884 |
|
| 885 |
// Ensure the directory exists |
| 886 |
if (!file_exists($secure_log_dir)) { |
| 887 |
wp_mkdir_p($secure_log_dir); |
| 888 |
} |
| 889 |
|
| 890 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 891 |
|
| 892 |
// Create .htaccess file to block access |
| 893 |
$htaccess_file = $secure_log_dir . '/.htaccess'; |
| 894 |
if (!$wp_filesystem->exists($htaccess_file)) { |
| 895 |
$htaccess_content = "<IfModule mod_authz_core.c>\nRequire all denied\n</IfModule>\n"; |
| 896 |
$htaccess_content .= "<IfModule !mod_authz_core.c>\nOrder allow,deny\nDeny from all\n</IfModule>\n"; |
| 897 |
$wp_filesystem->put_contents($htaccess_file, $htaccess_content); |
| 898 |
} |
| 899 |
|
| 900 |
// Add an index.php file for extra security |
| 901 |
$index_file = $secure_log_dir . '/index.php'; |
| 902 |
if (!$wp_filesystem->exists($index_file)) { |
| 903 |
$wp_filesystem->put_contents($index_file, "<?php\n// Silence is golden."); |
| 904 |
} |
| 905 |
|
| 906 |
} |
| 907 |
|
| 908 |
function activate_pieregister_license_key(){ |
| 909 |
global $wpdb; |
| 910 |
$old_pr_keys = get_option("api_manager_example"); |
| 911 |
|
| 912 |
$global_options = array(); |
| 913 |
$global_options['api_key'] = ( (isset($old_pr_keys['api_key']) && !empty($old_pr_keys['api_key'])) ? $old_pr_keys['api_key'] : "" ); |
| 914 |
$global_options['activation_email'] = ( (isset($old_pr_keys['activation_email']) && !empty($old_pr_keys['activation_email'])) ? $old_pr_keys['activation_email'] : "" ); |
| 915 |
|
| 916 |
if( empty($global_options['api_key']) || empty($old_pr_keys['activation_email']) ) : |
| 917 |
update_option( 'api_manager_example', $global_options ); |
| 918 |
|
| 919 |
if( file_exists(PIEREG_DIR_NAME . '/classes/api/class-wc-api-manager-passwords.php') ) |
| 920 |
require_once(PIEREG_DIR_NAME . '/classes/api/class-wc-api-manager-passwords.php'); |
| 921 |
|
| 922 |
$API_Manager_Example_Password_Management = new API_Manager_Example_Password_Management(); |
| 923 |
// Generate a unique installation $instance id |
| 924 |
$instance = $API_Manager_Example_Password_Management->generate_password( 12, false ); |
| 925 |
|
| 926 |
$single_options = array( |
| 927 |
'piereg_api_manager_product_id' => 'Pie-Register-pro', |
| 928 |
'piereg_api_manager_instance' => $instance, |
| 929 |
'api_manager_example_deactivate_checkbox' => 'on', |
| 930 |
'piereg_api_manager_activated' => 'Deactivated', |
| 931 |
); |
| 932 |
foreach ( $single_options as $key => $value ) { |
| 933 |
update_option( $key, $value ); |
| 934 |
} |
| 935 |
|
| 936 |
$curr_ver = get_option( $this->piereg_api_manager_version_name ); |
| 937 |
// checks if the current plugin version is lower than the version being installed |
| 938 |
if ( version_compare( $this->version, $curr_ver, '>' ) ) { |
| 939 |
// update the version |
| 940 |
update_option( $this->piereg_api_manager_version_name, $this->version ); |
| 941 |
} |
| 942 |
endif; |
| 943 |
} |
| 944 |
function piereg_add_custom_cap( $piereg_custom_capabilities ) |
| 945 |
{ |
| 946 |
foreach ( $piereg_custom_capabilities as $piereg_custom_capability) |
| 947 |
{ |
| 948 |
switch( $piereg_custom_capability ) |
| 949 |
{ |
| 950 |
case 'piereg_manage_cap' : |
| 951 |
$this->piereg_assign_cap($piereg_custom_capability,'administrator'); |
| 952 |
break; |
| 953 |
default: |
| 954 |
} |
| 955 |
} |
| 956 |
} |
| 957 |
function piereg_assign_cap( $capability,$role ) |
| 958 |
{ |
| 959 |
$role = get_role($role); |
| 960 |
$role->add_cap($capability); |
| 961 |
$role->add_cap('read'); |
| 962 |
} |
| 963 |
function install_default_reg_form(){ |
| 964 |
$form_id = get_option("piereg_form_fields_id"); |
| 965 |
$all_forms_info = $this->get_pr_forms_info(); |
| 966 |
|
| 967 |
if(empty($form_id) || count($all_forms_info) == 0 ) |
| 968 |
{ |
| 969 |
$form_id = intval($form_id)+1;//increment form id |
| 970 |
update_option("piereg_form_fields_id",$form_id);//updated form id |
| 971 |
|
| 972 |
update_option('piereg_form_free_id', $form_id); // assignining reg for free ver |
| 973 |
|
| 974 |
$pie_fields = get_option("pie_fields");//get reg form |
| 975 |
$pie_fields = ( (empty($pie_fields)) ? get_option("pie_fields_default") : $pie_fields );//get default form |
| 976 |
|
| 977 |
|
| 978 |
// add membership field if paypal payment is ON. |
| 979 |
$current = get_option(OPTION_PIE_REGISTER); |
| 980 |
$pie_plugin_db_version = get_option('piereg_plugin_db_version'); |
| 981 |
$pie_plugin_db_version = explode('.',$pie_plugin_db_version); |
| 982 |
if($pie_plugin_db_version[0] == 2 && isset($current['enable_paypal'],$current['paypal_butt_id']) && ($current['enable_paypal'] == 1 && !empty($current['paypal_butt_id'])) ) |
| 983 |
{ |
| 984 |
$pie_fields = maybe_unserialize($pie_fields); |
| 985 |
|
| 986 |
$pie_fields_submit = $pie_fields['submit']; |
| 987 |
unset($pie_fields['submit']); |
| 988 |
|
| 989 |
$int_m = count($pie_fields); |
| 990 |
|
| 991 |
$membership_field['id'] = $int_m; |
| 992 |
$membership_field['type'] = "pricing"; |
| 993 |
$membership_field['label'] = "Membership"; |
| 994 |
$membership_field['desc'] = ""; |
| 995 |
$membership_field['allow_payment_gateways'] = array("PaypalStandard"); |
| 996 |
$membership_field['validation_message'] = ""; |
| 997 |
$membership_field['css'] = ""; |
| 998 |
$membership_field['field_as'] = 1; |
| 999 |
|
| 1000 |
array_push($pie_fields,$membership_field); |
| 1001 |
$pie_fields['submit'] = $pie_fields_submit; |
| 1002 |
|
| 1003 |
if( !is_serialized( $pie_fields ) ) |
| 1004 |
{ |
| 1005 |
serialize($pie_fields); |
| 1006 |
} |
| 1007 |
} |
| 1008 |
// add membership field if paypal payment is ON. |
| 1009 |
|
| 1010 |
|
| 1011 |
if( is_serialized( $pie_fields ) ) { |
| 1012 |
update_option("piereg_form_fields_".$form_id, $pie_fields );//install default form |
| 1013 |
} else { |
| 1014 |
update_option("piereg_form_fields_".$form_id, serialize($pie_fields) );//install default form |
| 1015 |
} |
| 1016 |
$_field['Id'] = $form_id; |
| 1017 |
$_field['Title'] = ( (isset($pie_fields['form']['label']) && !empty($pie_fields['form']['label']) ) ? $pie_fields['form']['label'] : 'Registration Form' ); |
| 1018 |
$_field['Views'] = "0"; |
| 1019 |
$_field['Entries'] = "0"; |
| 1020 |
$_field['Status'] = "enable"; |
| 1021 |
update_option("piereg_form_field_option_".$form_id, $_field); |
| 1022 |
} |
| 1023 |
return $form_id; |
| 1024 |
} |
| 1025 |
function getDefaultMeta() |
| 1026 |
{ |
| 1027 |
$structure = array(); |
| 1028 |
$structure["text"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="length_%d%">'.__("Length","pie-register").'</label><input type="text" name="field[%d%][length]" id="length_%d%" class="input_fields character_fields field_length numeric"><a class="info" href="javascript:;">'.__("Specifies the visible width of a text field.","pie-register").'</a></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_rule_%d%">'.__("Validation Rule","pie-register").'</label><select name="field[%d%][validation_rule]" id="validation_rule_%d%"><option>'.__("None","pie-register").'</option><option value="number">'.__("Number","pie-register").'</option><option value="alphabetic">'.__("Alphabetic","pie-register").'</option><option value="alphanumeric">'.__("Alphanumeric","pie-register").'</option><option value="email">'.__("Email","pie-register").'</option><option value="website">'.__("Website","pie-register").'</option><option value="standard">'.__("USA Format","pie-register").' (xxx) (xxx-xxxx)</option><option value="international">'.__("Phone International","pie-register").' xxx-xxx-xxxx</option></select></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1029 |
|
| 1030 |
if($this->piereg_field_visbility_addon_active){ |
| 1031 |
$structure["text"] = apply_filters('pie_addon_field_visibility_settings', $structure["text"]); |
| 1032 |
}else{ |
| 1033 |
$structure["text"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1034 |
} |
| 1035 |
|
| 1036 |
// if bbpress plugin activated |
| 1037 |
if ($this->piereg_bbpress_addon_active){ |
| 1038 |
$structure["text"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1039 |
} |
| 1040 |
$structure["text"] .= '</div></div>'; |
| 1041 |
|
| 1042 |
$structure["username"] = '<input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="fields_main"><div class="advance_options_fields"><input type="hidden" value="1" name="field[%d%][required]"><input type="hidden" name="field[%d%][label]"><input type="hidden" name="field[%d%][validation_rule]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="Username" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"><input type="hidden" id="default_username"></div>'; |
| 1043 |
|
| 1044 |
$structure["username"] .='</div></div>'; |
| 1045 |
|
| 1046 |
$structure["default"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div>'; |
| 1047 |
|
| 1048 |
$structure["default"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1049 |
|
| 1050 |
$structure["default"] .= '</div></div>'; |
| 1051 |
|
| 1052 |
$structure["aim"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="AIM" id="label_%d%" class="input_fields field_label"></div></div></div>'; |
| 1053 |
|
| 1054 |
$structure["aim"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="AIM" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div></div></div>'; |
| 1055 |
|
| 1056 |
$structure["url"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" value="Website" class="input_fields field_label"><input type="hidden" name="field[%d%][validation_rule]"><input type="hidden" id="default_url"></div>'; |
| 1057 |
|
| 1058 |
$structure["url"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1059 |
|
| 1060 |
if( $this->piereg_pro_is_activate ) |
| 1061 |
{ |
| 1062 |
$structure["url"] .= $this->field_conditionl_logic_settings(); |
| 1063 |
} |
| 1064 |
|
| 1065 |
$structure["url"] .= '</div></div>'; |
| 1066 |
|
| 1067 |
$structure["yim"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" value="Yahoo IM" class="input_fields field_label"></div><div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div></div></div>'; |
| 1068 |
|
| 1069 |
$structure["description"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" value="About Yourself" class="input_fields field_label"></div><div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div></div></div>'; |
| 1070 |
|
| 1071 |
$structure["jabber"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="Jabber / Google Talk" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div></div></div>'; |
| 1072 |
$structure["password"] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" value="1" name="field[%d%][required]"><input type="hidden" name="field[%d%][validation_rule]"><input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="Password" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="label2_%d%">'.__("Label2","pie-register").'</label><input type="text" name="field[%d%][label2]" value="Confirm Password" id="label2_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="placeholder_%d%">Placeholder</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="placeholder2_%d%">Placeholder 2</label><input type="text" name="field[%d%][placeholder2]" id="placeholder2_%d%" class="input_fields field_placeholder2"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div><div class="advance_fields"><label for="password_generator_%d%">'.__("Password Generator","pie-register").'</label><input value="1" type="checkbox" name="field[%d%][password_generator]" id="password_generator_%d%" class="checkbox_fields"></div><div class="advance_fields"><label for="hide_confirm_password_%d%">'.__("Hide Confirm Password","pie-register").'</label><input value="1" type="checkbox" name="field[%d%][hide_confirm_password]" id="hide_confirm_password_%d%" class="hide_confirm_password checkbox_fields"></div><div class="advance_fields"><label for="show_meter_%d%">'.__("Show Strength Meter","pie-register").'</label><select class="strength_meter show_meter checkbox_fields" name="field[%d%][show_meter]" id="show_meter_%d%"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div><div class="strength_labels_div"><div class="advance_fields"><label for="pass_strength_indicator_label_%d%">'.__("Strength Indicator",'pie-register').'</label><input type="text" name="field[%d%][pass_strength_indicator_label]" id="pass_strength_indicator_label_%d%" class="input_fields" value="Strength Indicator" /></div><div class="advance_fields"><label for="pass_very_weak_label_%d%">'.__("Very Weak",'pie-register').'</label><input type="text" name="field[%d%][pass_very_weak_label]" id="pass_very_weak_label_%d%" class="input_fields" value="Very Weak" /></div><div class="advance_fields"><label for="pass_weak_label_%d%">'.__("Weak",'pie-register').'</label><input type="text" name="field[%d%][pass_weak_label]" id="pass_weak_label_%d%" class="input_fields" value="Weak" /></div><div class="advance_fields"><label for="pass_medium_label_%d%">'.__("Medium",'pie-register').'</label><input type="text" name="field[%d%][pass_medium_label]" id="pass_medium_label_%d%" class="input_fields" value="Medium" /></div><div class="advance_fields"><label for="pass_strong_label_%d%">'.__("Strong",'pie-register').'</label><input type="text" name="field[%d%][pass_strong_label]" id="pass_strong_label_%d%" class="input_fields" value="Strong" /></div><div class="advance_fields"><label for="pass_mismatch_label_%d%">'.__("Mismatch",'pie-register').'</label><input type="text" name="field[%d%][pass_mismatch_label]" id="pass_mismatch_label_%d%" class="input_fields" value="Mismatch" /></div><div class="advance_fields"><label for="restrict_strength_%d%">'.__("Minimum Strength","pie-register").'</label><select class="show_meter" name="field[%d%][restrict_strength]" id="restrict_strength_%d%"><option value="1" selected="selected">'.__("Very weak","pie-register").'</option><option value="2">'.__("Weak","pie-register").'</option><option value="3">'.__("Medium","pie-register").'</option><option value="4">'.__("Strong","pie-register").'</option></select></div><div class="advance_fields"><label for="strength_message_%d%">'.__("Strength Message","pie-register").'</label><input type="text" name="field[%d%][strength_message]" id="strength_message_%d%" class="input_fields" value="Weak Password"></div><input type="hidden" id="default_password"></div>'; |
| 1073 |
|
| 1074 |
$structure["password"] .= '</div></div>'; |
| 1075 |
|
| 1076 |
$structure['email'] = '<input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="fields_main"><div class="advance_options_fields"><input type="hidden" value="1" name="field[%d%][required]"><input type="hidden" name="field[%d%][label]"><input type="hidden" name="field[%d%][validation_rule]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="Email" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields confrim_email_label2"><label for="label2_%d%">'.__("Label2","pie-register").'</label><input type="text" name="field[%d%][label2]" value="Confirm Email" id="label2_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="confirm_email_%d%">'.__("Confirm Email","pie-register").'</label><input name="field[%d%][confirm_email]" id="confirm_email" value="%d%" type="checkbox" class="checkbox_fields"></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields confrim_email_label2"><label for="placeholder2_%d%">'.__("Placeholder 2","pie-register").'</label><input type="text" name="field[%d%][placeholder2]" id="placeholder2_%d%" class="input_fields field_placeholder2"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1077 |
|
| 1078 |
if($this->piereg_field_visbility_addon_active ){ |
| 1079 |
$structure["email"] = apply_filters('pie_addon_field_visibility_settings', $structure["email"],'email'); |
| 1080 |
} |
| 1081 |
|
| 1082 |
$structure['email'] .= '</div></div>'; |
| 1083 |
|
| 1084 |
$structure["textarea"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="rows_%d%">'.__("Rows","pie-register").'</label><input type="text" value="8" name="field[%d%][rows]" id="rows_%d%" class="input_fields character_fields field_rows numeric"><a class="info" href="javascript:;">'.__("The rows attribute specifies the visible height of a text area.","pie-register").'</a></div><div class="advance_fields"><label for="cols_%d%">'.__("Columns","pie-register").'</label><input type="text" value="73" name="field[%d%][cols]" id="cols_%d%" class="input_fields character_fields field_cols numeric"><a class="info" href="javascript:;">'.__("The columns attribute specifies the visible width of a text area.","pie-register").'</a></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1085 |
|
| 1086 |
if($this->piereg_field_visbility_addon_active ){ |
| 1087 |
$structure["textarea"] = apply_filters('pie_addon_field_visibility_settings', $structure["textarea"]); |
| 1088 |
}else{ |
| 1089 |
$structure["textarea"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1090 |
} |
| 1091 |
|
| 1092 |
// if bbpress plugin activated |
| 1093 |
if ($this->piereg_bbpress_addon_active){ |
| 1094 |
$structure["textarea"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1095 |
} |
| 1096 |
$structure["textarea"] .= '</div></div>'; |
| 1097 |
|
| 1098 |
|
| 1099 |
$structure["dropdown"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields multi_options sel_options_%d%"><label for="display_%d%">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields select_option_display"><label for="value_%d%">'.__("Value","pie-register").'</label><input type="text" name="field[%d%][value][]" id="value_%d%" class="input_fields character_fields select_option_value"><label>'.__("Checked","pie-register").'</label><input type="radio" value="0" id="check_%d%" name="field[%d%][selected][]" class="select_option_checked"><a class="pie_add_options_icon" style="color:white" href="javascript:;" onClick="addOptions(%d%,\'radio\',jQuery(this));">+</a><!--<a style="color:white;font-size: 13px;margin-left: 2px;" href="javascript:;" onclick="jQuery(this).parent().remove();">x</a>--></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div><div class="advance_fields"> <label for="list_type_%d%">'.__("List Type","pie-register").'</label><select name="field[%d%][list_type]" id="list_type_%d%"><option value="None">'.__("None","pie-register").'</option><option value="country">'.__("Country","pie-register").'</option><option value="us_states">'.__("US States","pie-register").'</option><option value="can_states">'.__("Canadian States","pie-register").'</option> </select></div>'; |
| 1100 |
|
| 1101 |
if($this->piereg_field_visbility_addon_active ){ |
| 1102 |
$structure["dropdown"] = apply_filters('pie_addon_field_visibility_settings', $structure["dropdown"]); |
| 1103 |
}else{ |
| 1104 |
$structure["dropdown"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1105 |
} |
| 1106 |
|
| 1107 |
// if bbpress plugin activated |
| 1108 |
if ($this->piereg_bbpress_addon_active){ |
| 1109 |
$structure["dropdown"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1110 |
} |
| 1111 |
$structure["dropdown"] .= '</div></div>'; |
| 1112 |
|
| 1113 |
|
| 1114 |
$structure["multiselect"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields multi_options sel_options_%d%"><label for="display_%d%">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields select_option_display"><label for="value_%d%">'.__("Value","pie-register").'</label><input type="text" name="field[%d%][value][]" id="value_%d%" class="input_fields character_fields select_option_value"><label>'.__("Checked","pie-register").'</label><input type="checkbox" value="0" id="check_%d%" name="field[%d%][selected][]" class="select_option_checked"><a class="pie_add_options_icon" style="color:white" href="javascript:;" onClick="addOptions(%d%,\'checkbox\',jQuery(this));">+</a><!--<a style="color:white;font-size: 13px;margin-left: 2px;" href="javascript:;" onclick="jQuery(this).parent().remove();">x</a>--></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div><div class="advance_fields"> <label for="list_type_%d%">'.__("List Type","pie-register").'</label><select name="field[%d%][list_type]" id="list_type_%d%"><option value="None">'.__("None","pie-register").'</option><option value="country">'.__("Country","pie-register").'</option><option value="us_states">'.__("US States","pie-register").'</option><option value="can_states">'.__("Canadian States","pie-register").'</option></select></div>'; |
| 1115 |
|
| 1116 |
if($this->piereg_field_visbility_addon_active ){ |
| 1117 |
$structure["multiselect"] = apply_filters('pie_addon_field_visibility_settings', $structure["multiselect"]); |
| 1118 |
}else{ |
| 1119 |
$structure["multiselect"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1120 |
} |
| 1121 |
|
| 1122 |
// if bbpress plugin activated |
| 1123 |
if ($this->piereg_bbpress_addon_active){ |
| 1124 |
$structure["multiselect"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1125 |
} |
| 1126 |
|
| 1127 |
$structure["multiselect"] .= '</div></div>'; |
| 1128 |
|
| 1129 |
|
| 1130 |
$structure["number"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="min_%d%">'.__("Min","pie-register").'</label><input type="text" name="field[%d%][min]" id="min_%d%" class="input_fields character_fields numeric"></div><div class="advance_fields"><label for="max_%d%">'.__("Max","pie-register").'</label><input type="text" name="field[%d%][max]" id="max_%d%" class="input_fields character_fields numeric"></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1131 |
|
| 1132 |
if($this->piereg_field_visbility_addon_active ){ |
| 1133 |
$structure["number"] = apply_filters('pie_addon_field_visibility_settings', $structure["number"]); |
| 1134 |
}else{ |
| 1135 |
$structure["number"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1136 |
} |
| 1137 |
|
| 1138 |
// if bbpress plugin activated |
| 1139 |
if ($this->piereg_bbpress_addon_active){ |
| 1140 |
$structure["number"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1141 |
} |
| 1142 |
|
| 1143 |
|
| 1144 |
$structure["number"] .= '</div></div>'; |
| 1145 |
|
| 1146 |
$structure["checkbox"] = '<div class="fields_main"> <div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div> <div class="advance_fields multi_options sel_options_%d%"><label for="display_%d%">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields checkbox_option_display"><label for="value_%d%">'.__("Value","pie-register").'</label><input type="text" name="field[%d%][value][]" id="value_%d%" class="input_fields character_fields checkbox_option_value"><label>'.__("Checked","pie-register").'</label><input type="checkbox" value="0" id="check_%d%" name="field[%d%][selected][]" class="checkbox_option_checked"><a class="pie_add_options_icon" style="color:white" href="javascript:;" onClick="addOptions(%d%,\'checkbox\');">+</a></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1147 |
|
| 1148 |
if($this->piereg_field_visbility_addon_active ){ |
| 1149 |
$structure["checkbox"] = apply_filters('pie_addon_field_visibility_settings', $structure["checkbox"]); |
| 1150 |
}else{ |
| 1151 |
$structure["checkbox"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1152 |
} |
| 1153 |
|
| 1154 |
// if bbpress plugin activated |
| 1155 |
if ($this->piereg_bbpress_addon_active){ |
| 1156 |
$structure["checkbox"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1157 |
} |
| 1158 |
|
| 1159 |
$structure["checkbox"] .= '</div></div>'; |
| 1160 |
|
| 1161 |
$structure["radio"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields multi_options sel_options_%d%"><label for="display_%d%">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields radio_option_display"><label for="value_%d%">'.__("Value","pie-register").'</label><input type="text" name="field[%d%][value][]" id="value_%d%" class="input_fields character_fields radio_option_value"><label>'.__("Checked","pie-register").'</label><input type="radio" value="0" id="check_%d%" name="field[%d%][selected][]" class="radio_option_checked"><a class="pie_add_options_icon" style="color:white" href="javascript:;" onClick="addOptions(%d%,\'radio\');">+</a></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1162 |
|
| 1163 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1164 |
$structure["radio"] = apply_filters('pie_addon_field_visibility_settings', $structure["radio"]); |
| 1165 |
}else{ |
| 1166 |
$structure["radio"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1167 |
} |
| 1168 |
|
| 1169 |
// if bbpress plugin activated |
| 1170 |
if ($this->piereg_bbpress_addon_active){ |
| 1171 |
$structure["radio"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1172 |
} |
| 1173 |
|
| 1174 |
$structure["radio"] .= '</div></div>'; |
| 1175 |
|
| 1176 |
$structure["html"] = '<input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><textarea rows="8" id="htmlbox_%d%" class="ckeditor" name="field[%d%][html]" cols="16"></textarea></div>'; |
| 1177 |
|
| 1178 |
if($this->piereg_field_visbility_addon_active ){ |
| 1179 |
$structure["html"] = apply_filters('pie_addon_field_visibility_settings', $structure["html"]); |
| 1180 |
}else{ |
| 1181 |
$structure["html"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1182 |
} |
| 1183 |
|
| 1184 |
$structure["html"] .= '</div></div>'; |
| 1185 |
|
| 1186 |
$structure["sectionbreak"] = '<input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div>'; |
| 1187 |
|
| 1188 |
$structure["sectionbreak"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1189 |
|
| 1190 |
$structure["sectionbreak"] .= '</div></div>'; |
| 1191 |
|
| 1192 |
$structure["pagebreak"] = '<div class="fields_main"><div class="advance_options_fields page_break_field_settings"><input type="hidden" value="0" class="input_fields" name="field[%d%][meta]" id="meta_%d%"><div class="advance_fields"><label for="next_button_%d%">'.__("Next Button","pie-register").'</label><div class="calendar_icon_type"> <input class="next_button" type="radio" id="next_button_%d%_text" name="field[%d%][next_button]" value="text" checked="checked"> <label for="next_button_%d%_text">'.__("Text","pie-register").' </label> <input class="next_button" type="radio" id="next_button_%d%_url" name="field[%d%][next_button]" value="url"><label for="next_button_%d%_url"> '.__("Image","pie-register").'</label></div><div id="next_button_url_container_%d%" style="float:left;clear: both;display: none;"> <label for="next_button_%d%_url"> '.__("Image URL","pie-register").': </label> <input type="text" name="field[%d%][next_button_url]" class="input_fields" id="next_button_%d%_url"></div><div id="next_button_text_container_%d%" style="float:left;clear: both;"> <label for="next_button_%d%_text"> '.__("Text","pie-register").': </label> <input type="text" name="field[%d%][next_button_text]" value="Next" class="input_fields" id="next_button_%d%_text"></div></div><div class="advance_fields"><label for="prev_button_%d%">'.__("Previous Button","pie-register").'</label><div class="calendar_icon_type"> <input class="prev_button" type="radio" id="prev_button_%d%_text" name="field[%d%][prev_button]" value="text" checked="checked"> <label for="prev_button_%d%_text">'.__("Text","pie-register").' </label> <input class="prev_button" type="radio" id="prev_button_%d%_url" name="field[%d%][prev_button]" value="url"> <label for="prev_button_%d%_url"> '.__("Image","pie-register").'</label></div><div id="prev_button_url_container_%d%" style="float:left;clear: both;display: none;"> <label for="prev_button_%d%_url"> '.__("Image URL","pie-register").': </label> <input type="text" name="field[%d%][prev_button_url]" class="input_fields" id="prev_button_%d%_url"></div><div id="prev_button_text_container_%d%" style="float:left;clear: both;"> <label for="prev_button_%d%_text"> '.__("Text","pie-register").': </label> <input type="text" name="field[%d%][prev_button_text]" value="Previous" class="input_fields" id="prev_button_%d%_text"></div></div></div></div>'; |
| 1193 |
|
| 1194 |
$structure['name'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="First Name" id="label_%d%" class="input_fields field_label"><input type="hidden" name="field[%d%][validation_rule]"></div><div class="advance_fields"><label for="label2_%d%">'.__("Label2","pie-register").'</label><input type="text" name="field[%d%][label2]" value="Last Name" id="label2_%d%" class="input_fields field_label2"></div><div class="advance_fields"><label for="length_%d%">'.__("Length","pie-register").'</label><input type="text" name="field[%d%][length]" id="length_%d%" class="input_fields character_fields field_length numeric"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="hide_last_name_%d%">'.__("Hide Last Name","pie-register").'</label><input value="1" type="checkbox" name="field[%d%][hide_last_name]" id="hide_last_name_%d%" class="checkbox_fields hide_last_name"></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="placeholder2_%d%">'.__("Placeholder 2","pie-register").'</label><input type="text" name="field[%d%][placeholder2]" id="placeholder2_%d%" class="input_fields field_placeholder2"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1195 |
|
| 1196 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1197 |
$structure["name"] = apply_filters('pie_addon_field_visibility_settings', $structure["name"]); |
| 1198 |
}else{ |
| 1199 |
$structure["name"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1200 |
} |
| 1201 |
|
| 1202 |
// if bbpress plugin activated |
| 1203 |
if ($this->piereg_bbpress_addon_active){ |
| 1204 |
$structure["name"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1205 |
} |
| 1206 |
|
| 1207 |
$structure['name'] .= '</div></div>'; |
| 1208 |
|
| 1209 |
$structure['time'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"> <label for="time_type_%d%">'.__("List Type","pie-register").'</label><select class="time_format" name="field[%d%][time_type]" id="time_type_%d%"><option value="12">'.__("12 hour","pie-register").'</option><option value="24">'.__("24 hour","pie-register").'</option></select></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1210 |
|
| 1211 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1212 |
$structure["time"] = apply_filters('pie_addon_field_visibility_settings', $structure["time"]); |
| 1213 |
}else{ |
| 1214 |
$structure["time"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1215 |
} |
| 1216 |
|
| 1217 |
// if bbpress plugin activated |
| 1218 |
if ($this->piereg_bbpress_addon_active){ |
| 1219 |
$structure["time"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1220 |
} |
| 1221 |
|
| 1222 |
$structure['time'] .= '</div></div>'; |
| 1223 |
|
| 1224 |
$structure['website'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div></div></div>'; |
| 1225 |
|
| 1226 |
$structure['upload'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="file_types_%d%">'.__("File Types","pie-register").'</label><input type="text" name="field[%d%][file_types]" id="file_types_%d%" class="input_fields"><a class="info" href="javascript:;">'.__("Separated with commas","pie-register").' (i.e. jpg, gif, png, pdf)</a></div>'; |
| 1227 |
|
| 1228 |
$structure['upload'] .= '<div class="advance_fields"><label for="file_size_%d%">'.__("File Size","pie-register").'</label><input type="number" class="input_fields" disabled><a class="info" href="javascript:;" style="color:red;">'.__("Available in premium version","pie-register").'</a></div>'; |
| 1229 |
|
| 1230 |
$structure['upload'] .= '<div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1231 |
|
| 1232 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1233 |
$structure["upload"] = apply_filters('pie_addon_field_visibility_settings', $structure["upload"]); |
| 1234 |
}else{ |
| 1235 |
$structure["upload"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1236 |
} |
| 1237 |
|
| 1238 |
$structure["upload"] .= '<span>'.__("If you are a Pie Register Premium user, all the files uploaded with the registration forms will be available under the Attachments Tab on your Pie Register’s Admin dashboard.","pie-register").'</span>'; |
| 1239 |
|
| 1240 |
$structure['upload'] .= '</div>'; |
| 1241 |
|
| 1242 |
$structure['profile_pic'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><input type="hidden" id="default_profile_pic"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1243 |
|
| 1244 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1245 |
$structure["profile_pic"] = apply_filters('pie_addon_field_visibility_settings', $structure["profile_pic"]); |
| 1246 |
}else{ |
| 1247 |
$structure["profile_pic"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1248 |
} |
| 1249 |
|
| 1250 |
// if bbpress plugin activated |
| 1251 |
if ($this->piereg_bbpress_addon_active){ |
| 1252 |
$structure["profile_pic"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1253 |
} |
| 1254 |
|
| 1255 |
$structure['profile_pic'] .= '</div></div>'; |
| 1256 |
|
| 1257 |
$structure['address'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"> <label for="address_type_%d%">'.__("List Type","pie-register").'</label><select class="address_type" name="field[%d%][address_type]" id="address_type_%d%"><option value="International">'.__("International","pie-register").'</option><option value="United States">'.__("United States","pie-register").'</option><option value="Canada">'.__("Canada","pie-register").'</option></select></div><div id="default_country_div_%d%" class="advance_fields"> <label for="default_country_%d%">'.__("Default Country","pie-register").'</label><select class="default_country" name="field[%d%][default_country]" id="default_country_%d%"><option value="" selected="selected"></option><option value="Afghanistan">'.__("Afghanistan","pie-register").'</option><option value="Albania">'.__("Albania","pie-register").'</option><option value="Algeria">'.__("Algeria","pie-register").'</option><option value="American Samoa">'.__("American Samoa","pie-register").'</option><option value="Andorra">'.__("Andorra","pie-register").'</option><option value="Angola">'.__("Angola","pie-register").'</option><option value="Antigua and Barbuda">'.__("Antigua and Barbuda","pie-register").'</option><option value="Argentina">'.__("Argentina","pie-register").'</option><option value="Armenia">'.__("Armenia","pie-register").'</option><option value="Australia">'.__("Australia","pie-register").'</option><option value="Austria">'.__("Austria","pie-register").'</option><option value="Azerbaijan">'.__("Azerbaijan","pie-register").'</option><option value="Bahamas">'.__("Bahamas","pie-register").'</option><option value="Bahrain">'.__("Bahrain","pie-register").'</option><option value="Bangladesh">'.__("Bangladesh","pie-register").'</option><option value="Barbados">'.__("Barbados","pie-register").'</option><option value="Belarus">'.__("Belarus","pie-register").'</option><option value="Belgium">'.__("Belgium","pie-register").'</option><option value="Belize">'.__("Belize","pie-register").'</option><option value="Benin">'.__("Benin","pie-register").'</option><option value="Bermuda">'.__("Bermuda","pie-register").'</option><option value="Bhutan">'.__("Bhutan","pie-register").'</option><option value="Bolivia">'.__("Bolivia","pie-register").'</option><option value="Bosnia and Herzegovina">'.__("Bosnia and Herzegovina","pie-register").'</option><option value="Botswana">'.__("Botswana","pie-register").'</option><option value="Brazil">'.__("Brazil","pie-register").'</option><option value="Brunei">'.__("Brunei","pie-register").'</option><option value="Bulgaria">'.__("Bulgaria","pie-register").'</option><option value="Burkina Faso">'.__("Burkina Faso","pie-register").'</option><option value="Burundi">'.__("Burundi","pie-register").'</option><option value="Cambodia">'.__("Cambodia","pie-register").'</option><option value="Cameroon">'.__("Cameroon","pie-register").'</option><option value="Canada">'.__("Canada","pie-register").'</option><option value="Cape Verde">'.__("Cape Verde","pie-register").'</option><option value="Central African Republic">'.__("Central African Republic","pie-register").'</option><option value="Chad">'.__("Chad","pie-register").'</option><option value="Chile">'.__("Chile","pie-register").'</option><option value="China">'.__("China","pie-register").'</option><option value="Colombia">'.__("Colombia","pie-register").'</option><option value="Comoros">'.__("Comoros","pie-register").'</option><option value="Congo, Democratic Republic of the">'.__("Congo, Democratic Republic of the","pie-register").'</option><option value="Congo, Republic of the">'.__("Congo, Republic of the","pie-register").'</option><option value="Costa Rica">'.__("Costa Rica","pie-register").'</option><option value="Côte d\'Ivoire">'.__("Côte d\'Ivoire","pie-register").'</option><option value="Croatia">'.__("Croatia","pie-register").'</option><option value="Cuba">'.__("Cuba","pie-register").'</option><option value="Cyprus">'.__("Cyprus","pie-register").'</option><option value="Czech Republic">'.__("Czech Republic","pie-register").'</option><option value="Denmark">'.__("Denmark","pie-register").'</option><option value="Djibouti">'.__("Djibouti","pie-register").'</option><option value="Dominica">'.__("Dominica","pie-register").'</option><option value="Dominican Republic">'.__("Dominican Republic","pie-register").'</option><option value="East Timor">'.__("East Timor","pie-register").'</option><option value="Ecuador">'.__("Ecuador","pie-register").'</option><option value="Egypt">'.__("Egypt","pie-register").'</option><option value="El Salvador">'.__("El Salvador","pie-register").'</option><option value="Equatorial Guinea">'.__("Equatorial Guinea","pie-register").'</option><option value="Eritrea">'.__("Eritrea","pie-register").'</option><option value="Estonia">'.__("Estonia","pie-register").'</option><option value="Eswatini">'.__("Eswatini","pie-register").'</option><option value="Ethiopia">'.__("Ethiopia","pie-register").'</option><option value="Fiji">'.__("Fiji","pie-register").'</option><option value="Finland">'.__("Finland","pie-register").'</option><option value="France">'.__("France","pie-register").'</option><option value="Gabon">'.__("Gabon","pie-register").'</option><option value="The Gambia">'.__("The Gambia","pie-register").'</option><option value="Georgia">'.__("Georgia","pie-register").'</option><option value="Germany">'.__("Germany","pie-register").'</option><option value="Ghana">'.__("Ghana","pie-register").'</option><option value="Greece">'.__("Greece","pie-register").'</option><option value="Greenland">'.__("Greenland","pie-register").'</option><option value="Grenada">'.__("Grenada","pie-register").'</option><option value="Guam">'.__("Guam","pie-register").'</option><option value="Guatemala">'.__("Guatemala","pie-register").'</option><option value="Guinea">'.__("Guinea","pie-register").'</option><option value="Guinea-Bissau">'.__("Guinea-Bissau","pie-register").'</option><option value="Guyana">'.__("Guyana","pie-register").'</option><option value="Haiti">'.__("Haiti","pie-register").'</option><option value="Honduras">'.__("Honduras","pie-register").'</option><option value="Hong Kong">'.__("Hong Kong","pie-register").'</option><option value="Hungary">'.__("Hungary","pie-register").'</option><option value="Iceland">'.__("Iceland","pie-register").'</option><option value="India">'.__("India","pie-register").'</option><option value="Indonesia">'.__("Indonesia","pie-register").'</option><option value="Iran">'.__("Iran","pie-register").'</option><option value="Iraq">'.__("Iraq","pie-register").'</option><option value="Ireland">'.__("Ireland","pie-register").'</option><option value="Israel">'.__("Israel","pie-register").'</option><option value="Italy">'.__("Italy","pie-register").'</option><option value="Jamaica">'.__("Jamaica","pie-register").'</option><option value="Japan">'.__("Japan","pie-register").'</option><option value="Jordan">'.__("Jordan","pie-register").'</option><option value="Kazakhstan">'.__("Kazakhstan","pie-register").'</option><option value="Kenya">'.__("Kenya","pie-register").'</option><option value="Kiribati">'.__("Kiribati","pie-register").'</option><option value="North Korea">'.__("North Korea","pie-register").'</option><option value="South Korea">'.__("South Korea","pie-register").'</option><option value="Kuwait">'.__("Kuwait","pie-register").'</option><option value="Kyrgyzstan">'.__("Kyrgyzstan","pie-register").'</option><option value="Laos">'.__("Laos","pie-register").'</option><option value="Latvia">'.__("Latvia","pie-register").'</option><option value="Lebanon">'.__("Lebanon","pie-register").'</option><option value="Lesotho">'.__("Lesotho","pie-register").'</option><option value="Liberia">'.__("Liberia","pie-register").'</option><option value="Libya">'.__("Libya","pie-register").'</option><option value="Liechtenstein">'.__("Liechtenstein","pie-register").'</option><option value="Lithuania">'.__("Lithuania","pie-register").'</option><option value="Luxembourg">'.__("Luxembourg","pie-register").'</option><option value="Madagascar">'.__("Madagascar","pie-register").'</option><option value="Malawi">'.__("Malawi","pie-register").'</option><option value="Malaysia">'.__("Malaysia","pie-register").'</option><option value="Maldives">'.__("Maldives","pie-register").'</option><option value="Mali">'.__("Mali","pie-register").'</option><option value="Malta">'.__("Malta","pie-register").'</option><option value="Marshall Islands">'.__("Marshall Islands","pie-register").'</option><option value="Mauritania">'.__("Mauritania","pie-register").'</option><option value="Mauritius">'.__("Mauritius","pie-register").'</option><option value="Mexico">'.__("Mexico","pie-register").'</option><option value="Micronesia">'.__("Micronesia","pie-register").'</option><option value="Moldova">'.__("Moldova","pie-register").'</option><option value="Monaco">'.__("Monaco","pie-register").'</option><option value="Mongolia">'.__("Mongolia","pie-register").'</option><option value="Montenegro">'.__("Montenegro","pie-register").'</option><option value="Morocco">'.__("Morocco","pie-register").'</option><option value="Mozambique">'.__("Mozambique","pie-register").'</option><option value="Myanmar">'.__("Myanmar","pie-register").'</option><option value="Namibia">'.__("Namibia","pie-register").'</option><option value="Nauru">'.__("Nauru","pie-register").'</option><option value="Nepal">'.__("Nepal","pie-register").'</option><option value="Netherlands">'.__("Netherlands","pie-register").'</option><option value="New Zealand">'.__("New Zealand","pie-register").'</option><option value="Nicaragua">'.__("Nicaragua","pie-register").'</option><option value="Niger">'.__("Niger","pie-register").'</option><option value="Nigeria">'.__("Nigeria","pie-register").'</option><option value="Norway">'.__("Norway","pie-register").'</option><option value="Northern Mariana Islands">'.__("Northern Mariana Islands","pie-register").'</option><option value="Oman">'.__("Oman","pie-register").'</option><option value="Pakistan">'.__("Pakistan","pie-register").'</option><option value="Palau">'.__("Palau","pie-register").'</option><option value="Palestine">'.__("Palestine","pie-register").'</option><option value="Panama">'.__("Panama","pie-register").'</option><option value="Papua New Guinea">'.__("Papua New Guinea","pie-register").'</option><option value="Paraguay">'.__("Paraguay","pie-register").'</option><option value="Peru">'.__("Peru","pie-register").'</option><option value="Philippines">'.__("Philippines","pie-register").'</option><option value="Poland">'.__("Poland","pie-register").'</option><option value="Portugal">'.__("Portugal","pie-register").'</option><option value="Puerto Rico">'.__("Puerto Rico","pie-register").'</option><option value="Qatar">'.__("Qatar","pie-register").'</option><option value="Republic of North Macedonia">'.__("Republic of North Macedonia","pie-register").'</option><option value="Romania">'.__("Romania","pie-register").'</option><option value="Russia">'.__("Russia","pie-register").'</option><option value="Rwanda">'.__("Rwanda","pie-register").'</option><option value="Saint Kitts and Nevis">'.__("Saint Kitts and Nevis","pie-register").'</option><option value="Saint Lucia">'.__("Saint Lucia","pie-register").'</option><option value="Saint Vincent and the Grenadines">'.__("Saint Vincent and the Grenadines","pie-register").'</option><option value="Samoa">'.__("Samoa","pie-register").'</option><option value="San Marino">'.__("San Marino","pie-register").'</option><option value="Sao Tome and Principe">'.__("Sao Tome and Principe","pie-register").'</option><option value="Saudi Arabia">'.__("Saudi Arabia","pie-register").'</option><option value="Senegal">'.__("Senegal","pie-register").'</option><option value="Serbia">'.__("Serbia","pie-register").'</option><option value="Seychelles">'.__("Seychelles","pie-register").'</option><option value="Sierra Leone">'.__("Sierra Leone","pie-register").'</option><option value="Singapore">'.__("Singapore","pie-register").'</option><option value="Slovakia">'.__("Slovakia","pie-register").'</option><option value="Slovenia">'.__("Slovenia","pie-register").'</option><option value="Solomon Islands">'.__("Solomon Islands","pie-register").'</option><option value="Somalia">'.__("Somalia","pie-register").'</option><option value="South Africa">'.__("South Africa","pie-register").'</option><option value="Spain">'.__("Spain","pie-register").'</option><option value="Sri Lanka">'.__("Sri Lanka","pie-register").'</option><option value="Sudan">'.__("Sudan","pie-register").'</option><option value="Sudan, South">'.__("Sudan, South","pie-register").'</option><option value="Suriname">'.__("Suriname","pie-register").'</option><option value="Sweden">'.__("Sweden","pie-register").'</option><option value="Switzerland">'.__("Switzerland","pie-register").'</option><option value="Syria">'.__("Syria","pie-register").'</option><option value="Taiwan">'.__("Taiwan","pie-register").'</option><option value="Tajikistan">'.__("Tajikistan","pie-register").'</option><option value="Tanzania">'.__("Tanzania","pie-register").'</option><option value="Thailand">'.__("Thailand","pie-register").'</option><option value="Togo">'.__("Togo","pie-register").'</option><option value="Tonga">'.__("Tonga","pie-register").'</option><option value="Trinidad and Tobago">'.__("Trinidad and Tobago","pie-register").'</option><option value="Tunisia">'.__("Tunisia","pie-register").'</option><option value="Turkey">'.__("Turkey","pie-register").'</option><option value="Turkmenistan">'.__("Turkmenistan","pie-register").'</option><option value="Tuvalu">'.__("Tuvalu","pie-register").'</option><option value="Uganda">'.__("Uganda","pie-register").'</option><option value="Ukraine">'.__("Ukraine","pie-register").'</option><option value="United Arab Emirates">'.__("United Arab Emirates","pie-register").'</option><option value="United Kingdom">'.__("United Kingdom","pie-register").'</option><option value="United States">'.__("United States","pie-register").'</option><option value="Uruguay">'.__("Uruguay","pie-register").'</option><option value="Uzbekistan">'.__("Uzbekistan","pie-register").'</option><option value="Vanuatu">'.__("Vanuatu","pie-register").'</option><option value="Vatican City">'.__("Vatican City","pie-register").'</option><option value="Venezuela">'.__("Venezuela","pie-register").'</option><option value="Vietnam">'.__("Vietnam","pie-register").'</option><option value="Virgin Islands, British">'.__("Virgin Islands, British","pie-register").'</option><option value="Virgin Islands, U.S.">'.__("Virgin Islands, U.S.","pie-register").'</option><option value="Yemen">'.__("Yemen","pie-register").'</option><option value="Zambia">'.__("Zambia","pie-register").'</option><option value="Zimbabwe">'.__("Zimbabwe","pie-register").'</option></select></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="hide_address2_%d%">'.__("Hide Address 2","pie-register").'</label><input onChange="checkEvents(this,\'address_address2_%d%\')" name="field[%d%][hide_address2]" id="hide_address2_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="hide_address2_%d%" class="required"></label></div><div class="advance_fields"><label for="hide_state_%d%">'.__("Hide State","pie-register").'</label><input class="hide_state" name="field[%d%][hide_state]" id="hide_state_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="hide_state_%d%" class="required"></label></div><div style="display:none;" id="default_state_div_%d%" class="advance_fields"><label for="default_state_%d%">'.__("Default State","pie-register").'</label><select id="us_states_%d%" style="display:none;" class="default_state us_states_%d%" name="field[%d%][us_default_state]"><option value="" selected="selected"></option><option value="Alabama">'.__("Alabama","pie-register").'</option><option value="Alaska">'.__("Alaska","pie-register").'</option><option value="Arizona">'.__("Arizona","pie-register").'</option><option value="Arkansas">'.__("Arkansas","pie-register").'</option><option value="California">'.__("California","pie-register").'</option><option value="Colorado">'.__("Colorado","pie-register").'</option><option value="Connecticut">'.__("Connecticut","pie-register").'</option><option value="Delaware">'.__("Delaware","pie-register").'</option><option value="District of Columbia">'.__("District of Columbia","pie-register").'</option><option value="Florida">'.__("Florida","pie-register").'</option><option value="Georgia">'.__("Georgia","pie-register").'</option><option value="Hawaii">'.__("Hawaii","pie-register").'</option><option value="Idaho">'.__("Idaho","pie-register").'</option><option value="Illinois">'.__("Illinois","pie-register").'</option><option value="Indiana">'.__("Indiana","pie-register").'</option><option value="Iowa">'.__("Iowa","pie-register").'</option><option value="Kansas">'.__("Kansas","pie-register").'</option><option value="Kentucky">'.__("Kentucky","pie-register").'</option><option value="Louisiana">'.__("Louisiana","pie-register").'</option><option value="Maine">'.__("Maine","pie-register").'</option><option value="Maryland">'.__("Maryland","pie-register").'</option><option value="Massachusetts">'.__("Massachusetts","pie-register").'</option><option value="Michigan">'.__("Michigan","pie-register").'</option><option value="Minnesota">'.__("Minnesota","pie-register").'</option><option value="Mississippi">'.__("Mississippi","pie-register").'</option><option value="Missouri">'.__("Missouri","pie-register").'</option><option value="Montana">'.__("Montana","pie-register").'</option><option value="Nebraska">'.__("Nebraska","pie-register").'</option><option value="Nevada">'.__("Nevada","pie-register").'</option><option value="New Hampshire">'.__("New Hampshire","pie-register").'</option><option value="New Jersey">'.__("New Jersey","pie-register").'</option><option value="New Mexico">'.__("New Mexico","pie-register").'</option><option value="New York">'.__("New York","pie-register").'</option><option value="North Carolina">'.__("North Carolina","pie-register").'</option><option value="North Dakota">'.__("North Dakota","pie-register").'</option><option value="Ohio">'.__("Ohio","pie-register").'</option><option value="Oklahoma">'.__("Oklahoma","pie-register").'</option><option value="Oregon">'.__("Oregon","pie-register").'</option><option value="Pennsylvania">'.__("Pennsylvania","pie-register").'</option><option value="Rhode Island">'.__("Rhode Island","pie-register").'</option><option value="South Carolina">'.__("South Carolina","pie-register").'</option><option value="South Dakota">'.__("South Dakota","pie-register").'</option><option value="Tennessee">'.__("Tennessee","pie-register").'</option><option value="Texas">'.__("Texas","pie-register").'</option><option value="Utah">'.__("Utah","pie-register").'</option><option value="Vermont">'.__("Vermont","pie-register").'</option><option value="Virginia">'.__("Virginia","pie-register").'</option><option value="Washington">'.__("Washington","pie-register").'</option><option value="West Virginia">'.__("West Virginia","pie-register").'</option><option value="Wisconsin">'.__("Wisconsin","pie-register").'</option><option value="Wyoming">'.__("Wyoming","pie-register").'</option><option value="Armed Forces Americas">'.__("Armed Forces Americas","pie-register").'</option><option value="Armed Forces Europe">'.__("Armed Forces Europe","pie-register").'</option><option value="Armed Forces Pacific">'.__("Armed Forces Pacific","pie-register").'</option></select><select id="can_states_%d%" style="display:none;" class="default_state can_states_%d%" name="field[%d%][canada_default_state]"><option value="" selected="selected"></option><option value="Alberta">'.__("Alberta","pie-register").'</option><option value="British Columbia">'.__("British Columbia","pie-register").'</option><option value="Manitoba">'.__("Manitoba","pie-register").'</option><option value="New Brunswick">'.__("New Brunswick","pie-register").'</option><option value="Newfoundland & Labrador">'.__("Newfoundland and Labrador","pie-register").'</option><option value="Northwest Territories">'.__("Northwest Territories","pie-register").'</option><option value="Nova Scotia">'.__("Nova Scotia","pie-register").'</option><option value="Nunavut">'.__("Nunavut","pie-register").'</option><option value="Ontario">'.__("Ontario","pie-register").'</option><option value="Prince Edward Island">'.__("Prince Edward Island","pie-register").'</option><option value="Quebec">'.__("Quebec","pie-register").'</option><option value="Saskatchewan">'.__("Saskatchewan","pie-register").'</option><option value="Yukon">'.__("Yukon","pie-register").'</option></select></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1258 |
|
| 1259 |
// pie-register-woocommerce Addon |
| 1260 |
|
| 1261 |
if ($this->woocommerce_and_piereg_wc_addon_active) |
| 1262 |
{ |
| 1263 |
$structure['wc_billing_address'] = apply_filters("pieregister_create_woocommerce_billing_fields", ""); |
| 1264 |
$structure['wc_shipping_address'] = apply_filters("pieregister_create_woocommerce_shipping_fields", ""); |
| 1265 |
} |
| 1266 |
|
| 1267 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1268 |
$structure["address"] = apply_filters('pie_addon_field_visibility_settings', $structure["address"]); |
| 1269 |
}else{ |
| 1270 |
$structure["address"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1271 |
} |
| 1272 |
|
| 1273 |
// if bbpress plugin activated |
| 1274 |
if ($this->piereg_bbpress_addon_active){ |
| 1275 |
$structure["address"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1276 |
} |
| 1277 |
|
| 1278 |
$structure["address"] .= '</div></div>'; |
| 1279 |
|
| 1280 |
if( false ) |
| 1281 |
{ |
| 1282 |
// With Classic Recaptch which is deprecated since PR ver 3.0 |
| 1283 |
$structure['captcha'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields piereg_recaptcha_skin"><label for="recaptcha_skin_%d%">'.__("Captcha Skin","pie-register").'</label><select class="show_in_profile checkbox_fields" name="field[%d%][recaptcha_skin]" id="recaptcha_skin_%d%"><option value="red" selected="selected">'.__("Red","pie-register").'</option><option value="white">'.__("White","pie-register").'</option><option value="clean">'.__("Clean","pie-register").'</option><option value="blackglass">'.__("Blackglass","pie-register").'</option></select></div><div class="advance_fields piereg_recaptcha_type"><label for="recaptcha_type_%d%">'.__("Captcha Type","pie-register").'</label><select name="field[%d%][recaptcha_type]" id="recaptcha_type_%d%" class="show_in_profile checkbox_fields piereg_recaptcha_type"><option value="1" selected="selected">'.__("Classic ReCaptcha","pie-register").'</option><option value="2">'.__("No Captcha ReCaptcha","pie-register").'</option></select></div></div></div>'; |
| 1284 |
} |
| 1285 |
else |
| 1286 |
{ |
| 1287 |
$structure['captcha'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields piereg_recaptcha_type"><input type="hidden" class="input_fields" name="field[%d%][recaptcha_type]" value="2"></div></div></div>'; |
| 1288 |
} |
| 1289 |
|
| 1290 |
$structure['math_captcha'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" value="1" name="field[%d%][required]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" value="Math Captcha" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div></div></div>'; |
| 1291 |
|
| 1292 |
$structure['phone'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"> <label for="phone_format_%d%">'.__("Phone Format","pie-register").'</label><select class="phone_format" name="field[%d%][phone_format]" id="phone_format_%d%"><option value="standard">'.__("USA Format","pie-register").' (###) ###-####</option><option value="international">'.__("International","pie-register").'</option></select></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1293 |
|
| 1294 |
if($this->piereg_field_visbility_addon_active){ |
| 1295 |
$structure["phone"] = apply_filters('pie_addon_field_visibility_settings', $structure["phone"]); |
| 1296 |
}else{ |
| 1297 |
$structure["phone"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1298 |
} |
| 1299 |
|
| 1300 |
// if bbpress plugin activated |
| 1301 |
if ($this->piereg_bbpress_addon_active){ |
| 1302 |
$structure["phone"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1303 |
} |
| 1304 |
|
| 1305 |
$structure['phone'] .= '</div></div>'; |
| 1306 |
|
| 1307 |
include_once( $this->admin_path . 'includes/plugin.php' ); |
| 1308 |
|
| 1309 |
# [The function that control is_plugin_active is not loaded before code below. 20-04-2015] |
| 1310 |
if( is_plugin_active("pie-register-twilio/pie-register-twilio.php") ){ |
| 1311 |
$structure['two_way_login_phone'] = '<div class="fields_main"><div class="advance_options_fields"><input type="hidden" value="international" class="input_fields" name="field[%d%][phone_format]"><input type="hidden" class="input_fields" name="field[%d%][type]"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label" value="2Way Login Phone #"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16">'.__("Please do not use the + sign. \n e.g. 4155551212 (USA), 07400123456 (GB).","pie-register").'</textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"></div><!--<div class="advance_fields"> <label for="phone_format_%d%">'.__("Phone Format","pie-register").'</label><select class="phone_format" name="field[%d%][phone_format]" id="phone_format_%d%"><option value="standard">'.__("USA Format","pie-register").' (###) ###-####</option><option value="international">'.__("International","pie-register").'</option></select></div>--><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div><input type="hidden" id="default_two_way_login_phone">'; |
| 1312 |
|
| 1313 |
if($this->piereg_field_visbility_addon_active){ |
| 1314 |
$structure["two_way_login_phone"] = apply_filters('pie_addon_field_visibility_settings', $structure["two_way_login_phone"]); |
| 1315 |
}else{ |
| 1316 |
$structure["two_way_login_phone"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1317 |
} |
| 1318 |
|
| 1319 |
$structure['two_way_login_phone'] .= '</div></div>'; |
| 1320 |
} |
| 1321 |
|
| 1322 |
$structure['date'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"> <label for="date_type_%d%">'.__("Date Format","pie-register").'</label><select class="date_format" name="field[%d%][date_format]" id="date_format_%d%"><option value="mm/dd/yy">mm/dd/yy</option><option value="dd/mm/yy">dd/mm/yy</option><option value="dd-mm-yy">dd-mm-yy</option><option value="dd.mm.yy">dd.mm.yy</option><option value="yy/mm/dd">yy/mm/dd</option><option value="yy.mm.dd">yy.mm.dd</option></select></div><div class="advance_fields"> <label for="date_type_%d%">'.__("Date Input Type","pie-register").'</label><select class="date_type" name="field[%d%][date_type]" id="date_type_%d%"><option value="datefield">'.__("Date Field","pie-register").'</option><option value="datepicker">'.__("Date Picker","pie-register").'</option><option value="datedropdown">'.__("Date Drop Down","pie-register").'</option></select></div><div style="display:none;" id="icon_div_%d%" class="advance_fields pie_date_icon_div"> <label for="date_type_%d%"> </label><div class="calendar_icon_type"><input class="calendar_icon" type="radio" id="calendar_icon_%d%_none" name="field[%d%][calendar_icon]" value="none" checked="checked"><label for="calendar_icon_%d%_none"> '.__("No Icon","pie-register").' </label> <input class="calendar_icon" type="radio" id="calendar_icon_%d%_calendar" name="field[%d%][calendar_icon]" value="calendar"><label for="calendar_icon_%d%_calendar"> '.__("Calendar Icon","pie-register").' </label> <input class="calendar_icon" type="radio" id="calendar_icon_%d%_custom" name="field[%d%][calendar_icon]" value="custom"><label for="calendar_icon_%d%_custom"> '.__("Custom Icon","pie-register").' </label></div><div id="icon_url_container_%d%" style="display: none;float:left;clear: both;"> <label for="cfield_calendar_icon_%d%_url"> '.__("Image URL","pie-register").': </label> <input type="text" class="input_fields" name="field[%d%][calendar_icon_url]" id="cfield_calendar_icon_%d%_url"></div></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1323 |
|
| 1324 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1325 |
$structure["date"] = apply_filters('pie_addon_field_visibility_settings', $structure["date"]); |
| 1326 |
}else{ |
| 1327 |
$structure["date"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1328 |
} |
| 1329 |
|
| 1330 |
// if bbpress plugin activated |
| 1331 |
if ($this->piereg_bbpress_addon_active){ |
| 1332 |
$structure["date"] .= '<div class="advance_fields"><label for="show_in_bbpress_%d%">'.__("Show in bbPress","pie-register").'</label><select name="field[%d%][show_in_bbpress]" id="show_in_bbpress_%d%" class="show_in_bbpress checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1333 |
} |
| 1334 |
$structure["date"] .= '</div></div>'; |
| 1335 |
|
| 1336 |
$structure['list'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="rows_%d%">'.__("Rows","pie-register").'</label><input type="text" value="1" name="field[%d%][rows]" id="rows_%d%" class="input_fields character_fields list_rows numeric greaterzero"><a class="info" href="javascript:;">'.__("Specifies the number of rows in a list.","pie-register").'</a></div><div class="advance_fields"><label for="cols_%d%">'.__("Columns","pie-register").'</label><input type="text" value="1" name="field[%d%][cols]" id="cols_%d%" class="input_fields character_fields list_cols numeric greaterzero"><a class="info" href="javascript:;">'.__("Specifies the number of columns in a list.","pie-register").'</a></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1337 |
|
| 1338 |
if( $this->piereg_field_visbility_addon_active ){ |
| 1339 |
$structure["list"] = apply_filters('pie_addon_field_visibility_settings', $structure["list"]); |
| 1340 |
}else{ |
| 1341 |
$structure["list"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1342 |
} |
| 1343 |
|
| 1344 |
$structure["list"] .= '</div></div>'; |
| 1345 |
|
| 1346 |
// dropdown_ur |
| 1347 |
$structure["custom_role"] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div> <div class="advance_fields multi_options sel_options_%d% role_options"><label for="display_%d%">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields radio_option_display"><label class="label-role" for="value_%d%">'.__("Value","pie-register").'</label><input type="text" name="field[%d%][value][]" id="value_%d%" class="input_fields character_fields radio_option_value"><label class="label-role" for="custom_role_%d%">'.__("Role","pie-register").'</label>'; |
| 1348 |
|
| 1349 |
$structure["custom_role"] .= '<select class="checkbox_fields select-role" id="role_selection_%d%" name="field[%d%][role_selection][]" >'; |
| 1350 |
|
| 1351 |
global $wp_roles; |
| 1352 |
|
| 1353 |
$role = $wp_roles->roles; |
| 1354 |
$wp_default_user_role = get_option("default_role"); |
| 1355 |
|
| 1356 |
foreach($role as $key=>$value) |
| 1357 |
{ |
| 1358 |
$structure["custom_role"] .= '<option value="'.$key.'"'; |
| 1359 |
$structure["custom_role"] .= '>'.$value['name'].'</option>'; |
| 1360 |
} |
| 1361 |
|
| 1362 |
$structure["custom_role"] .= '</select>'; |
| 1363 |
|
| 1364 |
$structure["custom_role"] .= '<label>'.__("Checked","pie-register").'</label><input type="radio" value="0" id="check_%d%" name="field[%d%][selected][]" class="radio_option_checked"><a class="pie_add_options_icon" style="color:white" href="javascript:;" onClick="addOptions(%d%,\'radio\');">+</a></div>'; |
| 1365 |
|
| 1366 |
$structure["custom_role"] .= '<div class="advance_fields"><label>'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1367 |
|
| 1368 |
$structure["custom_role"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1369 |
|
| 1370 |
$structure["custom_role"] .= '</div></div>'; |
| 1371 |
|
| 1372 |
|
| 1373 |
$structure['hidden'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="default_value_%d%">'.__("Default Value","pie-register").'</label><input type="text" name="field[%d%][default_value]" id="default_value_%d%" class="input_fields field_default_value"><a href="javascript:;" class="piereg-toggle-tags piereg-not-show-tags" ><i class="fa fa-tags"></i> <span>Show Smart Tags</span></a><div class="piereg-toggle-tag-display" style="display:none;"><ul class="piereg-others"><li class="heading">Other</li><li class="smart-tag-field" data-type="other" data-field_name="admin_email">Site Admin Email</li><li class="smart-tag-field" data-type="other" data-field_name="site_name">Site Name</li><li class="smart-tag-field" data-type="other" data-field_name="site_url">Site URL</li><li class="smart-tag-field" data-type="other" data-field_name="page_title">Page Title</li><li class="smart-tag-field" data-type="other" data-field_name="page_url">Page URL</li><li class="smart-tag-field" data-type="other" data-field_name="page_id">Page ID</li><li class="smart-tag-field" data-type="other" data-field_name="form_name">Form Name</li><li class="smart-tag-field" data-type="other" data-field_name="user_ip_address">User IP Address</li></ul></div></div></div></div>'; |
| 1374 |
|
| 1375 |
$structure['invitation'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div><div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="placeholder_%d%">'.__("Placeholder","pie-register").'</label><input type="text" name="field[%d%][placeholder]" id="placeholder_%d%" class="input_fields field_placeholder"></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1376 |
|
| 1377 |
$structure["invitation"] .= '<div class="advance_fields"><label for="show_in_profile_%d%">'.__("Show in Profile","pie-register").'</label><select name="field[%d%][show_in_profile]" id="show_in_profile_%d%" class="show_in_profile checkbox_fields"><option value="1" selected="selected">'.__("Yes","pie-register").'</option><option value="0">'.__("No","pie-register").'</option></select></div>'; |
| 1378 |
|
| 1379 |
global $wpdb; |
| 1380 |
$invitation_code_table_name = $wpdb->prefix."pieregister_code"; |
| 1381 |
$invite_codes = ""; |
| 1382 |
|
| 1383 |
if($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $invitation_code_table_name)) == $invitation_code_table_name) { |
| 1384 |
$result_invitaion_code = $wpdb->get_results( "SELECT * FROM `{$invitation_code_table_name}` ORDER BY `id` ASC" ); |
| 1385 |
$today = gmdate('Y-m-d'); |
| 1386 |
foreach($result_invitaion_code as $object){ |
| 1387 |
if( |
| 1388 |
( $object->expiry_date == "0000-00-00" || strtotime($object->expiry_date) > strtotime($today) ) |
| 1389 |
&& |
| 1390 |
intval($object->status) != 0 |
| 1391 |
&& |
| 1392 |
( |
| 1393 |
intval($object->code_usage) == 0 |
| 1394 |
|| |
| 1395 |
( intval($object->code_usage) > 0 && intval($object->code_usage) > intval($object->count) ) |
| 1396 |
) |
| 1397 |
){ |
| 1398 |
$invite_codes .= '<option value="'.$object->name.'" >'.$object->name.'</option>'; |
| 1399 |
} |
| 1400 |
} |
| 1401 |
} |
| 1402 |
|
| 1403 |
$structure["invitation"] .= '<div class="advance_fields"><label for="allowed_codes_%d%">'.__("Allowed Codes","pie-register").'</label><select multiple name="field[%d%][allowed_codes][]" id="allowed_codes_%d%" class="allowed_codes checkbox_fields">'.$invite_codes.'</select></div>'; |
| 1404 |
|
| 1405 |
$structure['invitation'] .= '</div></div>'; |
| 1406 |
|
| 1407 |
$structure['terms'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" class="input_fields field_label"></div>'; |
| 1408 |
|
| 1409 |
$structure['terms'] .= '<div class="advance_fields"><label for="cont_%d%">'.__("Content","pie-register").'</label><select name="field[%d%][cont]" id="cont_%d%">'; |
| 1410 |
$pages = get_pages(array( 'numberposts' => -1)); |
| 1411 |
if(sizeof($pages) > 0) |
| 1412 |
{ |
| 1413 |
foreach( $pages as $page ) : $page->post_content; |
| 1414 |
$structure['terms'] .= '<option class="level-0" value="'.$page->ID.'">'; |
| 1415 |
$structure['terms'] .= $page->post_title; |
| 1416 |
$structure['terms'] .= '</option>'; |
| 1417 |
endforeach; |
| 1418 |
} |
| 1419 |
$structure['terms'] .='</select></div>'; |
| 1420 |
|
| 1421 |
$structure['terms'] .= '<div class="advance_fields"><label for="required_%d%">'.__("Rules","pie-register").'</label><input name="field[%d%][required]" id="required_%d%" value="%d%" type="checkbox" class="checkbox_fields"><label for="required_%d%" class="required">'.__("Required","pie-register").'</label></div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div></div></div>'; |
| 1422 |
|
| 1423 |
global $wp_roles; |
| 1424 |
$role = $wp_roles->roles; |
| 1425 |
$user_role_option = ""; |
| 1426 |
$piereg_default_wp_usre_role = get_option("default_role"); |
| 1427 |
$piereg_selected_user_role = ""; |
| 1428 |
foreach($role as $key=>$value) |
| 1429 |
{ |
| 1430 |
if($piereg_default_wp_usre_role == $key) |
| 1431 |
{ |
| 1432 |
$piereg_selected_user_role = ' selected="selected" '; |
| 1433 |
} |
| 1434 |
$user_role_option .= '<option value="'.$key.'" '. $piereg_selected_user_role .' >'.$value['name'].'</option>'; |
| 1435 |
$piereg_selected_user_role = ""; |
| 1436 |
} |
| 1437 |
|
| 1438 |
$payment_gateways_list = $this->payment_gateways_list(); |
| 1439 |
$payment_gateways_html = "%payment_gateways_list_box%"; |
| 1440 |
|
| 1441 |
$structure['pricing'] = '<div class="fields_main"><div class="advance_options_fields"><div class="advance_fields"><label for="label_%d%">'.__("Label","pie-register").'</label><input type="text" name="field[%d%][label]" id="label_%d%" value="Membership" class="input_fields field_label"></div><div class="advance_fields"><label for="desc_%d%">'.__("Description","pie-register").'</label><textarea name="field[%d%][desc]" id="desc_%d%" rows="8" cols="16"></textarea></div>'; |
| 1442 |
|
| 1443 |
if( "not" == "allowed" ) { |
| 1444 |
$structure['pricing'] .= '<div class="advance_fields dropdown_field_value sel_options_%d%"><div class="advance_fields dropdown_field_value"><label for="display_%d%" class="select_option_display">'.__("Display Value","pie-register").'</label><input type="text" name="field[%d%][display][]" id="display_%d%" class="input_fields character_fields select_option_display"><label for="starting_price_%d%">'.__("Starting Price","pie-register").'</label><input type="text" name="field[%d%][starting_price][]" id="starting_price_%d%" class="input_fields character_fields select_option_starting_price"><label for="for_%d%">'.__("For","pie-register").'</label><input type="text" name="field[%d%][for][]" id="for_%d%" class="input_fields character_fields select_option_for"><select class="input_fields character_fields_mon select_option_for_period" name="field[%d%][for_period][]" id="for_period_%d%" ><option value="days">'.__("Days","pie-register").'</option><option value="weeks">'.__("Weeks","pie-register").'</option><option value="months">'.__("Months","pie-register").'</option></select></div><div class="advance_fields dropdown_field_value"><label class="select_option_then_price" for="then_price_%d%">'.__("Then Price","pie-register").'</label><input type="text" name="field[%d%][then_price][]" id="then_price_%d%" class="input_fields character_fields select_option_then_price"><label for="activation_cycle_%d%">'.__("Activation Cycle","pie-register").'</label><select class="input_fields character_fields_sec select_option_activation_cycle" name="field[%d%][activation_cycle][]" id="activation_cycle_%d%" ><option value="-1">'.__("Use Default","pie-register").'</option><option value="0">'.__("One Time","pie-register").'</option><option value="7">'.__("Weekly","pie-register").'</option><option value="30">'.__("Monthly","pie-register").'</option><option value="182">'.__("Half Yearly","pie-register").'</option><option value="273">'.__("Quarterly","pie-register").'</option><option value="365">'.__("Yearly","pie-register").'</option></select><label for="role_%d%">'.__("Role","pie-register").'</label><select class="input_fields character_fields_sec select_option_role" name="field[%d%][role][]" id="role_%d%" >'.$user_role_option.'</select><label>'.__("Checked","pie-register").'</label><input type="radio" value="0" id="check_%d%" name="field[%d%][selected][]" class="select_option_checked"><a style="color:white" href="javascript:;" onClick="addPricingOptions(%d%,\'radio\',jQuery(this));">+</a></div></div>'; |
| 1445 |
} // until multiple payment gateways with recurring payment release |
| 1446 |
|
| 1447 |
$structure['pricing'] .= '<div class="advance_fields"><label>'.__("Allow Payment Gateways","pie-register").'</label>'.$payment_gateways_html.'</div><div class="advance_fields"><label for="validation_message_%d%">'.__("Validation Message","pie-register").'</label><input type="text" name="field[%d%][validation_message]" id="validation_message_%d%" class="input_fields"></div><div class="advance_fields"><label for="css_%d%">'.__("CSS Class Name","pie-register").'</label><input type="text" name="field[%d%][css]" id="css_%d%" class="input_fields"></div>'; |
| 1448 |
|
| 1449 |
//Only for PayPal |
| 1450 |
if( isset($payment_gateways_list['PaypalStandard']) ) |
| 1451 |
{ |
| 1452 |
$structure['pricing'] .= '<div class="advance_fields"><label for="hosted_btn_id_%d%">'.__("Hosted Button ID (for PayPal)","pie-register").'</label><input type="text" name="field[%d%][hosted_btn_id]" id="hosted_btn_id_%d%" class="input_fields"><a class="info" href="javascript:;">'.__("This Hosted Button ID will override the global Hosted Button ID. Make sure that the global Hosted Button ID is set. Navigate to payment gateways to configure the Hosted Button ID.","pie-register").'</a></div>'; |
| 1453 |
} |
| 1454 |
|
| 1455 |
// if stripe activate and enable |
| 1456 |
|
| 1457 |
if($this->checkAddonActivated('Stripe') == true || $this->checkAddonActivated('AuthNet') == true || $this->checkAddonActivated('Stripe_Recurring') == true ) |
| 1458 |
{ |
| 1459 |
$structure['pricing'] .= '<div class="advance_fields stripe_price"><label for="payment_charge_%d%">'.__("Price (not for PayPal)","pie-register").'</label><input type="text" name="field[%d%][payment_charge]" id="payment_charge_%d%" class="input_fields"></div>'; |
| 1460 |
} |
| 1461 |
if( (isset($payment_gateways_list['stripe']) && $this->checkAddonActivated('Stripe') == true ) || (isset($payment_gateways_list['stripe']) && $this->checkAddonActivated('Stripe_Recurring') == true ) ) |
| 1462 |
{ |
| 1463 |
$structure['pricing'] .= '<div class="advance_fields stripe_api_description"><label for="stripe_api_description_%d%">'.__("API Description for Stripe","pie-register").'</label><input type="text" name="field[%d%][stripe_api_description]" id="stripe_api_description_%d%" class="input_fields"></div>'; |
| 1464 |
} |
| 1465 |
|
| 1466 |
$structure['pricing'] .= '</div></div>'; |
| 1467 |
|
| 1468 |
return $structure; |
| 1469 |
} |
| 1470 |
function payment_gateways_list(){ |
| 1471 |
$pie_reg = get_option(OPTION_PIE_REGISTER); |
| 1472 |
$payment_gateways_name_list = array(); |
| 1473 |
/* For Authorize.Net*/ |
| 1474 |
if ( (isset($pie_reg['enable_authorize_net'],$pie_reg['piereg_authorize_net_login_id']) && $pie_reg['enable_authorize_net'] == 1 and trim($pie_reg['piereg_authorize_net_login_id']) != "" && $this->checkAddonActivated('AuthNet') == true) ){ |
| 1475 |
$payment_gateways_name_list["authorizeNet"] = "Authorize.Net"; |
| 1476 |
} |
| 1477 |
/*For Stripe*/ |
| 1478 |
if( (isset($pie_reg['enable_stripe']) && $pie_reg['enable_stripe'] == 1 && $this->checkAddonActivated('Stripe') == true ) ){ |
| 1479 |
$payment_gateways_name_list["stripe"] = "Stripe"; |
| 1480 |
} |
| 1481 |
/*For Stripe Recurring*/ |
| 1482 |
if( (isset($pie_reg['enable_stripe']) && $pie_reg['enable_stripe'] == 1 && $this->checkAddonActivated('Stripe_Recurring') == true ) ){ |
| 1483 |
$payment_gateways_name_list["stripe"] = "Stripe"; |
| 1484 |
} |
| 1485 |
/*For Paypal (Standard)*/ |
| 1486 |
if( (isset($pie_reg['enable_paypal'],$pie_reg['paypal_butt_id']) && $pie_reg['enable_paypal'] == 1 and trim($pie_reg['paypal_butt_id']) != "") ){ |
| 1487 |
$payment_gateways_name_list["PaypalStandard"] = "Paypal"; |
| 1488 |
} |
| 1489 |
return $payment_gateways_name_list; |
| 1490 |
} |
| 1491 |
function deactivation_settings(){ |
| 1492 |
global $wpdb; |
| 1493 |
$option = get_option(OPTION_PIE_REGISTER); |
| 1494 |
do_action( 'pie_deactivation_base', $option ); |
| 1495 |
|
| 1496 |
//$this->uninstall_settings(); |
| 1497 |
} |
| 1498 |
function uninstall_settings() |
| 1499 |
{ |
| 1500 |
do_action( 'pie_uninstall_base' ); |
| 1501 |
|
| 1502 |
// Remove - deleting options and tables |
| 1503 |
// $this->uninstall_pieregister_license_key(); |
| 1504 |
} |
| 1505 |
function uninstall_pieregister_license_key(){ |
| 1506 |
global $wpdb, $blog_id; |
| 1507 |
|
| 1508 |
$this->license_key_deactivation(); |
| 1509 |
|
| 1510 |
// Remove options |
| 1511 |
if ( is_multisite() ) { |
| 1512 |
|
| 1513 |
switch_to_blog( $blog_id ); |
| 1514 |
|
| 1515 |
foreach ( array( |
| 1516 |
'api_manager_example', |
| 1517 |
'piereg_api_manager_product_id', |
| 1518 |
'piereg_api_manager_instance', |
| 1519 |
'api_manager_example_deactivate_checkbox', |
| 1520 |
'piereg_api_manager_activated', |
| 1521 |
'bf_version' |
| 1522 |
) as $option) { |
| 1523 |
delete_option( $option ); |
| 1524 |
} |
| 1525 |
|
| 1526 |
restore_current_blog(); |
| 1527 |
|
| 1528 |
} else { |
| 1529 |
foreach ( array( |
| 1530 |
'api_manager_example', |
| 1531 |
'piereg_api_manager_product_id', |
| 1532 |
'piereg_api_manager_instance', |
| 1533 |
'api_manager_example_deactivate_checkbox', |
| 1534 |
'piereg_api_manager_activated' |
| 1535 |
) as $option) { |
| 1536 |
delete_option( $option ); |
| 1537 |
} |
| 1538 |
} |
| 1539 |
} |
| 1540 |
/* |
| 1541 |
* Deactivates the license on the API server |
| 1542 |
* @return void |
| 1543 |
*/ |
| 1544 |
public function license_key_deactivation() { |
| 1545 |
|
| 1546 |
$piereg_api_manager_key_class = new Api_Manager_Example_Key(); |
| 1547 |
$activation_status = get_option( 'piereg_api_manager_activated' ); |
| 1548 |
$default_options = get_option( 'api_manager_example' ); |
| 1549 |
$api_email = $default_options['activation_email']; |
| 1550 |
$api_key = $default_options['api_key']; |
| 1551 |
|
| 1552 |
$args = array( |
| 1553 |
'email' => $api_email, |
| 1554 |
'licence_key' => $api_key, |
| 1555 |
); |
| 1556 |
|
| 1557 |
if ( $activation_status == 'Activated' && $api_key != '' && $api_email != '' ) { |
| 1558 |
$piereg_api_manager_key_class->deactivate( $args ); // reset license key activation |
| 1559 |
} |
| 1560 |
} |
| 1561 |
|
| 1562 |
function createFieldName($text) |
| 1563 |
{ |
| 1564 |
return $this->getMetaKey($text); |
| 1565 |
} |
| 1566 |
function getMetaKey($text) |
| 1567 |
{ |
| 1568 |
return str_replace("-","_",sanitize_title($text)); |
| 1569 |
} |
| 1570 |
function filterSubject($user,$subject) |
| 1571 |
{ |
| 1572 |
if(!is_object($user)) |
| 1573 |
{ |
| 1574 |
if ( username_exists( $user ) ){ |
| 1575 |
$user = get_user_by('login', $user); |
| 1576 |
} |
| 1577 |
// Then, by e-mail address |
| 1578 |
elseif( email_exists($user) ){ |
| 1579 |
$user = get_user_by('email', $user); |
| 1580 |
} |
| 1581 |
// Then, by user ID |
| 1582 |
else{ |
| 1583 |
$user = new WP_User( intval($user) ); |
| 1584 |
} |
| 1585 |
} |
| 1586 |
if(!$user) return false; |
| 1587 |
|
| 1588 |
$user_login = stripslashes($user->data->user_login); |
| 1589 |
$user_email = stripslashes($user->data->user_email); |
| 1590 |
$blog_name = get_option("blogname"); |
| 1591 |
|
| 1592 |
$keys = array("%user_login%","%user_email%","%blogname%"); |
| 1593 |
$values = array($user_login,$user_email,$blog_name); |
| 1594 |
|
| 1595 |
$return = str_replace($keys,$values,$subject); |
| 1596 |
|
| 1597 |
return $return; |
| 1598 |
} |
| 1599 |
|
| 1600 |
function filterEmail($text,$user,$user_pass="",$password_reset_key=false,$extra_variables = array()) |
| 1601 |
{ |
| 1602 |
if(!is_object($user)) |
| 1603 |
{ |
| 1604 |
|
| 1605 |
if ( username_exists( $user ) ){ |
| 1606 |
$user = get_user_by('login', $user); |
| 1607 |
} |
| 1608 |
// Then, by e-mail address |
| 1609 |
elseif( email_exists($user) ){ |
| 1610 |
$user = get_user_by('email', $user); |
| 1611 |
} |
| 1612 |
// Then, by user ID |
| 1613 |
else{ |
| 1614 |
$user = new WP_User( intval($user) ); |
| 1615 |
} |
| 1616 |
} |
| 1617 |
if(!$user) return false; |
| 1618 |
|
| 1619 |
/* |
| 1620 |
* Define Variables |
| 1621 |
*/ |
| 1622 |
$reset_email_key = "";//Reset Email Key |
| 1623 |
$confirm_current_email_url = ""; |
| 1624 |
$user_last_date = "";//Add User Last Date |
| 1625 |
|
| 1626 |
/* |
| 1627 |
* Replace Array to Variables |
| 1628 |
*/ |
| 1629 |
if(!empty($extra_variables)) |
| 1630 |
extract($extra_variables); |
| 1631 |
|
| 1632 |
$option = get_option(OPTION_PIE_REGISTER); |
| 1633 |
$user_form_id = get_user_meta( $user->ID, 'user_registered_form_id', true); |
| 1634 |
$form_fields = unserialize( get_option("piereg_form_fields_" . $user_form_id ) ); |
| 1635 |
|
| 1636 |
$text = $this->replaceMetaKeys($text,$user->ID, $form_fields); |
| 1637 |
$user_login = stripslashes($user->data->user_login); |
| 1638 |
$user_email = stripslashes($user->data->user_email); |
| 1639 |
$blog_name = get_option("blogname"); |
| 1640 |
$site_url = get_option("siteurl"); |
| 1641 |
$blogname_url = '<a href="'.esc_url(get_option("siteurl")).'">'.get_option("blogname").'</a>'; |
| 1642 |
$first_name = get_user_meta( $user->ID, 'first_name' ); |
| 1643 |
$last_name = get_user_meta( $user->ID, 'last_name' ); |
| 1644 |
$user_url = $user->data->user_url; |
| 1645 |
$user_aim = get_user_meta( $user->ID, 'aim' ); |
| 1646 |
$user_yim = get_user_meta( $user->ID, 'yim' ); |
| 1647 |
$user_jabber = get_user_meta( $user->ID, 'jabber' ); |
| 1648 |
$user_biographical_nfo = get_user_meta( $user->ID, 'description' ); |
| 1649 |
$invitation_code = get_user_meta( $user->ID, 'invite_code' ); |
| 1650 |
$invitation_code = (isset($invitation_code[0]) && is_array($invitation_code))? $invitation_code[0] : ""; |
| 1651 |
$custom_role = get_user_meta( $user->ID, 'custom_role' ); // dropdown-ur |
| 1652 |
$custom_role = (isset($custom_role[0]) && is_array($custom_role))? $custom_role[0] : ""; // dropdown-ur |
| 1653 |
$user_ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ); |
| 1654 |
$hash = get_user_meta( $user->ID, 'hash', true ); |
| 1655 |
$admin_hash = get_user_meta( $user->ID, 'admin_hash', true ); // task av |
| 1656 |
$wc_billing_address = $this->woocommerce_and_piereg_wc_addon_active ? apply_filters("pieregister_display_woocommerce_billing_address", $user->ID) : ""; |
| 1657 |
$wc_shipping_address = $this->woocommerce_and_piereg_wc_addon_active ? apply_filters("pieregister_display_woocommerce_shipping_address", $user->ID) : ""; |
| 1658 |
|
| 1659 |
|
| 1660 |
if(isset($hash)) |
| 1661 |
$activationurl = $this->pie_modify_custom_url($this->pie_login_url(),"action=activate").'&pie_id='.$user->data->user_login.'&activation_key='.((isset($hash))?$hash:""); |
| 1662 |
else |
| 1663 |
$activationurl = ""; |
| 1664 |
|
| 1665 |
if($activationurl != ""){ |
| 1666 |
$activationurl = '<a href="'.esc_url($activationurl).'" target="_blank">'.esc_html($activationurl).'</a>'; |
| 1667 |
} |
| 1668 |
// task av |
| 1669 |
if(isset($admin_hash)) |
| 1670 |
$verificationurl = $this->pie_modify_custom_url(site_url(),"action=unverified_user").'&pie_id='.$user->data->user_login.'&verification_key='.((isset($admin_hash))?$admin_hash:""); |
| 1671 |
else |
| 1672 |
$verificationurl = ""; |
| 1673 |
|
| 1674 |
if($verificationurl != ""){ |
| 1675 |
$verificationurl = '<a href="'.esc_url($verificationurl).'" target="_blank">'.esc_html($verificationurl).'</a>'; |
| 1676 |
} |
| 1677 |
|
| 1678 |
$all_field = $this->get_all_field($user->data->user_email); |
| 1679 |
$user_registration_date = $user->data->user_registered; |
| 1680 |
|
| 1681 |
if($password_reset_key) |
| 1682 |
$reset_password_url = $this->pie_modify_custom_url($this->pie_login_url(),"action=rp&key={$password_reset_key}&login={$user_login}"); |
| 1683 |
else |
| 1684 |
$reset_password_url = ""; |
| 1685 |
|
| 1686 |
if($reset_password_url != ""){ |
| 1687 |
$reset_password_url = '<a href="'.esc_url($reset_password_url).'" target="_blank">'.esc_html($reset_password_url).'</a>'; |
| 1688 |
} |
| 1689 |
/* |
| 1690 |
* Add since 2.0.13 |
| 1691 |
* User New Email |
| 1692 |
*/ |
| 1693 |
$user_new_email = get_user_meta( $user->ID, 'new_email_address', true ); |
| 1694 |
|
| 1695 |
/* |
| 1696 |
* Add since 2.0.13 |
| 1697 |
* Email edit verification url |
| 1698 |
*/ |
| 1699 |
$reset_email_url = ""; |
| 1700 |
if($reset_email_key) |
| 1701 |
$reset_email_url = $this->get_page_uri($option['alternate_login'],"action=email_edit&key={$reset_email_key}&login={$user_login}"); |
| 1702 |
else |
| 1703 |
$reset_email_url = ""; |
| 1704 |
if($reset_email_url != ""){ |
| 1705 |
$reset_email_url = '<a href="'.esc_url($reset_email_url).'" target="_blank">'.esc_html($reset_email_url).'</a>'; |
| 1706 |
} |
| 1707 |
|
| 1708 |
$confirm_current_email_url = ""; |
| 1709 |
if(isset($confirm_current_email_key)) |
| 1710 |
$confirm_current_email_url = $this->get_page_uri($option['alternate_login'],"action=current_email_verify&key={$confirm_current_email_key}&login={$user_login}"); |
| 1711 |
else |
| 1712 |
$confirm_current_email_url = ""; |
| 1713 |
if($confirm_current_email_url != ""){ |
| 1714 |
$confirm_current_email_url = '<a href="'.esc_url($confirm_current_email_url).'" target="_blank">'.esc_html($confirm_current_email_url).'</a>'; |
| 1715 |
} |
| 1716 |
|
| 1717 |
/////////////// PAYMENT LINK /////////// |
| 1718 |
$pending_payment_url = ""; |
| 1719 |
$register_type = get_user_meta($user->ID, 'register_type', true); |
| 1720 |
if($register_type == "payment_verify"){ |
| 1721 |
$hash = wp_generate_password(32, false); |
| 1722 |
update_user_meta( $user->ID, 'hash', $hash ); |
| 1723 |
|
| 1724 |
$user_registered_form_id = get_user_meta($user->ID, "user_registered_form_id" , true); |
| 1725 |
|
| 1726 |
$piereg_form_data = $this->getCurrentFields($user_registered_form_id); |
| 1727 |
|
| 1728 |
foreach ( $piereg_form_data as $key => $val) |
| 1729 |
{ |
| 1730 |
if ( isset( $val['type'] ) && ( $val['type'] == 'pricing') ) |
| 1731 |
{ |
| 1732 |
$hosted_btn_id = isset($val['hosted_btn_id']) && !empty($val['hosted_btn_id']) ? $val['hosted_btn_id'] : $option['paypal_butt_id']; |
| 1733 |
} |
| 1734 |
} |
| 1735 |
|
| 1736 |
if($option['paypal_sandbox'] == "yes") |
| 1737 |
$pending_payment_url = PIE_SSL_SAND_URL."?cmd=_s-xclick&hosted_button_id=".$hosted_btn_id."&custom=".$hash."|".$user->ID."&bn=Genetech_SI_Custom"; |
| 1738 |
else |
| 1739 |
$pending_payment_url = PIE_SSL_P_URL."?cmd=_s-xclick&hosted_button_id=".$hosted_btn_id."&custom=".$hash."|".$user->ID."&bn=Genetech_SI_Custom"; |
| 1740 |
$pending_payment_url = '<a href="'.esc_url($pending_payment_url).'">'.esc_html($pending_payment_url).'</a>'; |
| 1741 |
} |
| 1742 |
// Verification Rejection Reason |
| 1743 |
$verif_reject_reason = isset($_POST['piereg_user_verification_rejected_reason']) && !empty($_POST['piereg_user_verification_rejected_reason']) ? trim(sanitize_textarea_field($_POST['piereg_user_verification_rejected_reason'])) : ''; |
| 1744 |
|
| 1745 |
$user_pass = !empty($user_pass) ? $user_pass : "********"; |
| 1746 |
////////////////////////////////////// |
| 1747 |
$keys = array("%user_login%","%user_email%","%blogname%","%siteurl%","%activationurl%","%verificationurl%","%firstname%","%lastname%","%user_url%","%user_aim%","%user_yim%","%user_jabber%","%user_biographical_nfo%","%all_field%","%user_registration_date%","%reset_password_url%","%invitation_code%","%custom_role%","%pending_payment_url%","%blogname_url%","%user_ip%","%user_pass%","%user_new_email%","%reset_email_url%","%user_last_date%","%confirm_current_email_url%","%wc_billing_address%","%wc_shipping_address%","%verification_rejection_reason%"); // dropdown-ur |
| 1748 |
|
| 1749 |
$values = array($user_login ,$user_email,$blog_name, $site_url,$activationurl,$verificationurl,$this->returnFormattedValue($first_name),$this->returnFormattedValue($last_name),$user_url,$this->returnFormattedValue($user_aim),$this->returnFormattedValue($user_yim),$this->returnFormattedValue($user_jabber),$this->returnFormattedValue($user_biographical_nfo), $all_field,$user_registration_date,$reset_password_url,$invitation_code,$custom_role,$pending_payment_url,$blogname_url,$user_ip,$user_pass,$user_new_email,$reset_email_url,$user_last_date,$confirm_current_email_url,$wc_billing_address,$wc_shipping_address,$verif_reject_reason); |
| 1750 |
|
| 1751 |
$return_text = str_replace($keys,$values,$text); |
| 1752 |
|
| 1753 |
/////////////// CUSTOM FIELDS /////////////// |
| 1754 |
$customfields = array(); |
| 1755 |
$user_form_id = get_user_meta( $user->ID, 'user_registered_form_id', true); |
| 1756 |
$form_fields = unserialize( get_option("piereg_form_fields_" . $user_form_id ) ); |
| 1757 |
|
| 1758 |
if( preg_match_all("'%pie_(.*?)%'si", $text, $customfields) ) |
| 1759 |
{ |
| 1760 |
|
| 1761 |
|
| 1762 |
foreach( $customfields[0] as $val ) |
| 1763 |
{ |
| 1764 |
$pie_field_slug = str_replace( "%", "", $val ); |
| 1765 |
$pie_field_value = get_user_meta( $user->ID, $pie_field_slug, true); |
| 1766 |
$_type = explode("_", $pie_field_slug); |
| 1767 |
$_types_multi_val = array('radio','checkbox','multiselect','dropdown'); |
| 1768 |
|
| 1769 |
if($_type[1] == 'pricing'){ |
| 1770 |
$pie_field_value = get_user_meta( $user->ID, 'pie_pricing', true); |
| 1771 |
} |
| 1772 |
|
| 1773 |
if( $pie_field_value && (is_array($pie_field_value) || in_array( $_type[1], $_types_multi_val )) ) |
| 1774 |
{ |
| 1775 |
|
| 1776 |
if( in_array( $_type[1], $_types_multi_val ) ) |
| 1777 |
{ |
| 1778 |
$field_data = $form_fields[$_type[2]]; |
| 1779 |
|
| 1780 |
if(is_array($field_data['value'])) |
| 1781 |
$combined_array = array_combine($field_data['value'], $field_data['display']); |
| 1782 |
|
| 1783 |
$corrected_value = array(); |
| 1784 |
|
| 1785 |
for($a = 0 ; $a < sizeof($pie_field_value) ; $a++ ) |
| 1786 |
{ |
| 1787 |
if(isset($pie_field_value[$a])) |
| 1788 |
$corrected_value[$a] = $combined_array[$pie_field_value[$a]]; |
| 1789 |
} |
| 1790 |
|
| 1791 |
$pie_field_value = implode(", ",$corrected_value); |
| 1792 |
} |
| 1793 |
else |
| 1794 |
{ |
| 1795 |
$_params = array( |
| 1796 |
"_type" => $_type[1], |
| 1797 |
"_value" => $pie_field_value |
| 1798 |
); |
| 1799 |
|
| 1800 |
$pie_field_value = $this->getValue( true, $_params ); |
| 1801 |
} |
| 1802 |
|
| 1803 |
} |
| 1804 |
|
| 1805 |
$return_text = str_replace($val,$pie_field_value,$return_text); |
| 1806 |
|
| 1807 |
} |
| 1808 |
} |
| 1809 |
|
| 1810 |
return $this->nl2br_save_html($return_text); |
| 1811 |
} |
| 1812 |
|
| 1813 |
function nl2br_save_html($string) { |
| 1814 |
if(! preg_match("#</.*>#", $string)) // return if no html tags. |
| 1815 |
return nl2br($string); |
| 1816 |
|
| 1817 |
$string = str_replace(array("\r\n", "\r", "\n"), "\n", $string); |
| 1818 |
|
| 1819 |
$lines = explode("\n", $string); |
| 1820 |
$output = ''; |
| 1821 |
foreach($lines as $line) { |
| 1822 |
$line = rtrim($line); |
| 1823 |
if(! preg_match("#</?[^/<>]*>$#", $line)) // Check if opening or closing tag present in line. |
| 1824 |
$line .= '<br />'; |
| 1825 |
$output .= $line . "\n"; |
| 1826 |
} |
| 1827 |
|
| 1828 |
return $output; |
| 1829 |
} |
| 1830 |
|
| 1831 |
function returnFormattedValue($array){ |
| 1832 |
if($array !== ''){ |
| 1833 |
if(is_array($array) && isset($array[0])){ |
| 1834 |
return $array[0]; |
| 1835 |
}else if(!is_array($array)){ |
| 1836 |
return $array; |
| 1837 |
} |
| 1838 |
} |
| 1839 |
return ''; |
| 1840 |
} |
| 1841 |
|
| 1842 |
function get_all_field($user) |
| 1843 |
{ |
| 1844 |
if(!is_object($user)) |
| 1845 |
{ |
| 1846 |
global $wpdb; |
| 1847 |
$user = $wpdb->get_results( $wpdb->prepare("SELECT `ID`, `user_login`, `user_nicename`, `user_email`, `user_registered` FROM `{$wpdb->users}` WHERE `user_email` = %s", stripslashes( $user ) ) ); |
| 1848 |
if(isset($wpdb->last_error) && !empty($wpdb->last_error)){ |
| 1849 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 1850 |
} |
| 1851 |
$user = $user[0]; |
| 1852 |
} |
| 1853 |
if($user) |
| 1854 |
{ |
| 1855 |
$val = "<table>"; |
| 1856 |
foreach($user as $key=>$value) |
| 1857 |
{ |
| 1858 |
if($key != "ID") |
| 1859 |
{ |
| 1860 |
$val .= "<tr> |
| 1861 |
<td>".esc_html($this->chnge_case($key))."</td> |
| 1862 |
<td>".esc_html($value)."</td> |
| 1863 |
</tr>"; |
| 1864 |
} |
| 1865 |
} |
| 1866 |
$val .= "</table>"; |
| 1867 |
} |
| 1868 |
else{ |
| 1869 |
$val = ""; |
| 1870 |
} |
| 1871 |
return $val; |
| 1872 |
} |
| 1873 |
function chnge_case($key = "") |
| 1874 |
{ |
| 1875 |
return @ucwords(strtolower(str_replace("_"," ",$key))); |
| 1876 |
} |
| 1877 |
function createDropdown($options,$sel = "") |
| 1878 |
{ |
| 1879 |
$html = ""; |
| 1880 |
if(is_array($options)) |
| 1881 |
{ |
| 1882 |
for($a = 0 ;$a < sizeof($options);$a++) |
| 1883 |
{ |
| 1884 |
if( $a == 0 ) |
| 1885 |
{ |
| 1886 |
$html .= '<option value="">'.apply_filters('piereg_dropdown_please_select',esc_html(__("--Please Select --","pie-register"))).'</option>'; |
| 1887 |
} |
| 1888 |
|
| 1889 |
$selected = ""; |
| 1890 |
if(isset($sel) && is_array($sel)){ |
| 1891 |
if(in_array($options[$a],$sel)){ |
| 1892 |
$selected = 'selected="selected"'; |
| 1893 |
} |
| 1894 |
}else{ |
| 1895 |
if($options[$a]==$sel) |
| 1896 |
$selected = 'selected="selected"'; |
| 1897 |
} |
| 1898 |
$html .= '<option ' . $selected . ' value="' . esc_attr( $options[$a] ) . '">' . esc_html( $options[$a] ) . '</option>'; |
| 1899 |
} |
| 1900 |
} |
| 1901 |
return $html; |
| 1902 |
} |
| 1903 |
// pie-register-woocommerce Addon |
| 1904 |
function createCountryDropdown($options,$sel = "") |
| 1905 |
{ |
| 1906 |
$html = ""; |
| 1907 |
if(is_array($options)) |
| 1908 |
{ |
| 1909 |
for($a = 0 ;$a < sizeof($options);$a++) |
| 1910 |
{ |
| 1911 |
if( $a == 0 ) |
| 1912 |
{ |
| 1913 |
$html .= '<option value="">'.apply_filters('piereg_dropdown_please_select',esc_html(__("--Please Select --","pie-register"))).'</option>'; |
| 1914 |
} |
| 1915 |
|
| 1916 |
$selected = ""; |
| 1917 |
if(isset($sel) && is_array($sel)){ |
| 1918 |
if(in_array($options[$a]['iso_code'],$sel)){ |
| 1919 |
$selected = 'selected="selected"'; |
| 1920 |
} |
| 1921 |
}else{ |
| 1922 |
if($options[$a]['iso_code']==$sel) |
| 1923 |
$selected = 'selected="selected"'; |
| 1924 |
} |
| 1925 |
$html .= '<option '.$selected.' value="'.esc_attr($options[$a]['iso_code']).'">'.esc_html($options[$a]['name']).'</option>'; |
| 1926 |
} |
| 1927 |
} |
| 1928 |
return $html; |
| 1929 |
} |
| 1930 |
function createStatesDropdown($options,$sel = "") |
| 1931 |
{ |
| 1932 |
$html = ""; |
| 1933 |
if(is_array($options)) |
| 1934 |
{ |
| 1935 |
for($a = 0 ;$a < sizeof($options);$a++) |
| 1936 |
{ |
| 1937 |
if( $a == 0 ) |
| 1938 |
{ |
| 1939 |
$html .= '<option value="">'.apply_filters('piereg_dropdown_please_select',__("--Please Select --","pie-register")).'</option>'; |
| 1940 |
} |
| 1941 |
|
| 1942 |
$selected = ""; |
| 1943 |
if(isset($sel) && is_array($sel)){ |
| 1944 |
if(in_array($options[$a]['iso_code'],$sel)){ |
| 1945 |
$selected = 'selected="selected"'; |
| 1946 |
} |
| 1947 |
}else{ |
| 1948 |
if($options[$a]['iso_code']==$sel) |
| 1949 |
$selected = 'selected="selected"'; |
| 1950 |
} |
| 1951 |
$html .= '<option '.$selected.' value="'.esc_attr($options[$a]['iso_code']).'">'.esc_html($options[$a]['name']).'</option>'; |
| 1952 |
} |
| 1953 |
} |
| 1954 |
return $html; |
| 1955 |
} |
| 1956 |
function codeTable() |
| 1957 |
{ |
| 1958 |
global $wpdb; |
| 1959 |
return $wpdb->prefix."pieregister_code"; |
| 1960 |
} |
| 1961 |
function warnings() |
| 1962 |
{ //Show warning if plugin is installed on a WordPress lower than 3.2 |
| 1963 |
global $wp_version; |
| 1964 |
//VERSION CONTROL |
| 1965 |
if( $wp_version < 3.5 ) |
| 1966 |
echo "<div id='piereg-warning' class='updated fade-ff0000'><p><strong>".esc_html__('Pie Register is compatible with WordPress v3.5 and up. You are currently using an older version WordPress.', 'pie-register').esc_html($wp_version).". ".esc_html__("The plugin may not work as expected.","pie-register")."</strong> </p></div>"; |
| 1967 |
|
| 1968 |
} |
| 1969 |
public function check_enable_social_site_method()// only check any Social Site method enable or not. |
| 1970 |
{ |
| 1971 |
$pie_reg = get_option(OPTION_PIE_REGISTER); |
| 1972 |
if( |
| 1973 |
(isset($pie_reg['piereg_enable_facebook']) and $pie_reg['piereg_enable_facebook'] == 1 and trim($pie_reg['piereg_facebook_app_id']) != "") or |
| 1974 |
(isset($pie_reg['piereg_enable_linkedin']) and $pie_reg['piereg_enable_linkedin'] == 1 and trim($pie_reg['piereg_linkedin_app_id']) != "") or |
| 1975 |
(isset($pie_reg['piereg_enable_google']) and $pie_reg['piereg_enable_google'] == 1 ) or |
| 1976 |
(isset($pie_reg['piereg_enable_yahoo']) and $pie_reg['piereg_enable_yahoo'] == 1 ) or |
| 1977 |
(isset($pie_reg['piereg_enable_twitter']) and $pie_reg['piereg_enable_twitter'] == 1 and trim($pie_reg['piereg_twitter_app_id'] ) != "") or |
| 1978 |
(isset($pie_reg['piereg_enable_wordpress']) and $pie_reg['piereg_enable_wordpress'] == 1 and trim($pie_reg['piereg_wordpress_app_id'] ) != "") |
| 1979 |
) |
| 1980 |
{ |
| 1981 |
return "true"; |
| 1982 |
} |
| 1983 |
else |
| 1984 |
{ |
| 1985 |
return "false"; |
| 1986 |
} |
| 1987 |
|
| 1988 |
} |
| 1989 |
|
| 1990 |
public function check_enable_payment_method()// only check any payment method enable or not. |
| 1991 |
{ |
| 1992 |
$pie_reg = get_option(OPTION_PIE_REGISTER); |
| 1993 |
if( |
| 1994 |
/* For Authorize.Net*/ |
| 1995 |
(isset($pie_reg['enable_authorize_net'],$pie_reg['piereg_authorize_net_login_id']) && $pie_reg['enable_authorize_net'] == 1 and trim($pie_reg['piereg_authorize_net_login_id']) != "" && $this->checkAddonActivated('AuthNet') == true) or |
| 1996 |
/*For Stripe*/ |
| 1997 |
(isset($pie_reg['enable_stripe']) && $pie_reg['enable_stripe'] == 1 && $this->checkAddonActivated('Stripe') == true ) or |
| 1998 |
/*For Stripe Recurring*/ |
| 1999 |
(isset($pie_reg['enable_stripe']) && $pie_reg['enable_stripe'] == 1 && $this->checkAddonActivated('Stripe_Recurring') == true ) or |
| 2000 |
/*For Paypal (Standard)*/ |
| 2001 |
(isset($pie_reg['enable_paypal'],$pie_reg['paypal_butt_id']) && $pie_reg['enable_paypal'] == 1 and trim($pie_reg['paypal_butt_id']) != "") |
| 2002 |
) |
| 2003 |
{ |
| 2004 |
return "true"; |
| 2005 |
} |
| 2006 |
else |
| 2007 |
{ |
| 2008 |
return "false"; |
| 2009 |
} |
| 2010 |
} |
| 2011 |
function check_plugin_activation() |
| 2012 |
{ |
| 2013 |
if( |
| 2014 |
is_plugin_active("pie-register-stripe/pie-register-stripe.php") or |
| 2015 |
is_plugin_active("pie-register-stripe-recurring/pie-register-stripe-recurring.php") or |
| 2016 |
is_plugin_active("pie-register-authorize-net/pie-register-authorize-net.php") |
| 2017 |
) |
| 2018 |
{ |
| 2019 |
return "true"; |
| 2020 |
} |
| 2021 |
else{ |
| 2022 |
return "false"; |
| 2023 |
} |
| 2024 |
} |
| 2025 |
function check_payment_plugin_activation(){ |
| 2026 |
return $this->check_plugin_activation(); |
| 2027 |
} |
| 2028 |
|
| 2029 |
function get_addons_status(){ |
| 2030 |
if( |
| 2031 |
(is_plugin_active("pie-register-authorize-net/pie-register-authorize-net.php") && get_option('piereg_api_manager_addon_AuthNet_status') == "inactive") |
| 2032 |
|| (is_plugin_active("pie-register-bbpress/pie-register-bbpress.php") && get_option('piereg_api_manager_addon_Bbpress_status') == "inactive") |
| 2033 |
|| (is_plugin_active("pie-register-bulkemail/pie-register-bulkemail.php") && get_option('piereg_api_manager_addon_BulkEmail_status') == "inactive") |
| 2034 |
|| (is_plugin_active("pie-register-field-visibility/pie-register-field-visibility.php") && get_option('piereg_api_manager_addon_Field_Visibility_status') == "inactive") |
| 2035 |
|| (is_plugin_active("pie-register-geolocation/pie-register-geolocation.php") && get_option('piereg_api_manager_addon_geolocation_status') == "inactive") |
| 2036 |
|| (is_plugin_active("pie-register-mailchimp/pie-register-mailchimp.php") && get_option('piereg_api_manager_addon_Mail_Chimp_status') == "inactive") |
| 2037 |
|| (is_plugin_active("pie-register-profile-search/pie-register-profile-search.php") && get_option('piereg_api_manager_addon_Profile_Search_status') == "inactive") |
| 2038 |
|| (is_plugin_active("pie-register-social-site/pie-register-social-site.php") && get_option('piereg_api_manager_addon_Social_Sites_Login_status') == "inactive") |
| 2039 |
|| (is_plugin_active("pie-register-stripe/pie-register-stripe.php") && get_option('piereg_api_manager_addon_Stripe_status') == "inactive") |
| 2040 |
|| (is_plugin_active("pie-register-twilio/pie-register-twilio.php") && get_option('piereg_api_manager_addon_Twilio_status') == "inactive") |
| 2041 |
|| (is_plugin_active("pie-register-woocommerce/pie-register-woocommerce.php") && get_option('piereg_api_manager_addon_WooCommerce_status') == "inactive") |
| 2042 |
|
| 2043 |
) { |
| 2044 |
return true; |
| 2045 |
} else { |
| 2046 |
return false; |
| 2047 |
} |
| 2048 |
} |
| 2049 |
|
| 2050 |
function piereg_default_settings() |
| 2051 |
{ |
| 2052 |
$pie_pages_id = get_option("pie_pages"); |
| 2053 |
$update = get_option(OPTION_PIE_REGISTER); |
| 2054 |
//E-Mail TYpes |
| 2055 |
$email_type = array( |
| 2056 |
"default_template" => __("Your account is ready.","pie-register"), |
| 2057 |
"admin_verification" => __("Your account is being processed.","pie-register"), |
| 2058 |
"email_verification" => __("Email verification.","pie-register"), |
| 2059 |
"email_thankyou" => __("Your account has been activated.","pie-register"), |
| 2060 |
"pending_payment" => __("Overdue Payment.","pie-register"), |
| 2061 |
"payment_success" => __("Payment Processed.","pie-register"), |
| 2062 |
"payment_faild" => __("Payment Failed.","pie-register"), |
| 2063 |
"pending_payment_reminder" => __("Payment Pending.","pie-register"), |
| 2064 |
"email_verification_reminder" => __("Email Verification Reminder.","pie-register"), |
| 2065 |
"forgot_password_notification" => __("Password Reset Request.","pie-register"), |
| 2066 |
"user_verification_rejected" => __("User verification has been rejected.","pie-register"), |
| 2067 |
"user_verification_rejected" => __("User verification has been rejected.","pie-register"), |
| 2068 |
"user_subscription_activated" => __("User Subscription Activated","pie-register"), |
| 2069 |
"user_subscription_cancelled" => __("Your subscription has been cancelled.","pie-register") |
| 2070 |
); |
| 2071 |
|
| 2072 |
add_option("pie_user_email_types",$email_type); |
| 2073 |
|
| 2074 |
// Truncate redirect roles table |
| 2075 |
global $wpdb; |
| 2076 |
global $PR_Bot_List; |
| 2077 |
$redirect_settings_table_name = $wpdb->prefix."pieregister_redirect_settings"; |
| 2078 |
if(!$wpdb->query($wpdb->prepare("TRUNCATE TABLE `{$wpdb->prefix}pieregister_redirect_settings`", array()))) |
| 2079 |
{ |
| 2080 |
$this->pr_error_log($wpdb->last_error.($this->get_error_log_info(__FUNCTION__,__LINE__,__FILE__))); |
| 2081 |
} |
| 2082 |
|
| 2083 |
$update = get_option(OPTION_PIE_REGISTER); |
| 2084 |
|
| 2085 |
$update["paypal_butt_id"] = ""; |
| 2086 |
$update["paypal_pdt"] = ""; |
| 2087 |
$update["paypal_sandbox"] = ""; |
| 2088 |
$update["payment_success_msg"] = __("Payment was successful.","pie-register"); |
| 2089 |
$update["payment_faild_msg"] = __("Payment failed.","pie-register"); |
| 2090 |
$update["payment_renew_msg"] = __("Account needs to be activated.","pie-register"); |
| 2091 |
$update["payment_already_activate_msg"] = __("Account is already active.","pie-register"); |
| 2092 |
$update['enable_admin_notifications'] = 1; |
| 2093 |
$update['enable_admin_notifications_profile_update'] = 1; |
| 2094 |
$update['enable_paypal'] = 0; |
| 2095 |
$update['enable_blockedips'] = 0; |
| 2096 |
$update['enable_blockedusername'] = 0; |
| 2097 |
$update['enable_blockedemail'] = 0; |
| 2098 |
$update['admin_sendto_email'] = get_option( 'admin_email' ); |
| 2099 |
$update['admin_from_name'] = "Administrator"; |
| 2100 |
$update['admin_from_email'] = get_option( 'admin_email' ); |
| 2101 |
$update['admin_to_email'] = get_option( 'admin_email' ); |
| 2102 |
$update['admin_bcc_email'] = get_option( 'admin_email' ); |
| 2103 |
$update['admin_subject_email'] = __("New User Registration","pie-register"); |
| 2104 |
$update['admin_message_email_formate'] = 1; |
| 2105 |
$update['admin_message_email'] = '<p>Hello Admin,</p><p>A new user has been registered on your Website,. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 2106 |
|
| 2107 |
$update['admin_sendto_email_profile_update'] = get_option( 'admin_email' ); |
| 2108 |
$update['admin_from_name_profile_update'] = "Administrator"; |
| 2109 |
$update['admin_from_email_profile_update'] = get_option( 'admin_email' ); |
| 2110 |
$update['admin_to_email_profile_update'] = get_option( 'admin_email' ); |
| 2111 |
$update['admin_bcc_email_profile_update'] = get_option( 'admin_email' ); |
| 2112 |
$update['admin_subject_email_profile_update'] = __("User Profile Updated","pie-register"); |
| 2113 |
$update['admin_message_email_formate_profile_update'] = 1; |
| 2114 |
$update['admin_message_email_profile_update'] = '<p>Hello Admin,</p><p>A new user has been registered on your Website,. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 2115 |
|
| 2116 |
$update['enable_admin_notifications_cancel_subscription'] = 1; |
| 2117 |
$update['admin_sendto_email_cancel_subscription'] = get_option( 'admin_email' ); |
| 2118 |
$update['admin_from_name_cancel_subscription'] = "Administrator"; |
| 2119 |
$update['admin_from_email_cancel_subscription'] = get_option( 'admin_email' ); |
| 2120 |
$update['admin_to_email_cancel_subscription'] = get_option( 'admin_email' ); |
| 2121 |
$update['admin_bcc_email_cancel_subscription'] = get_option( 'admin_email' ); |
| 2122 |
$update['admin_subject_email_cancel_subscription'] = __("User Subscription Cancelled","pie-register"); |
| 2123 |
$update['admin_message_email_formate_cancel_subscription'] = 1; |
| 2124 |
$update['enable_admin_notification_user_role_cancel_subscription'] = 0; |
| 2125 |
$update['admin_message_email_cancel_subscription'] = '<p>Hello Admin,</p><p>The subscription has been cancelled by a user. Details are given below:</p><p>Thanks</p><p>Team %blogname%</p>'; |
| 2126 |
|
| 2127 |
//UX_Basic_settings |
| 2128 |
$update['display_hints'] = 0; |
| 2129 |
$update['login_username_label'] = 'Username'; |
| 2130 |
$update['login_username_placeholder'] = ''; |
| 2131 |
$update['login_password_label'] = 'Password'; |
| 2132 |
$update['login_password_placeholder'] = ''; |
| 2133 |
$update['forgot_pass_username_label'] = 'Username or Email:'; |
| 2134 |
$update['forgot_pass_username_placeholder'] = ''; |
| 2135 |
|
| 2136 |
|
| 2137 |
$update['redirect_user'] = 1; |
| 2138 |
$update['subscriber_login'] = 0; |
| 2139 |
$update['allow_pr_edit_wplogin'] = 0; |
| 2140 |
$update['block_WP_profile'] = 0; |
| 2141 |
$update['modify_avatars'] = 0; |
| 2142 |
$update['show_admin_bar'] = 1; |
| 2143 |
$update['block_wp_login'] = 1; |
| 2144 |
$update['alternate_login'] = $pie_pages_id[0]; |
| 2145 |
$update['alternate_register'] = $pie_pages_id[1]; |
| 2146 |
$update['alternate_forgotpass'] = $pie_pages_id[2]; |
| 2147 |
$update['alternate_profilepage'] = $pie_pages_id[3]; |
| 2148 |
|
| 2149 |
$update['after_login'] = -1; |
| 2150 |
|
| 2151 |
//Captcha_login_form |
| 2152 |
$update['captcha_in_login_value'] = 0; |
| 2153 |
$update['captcha_in_login_attempts'] = 0; |
| 2154 |
$update['capthca_in_login_label'] = ''; |
| 2155 |
$update['capthca_in_login'] = '2'; |
| 2156 |
$update['piereg_security_attempts_login_value'] = '0'; |
| 2157 |
$update['security_attempts_login_time'] = '1'; |
| 2158 |
$update['security_attempts_login'] = '2'; |
| 2159 |
|
| 2160 |
//Captcha_forgot_form |
| 2161 |
$update['captcha_in_forgot_value'] = 0; |
| 2162 |
$update['capthca_in_forgot_pass_label'] = ''; |
| 2163 |
$update['capthca_in_forgot_pass'] = '2'; |
| 2164 |
$update['piereg_security_attempts_forgot_value'] = '0'; |
| 2165 |
$update['security_attempts_forgot_time'] = '1'; |
| 2166 |
$update['security_attempts_forgot'] = '2'; |
| 2167 |
|
| 2168 |
//security_attempts_login |
| 2169 |
$update['security_captcha_attempts_login'] = 0; |
| 2170 |
$update['security_captcha_login'] = 2; |
| 2171 |
$update['security_attempts_login'] = 0; |
| 2172 |
$update['security_attempts_login_time'] = 1; |
| 2173 |
|
| 2174 |
|
| 2175 |
$update['alternate_login_url'] = ''; |
| 2176 |
|
| 2177 |
$update['alternate_logout'] = -1; |
| 2178 |
$update['alternate_logout_url'] = ''; |
| 2179 |
$update['login_after_register'] = 0; |
| 2180 |
/* Bot Settings */ |
| 2181 |
$update['restrict_bot_enabel'] = 0; |
| 2182 |
$update['restrict_bot_content'] = $PR_Bot_List; |
| 2183 |
$update['restrict_bot_content_message'] = "Restricted Post: You are not allowed to view the content of this Post"; |
| 2184 |
|
| 2185 |
$update['outputhtml'] = 1; |
| 2186 |
$update['outputcss'] = 1; |
| 2187 |
|
| 2188 |
$update['pass_strength_indicator_label'] = "Strength Meter"; |
| 2189 |
$update['pass_very_weak_label'] = "Very weak"; |
| 2190 |
$update['pass_weak_label'] = "Weak"; |
| 2191 |
$update['pass_medium_label'] = "Medium"; |
| 2192 |
$update['pass_strong_label'] = "Strong"; |
| 2193 |
$update['pass_mismatch_label'] = "Mismatch"; |
| 2194 |
$update['pr_theme'] = "0"; |
| 2195 |
|
| 2196 |
|
| 2197 |
$update['outputjquery_ui'] = 1; |
| 2198 |
$update['no_conflict'] = 0; |
| 2199 |
$update['currency'] = "USD"; |
| 2200 |
$update['verification'] = 0; |
| 2201 |
$update['email_edit_verification_step'] = 1; |
| 2202 |
$update['piereg_recaptcha_type'] = "v2"; |
| 2203 |
$update['grace_period'] = 0; |
| 2204 |
$update['captcha_publc'] = ""; |
| 2205 |
$update['captcha_private'] = ""; |
| 2206 |
$update['captcha_publc_v3'] = ""; |
| 2207 |
$update['captcha_private_v3'] = ""; |
| 2208 |
$update['paypal_button_id'] = ""; |
| 2209 |
$update['paypal_pdt_token'] = ""; |
| 2210 |
$update['custom_css'] = ""; |
| 2211 |
$update['tracking_code'] = ""; |
| 2212 |
|
| 2213 |
$update['enable_invitation_codes'] = 0; |
| 2214 |
$update['invitation_codes'] = ""; |
| 2215 |
|
| 2216 |
$update['pie_email_linkpage'] = $pie_pages_id[1]; |
| 2217 |
$update['pie_email_invitecode'] = 0; |
| 2218 |
$update['pie_name_from'] = "Admin"; |
| 2219 |
$update['pie_email_from'] = get_option( 'admin_email' ); |
| 2220 |
$update['pie_email_subject'] = "Invitation to register with " . get_bloginfo('name'); |
| 2221 |
$update['pie_email_content'] = 'Hi there,'.PHP_EOL.PHP_EOL.'You are invited to create an account with' . get_bloginfo('name') . '. Click <a href="%invitation_link%">this link</a> to complete registration.'.PHP_EOL.PHP_EOL.'Regards,'.PHP_EOL.get_bloginfo('name'); |
| 2222 |
|
| 2223 |
$update['reg_form_submission_time_enable'] = "0"; |
| 2224 |
$update['reg_form_submission_time'] = "0"; |
| 2225 |
$update['custom_logo_url'] = ""; |
| 2226 |
|
| 2227 |
$update['custom_logo_tooltip'] = ""; |
| 2228 |
|
| 2229 |
$update['custom_logo_link'] = ""; |
| 2230 |
$update['show_custom_logo'] = 1; |
| 2231 |
|
| 2232 |
$update['pie_regis_set_user_role_'] = "subscriber"; |
| 2233 |
|
| 2234 |
|
| 2235 |
$pie_user_email_types = get_option( 'pie_user_email_types'); |
| 2236 |
|
| 2237 |
foreach ($pie_user_email_types as $val=>$type) |
| 2238 |
{ |
| 2239 |
$update['enable_user_notifications'] = 0; |
| 2240 |
|
| 2241 |
$update['user_from_name_'.$val] = "Admin"; |
| 2242 |
$update['user_from_email_'.$val] = get_option( 'admin_email' ); |
| 2243 |
$update['user_to_email_'.$val] = get_option( 'admin_email' ); |
| 2244 |
$update['user_subject_email_'.$val] = $type; |
| 2245 |
$update['user_formate_email_'.$val] = 1; |
| 2246 |
} |
| 2247 |
|
| 2248 |
$update['user_message_email_admin_verification'] = '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>A site administrator will review your request. Once approved, you will be notified via email.</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2249 |
|
| 2250 |
$update['user_message_email_email_verification'] = '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>Please use the link below to verify your email address. </p><p>%activationurl%</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2251 |
|
| 2252 |
$update['user_message_email_email_thankyou'] = '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>You are ready to enjoy the benefits of our products and services by signing in to your personalized account.</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 2253 |
$update['user_message_email_payment_success'] = '<p>Dear %user_login%,</p><p>Congratulations, your payment has been successfully processed. <br/>Please enjoy the benefits of your membership on %blogname% </p><p>Thank You,</p><p>Team %blogname%</p>'; |
| 2254 |
|
| 2255 |
$update['user_message_email_payment_faild'] = '<p>Dear %user_login%,</p><p>Our last attempt to charge the membership payment for your account has failed. </p><p>You are requested to log in to your account at %blogname% to provide a different payment method, or contact your bank/credit-card company to resolve this issue.</p><p>Kind Regards,</p><p>Team %blogname%<br/></p>'; |
| 2256 |
|
| 2257 |
$update['user_message_email_pending_payment'] = '<p>Dear %user_login%,</p><p>This is a reminder that membership payment is overdue for your account on %blogname%. Please process your payment immediately to keep membership previlages active. </p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 2258 |
|
| 2259 |
$update['user_message_email_default_template'] = '<p>Dear %user_login%,</p><p>Thank You for registering with our website.</p><p>You are ready to enjoy the benefits of our products and services by signing in to your personalized account.</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 2260 |
|
| 2261 |
$update['user_message_email_pending_payment_reminder'] ='<p>Dear %user_login%,</p><p>We have noticed that you created an account on %blogname% a few days ago, but have not completed the payment. Please use the link below to complete the payment. <br/>Your account will be activated once the payment is received.</p><p>%pending_payment_url%</p><p>Best Regards,</p><p>Team %blogname%</p>'; |
| 2262 |
|
| 2263 |
$update['user_message_email_email_verification_reminder'] = '<p>Dear %user_login%,</p><p>Thank You for registering with our website. </p><p>We noticed that you created an account on %blogname% but have not completed the email verification process. </p><p>Please use the link below to verify your email address. </p><p>%activationurl%</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2264 |
|
| 2265 |
$update['user_message_email_forgot_password_notification'] = '<p>Dear %user_login%,</p><p>We have received a request to reset your account password on %blogname%. Please use the link below to reset your password. If you did not request a new password, please ignore this email and the change will not be made.</p><p>( %reset_password_url% )</p><p>Best Regards,</p><p>Team %user_login%</p>'; |
| 2266 |
|
| 2267 |
$update['user_message_email_email_edit_verification'] = '<p>Hello %user_login%,</p><p>We have received a request to change the email address for your account on %blogname%.</p><p>Old Email Address: %user_email%<br/>New Email Address: %user_new_email%. </p><p>Please use the link below to complete this change.</p><p>(%reset_email_url%)</p><p>Thanks</p><p>%blogname%<br/></p>'; |
| 2268 |
|
| 2269 |
$update['user_message_email_current_email_verification'] = '<p>Hello %user_login%,</p><p>We have received a request to change the email address for your account on %blogname%.</p><p>Old Email Address: %user_email%<br/> New Email Address: %user_new_email%. </p><p>If you requested this change, please use the link below to complete the action. Otherwise please ignore this email and the change will not be made.</p><p>(%confirm_current_email_url%)</p><p>Thanks</p><p>%blogname%<br/></p>'; |
| 2270 |
|
| 2271 |
$update['user_message_email_user_verification_rejected'] = '<p>Dear %user_login%,</p><p>We noticed that you created an account on %blogname% but your account has not been verified. </p><p>Please contact site administrator.</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2272 |
|
| 2273 |
$update['user_message_email_user_subscription_activated'] = '<p>Dear %user_login%,</p><p>Your subscription has been activated. </p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2274 |
|
| 2275 |
$update['user_message_email_user_subscription_cancelled'] = '<p>Dear %user_login%,</p><p>Your subscription has been cancelled, and your card will no longer be charged!</p><p>Best Wishes,</p><p>Team %blogname%</p>'; |
| 2276 |
//Reset_all_pie_register_settings |
| 2277 |
update_option(OPTION_PIE_REGISTER, $update ); |
| 2278 |
$this->set_pr_global_options( $update, OPTION_PIE_REGISTER ); |
| 2279 |
} |
| 2280 |
function pie_registration_url($url=false) |
| 2281 |
{ |
| 2282 |
$this->pr_get_WP_Rewrite(); |
| 2283 |
|
| 2284 |
global $PR_GLOBAL_OPTIONS; |
| 2285 |
$options = $PR_GLOBAL_OPTIONS; |
| 2286 |
$pie_registration_url = get_permalink($options['alternate_register']); |
| 2287 |
return ($pie_registration_url)? $pie_registration_url : wp_registration_url(); |
| 2288 |
} |
| 2289 |
static function static_pie_registration_url($url=false) |
| 2290 |
{ |
| 2291 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 2292 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 2293 |
|
| 2294 |
global $PR_GLOBAL_OPTIONS; |
| 2295 |
$options = $PR_GLOBAL_OPTIONS; |
| 2296 |
$pie_registration_url = get_permalink($options['alternate_register']); |
| 2297 |
return ($pie_registration_url)? $pie_registration_url : wp_registration_url(); |
| 2298 |
} |
| 2299 |
function pie_login_url($url=false) |
| 2300 |
{ |
| 2301 |
global $PR_GLOBAL_OPTIONS; |
| 2302 |
$options = $PR_GLOBAL_OPTIONS; |
| 2303 |
$this->pr_get_WP_Rewrite(); |
| 2304 |
|
| 2305 |
$pie_login_url = $this->get_page_uri($options['alternate_login']); |
| 2306 |
$redirect_to_url = explode("?redirect_to=",$url); |
| 2307 |
|
| 2308 |
if(isset($redirect_to_url[1]) && !empty($redirect_to_url[1])){ |
| 2309 |
$pie_login_url = $this->pie_modify_custom_url($pie_login_url,"redirect_to=".(urlencode($redirect_to_url[1])) ); |
| 2310 |
}else{ |
| 2311 |
if (doing_filter('login_url')) { |
| 2312 |
$pie_login_url = $pie_login_url; |
| 2313 |
} else{ |
| 2314 |
$current_page_uri = $this->get_current_permalink(); |
| 2315 |
$current_page_uri = ( (!empty($current_page_uri)) ? $current_page_uri : $this->piereg_get_current_url() ); |
| 2316 |
$pie_login_url = $this->pie_modify_custom_url($pie_login_url,"redirect_to=".(urlencode($current_page_uri)) ); |
| 2317 |
} |
| 2318 |
} |
| 2319 |
|
| 2320 |
return ( ($pie_login_url)? $pie_login_url : ( (!empty($url))?$url:wp_login_url() ) ); |
| 2321 |
} |
| 2322 |
function static_pie_login_url($url=false) |
| 2323 |
{ |
| 2324 |
global $PR_GLOBAL_OPTIONS; |
| 2325 |
$options = $PR_GLOBAL_OPTIONS; |
| 2326 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 2327 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 2328 |
|
| 2329 |
$pie_login_url = PieReg_Base::static_get_page_uri($options['alternate_login']); |
| 2330 |
|
| 2331 |
$redirect_to_url = explode("?redirect_to=",$url); |
| 2332 |
|
| 2333 |
if(isset($redirect_to_url[1]) && !empty($redirect_to_url[1])){ |
| 2334 |
$pie_login_url = PieReg_Base::static_pie_modify_custom_url($pie_login_url,"redirect_to=".(urlencode($redirect_to_url[1])) ); |
| 2335 |
}else{ |
| 2336 |
$current_page_uri = PieReg_Base::static_get_current_permalink(); |
| 2337 |
$current_page_uri = ( (!empty($current_page_uri)) ? $current_page_uri : $this->piereg_get_current_url() ); |
| 2338 |
$pie_login_url = PieReg_Base::static_pie_modify_custom_url($pie_login_url,"redirect_to=".(urlencode($current_page_uri)) ); |
| 2339 |
} |
| 2340 |
|
| 2341 |
return ( ($pie_login_url)? $pie_login_url : ( (!empty($url))?$url:wp_login_url() ) ); |
| 2342 |
} |
| 2343 |
function pie_lostpassword_url($url=false) |
| 2344 |
{ |
| 2345 |
$this->pr_get_WP_Rewrite(); |
| 2346 |
|
| 2347 |
global $PR_GLOBAL_OPTIONS; |
| 2348 |
$options = $PR_GLOBAL_OPTIONS; |
| 2349 |
$pie_lostpass_url = get_permalink($options['alternate_forgotpass']); |
| 2350 |
return ($pie_lostpass_url)? $pie_lostpass_url : wp_lostpassword_url(); |
| 2351 |
} |
| 2352 |
static function static_pie_lostpassword_url($url=false) |
| 2353 |
{ |
| 2354 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 2355 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 2356 |
|
| 2357 |
global $PR_GLOBAL_OPTIONS; |
| 2358 |
$options = $PR_GLOBAL_OPTIONS; |
| 2359 |
$pie_lostpass_url = get_permalink($options['alternate_forgotpass']); |
| 2360 |
return ($pie_lostpass_url)? $pie_lostpass_url : wp_lostpassword_url(); |
| 2361 |
} |
| 2362 |
function pie_add_logout_url_nonce($items){ |
| 2363 |
foreach($items as $item){ |
| 2364 |
if( strpos( $item->url, 'piereg_logout_url=true' ) !== false){ |
| 2365 |
$item->url = $item->url . '&_logout_nonce=' . wp_create_nonce( 'pie-log-out' ); |
| 2366 |
} |
| 2367 |
} |
| 2368 |
return $items; |
| 2369 |
} |
| 2370 |
function piereg_logout_url($url,$redirect) |
| 2371 |
{ |
| 2372 |
$options = $this->get_pr_global_options(); |
| 2373 |
$this->pr_get_WP_Rewrite(); |
| 2374 |
$this->piereg_get_wp_plugable_file(); |
| 2375 |
|
| 2376 |
/* |
| 2377 |
* Get after Log Out url by current user role |
| 2378 |
*/ |
| 2379 |
$log_out_url = ""; |
| 2380 |
$log_out_page_id = ""; |
| 2381 |
|
| 2382 |
if(!empty($log_out_url) && ($log_out_page_id == 0 || $log_out_page_id == "")){ |
| 2383 |
$redirect = trim($log_out_url); |
| 2384 |
} |
| 2385 |
elseif(!empty($log_out_page_id) && $log_out_page_id > 0){ |
| 2386 |
$redirect = $this->get_page_uri(intval($log_out_page_id)); |
| 2387 |
} |
| 2388 |
elseif( $options['alternate_logout'] == 'url' && !empty($options['alternate_logout_url'])){ |
| 2389 |
$piereg_after_redirect_page = $options['alternate_logout_url']; |
| 2390 |
$redirect = $piereg_after_redirect_page; |
| 2391 |
} |
| 2392 |
elseif( intval($options['alternate_logout']) > 0 && $options['alternate_logout'] != 'url'){ |
| 2393 |
$piereg_after_redirect_page = (intval($options['alternate_logout']) <= 0)? wp_logout_url() : $this->get_page_uri($options['alternate_logout']); |
| 2394 |
$redirect = $piereg_after_redirect_page; |
| 2395 |
} |
| 2396 |
elseif(isset($_GET['redirect_to']) && $_GET['redirect_to'] != ""){ |
| 2397 |
$redirect = esc_url_raw($_GET['redirect_to']); |
| 2398 |
} |
| 2399 |
|
| 2400 |
if(empty($redirect)) |
| 2401 |
$redirect = home_url(); |
| 2402 |
|
| 2403 |
$redirect = urlencode($redirect); |
| 2404 |
$new_logout_url = home_url() . '/?piereg_logout_url=true&redirect_to=' . $redirect . '&_logout_nonce=' . wp_create_nonce( 'pie-log-out' ); |
| 2405 |
return $new_logout_url; |
| 2406 |
} |
| 2407 |
static function static_piereg_logout_url($url,$redirect="") |
| 2408 |
{ |
| 2409 |
$options = self::get_pr_global_options(); |
| 2410 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 2411 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 2412 |
self::piereg_get_wp_plugable_file(); |
| 2413 |
|
| 2414 |
$log_out_url = ""; |
| 2415 |
$log_out_page_id = ""; |
| 2416 |
|
| 2417 |
if(!empty($log_out_url) && ($log_out_page_id == 0 || $log_out_page_id == "")){ |
| 2418 |
$redirect = trim($log_out_url); |
| 2419 |
} |
| 2420 |
elseif(!empty($log_out_page_id) && $log_out_page_id > 0){ |
| 2421 |
$redirect = self::get_page_uri(intval($log_out_page_id)); |
| 2422 |
} |
| 2423 |
elseif( $options['alternate_logout'] == 'url' && !empty($options['alternate_logout_url']) ){ |
| 2424 |
$piereg_after_redirect_page = $options['alternate_logout_url']; |
| 2425 |
$redirect = $piereg_after_redirect_page; |
| 2426 |
} |
| 2427 |
elseif( $options['alternate_logout'] > 0 && $options['alternate_logout'] != 'url' ){ |
| 2428 |
$piereg_after_redirect_page = (intval($options['alternate_logout']) <= 0)? wp_logout_url() : self::get_page_uri($options['alternate_logout']); |
| 2429 |
$redirect = $piereg_after_redirect_page; |
| 2430 |
} |
| 2431 |
elseif(isset($_GET['redirect_to']) && $_GET['redirect_to'] != ""){ |
| 2432 |
$redirect = esc_url_raw($_GET['redirect_to']); |
| 2433 |
} |
| 2434 |
|
| 2435 |
if(empty($redirect)) |
| 2436 |
$redirect = home_url(); |
| 2437 |
|
| 2438 |
$redirect = urlencode($redirect); |
| 2439 |
$new_logout_url = home_url() . '/?piereg_logout_url=true&redirect_to=' . $redirect . '&=_logout_nonce=' . wp_create_nonce( 'pie-log-out' ); |
| 2440 |
return $new_logout_url; |
| 2441 |
} |
| 2442 |
function pie_modify_custom_url($get_url,$query_string=false){ |
| 2443 |
$get_url = trim($get_url); |
| 2444 |
if(!$get_url) return false; |
| 2445 |
|
| 2446 |
if(strpos($get_url,"?")) |
| 2447 |
$url = $get_url."&".$query_string; |
| 2448 |
else |
| 2449 |
$url = $get_url."?".$query_string; |
| 2450 |
|
| 2451 |
return $url; |
| 2452 |
} |
| 2453 |
static function static_pie_modify_custom_url($get_url,$query_string=false){ |
| 2454 |
$get_url = trim($get_url); |
| 2455 |
if(!$get_url) return false; |
| 2456 |
|
| 2457 |
if(strpos($get_url,"?")) |
| 2458 |
$url = $get_url."&".$query_string; |
| 2459 |
else |
| 2460 |
$url = $get_url."?".$query_string; |
| 2461 |
|
| 2462 |
return $url; |
| 2463 |
} |
| 2464 |
// get current URL |
| 2465 |
function piereg_get_current_url($query_string = "") { |
| 2466 |
$current_url = 'http'; |
| 2467 |
$server_https = isset($_SERVER["HTTPS"]) ? sanitize_text_field(wp_unslash($_SERVER["HTTPS"])) : ""; |
| 2468 |
$server_name = sanitize_text_field($_SERVER["SERVER_NAME"]); |
| 2469 |
$server_port = sanitize_text_field($_SERVER["SERVER_PORT"]); |
| 2470 |
$request_uri = esc_url_raw($_SERVER["REQUEST_URI"]); |
| 2471 |
if (strtolower($server_https) == "on") |
| 2472 |
$current_url .= "s"; |
| 2473 |
$current_url .= "://"; |
| 2474 |
if ($server_port != "80") |
| 2475 |
$current_url .= $server_name . ":" . $server_port . $request_uri; |
| 2476 |
else |
| 2477 |
$current_url .= $server_name . $request_uri; |
| 2478 |
|
| 2479 |
if(!empty($query_string)) |
| 2480 |
return $this->pie_modify_custom_url($current_url,$query_string); |
| 2481 |
|
| 2482 |
return $current_url; |
| 2483 |
} |
| 2484 |
function piereg_validate_files($file_info,$extantion_array = array()) |
| 2485 |
{ |
| 2486 |
$result = false; |
| 2487 |
$extantion_array = array_map("trim",$extantion_array); |
| 2488 |
$result = in_array(pathinfo($file_info,PATHINFO_EXTENSION),$extantion_array); |
| 2489 |
$result = (trim($result))? $result : false; |
| 2490 |
return $result; |
| 2491 |
} |
| 2492 |
|
| 2493 |
function pie_profile_pictures_upload($user_id,$field,$field_slug,$form_id=0){ |
| 2494 |
global $errors; |
| 2495 |
$errors = new WP_Error(); |
| 2496 |
if( isset($_FILES[$field_slug]['name']) && $_FILES[$field_slug]['name'] != ''){ |
| 2497 |
////////////////////////////UPLOAD PROFILE PICTURE////////////////////////////// |
| 2498 |
$allowedExts = array("gif", "GIF", "jpeg", "JPEG", "jpg", "JPG", "png", "PNG", "bmp", "BMP" ); |
| 2499 |
$result = $this->piereg_validate_files(sanitize_file_name($_FILES[$field_slug]['name']),$allowedExts); |
| 2500 |
if($result) |
| 2501 |
{ |
| 2502 |
$temp = explode(".", sanitize_file_name($_FILES[$field_slug]["name"])); |
| 2503 |
$extension = end($temp); |
| 2504 |
$upload_dir = wp_upload_dir(); |
| 2505 |
$temp_dir = realpath($upload_dir['basedir'])."/piereg_users_files/".$user_id; |
| 2506 |
wp_mkdir_p($temp_dir); |
| 2507 |
$temp_file_name = sanitize_file_name("profile_pic_".abs( crc32( wp_generate_password( wp_rand(7,12) ) ."_".time() ) )."_".$form_id.".".$extension); |
| 2508 |
$temp_file_url = $upload_dir['baseurl']."/piereg_users_files/".$user_id."/".$temp_file_name; |
| 2509 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2510 |
if(!$wp_filesystem->move($_FILES[$field_slug]['tmp_name'],$temp_dir."/".$temp_file_name)){ |
| 2511 |
$errors->add( $field_slug , '<strong>'.esc_html(ucwords(__('error','pie-register'))).'</strong>: '.apply_filters("piereg_fail_to_upload_profile picture",__('Failed to upload the profile picture.','pie-register' ))); |
| 2512 |
}else{ |
| 2513 |
/*Upload Index.html file on User dir*/ |
| 2514 |
$this->upload_forbidden_html_file( realpath($upload_dir['basedir'])."/piereg_users_files" ); |
| 2515 |
/*Upload Index.html file on User dir*/ |
| 2516 |
$this->upload_forbidden_html_file( $temp_dir ); |
| 2517 |
|
| 2518 |
$old_picture = get_user_meta($user_id,"pie_".$field_slug, true); |
| 2519 |
if( !empty($old_picture) ){ |
| 2520 |
if( $wp_filesystem->exists($temp_dir."/".basename( $old_picture )) ){ |
| 2521 |
$wp_filesystem->delete( $temp_dir."/".basename( $old_picture ) ); |
| 2522 |
} |
| 2523 |
} |
| 2524 |
update_user_meta($user_id,"pie_".$field_slug, $temp_file_url); |
| 2525 |
$this->pie_success = 1; |
| 2526 |
} |
| 2527 |
|
| 2528 |
}else{ |
| 2529 |
$errors->add( $field_slug , '<strong>'.esc_html(ucwords(__('error','pie-register'))).'</strong>: '.apply_filters("piereg_invalid_file_type_in_profile_picture",__('Invalid file type used for profile picture.','pie-register' ))); |
| 2530 |
$this->pie_error = 1; |
| 2531 |
} |
| 2532 |
}else{ |
| 2533 |
update_user_meta($user_id,"pie_".$field_slug, ""); |
| 2534 |
} |
| 2535 |
|
| 2536 |
} |
| 2537 |
function upload_forbidden_html_file($dir_name){ |
| 2538 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2539 |
if( !empty($dir_name) && !$wp_filesystem->exists($dir_name."/index.html") ){ |
| 2540 |
$content = "<html><head><title>Forbidden</title></head><body><h1>Forbidden</h1><p>You Don't have permission to access on this server</p></body></html>"; |
| 2541 |
$wp_filesystem->put_contents($dir_name."/index.html", $content, 0644); |
| 2542 |
} |
| 2543 |
} |
| 2544 |
function pie_remove_upload($user_id,$field,$field_slug) { |
| 2545 |
$upload_dir = wp_upload_dir(); |
| 2546 |
$temp_dir = realpath($upload_dir['basedir'])."/piereg_users_files/".$user_id; |
| 2547 |
$file = get_user_meta($user_id,"pie_".$field_slug, true); |
| 2548 |
if ( is_array($file) ) |
| 2549 |
{ |
| 2550 |
$file = $file[0]; |
| 2551 |
} |
| 2552 |
if( !empty($file ) ){ |
| 2553 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2554 |
if( $wp_filesystem->exists($temp_dir."/".basename( $file )) ){ |
| 2555 |
$wp_filesystem->delete( $temp_dir."/".basename( $file ) ); |
| 2556 |
} else if ( $wp_filesystem->exists($temp_dir."/".'pie_'.$field_slug."/".basename( $file )) ) { |
| 2557 |
$this->delete_directory( realpath($temp_dir."/".'pie_'.$field_slug)); |
| 2558 |
} |
| 2559 |
} |
| 2560 |
delete_user_meta($user_id,"pie_".$field_slug); |
| 2561 |
$this->pie_success = 1; |
| 2562 |
} |
| 2563 |
function pie_upload_files($user_id,$field,$field_slug,$form_id=0){ |
| 2564 |
global $errors; |
| 2565 |
$errors = new WP_Error(); |
| 2566 |
$result = false; |
| 2567 |
if($_FILES[$field_slug]['name'] != ''){ |
| 2568 |
///////////////////UPLOAD ALL FILES////////////////////////// |
| 2569 |
|
| 2570 |
if($field['file_types'] != ""){ |
| 2571 |
$filter_string = stripcslashes($field['file_types']); |
| 2572 |
$filter_array = explode(",",$filter_string); |
| 2573 |
$result = $this->piereg_validate_files(sanitize_file_name($_FILES[$field_slug]['name']),$filter_array); |
| 2574 |
|
| 2575 |
if($result){ |
| 2576 |
$temp = explode(".", sanitize_file_name($_FILES[$field_slug]["name"])); |
| 2577 |
$extension = end($temp); |
| 2578 |
$upload_dir = wp_upload_dir(); |
| 2579 |
$temp_dir = realpath($upload_dir['basedir'])."/piereg_users_files/".$user_id."/"."pie_".$field_slug.""; |
| 2580 |
wp_mkdir_p($temp_dir); |
| 2581 |
$temp_file_name = sanitize_file_name("file_".abs( crc32( wp_generate_password( wp_rand(7,12) ) ."_".time() ) )."_".$form_id.".".$extension); |
| 2582 |
$temp_file_url = $upload_dir['baseurl']."/piereg_users_files/".$user_id."/"."pie_".$field_slug."/".$temp_file_name; |
| 2583 |
|
| 2584 |
// Allowed Mime Types in WordPress |
| 2585 |
$allowed_mime_types = get_allowed_mime_types(); |
| 2586 |
$valid_mime_type = wp_check_filetype($temp_file_name,$allowed_mime_types); |
| 2587 |
|
| 2588 |
// Validate file extension type |
| 2589 |
$validate_file_ext_type = wp_check_filetype_and_ext( $temp_file_url, $temp_file_name ); |
| 2590 |
|
| 2591 |
if ( ( $valid_mime_type['type'] !== false ) && ( $validate_file_ext_type['ext'] !== false ) && ( $validate_file_ext_type['type'] !== false) ) |
| 2592 |
{ |
| 2593 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2594 |
if(!$wp_filesystem->move($_FILES[$field_slug]['tmp_name'],$temp_dir."/".$temp_file_name)){ |
| 2595 |
$errors->add( $field_slug , '<strong>'.__('Error','pie-register').'</strong>: '.apply_filters("piereg_Fail_to_upload_profile_picture",__('Failed to upload the profile picture.','pie-register' ))); |
| 2596 |
}else{ |
| 2597 |
/*Upload Index.html file on User dir*/ |
| 2598 |
$this->upload_forbidden_html_file( realpath($upload_dir['basedir'])."/piereg_users_files" ); |
| 2599 |
/*Upload Index.html file on User dir*/ |
| 2600 |
$this->upload_forbidden_html_file( $temp_dir ); |
| 2601 |
|
| 2602 |
$old_file = get_user_meta($user_id,"pie_".$field_slug, true); |
| 2603 |
if( !empty($old_file) ){ |
| 2604 |
$old_file = !is_array($old_file) ? $old_file : $old_file[0]; |
| 2605 |
if( $wp_filesystem->exists($temp_dir."/".basename( $old_file )) ){ |
| 2606 |
$wp_filesystem->delete( $temp_dir."/".basename( $old_file ) ); |
| 2607 |
} |
| 2608 |
} |
| 2609 |
update_user_meta($user_id,"pie_".$field_slug, $temp_file_url); |
| 2610 |
$this->pie_success = 1; |
| 2611 |
} |
| 2612 |
} |
| 2613 |
else |
| 2614 |
{ |
| 2615 |
$errors->add( $field_slug , '<strong>'.ucwords(__('error','pie-register')).'</strong>: '.apply_filters("piereg_fail_to_upload_profile_picture",__('File Type Is Not Permitted','pie-register' ))); |
| 2616 |
} |
| 2617 |
}else{ |
| 2618 |
$errors->add( $field_slug , '<strong>'.__('Error','pie-register').'</strong>: '.apply_filters("piereg_invalid_file",__('Invalid File.','pie-register' ))); |
| 2619 |
} |
| 2620 |
} |
| 2621 |
elseif($field['file_types'] == ""){ |
| 2622 |
$temp = explode(".", sanitize_file_name($_FILES[$field_slug]["name"])); |
| 2623 |
$extension = end($temp); |
| 2624 |
$upload_dir = wp_upload_dir(); |
| 2625 |
$temp_dir = realpath($upload_dir['basedir'])."/piereg_users_files/".$user_id."/"."pie_".$field_slug.""; |
| 2626 |
wp_mkdir_p($temp_dir); |
| 2627 |
$temp_file_name = sanitize_file_name("file_".abs( crc32( wp_generate_password( wp_rand(7,12) ) ."_".time() ) )."_".$form_id.".".$extension); |
| 2628 |
$temp_file_url = $upload_dir['baseurl']."/piereg_users_files/".$user_id."/"."pie_".$field_slug."/".$temp_file_name; |
| 2629 |
|
| 2630 |
// Allowed Mime Types in WordPress |
| 2631 |
$allowed_mime_types = get_allowed_mime_types(); |
| 2632 |
$valid_mime_type = wp_check_filetype($temp_file_name,$allowed_mime_types); |
| 2633 |
|
| 2634 |
// Validate file extension type |
| 2635 |
$validate_file_ext_type = wp_check_filetype_and_ext( $temp_file_url, $temp_file_name ); |
| 2636 |
|
| 2637 |
if ( ( $valid_mime_type['type'] !== false ) && ( $validate_file_ext_type['ext'] !== false ) && ( $validate_file_ext_type['type'] !== false) ) |
| 2638 |
{ |
| 2639 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2640 |
if(!$wp_filesystem->move($_FILES[$field_slug]['tmp_name'],$temp_dir."/".$temp_file_name)){ |
| 2641 |
$errors->add( $field_slug , '<strong>'.ucwords(__('error','pie-register')).'</strong>: '.apply_filters("piereg_fail_to_upload_profile_picture",__('Failed to upload the profile picture.','pie-register' ))); |
| 2642 |
}else{ |
| 2643 |
/*Upload Index.html file on User dir*/ |
| 2644 |
$this->upload_forbidden_html_file( realpath($upload_dir['basedir'])."/piereg_users_files" ); |
| 2645 |
/*Upload Index.html file on User dir*/ |
| 2646 |
$this->upload_forbidden_html_file( $temp_dir ); |
| 2647 |
|
| 2648 |
$old_file = get_user_meta($user_id,"pie_".$field_slug, true); |
| 2649 |
if( !empty($old_file) ){ |
| 2650 |
$old_file = !is_array($old_file) ? $old_file : $old_file[0]; |
| 2651 |
if( $wp_filesystem->exists($temp_dir."/".basename( $old_file )) ){ |
| 2652 |
$wp_filesystem->delete( $temp_dir."/".basename( $old_file ) ); |
| 2653 |
} |
| 2654 |
} |
| 2655 |
update_user_meta($user_id,"pie_".$field_slug, $temp_file_url); |
| 2656 |
$this->pie_success = 1; |
| 2657 |
} |
| 2658 |
} |
| 2659 |
else |
| 2660 |
{ |
| 2661 |
$errors->add( $field_slug , '<strong>'.ucwords(__('error','pie-register')).'</strong>: '.apply_filters("piereg_fail_to_upload_profile_picture",__('File Type Is Not Permitted','pie-register' ))); |
| 2662 |
} |
| 2663 |
} |
| 2664 |
}else{ |
| 2665 |
update_user_meta($user_id,"pie_".$field_slug, ""); |
| 2666 |
} |
| 2667 |
} |
| 2668 |
function delete_directory($dirname) { |
| 2669 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2670 |
if ($wp_filesystem->is_dir($dirname)) { |
| 2671 |
return $wp_filesystem->rmdir($dirname, true); |
| 2672 |
} |
| 2673 |
return false; |
| 2674 |
} |
| 2675 |
private function pie_get_filesystem() { |
| 2676 |
global $wp_filesystem; |
| 2677 |
if ( empty( $wp_filesystem ) ) { |
| 2678 |
require_once( ABSPATH . 'wp-admin/includes/file.php' ); |
| 2679 |
WP_Filesystem(); |
| 2680 |
} |
| 2681 |
return $wp_filesystem; |
| 2682 |
} |
| 2683 |
/* |
| 2684 |
* Check SSL enable or not. And return true/false |
| 2685 |
*/ |
| 2686 |
function PR_IS_SSL(){ |
| 2687 |
$piereg_secure_cookie = false; |
| 2688 |
if ( !force_ssl_admin() && is_ssl() ) { |
| 2689 |
$piereg_secure_cookie = true; |
| 2690 |
force_ssl_admin(true); |
| 2691 |
} |
| 2692 |
return $piereg_secure_cookie; |
| 2693 |
} |
| 2694 |
function require_once_file($file_name = false) |
| 2695 |
{ |
| 2696 |
if($file_name) |
| 2697 |
{ |
| 2698 |
if(file_exists($file_name)) |
| 2699 |
require_once($file_name); |
| 2700 |
else |
| 2701 |
echo '<div style="background: none repeat scroll 0 0 rgb(252, 214, 214);border: 1px solid rgb(204, 204, 204);color: rgb(145, 7, 7);display: inline-block;margin: 5px 0;padding: 10px;width: auto;"><b>Warning :</b> File ( <b>'.esc_html(basename($file_name)).'</b> ) not found! [DIR : '.esc_html($file_name).']</div>'; |
| 2702 |
} |
| 2703 |
return false; |
| 2704 |
} |
| 2705 |
/* |
| 2706 |
* Error Logging |
| 2707 |
* Error_log Message Type |
| 2708 |
0 message is sent to PHP's system logger, using the Operating System's system logging mechanism or a file, depending on what the error_log configuration directive is set to. This is the default option. |
| 2709 |
1 message is sent by email to the address in the destination parameter. This is the only message type where the fourth parameter, extra_headers is used. |
| 2710 |
2 No longer an option. |
| 2711 |
3 message is appended to the file destination. A newline is not automatically added to the end of the message string. |
| 2712 |
4 message is sent directly to the SAPI logging handler. |
| 2713 |
*/ |
| 2714 |
function pr_error_log($error,$error_type = 'error',$message_type = 3){ |
| 2715 |
if(!$error) |
| 2716 |
return false; |
| 2717 |
|
| 2718 |
$file_dir = PIE_LOG_FILE; |
| 2719 |
if(!file_exists($file_dir)) |
| 2720 |
{ |
| 2721 |
return false; |
| 2722 |
} |
| 2723 |
|
| 2724 |
$error_header = "[".date_i18n("D d-m-Y H:i:s")."] [Client : ".sanitize_text_field(wp_unslash($_SERVER['REMOTE_ADDR']))."] [URI : ".esc_url_raw($_SERVER['REQUEST_URI'])."] [".$error_type."] "; |
| 2725 |
$error_message = $error_header.$error."\r\n\r\n"; |
| 2726 |
return error_log($error_message, $message_type, PIE_LOG_FILE."/piereg_log.log"); |
| 2727 |
} |
| 2728 |
function pr_payment_log($log_message,$file_name = "payment-log",$error_type = 'error',$message_type = 3){ |
| 2729 |
|
| 2730 |
// stoping payment logs - security reasons |
| 2731 |
return false; |
| 2732 |
|
| 2733 |
if(!$log_message) |
| 2734 |
return false; |
| 2735 |
|
| 2736 |
$file_dir = PIE_LOG_FILE; |
| 2737 |
if(!file_exists($file_dir)) |
| 2738 |
{ |
| 2739 |
return false; |
| 2740 |
} |
| 2741 |
|
| 2742 |
$log_message = $log_message."\r\n============================================\r\n"; |
| 2743 |
return error_log($log_message, $message_type, PIE_LOG_FILE."/".$file_name.".log"); |
| 2744 |
} |
| 2745 |
/* |
| 2746 |
* Return error info |
| 2747 |
*/ |
| 2748 |
function get_error_log_info($function = "",$line = "",$file = ""){ |
| 2749 |
return " [Function : ".($function)."] [Line : ".($line)."] [File : ".($file)."]"; |
| 2750 |
} |
| 2751 |
/* |
| 2752 |
* Set PR forms Stats |
| 2753 |
*/ |
| 2754 |
function set_pr_stats($stats,$type){ |
| 2755 |
if(!$stats || !$type) |
| 2756 |
return false; |
| 2757 |
|
| 2758 |
switch($stats){ |
| 2759 |
case "login": |
| 2760 |
case "forgot": |
| 2761 |
case "register": |
| 2762 |
if($type === "view" || $type === "used"){ |
| 2763 |
$piereg_stats = get_option(PIEREG_STATS_OPTION); |
| 2764 |
if(!isset($piereg_stats[$stats][$type])) |
| 2765 |
$piereg_stats[$stats][$type] = 1; |
| 2766 |
else |
| 2767 |
$piereg_stats[$stats][$type] = (intval($piereg_stats[$stats][$type]) + 1); |
| 2768 |
|
| 2769 |
update_option(PIEREG_STATS_OPTION,$piereg_stats); |
| 2770 |
return true; |
| 2771 |
} |
| 2772 |
return false; |
| 2773 |
break; |
| 2774 |
default: |
| 2775 |
return false; |
| 2776 |
break; |
| 2777 |
} |
| 2778 |
} |
| 2779 |
static function static_set_pr_stats($stats,$type){ |
| 2780 |
if(!$stats || !$type) |
| 2781 |
return false; |
| 2782 |
|
| 2783 |
switch($stats){ |
| 2784 |
case "login": |
| 2785 |
case "forgot": |
| 2786 |
case "register": |
| 2787 |
if($type === "view" || $type === "used"){ |
| 2788 |
$piereg_stats = get_option(PIEREG_STATS_OPTION); |
| 2789 |
if(!isset($piereg_stats[$stats][$type])) |
| 2790 |
$piereg_stats[$stats][$type] = 1; |
| 2791 |
else |
| 2792 |
$piereg_stats[$stats][$type] = (intval($piereg_stats[$stats][$type]) + 1); |
| 2793 |
|
| 2794 |
update_option(PIEREG_STATS_OPTION,$piereg_stats); |
| 2795 |
return true; |
| 2796 |
} |
| 2797 |
return false; |
| 2798 |
break; |
| 2799 |
default: |
| 2800 |
return false; |
| 2801 |
break; |
| 2802 |
} |
| 2803 |
} |
| 2804 |
/* |
| 2805 |
* Save currency name with array |
| 2806 |
*/ |
| 2807 |
function piereg_save_currency(){ |
| 2808 |
$old_currency_array = get_option(PIEREG_CURRENCY_OPTION); |
| 2809 |
$currency_array[0]["code"] = "AFN";$currency_array[0]["name"] = "Afghanistan Afghani"; |
| 2810 |
$currency_array[1]["code"] = "ALL";$currency_array[1]["name"] = "Albania Lek"; |
| 2811 |
$currency_array[2]["code"] = "DZD";$currency_array[2]["name"] = "Algeria Dinar"; |
| 2812 |
$currency_array[3]["code"] = "AOA";$currency_array[3]["name"] = "Angola Kwanza"; |
| 2813 |
$currency_array[4]["code"] = "ARS";$currency_array[4]["name"] = "Argentina Peso"; |
| 2814 |
$currency_array[5]["code"] = "AMD";$currency_array[5]["name"] = "Armenia Dram"; |
| 2815 |
$currency_array[6]["code"] = "AWG";$currency_array[6]["name"] = "Aruba Guilder"; |
| 2816 |
$currency_array[7]["code"] = "AUD";$currency_array[7]["name"] = "Australia Dollar"; |
| 2817 |
$currency_array[8]["code"] = "AZN";$currency_array[8]["name"] = "Azerbaijan New Manat"; |
| 2818 |
$currency_array[9]["code"] = "BSD";$currency_array[9]["name"] = "Bahamas Dollar"; |
| 2819 |
$currency_array[10]["code"] = "BHD";$currency_array[10]["name"] = "Bahrain Dinar"; |
| 2820 |
$currency_array[11]["code"] = "BDT";$currency_array[11]["name"] = "Bangladesh Taka"; |
| 2821 |
$currency_array[12]["code"] = "BBD";$currency_array[12]["name"] = "Barbados Dollar"; |
| 2822 |
$currency_array[13]["code"] = "BYR";$currency_array[13]["name"] = "Belarus Ruble"; |
| 2823 |
$currency_array[14]["code"] = "BZD";$currency_array[14]["name"] = "Belize Dollar"; |
| 2824 |
$currency_array[15]["code"] = "BMD";$currency_array[15]["name"] = "Bermuda Dollar"; |
| 2825 |
$currency_array[16]["code"] = "BTN";$currency_array[16]["name"] = "Bhutan Ngultrum"; |
| 2826 |
$currency_array[17]["code"] = "BOB";$currency_array[17]["name"] = "Bolivia Boliviano"; |
| 2827 |
$currency_array[18]["code"] = "BAM";$currency_array[18]["name"] = "Bosnia and Herzegovina Convertible Marka"; |
| 2828 |
$currency_array[19]["code"] = "BWP";$currency_array[19]["name"] = "Botswana Pula"; |
| 2829 |
$currency_array[20]["code"] = "BRL";$currency_array[20]["name"] = "Brazil Real"; |
| 2830 |
$currency_array[21]["code"] = "BND";$currency_array[21]["name"] = "Brunei Darussalam Dollar"; |
| 2831 |
$currency_array[22]["code"] = "BGN";$currency_array[22]["name"] = "Bulgaria Lev"; |
| 2832 |
$currency_array[23]["code"] = "BIF";$currency_array[23]["name"] = "Burundi Franc"; |
| 2833 |
$currency_array[24]["code"] = "KHR";$currency_array[24]["name"] = "Cambodia Riel"; |
| 2834 |
$currency_array[25]["code"] = "CAD";$currency_array[25]["name"] = "Canada Dollar"; |
| 2835 |
$currency_array[26]["code"] = "CVE";$currency_array[26]["name"] = "Cape Verde Escudo"; |
| 2836 |
$currency_array[27]["code"] = "KYD";$currency_array[27]["name"] = "Cayman Islands Dollar"; |
| 2837 |
$currency_array[28]["code"] = "CLP";$currency_array[28]["name"] = "Chile Peso"; |
| 2838 |
$currency_array[29]["code"] = "CNY";$currency_array[29]["name"] = "China Yuan Renminbi"; |
| 2839 |
$currency_array[30]["code"] = "COP";$currency_array[30]["name"] = "Colombia Peso"; |
| 2840 |
$currency_array[31]["code"] = "XOF";$currency_array[31]["name"] = "Communauté Financière Africaine (BCEAO) Franc"; |
| 2841 |
$currency_array[32]["code"] = "XAF";$currency_array[32]["name"] = "Communauté Financière Africaine (BEAC) CFA Franc BEAC"; |
| 2842 |
$currency_array[33]["code"] = "KMF";$currency_array[33]["name"] = "Comoros Franc"; |
| 2843 |
$currency_array[34]["code"] = "XPF";$currency_array[34]["name"] = "Comptoirs Français du Pacifique (CFP) Franc"; |
| 2844 |
$currency_array[35]["code"] = "CDF";$currency_array[35]["name"] = "Congo/Kinshasa Franc"; |
| 2845 |
$currency_array[36]["code"] = "CRC";$currency_array[36]["name"] = "Costa Rica Colon"; |
| 2846 |
$currency_array[37]["code"] = "HRK";$currency_array[37]["name"] = "Croatia Kuna"; |
| 2847 |
$currency_array[38]["code"] = "CUC";$currency_array[38]["name"] = "Cuba Convertible Peso"; |
| 2848 |
$currency_array[39]["code"] = "CUP";$currency_array[39]["name"] = "Cuba Peso"; |
| 2849 |
$currency_array[40]["code"] = "CZK";$currency_array[40]["name"] = "Czech Republic Koruna"; |
| 2850 |
$currency_array[41]["code"] = "DKK";$currency_array[41]["name"] = "Denmark Krone"; |
| 2851 |
$currency_array[42]["code"] = "DJF";$currency_array[42]["name"] = "Djibouti Franc"; |
| 2852 |
$currency_array[43]["code"] = "DOP";$currency_array[43]["name"] = "Dominican Republic Peso"; |
| 2853 |
$currency_array[44]["code"] = "XCD";$currency_array[44]["name"] = "East Caribbean Dollar"; |
| 2854 |
$currency_array[45]["code"] = "EGP";$currency_array[45]["name"] = "Egypt Pound"; |
| 2855 |
$currency_array[46]["code"] = "SVC";$currency_array[46]["name"] = "El Salvador Colon"; |
| 2856 |
$currency_array[47]["code"] = "ERN";$currency_array[47]["name"] = "Eritrea Nakfa"; |
| 2857 |
$currency_array[48]["code"] = "ETB";$currency_array[48]["name"] = "Ethiopia Birr"; |
| 2858 |
$currency_array[49]["code"] = "EUR";$currency_array[49]["name"] = "Euro Member Countries"; |
| 2859 |
$currency_array[50]["code"] = "FKP";$currency_array[50]["name"] = "Falkland Islands (Malvinas) Pound"; |
| 2860 |
$currency_array[51]["code"] = "FJD";$currency_array[51]["name"] = "Fiji Dollar"; |
| 2861 |
$currency_array[52]["code"] = "GMD";$currency_array[52]["name"] = "Gambia Dalasi"; |
| 2862 |
$currency_array[53]["code"] = "GEL";$currency_array[53]["name"] = "Georgia Lari"; |
| 2863 |
$currency_array[54]["code"] = "GHS";$currency_array[54]["name"] = "Ghana Cedi"; |
| 2864 |
$currency_array[55]["code"] = "GIP";$currency_array[55]["name"] = "Gibraltar Pound"; |
| 2865 |
$currency_array[56]["code"] = "GTQ";$currency_array[56]["name"] = "Guatemala Quetzal"; |
| 2866 |
$currency_array[57]["code"] = "GGP";$currency_array[57]["name"] = "Guernsey Pound"; |
| 2867 |
$currency_array[58]["code"] = "GNF";$currency_array[58]["name"] = "Guinea Franc"; |
| 2868 |
$currency_array[59]["code"] = "GYD";$currency_array[59]["name"] = "Guyana Dollar"; |
| 2869 |
$currency_array[60]["code"] = "HTG";$currency_array[60]["name"] = "Haiti Gourde"; |
| 2870 |
$currency_array[61]["code"] = "HNL";$currency_array[61]["name"] = "Honduras Lempira"; |
| 2871 |
$currency_array[62]["code"] = "HKD";$currency_array[62]["name"] = "Hong Kong Dollar"; |
| 2872 |
$currency_array[63]["code"] = "HUF";$currency_array[63]["name"] = "Hungary Forint"; |
| 2873 |
$currency_array[64]["code"] = "ISK";$currency_array[64]["name"] = "Iceland Krona"; |
| 2874 |
$currency_array[65]["code"] = "INR";$currency_array[65]["name"] = "India Rupee"; |
| 2875 |
$currency_array[66]["code"] = "IDR";$currency_array[66]["name"] = "Indonesia Rupiah"; |
| 2876 |
$currency_array[67]["code"] = "XDR";$currency_array[67]["name"] = "International Monetary Fund (IMF) Special Drawing Rights"; |
| 2877 |
$currency_array[68]["code"] = "IRR";$currency_array[68]["name"] = "Iran Rial"; |
| 2878 |
$currency_array[69]["code"] = "IQD";$currency_array[69]["name"] = "Iraq Dinar"; |
| 2879 |
$currency_array[70]["code"] = "IMP";$currency_array[70]["name"] = "Isle of Man Pound"; |
| 2880 |
$currency_array[71]["code"] = "ILS";$currency_array[71]["name"] = "Israel Shekel"; |
| 2881 |
$currency_array[72]["code"] = "JMD";$currency_array[72]["name"] = "Jamaica Dollar"; |
| 2882 |
$currency_array[73]["code"] = "JPY";$currency_array[73]["name"] = "Japan Yen"; |
| 2883 |
$currency_array[74]["code"] = "JEP";$currency_array[74]["name"] = "Jersey Pound"; |
| 2884 |
$currency_array[75]["code"] = "JOD";$currency_array[75]["name"] = "Jordan Dinar"; |
| 2885 |
$currency_array[76]["code"] = "KZT";$currency_array[76]["name"] = "Kazakhstan Tenge"; |
| 2886 |
$currency_array[77]["code"] = "KES";$currency_array[77]["name"] = "Kenya Shilling"; |
| 2887 |
$currency_array[78]["code"] = "KPW";$currency_array[78]["name"] = "Korea (North) Won"; |
| 2888 |
$currency_array[79]["code"] = "KRW";$currency_array[79]["name"] = "Korea (South) Won"; |
| 2889 |
$currency_array[80]["code"] = "KWD";$currency_array[80]["name"] = "Kuwait Dinar"; |
| 2890 |
$currency_array[81]["code"] = "KGS";$currency_array[81]["name"] = "Kyrgyzstan Som"; |
| 2891 |
$currency_array[82]["code"] = "LAK";$currency_array[82]["name"] = "Laos Kip"; |
| 2892 |
$currency_array[83]["code"] = "LBP";$currency_array[83]["name"] = "Lebanon Pound"; |
| 2893 |
$currency_array[84]["code"] = "LSL";$currency_array[84]["name"] = "Lesotho Loti"; |
| 2894 |
$currency_array[85]["code"] = "LRD";$currency_array[85]["name"] = "Liberia Dollar"; |
| 2895 |
$currency_array[86]["code"] = "LYD";$currency_array[86]["name"] = "Libya Dinar"; |
| 2896 |
$currency_array[87]["code"] = "MOP";$currency_array[87]["name"] = "Macau Pataca"; |
| 2897 |
$currency_array[88]["code"] = "MKD";$currency_array[88]["name"] = "Macedonia Denar"; |
| 2898 |
$currency_array[89]["code"] = "MGA";$currency_array[89]["name"] = "Madagascar Ariary"; |
| 2899 |
$currency_array[90]["code"] = "MWK";$currency_array[90]["name"] = "Malawi Kwacha"; |
| 2900 |
$currency_array[91]["code"] = "MYR";$currency_array[91]["name"] = "Malaysia Ringgit"; |
| 2901 |
$currency_array[92]["code"] = "MVR";$currency_array[92]["name"] = "Maldives (Maldive Islands) Rufiyaa"; |
| 2902 |
$currency_array[93]["code"] = "MRO";$currency_array[93]["name"] = "Mauritania Ouguiya"; |
| 2903 |
$currency_array[94]["code"] = "MUR";$currency_array[94]["name"] = "Mauritius Rupee"; |
| 2904 |
$currency_array[95]["code"] = "MXN";$currency_array[95]["name"] = "Mexico Peso"; |
| 2905 |
$currency_array[96]["code"] = "MDL";$currency_array[96]["name"] = "Moldova Leu"; |
| 2906 |
$currency_array[97]["code"] = "MNT";$currency_array[97]["name"] = "Mongolia Tughrik"; |
| 2907 |
$currency_array[98]["code"] = "MAD";$currency_array[98]["name"] = "Morocco Dirham"; |
| 2908 |
$currency_array[99]["code"] = "MZN";$currency_array[99]["name"] = "Mozambique Metical"; |
| 2909 |
$currency_array[100]["code"] = "MMK";$currency_array[100]["name"] = "Myanmar (Burma) Kyat"; |
| 2910 |
$currency_array[101]["code"] = "NAD";$currency_array[101]["name"] = "Namibia Dollar"; |
| 2911 |
$currency_array[102]["code"] = "NPR";$currency_array[102]["name"] = "Nepal Rupee"; |
| 2912 |
$currency_array[103]["code"] = "ANG";$currency_array[103]["name"] = "Netherlands Antilles Guilder"; |
| 2913 |
$currency_array[104]["code"] = "NZD";$currency_array[104]["name"] = "New Zealand Dollar"; |
| 2914 |
$currency_array[105]["code"] = "NIO";$currency_array[105]["name"] = "Nicaragua Cordoba"; |
| 2915 |
$currency_array[106]["code"] = "NGN";$currency_array[106]["name"] = "Nigeria Naira"; |
| 2916 |
$currency_array[107]["code"] = "NOK";$currency_array[107]["name"] = "Norway Krone"; |
| 2917 |
$currency_array[108]["code"] = "OMR";$currency_array[108]["name"] = "Oman Rial"; |
| 2918 |
$currency_array[109]["code"] = "PKR";$currency_array[109]["name"] = "Pakistan Rupee"; |
| 2919 |
$currency_array[110]["code"] = "PAB";$currency_array[110]["name"] = "Panama Balboa"; |
| 2920 |
$currency_array[111]["code"] = "PGK";$currency_array[111]["name"] = "Papua New Guinea Kina"; |
| 2921 |
$currency_array[112]["code"] = "PYG";$currency_array[112]["name"] = "Paraguay Guarani"; |
| 2922 |
$currency_array[113]["code"] = "PEN";$currency_array[113]["name"] = "Peru Nuevo Sol"; |
| 2923 |
$currency_array[114]["code"] = "PHP";$currency_array[114]["name"] = "Philippines Peso"; |
| 2924 |
$currency_array[115]["code"] = "PLN";$currency_array[115]["name"] = "Poland Zloty"; |
| 2925 |
$currency_array[116]["code"] = "QAR";$currency_array[116]["name"] = "Qatar Riyal"; |
| 2926 |
$currency_array[117]["code"] = "RON";$currency_array[117]["name"] = "Romania New Leu"; |
| 2927 |
$currency_array[118]["code"] = "RUB";$currency_array[118]["name"] = "Russia Ruble"; |
| 2928 |
$currency_array[119]["code"] = "RWF";$currency_array[119]["name"] = "Rwanda Franc"; |
| 2929 |
$currency_array[120]["code"] = "SHP";$currency_array[120]["name"] = "Saint Helena Pound"; |
| 2930 |
$currency_array[121]["code"] = "WST";$currency_array[121]["name"] = "Samoa Tala"; |
| 2931 |
$currency_array[122]["code"] = "SAR";$currency_array[122]["name"] = "Saudi Arabia Riyal"; |
| 2932 |
$currency_array[123]["code"] = "SPL*";$currency_array[123]["name"] = "Seborga Luigino"; |
| 2933 |
$currency_array[124]["code"] = "RSD";$currency_array[124]["name"] = "Serbia Dinar"; |
| 2934 |
$currency_array[125]["code"] = "SCR";$currency_array[125]["name"] = "Seychelles Rupee"; |
| 2935 |
$currency_array[126]["code"] = "SLL";$currency_array[126]["name"] = "Sierra Leone Leone"; |
| 2936 |
$currency_array[127]["code"] = "SGD";$currency_array[127]["name"] = "Singapore Dollar"; |
| 2937 |
$currency_array[128]["code"] = "SBD";$currency_array[128]["name"] = "Solomon Islands Dollar"; |
| 2938 |
$currency_array[129]["code"] = "SOS";$currency_array[129]["name"] = "Somalia Shilling"; |
| 2939 |
$currency_array[130]["code"] = "ZAR";$currency_array[130]["name"] = "South Africa Rand"; |
| 2940 |
$currency_array[131]["code"] = "LKR";$currency_array[131]["name"] = "Sri Lanka Rupee"; |
| 2941 |
$currency_array[132]["code"] = "SDG";$currency_array[132]["name"] = "Sudan Pound"; |
| 2942 |
$currency_array[133]["code"] = "SRD";$currency_array[133]["name"] = "Suriname Dollar"; |
| 2943 |
$currency_array[134]["code"] = "SZL";$currency_array[134]["name"] = "Swaziland Lilangeni"; |
| 2944 |
$currency_array[135]["code"] = "SEK";$currency_array[135]["name"] = "Sweden Krona"; |
| 2945 |
$currency_array[136]["code"] = "CHF";$currency_array[136]["name"] = "Switzerland Franc"; |
| 2946 |
$currency_array[137]["code"] = "SYP";$currency_array[137]["name"] = "Syria Pound"; |
| 2947 |
$currency_array[138]["code"] = "STD";$currency_array[138]["name"] = "São Tomé and PrÃncipe Dobra"; |
| 2948 |
$currency_array[139]["code"] = "TWD";$currency_array[139]["name"] = "Taiwan New Dollar"; |
| 2949 |
$currency_array[140]["code"] = "TJS";$currency_array[140]["name"] = "Tajikistan Somoni"; |
| 2950 |
$currency_array[141]["code"] = "TZS";$currency_array[141]["name"] = "Tanzania Shilling"; |
| 2951 |
$currency_array[142]["code"] = "THB";$currency_array[142]["name"] = "Thailand Baht"; |
| 2952 |
$currency_array[143]["code"] = "TOP";$currency_array[143]["name"] = "Tonga Pa'anga"; |
| 2953 |
$currency_array[144]["code"] = "TTD";$currency_array[144]["name"] = "Trinidad and Tobago Dollar"; |
| 2954 |
$currency_array[145]["code"] = "TND";$currency_array[145]["name"] = "Tunisia Dinar"; |
| 2955 |
$currency_array[146]["code"] = "TRY";$currency_array[146]["name"] = "Turkey Lira"; |
| 2956 |
$currency_array[147]["code"] = "TMT";$currency_array[147]["name"] = "Turkmenistan Manat"; |
| 2957 |
$currency_array[148]["code"] = "TVD";$currency_array[148]["name"] = "Tuvalu Dollar"; |
| 2958 |
$currency_array[149]["code"] = "UGX";$currency_array[149]["name"] = "Uganda Shilling"; |
| 2959 |
$currency_array[150]["code"] = "UAH";$currency_array[150]["name"] = "Ukraine Hryvnia"; |
| 2960 |
$currency_array[151]["code"] = "AED";$currency_array[151]["name"] = "United Arab Emirates Dirham"; |
| 2961 |
$currency_array[152]["code"] = "GBP";$currency_array[152]["name"] = "United Kingdom Pound"; |
| 2962 |
$currency_array[153]["code"] = "USD";$currency_array[153]["name"] = "United States Dollar"; |
| 2963 |
$currency_array[154]["code"] = "UYU";$currency_array[154]["name"] = "Uruguay Peso"; |
| 2964 |
$currency_array[155]["code"] = "UZS";$currency_array[155]["name"] = "Uzbekistan Som"; |
| 2965 |
$currency_array[156]["code"] = "VUV";$currency_array[156]["name"] = "Vanuatu Vatu"; |
| 2966 |
$currency_array[157]["code"] = "VEF";$currency_array[157]["name"] = "Venezuela Bolivar"; |
| 2967 |
$currency_array[158]["code"] = "VND";$currency_array[158]["name"] = "Viet Nam Dong"; |
| 2968 |
$currency_array[159]["code"] = "YER";$currency_array[159]["name"] = "Yemen Rial"; |
| 2969 |
$currency_array[160]["code"] = "ZMW";$currency_array[160]["name"] = "Zambia Kwacha"; |
| 2970 |
$currency_array[161]["code"] = "ZWD";$currency_array[161]["name"] = "Zimbabwe Dollar"; |
| 2971 |
update_option(PIEREG_CURRENCY_OPTION,$currency_array); |
| 2972 |
} |
| 2973 |
function read_upload_file($file_dir){ |
| 2974 |
|
| 2975 |
if(!file_exists($file_dir) || empty($file_dir)) |
| 2976 |
{ |
| 2977 |
$this->pie_post_array['error'] = __("File does not exist.","pie-register"); |
| 2978 |
return false; |
| 2979 |
} |
| 2980 |
|
| 2981 |
$wp_filesystem = $this->pie_get_filesystem(); |
| 2982 |
return $wp_filesystem->get_contents($file_dir); |
| 2983 |
} |
| 2984 |
function read_file_from_url($url){ |
| 2985 |
$FileData = ""; |
| 2986 |
//Read URL By WP_Http |
| 2987 |
//Use: To get google recaptcha on forms. |
| 2988 |
$request = wp_remote_get($url); |
| 2989 |
if ( is_array( $request ) && ! is_wp_error( $request ) ) { |
| 2990 |
$FileData = wp_remote_retrieve_body( $request ); |
| 2991 |
} |
| 2992 |
|
| 2993 |
return $FileData; |
| 2994 |
} |
| 2995 |
function get_pr_forms_info() |
| 2996 |
{ |
| 2997 |
$pr_form = array(); |
| 2998 |
$fields_id = get_option("piereg_form_fields_id"); |
| 2999 |
if(!empty($fields_id)) |
| 3000 |
{ |
| 3001 |
$count = 0; |
| 3002 |
for($a=1;$a<=$fields_id;$a++) |
| 3003 |
{ |
| 3004 |
$option = get_option("piereg_form_field_option_".$a); |
| 3005 |
if( !empty($option) && is_array($option) && isset($option['Id']) && (!isset($option['IsDeleted']) || trim($option['IsDeleted']) != 1) ) |
| 3006 |
$pr_form[$a] = $option; |
| 3007 |
} |
| 3008 |
} |
| 3009 |
return $pr_form; |
| 3010 |
} |
| 3011 |
// since 3.7.0.0 |
| 3012 |
// Gets form(s) by checking the LK |
| 3013 |
// TODO: Simplify |
| 3014 |
function get_pr_forms_info_check() |
| 3015 |
{ |
| 3016 |
$pr_form = array(); |
| 3017 |
$fields_id = get_option("piereg_form_fields_id"); |
| 3018 |
if(!empty($fields_id)) |
| 3019 |
{ |
| 3020 |
$count = 0; |
| 3021 |
for($a=1;$a<=$fields_id;$a++) |
| 3022 |
{ |
| 3023 |
$option = get_option("piereg_form_field_option_".$a); |
| 3024 |
if( !empty($option) && is_array($option) && isset($option['Id']) && (!isset($option['IsDeleted']) || trim($option['IsDeleted']) != 1) ) |
| 3025 |
$pr_form[$a] = $option; |
| 3026 |
|
| 3027 |
if(!$this->piereg_pro_is_activate) |
| 3028 |
break; |
| 3029 |
|
| 3030 |
} |
| 3031 |
} |
| 3032 |
return $pr_form; |
| 3033 |
} |
| 3034 |
function get_page_uri($page_id, $query_string = ""){ |
| 3035 |
$this->pr_get_WP_Rewrite(); |
| 3036 |
if(!empty($query_string)) |
| 3037 |
return $this->pie_modify_custom_url(get_permalink($page_id),$query_string); |
| 3038 |
else |
| 3039 |
return get_permalink(intval($page_id)); |
| 3040 |
} |
| 3041 |
static function static_get_page_uri($page_id, $query_string = ""){ |
| 3042 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 3043 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 3044 |
|
| 3045 |
if(!empty($query_string)) |
| 3046 |
return PieReg_Base::static_pie_modify_custom_url(get_permalink($page_id),$query_string); |
| 3047 |
else |
| 3048 |
return get_permalink(intval($page_id)); |
| 3049 |
} |
| 3050 |
function get_current_permalink(){ |
| 3051 |
$this->pr_get_WP_Rewrite(); |
| 3052 |
return get_permalink(); |
| 3053 |
} |
| 3054 |
static function static_get_current_permalink(){ |
| 3055 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 3056 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 3057 |
|
| 3058 |
return get_permalink(); |
| 3059 |
} |
| 3060 |
function pr_get_WP_Rewrite(){ |
| 3061 |
if ( empty( $GLOBALS['wp_rewrite'] ) ) |
| 3062 |
$GLOBALS['wp_rewrite'] = new WP_Rewrite(); |
| 3063 |
} |
| 3064 |
function include_pr_menu_pages($page_dir = false){ |
| 3065 |
$this->require_once_file($page_dir); |
| 3066 |
} |
| 3067 |
|
| 3068 |
function piereg_get_wp_plugable_file( $required = false, $file_name = "",$function_name = ""){ |
| 3069 |
if($file_name == "" || $function_name = ""){ |
| 3070 |
if(!function_exists('wp_get_current_user')) { |
| 3071 |
if($required) { |
| 3072 |
require_once(ABSPATH . WPINC . "/pluggable.php"); |
| 3073 |
} else { |
| 3074 |
include(ABSPATH . WPINC . "/pluggable.php"); |
| 3075 |
} |
| 3076 |
} |
| 3077 |
} |
| 3078 |
elseif(!function_exists($function_name)) { |
| 3079 |
if(file_exists(ABSPATH . WPINC . "/". $file_name.".php")) |
| 3080 |
include(ABSPATH . WPINC . "/".$file_name.".php"); |
| 3081 |
} |
| 3082 |
} |
| 3083 |
|
| 3084 |
/* |
| 3085 |
* Get currency code for payment method |
| 3086 |
*/ |
| 3087 |
function pr_get_currency_code($option = array()){ |
| 3088 |
if( empty($option) || !is_array($option) ) |
| 3089 |
$options = $this->get_pr_global_options(); |
| 3090 |
|
| 3091 |
return ( ( isset($options['currency']) && !empty($options['currency']) ) ? $options['currency'] : 'USD' ); |
| 3092 |
} |
| 3093 |
|
| 3094 |
/* |
| 3095 |
* Get and Update User Payment Log |
| 3096 |
*/ |
| 3097 |
function update_user_payment_log($user_id,$payment_log){ |
| 3098 |
if( empty($user_id) || empty($payment_log) || !is_array($payment_log) ) |
| 3099 |
return false; |
| 3100 |
|
| 3101 |
$old_payment_log = $this->get_user_payment_log( $user_id ); |
| 3102 |
$payment_log_array = array(); |
| 3103 |
|
| 3104 |
if(!empty($old_payment_log)) |
| 3105 |
$payment_log_array = $old_payment_log; |
| 3106 |
|
| 3107 |
$payment_log_array[] = $payment_log; |
| 3108 |
update_user_meta( $user_id, "piereg_user_payment_log", $payment_log_array); |
| 3109 |
return $payment_log_array; |
| 3110 |
} |
| 3111 |
function get_user_payment_log($user_id){ |
| 3112 |
if( empty($user_id) ) |
| 3113 |
return false; |
| 3114 |
$payment_log = get_user_meta( $user_id, "piereg_user_payment_log", true ); |
| 3115 |
return $payment_log; |
| 3116 |
} |
| 3117 |
|
| 3118 |
/* |
| 3119 |
* Sanitize All Post Fields |
| 3120 |
*/ |
| 3121 |
function piereg_sanitize_post_data_escape($post = array()){ |
| 3122 |
if(!is_array($post) || empty($post)) |
| 3123 |
return false; |
| 3124 |
|
| 3125 |
foreach($post as $key=>$val){ |
| 3126 |
if( isset($_POST[$key]) && strpos($key,"username") !== false ){ |
| 3127 |
$post[$key] = sanitize_user($_POST[$key]); |
| 3128 |
}elseif( isset($_POST[$key]) && ( strpos($key,"email") !== false || strpos($key,"e_mail") !== false ) ){ |
| 3129 |
$post[$key] = sanitize_email($_POST[$key]); |
| 3130 |
}elseif( isset($_POST[$key]) ){ |
| 3131 |
$post[$key] = $this->piereg_post_array_filter($_POST[$key]); |
| 3132 |
} |
| 3133 |
} |
| 3134 |
|
| 3135 |
return $post; |
| 3136 |
} |
| 3137 |
|
| 3138 |
function piereg_sanitize_post_data($form = '',$post = array()){ |
| 3139 |
if(!is_array($post) || empty($post) || $form == '') |
| 3140 |
return false; |
| 3141 |
|
| 3142 |
|
| 3143 |
switch ($form) { |
| 3144 |
case 'payment_gateway_page': |
| 3145 |
|
| 3146 |
foreach ($post as $key => $value) |
| 3147 |
{ |
| 3148 |
switch ($key) |
| 3149 |
{ |
| 3150 |
case 'enable_paypal': |
| 3151 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3152 |
break; |
| 3153 |
|
| 3154 |
case 'piereg_paypal_butt_id': |
| 3155 |
case 'piereg_paypal_sandbox': |
| 3156 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3157 |
break; |
| 3158 |
|
| 3159 |
default: |
| 3160 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3161 |
break; |
| 3162 |
} |
| 3163 |
} |
| 3164 |
|
| 3165 |
break; |
| 3166 |
|
| 3167 |
case 'payment_gateway_general_settings': |
| 3168 |
|
| 3169 |
foreach ($post as $key => $value) |
| 3170 |
{ |
| 3171 |
switch ($key) |
| 3172 |
{ |
| 3173 |
case 'payment_success_msg': |
| 3174 |
case 'payment_faild_msg': |
| 3175 |
case 'payment_renew_msg': |
| 3176 |
case 'payment_already_activate_msg': |
| 3177 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3178 |
break; |
| 3179 |
|
| 3180 |
default: |
| 3181 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3182 |
break; |
| 3183 |
} |
| 3184 |
} |
| 3185 |
|
| 3186 |
break; |
| 3187 |
|
| 3188 |
case 'admin_email_notification_page': |
| 3189 |
|
| 3190 |
foreach ($post as $key => $value) |
| 3191 |
{ |
| 3192 |
switch ($key) |
| 3193 |
{ |
| 3194 |
case 'admin_from_name': |
| 3195 |
case 'admin_subject_email': |
| 3196 |
case 'admin_subject_email_profile_update': |
| 3197 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3198 |
break; |
| 3199 |
|
| 3200 |
case 'admin_sendto_email': |
| 3201 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3202 |
break; |
| 3203 |
|
| 3204 |
case 'admin_to_email': |
| 3205 |
case 'admin_bcc_email': |
| 3206 |
$post[$key] = $this->sanitize_validate_as('email',$value); |
| 3207 |
break; |
| 3208 |
|
| 3209 |
case 'enable_admin_notifications': |
| 3210 |
case 'enable_admin_notifications_profile_update': |
| 3211 |
case 'enable_admin_notifications_cancel_subscription': |
| 3212 |
case 'admin_message_email_formate': |
| 3213 |
case 'admin_message_email_formate_profile_update': |
| 3214 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3215 |
break; |
| 3216 |
|
| 3217 |
case 'admin_message_email': |
| 3218 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3219 |
break; |
| 3220 |
|
| 3221 |
default: |
| 3222 |
//$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3223 |
break; |
| 3224 |
} |
| 3225 |
} |
| 3226 |
|
| 3227 |
break; |
| 3228 |
|
| 3229 |
case 'user_email_notification_page': |
| 3230 |
|
| 3231 |
foreach ($post as $key => $value) |
| 3232 |
{ |
| 3233 |
switch ($key) |
| 3234 |
{ |
| 3235 |
case 'user_email_type': |
| 3236 |
|
| 3237 |
case 'user_from_name_default_template': |
| 3238 |
case 'user_from_name_admin_verification': |
| 3239 |
case 'user_from_name_email_verification': |
| 3240 |
case 'user_from_name_email_edit_verification': |
| 3241 |
case 'user_from_name_current_email_verification': |
| 3242 |
case 'user_from_name_email_thankyou': |
| 3243 |
case 'user_from_name_forgot_password_notification': |
| 3244 |
case 'user_from_name_pending_payment': |
| 3245 |
case 'user_from_name_payment_success': |
| 3246 |
case 'user_from_name_payment_faild': |
| 3247 |
case 'user_from_name_pending_payment_reminder': |
| 3248 |
case 'user_from_name_email_verification_reminder': |
| 3249 |
case 'user_from_name_user_expiry_notice': |
| 3250 |
case 'user_from_name_user_temp_blocked_notice': |
| 3251 |
case 'user_from_name_user_renew_temp_blocked_account_notice': |
| 3252 |
case 'user_from_name_user_perm_blocked_notice': |
| 3253 |
case 'user_from_name_user_verification_rejected': |
| 3254 |
case 'user_from_name_user_subscription_activated': |
| 3255 |
case 'user_from_name_user_subscription_cancelled': |
| 3256 |
|
| 3257 |
case 'user_subject_email_default_template': |
| 3258 |
case 'user_subject_email_admin_verification': |
| 3259 |
case 'user_subject_email_email_verification': |
| 3260 |
case 'user_subject_email_email_edit_verification': |
| 3261 |
case 'user_subject_email_current_email_verification': |
| 3262 |
case 'user_subject_email_email_thankyou': |
| 3263 |
case 'user_subject_email_forgot_password_notification': |
| 3264 |
case 'user_subject_email_pending_payment': |
| 3265 |
case 'user_subject_email_payment_success': |
| 3266 |
case 'user_subject_email_payment_faild': |
| 3267 |
case 'user_subject_email_pending_payment_reminder': |
| 3268 |
case 'user_subject_email_email_verification_reminder': |
| 3269 |
case 'user_subject_email_user_expiry_notice': |
| 3270 |
case 'user_subject_email_user_temp_blocked_notice': |
| 3271 |
case 'user_subject_email_user_verification_rejected': |
| 3272 |
case 'user_subject_email_user_renew_temp_blocked_account_notice': |
| 3273 |
case 'user_subject_email_user_perm_blocked_notice': |
| 3274 |
case 'user_subject_email_user_subscription_activated': |
| 3275 |
case 'user_subject_email_user_subscription_cancelled': |
| 3276 |
|
| 3277 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3278 |
break; |
| 3279 |
|
| 3280 |
case 'user_from_email_default_template': |
| 3281 |
case 'user_from_email_admin_verification': |
| 3282 |
case 'user_from_email_email_verification': |
| 3283 |
case 'user_from_email_email_edit_verification': |
| 3284 |
case 'user_from_email_current_email_verification': |
| 3285 |
case 'user_from_email_email_thankyou': |
| 3286 |
case 'user_from_email_forgot_password_notification': |
| 3287 |
case 'user_from_email_pending_payment': |
| 3288 |
case 'user_from_email_payment_success': |
| 3289 |
case 'user_from_email_payment_faild': |
| 3290 |
case 'user_from_email_pending_payment_reminder': |
| 3291 |
case 'user_from_email_email_verification_reminder': |
| 3292 |
case 'user_from_email_user_expiry_notice': |
| 3293 |
case 'user_from_email_user_temp_blocked_notice': |
| 3294 |
case 'user_from_email_user_renew_temp_blocked_account_notice': |
| 3295 |
case 'user_from_email_user_perm_blocked_notice': |
| 3296 |
case 'user_from_email_user_subscription_activated': |
| 3297 |
case 'user_from_email_user_subscription_cancelled': |
| 3298 |
|
| 3299 |
case 'user_to_email_default_template': |
| 3300 |
case 'user_to_email_admin_verification': |
| 3301 |
case 'user_to_email_email_verification': |
| 3302 |
case 'user_to_email_email_edit_verification': |
| 3303 |
case 'user_to_email_current_email_verification': |
| 3304 |
case 'user_to_email_email_thankyou': |
| 3305 |
case 'user_to_email_forgot_password_notification': |
| 3306 |
case 'user_to_email_pending_payment': |
| 3307 |
case 'user_to_email_payment_success': |
| 3308 |
case 'user_to_email_payment_faild': |
| 3309 |
case 'user_to_email_pending_payment_reminder': |
| 3310 |
case 'user_to_email_email_verification_reminder': |
| 3311 |
case 'user_to_email_user_expiry_notice': |
| 3312 |
case 'user_to_email_user_temp_blocked_notice': |
| 3313 |
case 'user_to_email_user_verification_rejected': |
| 3314 |
case 'user_to_email_user_renew_temp_blocked_account_notice': |
| 3315 |
case 'user_to_email_user_perm_blocked_notice': |
| 3316 |
case 'user_to_email_user_subscription_activated': |
| 3317 |
case 'user_to_email_user_subscription_cancelled': |
| 3318 |
$post[$key] = $this->sanitize_validate_as('email',$value); |
| 3319 |
break; |
| 3320 |
|
| 3321 |
case 'user_formate_email_default_template': |
| 3322 |
case 'user_formate_email_admin_verification': |
| 3323 |
case 'user_formate_email_email_verification': |
| 3324 |
case 'user_formate_email_email_edit_verification': |
| 3325 |
case 'user_formate_email_current_email_verification': |
| 3326 |
case 'user_formate_email_email_thankyou': |
| 3327 |
case 'user_formate_email_forgot_password_notification': |
| 3328 |
case 'user_formate_email_pending_payment': |
| 3329 |
case 'user_formate_email_payment_success': |
| 3330 |
case 'user_formate_email_payment_faild': |
| 3331 |
case 'user_formate_email_pending_payment_reminder': |
| 3332 |
case 'user_formate_email_email_verification_reminder': |
| 3333 |
case 'user_formate_email_user_expiry_notice': |
| 3334 |
case 'user_formate_email_user_temp_blocked_notice': |
| 3335 |
case 'user_formate_email_user_verification_rejected': |
| 3336 |
case 'user_formate_email_user_renew_temp_blocked_account_notice': |
| 3337 |
case 'user_formate_email_user_perm_blocked_notice': |
| 3338 |
case 'user_formate_email_user_subscription_activated': |
| 3339 |
case 'user_formate_email_user_subscription_cancelled': |
| 3340 |
|
| 3341 |
case 'user_enable_default_template': |
| 3342 |
case 'user_enable_admin_verification': |
| 3343 |
case 'user_enable_email_verification': |
| 3344 |
case 'user_enable_email_edit_verification': |
| 3345 |
case 'user_enable_current_email_verification': |
| 3346 |
case 'user_enable_email_thankyou': |
| 3347 |
case 'user_enable_forgot_password_notification': |
| 3348 |
case 'user_enable_pending_payment': |
| 3349 |
case 'user_enable_payment_success': |
| 3350 |
case 'user_enable_payment_faild': |
| 3351 |
case 'user_enable_pending_payment_reminder': |
| 3352 |
case 'user_enable_email_verification_reminder': |
| 3353 |
case 'user_enable_user_expiry_notice': |
| 3354 |
case 'user_enable_user_temp_blocked_notice': |
| 3355 |
case 'user_enable_user_renew_temp_blocked_account_notice': |
| 3356 |
case 'user_enable_user_perm_blocked_notice': |
| 3357 |
case 'user_enable_user_verification_rejected': |
| 3358 |
case 'user_enable_user_subscription_activated': |
| 3359 |
case 'user_enable_user_subscription_cancelled': |
| 3360 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3361 |
break; |
| 3362 |
|
| 3363 |
case 'user_message_email_default_template': |
| 3364 |
case 'user_message_email_admin_verification': |
| 3365 |
case 'user_message_email_email_verification': |
| 3366 |
case 'user_message_email_email_edit_verification': |
| 3367 |
case 'user_message_email_current_email_verification': |
| 3368 |
case 'user_message_email_email_thankyou': |
| 3369 |
case 'user_message_email_forgot_password_notification': |
| 3370 |
case 'user_message_email_pending_payment': |
| 3371 |
case 'user_message_email_payment_success': |
| 3372 |
case 'user_message_email_payment_faild': |
| 3373 |
case 'user_message_email_pending_payment_reminder': |
| 3374 |
case 'user_message_email_email_verification_reminder': |
| 3375 |
case 'user_message_email_user_expiry_notice': |
| 3376 |
case 'user_message_email_user_temp_blocked_notice': |
| 3377 |
case 'user_message_email_user_renew_temp_blocked_account_notice': |
| 3378 |
case 'user_message_email_user_perm_blocked_notice': |
| 3379 |
case 'user_message_email_user_verification_rejected': |
| 3380 |
case 'user_message_email_user_subscription_activated': |
| 3381 |
case 'user_message_email_user_subscription_cancelled': |
| 3382 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3383 |
break; |
| 3384 |
|
| 3385 |
default: |
| 3386 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3387 |
break; |
| 3388 |
} |
| 3389 |
} |
| 3390 |
|
| 3391 |
break; |
| 3392 |
|
| 3393 |
case 'piereg_settings_allusers': |
| 3394 |
|
| 3395 |
foreach ($post as $key => $value) |
| 3396 |
{ |
| 3397 |
switch ($key) |
| 3398 |
{ |
| 3399 |
case 'alternate_login': |
| 3400 |
case 'alternate_register': |
| 3401 |
case 'alternate_forgotpass': |
| 3402 |
case 'alternate_profilepage': |
| 3403 |
case 'after_login': |
| 3404 |
case 'alternate_logout': |
| 3405 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3406 |
break; |
| 3407 |
case 'login_after_register': |
| 3408 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3409 |
default: |
| 3410 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3411 |
break; |
| 3412 |
} |
| 3413 |
} |
| 3414 |
|
| 3415 |
break; |
| 3416 |
|
| 3417 |
case 'piereg_license_key': |
| 3418 |
|
| 3419 |
foreach ($post as $key => $value) |
| 3420 |
{ |
| 3421 |
switch ($key) |
| 3422 |
{ |
| 3423 |
case 'piereg_license_key': |
| 3424 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3425 |
break; |
| 3426 |
|
| 3427 |
case 'piereg_license_email': |
| 3428 |
$post[$key] = $this->sanitize_validate_as('email',$value); |
| 3429 |
break; |
| 3430 |
|
| 3431 |
default: |
| 3432 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3433 |
break; |
| 3434 |
} |
| 3435 |
} |
| 3436 |
|
| 3437 |
break; |
| 3438 |
|
| 3439 |
case 'piereg_settings_ux': |
| 3440 |
|
| 3441 |
foreach ($post as $key => $value) |
| 3442 |
{ |
| 3443 |
switch ($key) |
| 3444 |
{ |
| 3445 |
case 'display_hints': |
| 3446 |
case 'outputcss': |
| 3447 |
case 'outputjquery_ui': |
| 3448 |
case 'pr_theme': |
| 3449 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3450 |
break; |
| 3451 |
|
| 3452 |
case 'login_username_label': |
| 3453 |
case 'login_username_placeholder': |
| 3454 |
case 'login_password_label': |
| 3455 |
case 'login_password_placeholder': |
| 3456 |
case 'forgot_pass_username_label': |
| 3457 |
case 'forgot_pass_username_placeholder': |
| 3458 |
case 'custom_logo_tooltip': |
| 3459 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3460 |
break; |
| 3461 |
|
| 3462 |
case 'custom_css': |
| 3463 |
case 'tracking_code': |
| 3464 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3465 |
break; |
| 3466 |
|
| 3467 |
case 'pie_custom_logo_url': |
| 3468 |
case 'custom_logo_link': |
| 3469 |
$post[$key] = $this->sanitize_validate_as('url',$value); |
| 3470 |
break; |
| 3471 |
|
| 3472 |
default: |
| 3473 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3474 |
break; |
| 3475 |
} |
| 3476 |
} |
| 3477 |
|
| 3478 |
break; |
| 3479 |
|
| 3480 |
case 'piereg_settings_overrides': |
| 3481 |
|
| 3482 |
foreach ($post as $key => $value) |
| 3483 |
{ |
| 3484 |
switch ($key) |
| 3485 |
{ |
| 3486 |
case 'redirect_user': |
| 3487 |
case 'show_admin_bar': |
| 3488 |
case 'block_WP_profile': |
| 3489 |
case 'block_wp_login': |
| 3490 |
case 'allow_pr_edit_wplogin': |
| 3491 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3492 |
break; |
| 3493 |
|
| 3494 |
default: |
| 3495 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3496 |
break; |
| 3497 |
} |
| 3498 |
} |
| 3499 |
|
| 3500 |
break; |
| 3501 |
|
| 3502 |
case 'piereg_settings_security_b': |
| 3503 |
|
| 3504 |
foreach ($post as $key => $value) |
| 3505 |
{ |
| 3506 |
switch ($key) |
| 3507 |
{ |
| 3508 |
case 'captcha_in_login_value': |
| 3509 |
case 'captcha_in_forgot_value': |
| 3510 |
case 'grace_period': |
| 3511 |
case 'email_edit_verification_step': |
| 3512 |
case 'capthca_in_login': |
| 3513 |
case 'piereg_security_attempts_login_value': |
| 3514 |
case 'security_attempts_login_time': |
| 3515 |
case 'security_attempts_login': |
| 3516 |
case 'captcha_in_forgot_value': |
| 3517 |
case 'piereg_security_attempts_forgot_value': |
| 3518 |
case 'security_attempts_forgot_time': |
| 3519 |
case 'security_attempts_forgot': |
| 3520 |
case 'restrict_bot_enabel': |
| 3521 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3522 |
break; |
| 3523 |
|
| 3524 |
case 'captcha_publc': |
| 3525 |
case 'capthca_in_login_label': |
| 3526 |
case 'captcha_private': |
| 3527 |
case 'verification': |
| 3528 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3529 |
break; |
| 3530 |
|
| 3531 |
case 'restrict_bot_content': |
| 3532 |
case 'restrict_bot_content_message'; |
| 3533 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3534 |
break; |
| 3535 |
|
| 3536 |
default: |
| 3537 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3538 |
break; |
| 3539 |
} |
| 3540 |
} |
| 3541 |
|
| 3542 |
break; |
| 3543 |
|
| 3544 |
case 'piereg_settings_security_advanced'; |
| 3545 |
foreach ($post as $key => $value) |
| 3546 |
{ |
| 3547 |
switch ($key) |
| 3548 |
{ |
| 3549 |
case 'reg_form_submission_time_enable': |
| 3550 |
case 'reg_form_submission_time': |
| 3551 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3552 |
break; |
| 3553 |
|
| 3554 |
default: |
| 3555 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3556 |
break; |
| 3557 |
} |
| 3558 |
} |
| 3559 |
|
| 3560 |
break; |
| 3561 |
|
| 3562 |
case 'piereg_invitation_code': |
| 3563 |
|
| 3564 |
foreach ($post as $key => $value) |
| 3565 |
{ |
| 3566 |
switch ($key) |
| 3567 |
{ |
| 3568 |
case 'enable_invitation_codes': |
| 3569 |
case 'invitation_code_usage': |
| 3570 |
case 'invitation_code_numbers': |
| 3571 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3572 |
break; |
| 3573 |
|
| 3574 |
case 'piereg_codepass': |
| 3575 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3576 |
break; |
| 3577 |
|
| 3578 |
default: |
| 3579 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3580 |
break; |
| 3581 |
} |
| 3582 |
} |
| 3583 |
|
| 3584 |
break; |
| 3585 |
|
| 3586 |
case 'piereg_export_csv': |
| 3587 |
|
| 3588 |
foreach ($post as $key => $value) |
| 3589 |
{ |
| 3590 |
switch ($key) |
| 3591 |
{ |
| 3592 |
|
| 3593 |
case 'pie_fields_csv': |
| 3594 |
case 'date_start': |
| 3595 |
case 'date_end': |
| 3596 |
case 'pie_meta_csv': |
| 3597 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3598 |
break; |
| 3599 |
|
| 3600 |
default: |
| 3601 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3602 |
break; |
| 3603 |
} |
| 3604 |
} |
| 3605 |
|
| 3606 |
break; |
| 3607 |
|
| 3608 |
case 'piereg_import_users': |
| 3609 |
|
| 3610 |
foreach ($post as $key => $value) |
| 3611 |
{ |
| 3612 |
switch ($key) |
| 3613 |
{ |
| 3614 |
|
| 3615 |
case 'update_existing_users': |
| 3616 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3617 |
break; |
| 3618 |
|
| 3619 |
case 'csvfile': |
| 3620 |
$post[$key] = $this->sanitize_validate_as('file',$value); |
| 3621 |
break; |
| 3622 |
|
| 3623 |
default: |
| 3624 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3625 |
break; |
| 3626 |
} |
| 3627 |
} |
| 3628 |
|
| 3629 |
break; |
| 3630 |
|
| 3631 |
case 'piereg_form_builder': |
| 3632 |
foreach ($post as $key => $value) |
| 3633 |
{ |
| 3634 |
|
| 3635 |
switch ($value['type']) |
| 3636 |
{ |
| 3637 |
default: |
| 3638 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3639 |
break; |
| 3640 |
} |
| 3641 |
} |
| 3642 |
|
| 3643 |
break; |
| 3644 |
|
| 3645 |
case 'piereg_restrict_users': |
| 3646 |
|
| 3647 |
foreach ($post as $key => $value) |
| 3648 |
{ |
| 3649 |
switch ($key) |
| 3650 |
{ |
| 3651 |
|
| 3652 |
case 'piereg_blk_username': |
| 3653 |
case 'piereg_blk_ip': |
| 3654 |
case 'piereg_blk_email': |
| 3655 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3656 |
break; |
| 3657 |
|
| 3658 |
case 'enable_blockedusername': |
| 3659 |
case 'enable_blockedips': |
| 3660 |
case 'enable_blockedemail': |
| 3661 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3662 |
break; |
| 3663 |
|
| 3664 |
default: |
| 3665 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3666 |
break; |
| 3667 |
} |
| 3668 |
} |
| 3669 |
|
| 3670 |
break; |
| 3671 |
|
| 3672 |
case 'piereg_allowed_users': |
| 3673 |
|
| 3674 |
foreach ($post as $key => $value) |
| 3675 |
{ |
| 3676 |
switch ($key) |
| 3677 |
{ |
| 3678 |
|
| 3679 |
case 'piereg_ald_username': |
| 3680 |
case 'piereg_ald_email': |
| 3681 |
$post[$key] = $this->sanitize_validate_as('html',$value); |
| 3682 |
break; |
| 3683 |
|
| 3684 |
case 'enable_allowedusername': |
| 3685 |
case 'enable_allowedemail': |
| 3686 |
$post[$key] = $this->sanitize_validate_as('number',$value); |
| 3687 |
break; |
| 3688 |
|
| 3689 |
default: |
| 3690 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3691 |
break; |
| 3692 |
} |
| 3693 |
} |
| 3694 |
|
| 3695 |
break; |
| 3696 |
|
| 3697 |
case 'piereg_redirect_settings': |
| 3698 |
|
| 3699 |
foreach ($post as $key => $value) |
| 3700 |
{ |
| 3701 |
switch ($key) |
| 3702 |
{ |
| 3703 |
|
| 3704 |
case 'piereg_user_role': |
| 3705 |
case 'log_in_page': |
| 3706 |
case 'log_out_page': |
| 3707 |
$post[$key] = $this->sanitize_validate_as('text',$value); |
| 3708 |
break; |
| 3709 |
|
| 3710 |
case 'logged_in_url': |
| 3711 |
case 'log_out_url': |
| 3712 |
$post[$key] = $this->sanitize_validate_as('url',$value); |
| 3713 |
break; |
| 3714 |
|
| 3715 |
default: |
| 3716 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3717 |
break; |
| 3718 |
} |
| 3719 |
} |
| 3720 |
|
| 3721 |
break; |
| 3722 |
|
| 3723 |
case 'piereg_login': |
| 3724 |
|
| 3725 |
foreach ($post as $key => $value) |
| 3726 |
{ |
| 3727 |
switch ($key) |
| 3728 |
{ |
| 3729 |
|
| 3730 |
case 'log': |
| 3731 |
$post[$key] = $this->sanitize_validate_as('user',$value); |
| 3732 |
break; |
| 3733 |
|
| 3734 |
case 'redirect_to': |
| 3735 |
$post[$key] = $this->sanitize_validate_as('url',$value); |
| 3736 |
break; |
| 3737 |
|
| 3738 |
default: |
| 3739 |
$post[$key] = $this->sanitize_validate_as('esc_textarea',$value); |
| 3740 |
break; |
| 3741 |
} |
| 3742 |
} |
| 3743 |
|
| 3744 |
break; |
| 3745 |
case 'post_restriction': |
| 3746 |
$npost = array(); |
| 3747 |
foreach ($post['post_restriction'] as $key => $value) |
| 3748 |
{ |
| 3749 |
switch ( $key ) { |
| 3750 |
|
| 3751 |
case 'piereg_post_type': |
| 3752 |
$npost[ $key ] = sanitize_key( $value ); |
| 3753 |
break; |
| 3754 |
|
| 3755 |
case 'piereg_post_visibility': |
| 3756 |
$npost[ $key ] = sanitize_key( $value ); |
| 3757 |
break; |
| 3758 |
|
| 3759 |
case 'piereg_restriction_type': |
| 3760 |
$npost[ $key ] = intval( $value ); |
| 3761 |
break; |
| 3762 |
|
| 3763 |
case 'piereg_redirect_url': |
| 3764 |
$npost[ $key ] = esc_url_raw( $value ); |
| 3765 |
break; |
| 3766 |
|
| 3767 |
case 'piereg_redirect_page': |
| 3768 |
$npost[ $key ] = intval( $value ); |
| 3769 |
break; |
| 3770 |
|
| 3771 |
case 'piereg_block_content': |
| 3772 |
$npost[ $key ] = sanitize_textarea_field( $value ); |
| 3773 |
break; |
| 3774 |
|
| 3775 |
} |
| 3776 |
} |
| 3777 |
$post = $npost; |
| 3778 |
|
| 3779 |
break; |
| 3780 |
default: |
| 3781 |
# do nothing... |
| 3782 |
break; |
| 3783 |
} |
| 3784 |
|
| 3785 |
return $post; |
| 3786 |
} |
| 3787 |
|
| 3788 |
function recursive_sanitize_array($array) { |
| 3789 |
foreach ( $array as $key => &$value ) { |
| 3790 |
if ( is_array( $value ) ) { |
| 3791 |
$value = $this->recursive_sanitize_array($value); |
| 3792 |
} |
| 3793 |
else { |
| 3794 |
$value = sanitize_text_field( $value ); |
| 3795 |
} |
| 3796 |
} |
| 3797 |
|
| 3798 |
return $array; |
| 3799 |
} |
| 3800 |
|
| 3801 |
function sanitize_validate_as($type,$value){ |
| 3802 |
|
| 3803 |
if( is_array($value) ){ |
| 3804 |
|
| 3805 |
$_TMP_arr = array(); |
| 3806 |
|
| 3807 |
foreach ($value as $k => $v) { |
| 3808 |
$_TMP_arr[$k] = $this->sanitize_validate_as($type,$v); |
| 3809 |
if($k === 'html') |
| 3810 |
{ |
| 3811 |
$_TMP_arr[$k] = $this->sanitize_validate_as('html',$v); |
| 3812 |
} else { |
| 3813 |
$_TMP_arr[$k] = $this->sanitize_validate_as($type,$v); |
| 3814 |
} |
| 3815 |
} |
| 3816 |
|
| 3817 |
return $_TMP_arr; |
| 3818 |
} |
| 3819 |
|
| 3820 |
switch ($type) { |
| 3821 |
case 'text': |
| 3822 |
return sanitize_text_field($value); |
| 3823 |
break; |
| 3824 |
|
| 3825 |
case 'number': |
| 3826 |
return filter_var($value,FILTER_SANITIZE_NUMBER_INT); |
| 3827 |
break; |
| 3828 |
|
| 3829 |
case 'email': |
| 3830 |
return sanitize_email($value); |
| 3831 |
break; |
| 3832 |
|
| 3833 |
case 'html': |
| 3834 |
return wp_kses($value,$this->alowed_iframe_tag_post()); |
| 3835 |
break; |
| 3836 |
|
| 3837 |
case 'url': |
| 3838 |
return esc_url($value); |
| 3839 |
break; |
| 3840 |
|
| 3841 |
case 'file': |
| 3842 |
return sanitize_file_name($value); |
| 3843 |
break; |
| 3844 |
|
| 3845 |
case 'user': |
| 3846 |
return sanitize_user(stripslashes($value)); |
| 3847 |
break; |
| 3848 |
|
| 3849 |
case 'esc_textarea': |
| 3850 |
default: |
| 3851 |
return sanitize_textarea_field($value); |
| 3852 |
break; |
| 3853 |
} |
| 3854 |
|
| 3855 |
} |
| 3856 |
|
| 3857 |
/* |
| 3858 |
* Add iframe in allowed tags ep_kses |
| 3859 |
*/ |
| 3860 |
function alowed_iframe_tag_post() { |
| 3861 |
$allowed_tags = wp_kses_allowed_html( 'post' ); |
| 3862 |
|
| 3863 |
// iframe |
| 3864 |
$allowed_tags['iframe'] = array( |
| 3865 |
'src' => array(), |
| 3866 |
'height' => array(), |
| 3867 |
'width' => array(), |
| 3868 |
'frameborder' => array(), |
| 3869 |
'allowfullscreen' => array(), |
| 3870 |
); |
| 3871 |
|
| 3872 |
return $allowed_tags; |
| 3873 |
} |
| 3874 |
|
| 3875 |
/* |
| 3876 |
* Sanitize All Get Data |
| 3877 |
*/ |
| 3878 |
function piereg_sanitize_get_data($get = array()){ |
| 3879 |
if(!is_array($get) || empty($get)) |
| 3880 |
return false; |
| 3881 |
|
| 3882 |
foreach($get as $key=>$val){ |
| 3883 |
if( isset($_GET[$key]) ){ |
| 3884 |
$_GET[$key] = $this->piereg_post_array_filter($_GET[$key]); |
| 3885 |
} |
| 3886 |
} |
| 3887 |
} |
| 3888 |
|
| 3889 |
function piereg_post_array_filter($post){ |
| 3890 |
$new_post = $post; |
| 3891 |
if( isset($new_post) && is_array($new_post) ){ |
| 3892 |
foreach($new_post as $k=>$val){ |
| 3893 |
$new_post[$k] = $this->piereg_post_array_filter($val); |
| 3894 |
} |
| 3895 |
return $new_post; |
| 3896 |
}else{ |
| 3897 |
return (sanitize_textarea_field(trim($new_post))); |
| 3898 |
} |
| 3899 |
} |
| 3900 |
|
| 3901 |
function stripslashes_deep($value){ |
| 3902 |
return is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); |
| 3903 |
} |
| 3904 |
|
| 3905 |
function sanitize_field_options($value) |
| 3906 |
{ |
| 3907 |
return !is_array($value) ? htmlspecialchars(str_replace(array('\/','\\'),'',stripslashes($value))) : $value; |
| 3908 |
} |
| 3909 |
|
| 3910 |
function piereg_save_payment_log_option($email,$method,$type,$responce){ |
| 3911 |
|
| 3912 |
$piereg = get_option(OPTION_PIE_REGISTER); |
| 3913 |
|
| 3914 |
$date_time = date_i18n("d-m-Y H:i:s"); |
| 3915 |
$key = wp_generate_password(32, false); |
| 3916 |
$data = get_option("piereg_payment_log_option"); |
| 3917 |
$duplicate_enty = false; |
| 3918 |
|
| 3919 |
if( $method == 'PayPal' && ( !empty($data) && is_array($data) ) ) { |
| 3920 |
foreach($data as $k=>$v) { |
| 3921 |
$key_exists = array_search($responce['txn_id'], $v['responce']); |
| 3922 |
if( $key_exists == 'txn_id' ) { |
| 3923 |
$duplicate_enty = true; |
| 3924 |
break; |
| 3925 |
} |
| 3926 |
} |
| 3927 |
} |
| 3928 |
|
| 3929 |
if( empty($data) ) |
| 3930 |
$data = array(); |
| 3931 |
|
| 3932 |
if(!$duplicate_enty) { |
| 3933 |
$data[$key]['email'] = $email; |
| 3934 |
$data[$key]['method'] = $method; |
| 3935 |
$data[$key]['type'] = $type; |
| 3936 |
$data[$key]['responce'] = $responce; |
| 3937 |
$data[$key]['date'] = $date_time; |
| 3938 |
|
| 3939 |
// Send Success email on PayPal Subscription activation |
| 3940 |
if( isset($piereg['user_enable_user_subscription_activated']) && ($piereg['user_enable_user_subscription_activated'] == 1) ) |
| 3941 |
{ |
| 3942 |
if ( isset($responce['subscr_id']) && !empty($responce['subscr_id']) ) |
| 3943 |
{ |
| 3944 |
$this->wp_mail_send($email,'user_subscription_activated'); |
| 3945 |
} |
| 3946 |
} |
| 3947 |
|
| 3948 |
update_option( "piereg_payment_log_option", $data ); |
| 3949 |
} |
| 3950 |
} |
| 3951 |
|
| 3952 |
function isUserIpsIsBlocked($current_ip, $array_ips) |
| 3953 |
{ |
| 3954 |
$isblocked = false; |
| 3955 |
foreach( $array_ips as $blockip ) { |
| 3956 |
if( strpos($blockip,'-') !== false ) { |
| 3957 |
$rangefrom = ip2long(substr($blockip, 0, strpos($blockip,"-"))); |
| 3958 |
$rangesexplode = explode("-",$blockip); |
| 3959 |
|
| 3960 |
$arr = explode('.', $rangesexplode[0]); |
| 3961 |
$ipstart = implode('.', array_slice($arr, 0, 3)); |
| 3962 |
$rangeto = ip2long($ipstart . "." . $rangesexplode[1]); |
| 3963 |
|
| 3964 |
if($current_ip >= $rangefrom && $current_ip <= $rangeto ){ |
| 3965 |
$isblocked = true; |
| 3966 |
break; |
| 3967 |
} |
| 3968 |
|
| 3969 |
} else if( ($current_ip == ip2long($blockip)) && ip2long($blockip)) { |
| 3970 |
$isblocked = true; |
| 3971 |
break; |
| 3972 |
} |
| 3973 |
} |
| 3974 |
|
| 3975 |
if($isblocked){ |
| 3976 |
return true; |
| 3977 |
}else{ |
| 3978 |
return false; |
| 3979 |
} |
| 3980 |
} |
| 3981 |
|
| 3982 |
|
| 3983 |
function isUserNameIsBlocked( $current_username, $array_username) { |
| 3984 |
$isblocked = false; |
| 3985 |
|
| 3986 |
$userdata = get_user_by('login', $current_username); |
| 3987 |
if( $userdata !== false && in_array('administrator', $userdata->roles) ) |
| 3988 |
{ |
| 3989 |
return false; |
| 3990 |
} |
| 3991 |
|
| 3992 |
foreach($array_username as $username) |
| 3993 |
{ |
| 3994 |
if(strpos($username,"*") !== false ) |
| 3995 |
{ |
| 3996 |
$username = str_replace("*","",$username); |
| 3997 |
if( strpos($current_username,$username) !== false ) { |
| 3998 |
$isblocked = true; |
| 3999 |
break; |
| 4000 |
} |
| 4001 |
|
| 4002 |
} else if($username == $current_username) { |
| 4003 |
|
| 4004 |
$isblocked = true; |
| 4005 |
break; |
| 4006 |
} |
| 4007 |
} |
| 4008 |
|
| 4009 |
if($isblocked) |
| 4010 |
return true; |
| 4011 |
else |
| 4012 |
return false; |
| 4013 |
|
| 4014 |
} |
| 4015 |
|
| 4016 |
function isEmailAddressIsBlocked( $current_emailaddr, $array_email ) { |
| 4017 |
$isblocked = false; |
| 4018 |
|
| 4019 |
$userdata = get_user_by('email', $current_emailaddr); |
| 4020 |
if( $userdata !== false && in_array('administrator', $userdata->roles) ) |
| 4021 |
{ |
| 4022 |
return false; |
| 4023 |
} |
| 4024 |
|
| 4025 |
foreach($array_email as $email) |
| 4026 |
{ |
| 4027 |
if(strpos($email,"*") !== false ) |
| 4028 |
{ |
| 4029 |
$email = str_replace("*","",$email); |
| 4030 |
if( strpos($current_emailaddr,$email) !== false ) { |
| 4031 |
$isblocked = true; |
| 4032 |
break; |
| 4033 |
} |
| 4034 |
|
| 4035 |
} else if($email == $current_emailaddr) { |
| 4036 |
|
| 4037 |
$isblocked = true; |
| 4038 |
break; |
| 4039 |
} |
| 4040 |
} |
| 4041 |
|
| 4042 |
if($isblocked) |
| 4043 |
return true; |
| 4044 |
else |
| 4045 |
return false; |
| 4046 |
} |
| 4047 |
|
| 4048 |
function isUserNameIsAllowed( $current_username, $array_username) { |
| 4049 |
$isblocked = false; |
| 4050 |
|
| 4051 |
$userdata = get_user_by('login', $current_username); |
| 4052 |
if($userdata !== false && in_array('administrator', $userdata->roles) ) |
| 4053 |
{ |
| 4054 |
return false; |
| 4055 |
} |
| 4056 |
|
| 4057 |
foreach($array_username as $username) |
| 4058 |
{ |
| 4059 |
if(strpos($username,"*") !== false ) |
| 4060 |
{ |
| 4061 |
$username = str_replace("*","",$username); |
| 4062 |
if( strpos($current_username,$username) !== false ) { |
| 4063 |
$isblocked = true; |
| 4064 |
break; |
| 4065 |
} |
| 4066 |
|
| 4067 |
} else if($username == $current_username) { |
| 4068 |
|
| 4069 |
$isblocked = true; |
| 4070 |
break; |
| 4071 |
} |
| 4072 |
} |
| 4073 |
|
| 4074 |
if($isblocked) |
| 4075 |
return false; |
| 4076 |
else |
| 4077 |
return true; |
| 4078 |
|
| 4079 |
} |
| 4080 |
|
| 4081 |
function isEmailAddressIsAllowed( $current_emailaddr, $array_email ) { |
| 4082 |
$isblocked = false; |
| 4083 |
|
| 4084 |
$userdata = get_user_by('email', $current_emailaddr); |
| 4085 |
if( $userdata !== false && in_array('administrator', $userdata->roles) ) |
| 4086 |
{ |
| 4087 |
return false; |
| 4088 |
} |
| 4089 |
|
| 4090 |
foreach($array_email as $email) |
| 4091 |
{ |
| 4092 |
if(strpos($email,"*") !== false ) |
| 4093 |
{ |
| 4094 |
$email = str_replace("*","",$email); |
| 4095 |
if( strpos($current_emailaddr,$email) !== false ) { |
| 4096 |
$isblocked = true; |
| 4097 |
break; |
| 4098 |
} |
| 4099 |
|
| 4100 |
} else if($email == $current_emailaddr) { |
| 4101 |
|
| 4102 |
$isblocked = true; |
| 4103 |
break; |
| 4104 |
} |
| 4105 |
} |
| 4106 |
|
| 4107 |
if($isblocked) |
| 4108 |
return false; |
| 4109 |
else |
| 4110 |
return true; |
| 4111 |
} |
| 4112 |
|
| 4113 |
function regFormForFreeVers( $isDelete=false ) { |
| 4114 |
$fields_id = get_option("piereg_form_fields_id"); |
| 4115 |
$form_on_free = get_option("piereg_form_free_id"); |
| 4116 |
$count = 0; |
| 4117 |
|
| 4118 |
if( ( !empty($fields_id) && !$form_on_free ) || $isDelete ) |
| 4119 |
{ |
| 4120 |
for( $a=1; $a<=$fields_id; $a++ ) |
| 4121 |
{ |
| 4122 |
$option = get_option("piereg_form_field_option_".$a); |
| 4123 |
if( !empty($option) && is_array($option) && isset($option['Id']) && !isset($option['IsDeleted']) ) |
| 4124 |
{ |
| 4125 |
$count++; |
| 4126 |
if( $count == 1 ) |
| 4127 |
{ |
| 4128 |
update_option('piereg_form_free_id', $option['Id']); |
| 4129 |
$form_on_free .= $option['Id']; |
| 4130 |
} |
| 4131 |
break; |
| 4132 |
} |
| 4133 |
} |
| 4134 |
} |
| 4135 |
return $form_on_free; |
| 4136 |
} |
| 4137 |
|
| 4138 |
function checkAddonActivated($addon_name="") |
| 4139 |
{ |
| 4140 |
if( $addon_name !== "") |
| 4141 |
{ |
| 4142 |
$_option_name = get_option('piereg_api_manager_addon_'.$addon_name.'_activated'); |
| 4143 |
if($_option_name && $_option_name == "Activated") |
| 4144 |
{ |
| 4145 |
return true; |
| 4146 |
} |
| 4147 |
} |
| 4148 |
|
| 4149 |
return false; |
| 4150 |
} |
| 4151 |
//ver 3.5.4 |
| 4152 |
|
| 4153 |
function anyAddonActivated(){ |
| 4154 |
|
| 4155 |
// check if any addon is activated |
| 4156 |
if( |
| 4157 |
!is_plugin_active('pie-register-authorize-net/pie-register-authorize-net.php') |
| 4158 |
&& |
| 4159 |
!is_plugin_active('pie-register-bulkemail/pie-register-bulkemail.php') |
| 4160 |
&& |
| 4161 |
!is_plugin_active('pie-register-field-visibility/pie-register-field-visibility.php') |
| 4162 |
&& |
| 4163 |
!is_plugin_active('pie-register-profile-search/pie-register-profile-search.php') |
| 4164 |
&& |
| 4165 |
!is_plugin_active('pie-register-social-site/pie-register-social-site.php') |
| 4166 |
&& |
| 4167 |
!is_plugin_active('pie-register-social-site/pie-register-social-site.php') |
| 4168 |
&& |
| 4169 |
!is_plugin_active('pie-register-stripe/pie-register-stripe.php') |
| 4170 |
&& |
| 4171 |
!is_plugin_active('pie-register-geolocation/pie-register-geolocation.php') |
| 4172 |
&& |
| 4173 |
!is_plugin_active('pie-register-mailchimp/pie-register-mailchimp.php') |
| 4174 |
&& |
| 4175 |
!is_plugin_active("pie-register-twilio/pie-register-twilio.php") ){ |
| 4176 |
|
| 4177 |
return true; |
| 4178 |
} |
| 4179 |
} |
| 4180 |
|
| 4181 |
// 3.6.15 |
| 4182 |
function get_aboutus_plugin_data( $plugin, $details, $all_plugins ) { |
| 4183 |
|
| 4184 |
if ( array_key_exists( $plugin, $all_plugins ) ) { |
| 4185 |
if ( is_plugin_active( $plugin ) ) { |
| 4186 |
// Status text/status. |
| 4187 |
$plugin_data['status_class'] = 'status-active'; |
| 4188 |
$plugin_data['status_text'] = esc_html__( 'Active', 'pie-register' ); |
| 4189 |
// Button text/status. |
| 4190 |
$plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-secondary disabled'; |
| 4191 |
$plugin_data['action_text'] = esc_html__( 'Activated', 'pie-register' ); |
| 4192 |
$plugin_data['plugin_src'] = esc_attr( $plugin ); |
| 4193 |
} else { |
| 4194 |
// Status text/status. |
| 4195 |
$plugin_data['status_class'] = 'status-inactive'; |
| 4196 |
$plugin_data['status_text'] = esc_html__( 'Inactive', 'pie-register' ); |
| 4197 |
// Button text/status. |
| 4198 |
$plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-secondary'; |
| 4199 |
$plugin_data['action_text'] = esc_html__( 'Activate', 'pie-register' ); |
| 4200 |
$plugin_data['plugin_src'] = esc_attr( $plugin ); |
| 4201 |
} |
| 4202 |
} else { |
| 4203 |
// Doesn't exist, install. |
| 4204 |
// Status text/status. |
| 4205 |
$plugin_data['status_class'] = 'status-download'; |
| 4206 |
if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) { |
| 4207 |
$plugin_data['status_class'] = 'status-go-to-url'; |
| 4208 |
} |
| 4209 |
$plugin_data['status_text'] = esc_html__( 'Not Installed', 'pie-register' ); |
| 4210 |
// Button text/status. |
| 4211 |
$plugin_data['action_class'] = $plugin_data['status_class'] . ' button button-primary'; |
| 4212 |
$plugin_data['action_text'] = esc_html__( 'Install & Activate Plugin', 'pie-register' ); |
| 4213 |
$plugin_data['plugin_src'] = esc_url( $details['url'] ); |
| 4214 |
} |
| 4215 |
|
| 4216 |
$plugin_data['details'] = $details; |
| 4217 |
|
| 4218 |
return $plugin_data; |
| 4219 |
} |
| 4220 |
|
| 4221 |
function getValue( $_is_not_form=false, $_other_values=array() ){ |
| 4222 |
|
| 4223 |
if( is_bool($_is_not_form) && $_is_not_form === true ) |
| 4224 |
{ |
| 4225 |
$value = isset($_other_values['_value']) ? $_other_values['_value'] : ""; |
| 4226 |
$this->type = isset($_other_values['_type']) ? $_other_values['_type'] : ""; |
| 4227 |
} |
| 4228 |
else { |
| 4229 |
$value = $this->stripslashes_deep(get_user_meta($this->user_id, $this->slug,true)); #get_usermeta deprecated |
| 4230 |
} |
| 4231 |
|
| 4232 |
if($this->type=="date") |
| 4233 |
{ |
| 4234 |
if( ($this->field['date_type'] == "datepicker") && isset($value['date']) && !isset($value['date']['mm']) ) { |
| 4235 |
$val = isset($value['date'][0]) ? $value['date'][0] : ""; |
| 4236 |
return $val; |
| 4237 |
} |
| 4238 |
else if(isset($value['date']) && is_array($value['date'])) |
| 4239 |
{ |
| 4240 |
if(!isset($value['date']['mm'])) { |
| 4241 |
$val = isset($value['date'][0]) ? $value['date'][0] : ""; |
| 4242 |
return $val; |
| 4243 |
} |
| 4244 |
|
| 4245 |
$val = $this->field['date_format']; |
| 4246 |
if( is_bool($_is_not_form) && $_is_not_form === true ) |
| 4247 |
{ |
| 4248 |
$val = "mm/dd/yy"; |
| 4249 |
} |
| 4250 |
|
| 4251 |
$mm_val = (!empty($value['date']['mm'])) ? $value['date']['mm'] : "mm"; |
| 4252 |
$val = str_replace("mm",$mm_val,$val); |
| 4253 |
|
| 4254 |
$dd_val = (!empty($value['date']['dd'])) ? $value['date']['dd'] : "dd"; |
| 4255 |
$val = str_replace("dd",$dd_val,$val); |
| 4256 |
|
| 4257 |
$yy_val = (!empty($value['date']['yy'])) ? $value['date']['yy'] : "yy"; |
| 4258 |
$val = str_replace("yy",$yy_val,$val); |
| 4259 |
|
| 4260 |
return $val; |
| 4261 |
} |
| 4262 |
|
| 4263 |
return $value; |
| 4264 |
} |
| 4265 |
else if($this->type=="time") |
| 4266 |
{ |
| 4267 |
if(((isset($value['hh']) && $value['hh'] === '') && (isset ($value['mm']) && $value['mm'] === ''))){ |
| 4268 |
return false; |
| 4269 |
} |
| 4270 |
if(is_array($value)){ |
| 4271 |
if($value['hh'] != '') |
| 4272 |
$value['hh'] = ($value['hh']); |
| 4273 |
if($value['mm'] != '') |
| 4274 |
$value['mm'] = ($value['mm']); |
| 4275 |
|
| 4276 |
|
| 4277 |
if ( isset($value['time_format']) ) $last = array_pop($value); |
| 4278 |
else $last = ""; |
| 4279 |
|
| 4280 |
return implode(" : ",$value) . ' ' . $last; |
| 4281 |
} |
| 4282 |
return $value; |
| 4283 |
} |
| 4284 |
else if($this->type=="invitation") |
| 4285 |
{ |
| 4286 |
$value = get_user_meta($this->user_id, "invite_code", true); #get_usermeta deprecated |
| 4287 |
|
| 4288 |
if(is_array($value)) |
| 4289 |
return implode(", ",$value); |
| 4290 |
else |
| 4291 |
return $value; |
| 4292 |
} |
| 4293 |
else if($this->type=="custom_role") // dropdown-ur |
| 4294 |
{ |
| 4295 |
$value = get_user_meta($this->user_id, "custom_role", true); #get_usermeta deprecated |
| 4296 |
|
| 4297 |
if(is_array($value)) |
| 4298 |
return implode(", ",$value); |
| 4299 |
else |
| 4300 |
return $value; |
| 4301 |
} |
| 4302 |
else if($this->type=="list") |
| 4303 |
{ |
| 4304 |
|
| 4305 |
if(!is_array($value)) |
| 4306 |
return $value; |
| 4307 |
$list = ""; |
| 4308 |
$list = '<table class="piereg_custom_list '.$this->slug.'">'; |
| 4309 |
for($a = 0 ; $a < sizeof($value) ; $a++) |
| 4310 |
{ |
| 4311 |
if(array_filter($value[$a])){ |
| 4312 |
$list .= '<tr>'; |
| 4313 |
$row = ""; |
| 4314 |
for($b = 0 ; $b < sizeof($value[$a]) ; $b++) |
| 4315 |
{ |
| 4316 |
$row .= $value[$a][$b]; |
| 4317 |
$list .= '<td>'.$value[$a][$b]."</td>"; |
| 4318 |
} |
| 4319 |
if(!empty($row)) |
| 4320 |
$list .= '</tr>'; |
| 4321 |
} |
| 4322 |
} |
| 4323 |
$list .= '</table>'; |
| 4324 |
$value = $list ; |
| 4325 |
|
| 4326 |
} |
| 4327 |
else if($this->type=="multiselect" && $_is_not_form !== true ) |
| 4328 |
{ |
| 4329 |
$list = ""; |
| 4330 |
if($value) { |
| 4331 |
$list = "<ol>"; |
| 4332 |
$combined_array = array_combine($this->field['value'],$this->field['display']); |
| 4333 |
|
| 4334 |
for($a = 0 ; $a < sizeof($value) ; $a++ ) |
| 4335 |
{ |
| 4336 |
if(isset($value[$a])) |
| 4337 |
{ |
| 4338 |
if( $this->field['list_type'] == 'None' ) |
| 4339 |
{ |
| 4340 |
$list .= "<li>".$combined_array[$value[$a]]."</li>"; |
| 4341 |
|
| 4342 |
} else { |
| 4343 |
|
| 4344 |
$list .= "<li>".$value[$a]."</li>"; |
| 4345 |
|
| 4346 |
} |
| 4347 |
} |
| 4348 |
} |
| 4349 |
$list .= "</ol>"; |
| 4350 |
} |
| 4351 |
$value = $list; |
| 4352 |
} |
| 4353 |
elseif($this->type == "dropdown" && $_is_not_form !== true ){ |
| 4354 |
$combined_array = array_combine($this->field['value'],$this->field['display']); |
| 4355 |
$corrected_value = array(); |
| 4356 |
|
| 4357 |
if( gettype($value) == 'string' ) $value = array($value); |
| 4358 |
|
| 4359 |
for($a = 0 ; $a < sizeof($value) ; $a++ ) |
| 4360 |
{ |
| 4361 |
if(isset($value[$a])) |
| 4362 |
{ |
| 4363 |
if($this->field['list_type']=='None') |
| 4364 |
{ |
| 4365 |
$corrected_value[$a] = isset($combined_array[$value[$a]]) ? $combined_array[$value[$a]] : ""; |
| 4366 |
if( isset($_other_values['is_conditional']) ) |
| 4367 |
{ |
| 4368 |
$corrected_value[$a] = $value[$a]; |
| 4369 |
} |
| 4370 |
} else { |
| 4371 |
$corrected_value[$a] = $value[$a]; |
| 4372 |
} |
| 4373 |
} |
| 4374 |
|
| 4375 |
} |
| 4376 |
$value = implode(", ",$corrected_value); |
| 4377 |
|
| 4378 |
}else if( ($this->type == "checkbox" || $this->type == "radio") && $_is_not_form !== true ) |
| 4379 |
{ |
| 4380 |
$combined_array = array_combine($this->field['value'],$this->field['display']); |
| 4381 |
$corrected_value = array(); |
| 4382 |
|
| 4383 |
if( gettype($value) == 'string' ) $value = array($value); |
| 4384 |
|
| 4385 |
for($a = 0 ; $a < sizeof($value) ; $a++ ) |
| 4386 |
{ |
| 4387 |
if(isset($value[$a]) && !empty($value[$a])) |
| 4388 |
$corrected_value[$a] = $combined_array[$value[$a]]; |
| 4389 |
} |
| 4390 |
|
| 4391 |
$value = implode(", ",$corrected_value); |
| 4392 |
} |
| 4393 |
else if($this->type=="address") |
| 4394 |
{ |
| 4395 |
$results = ""; |
| 4396 |
if(is_array($value)) { |
| 4397 |
$ret = (isset($value[0]) && is_array($value[0])) ? $value[0] : $value; |
| 4398 |
foreach($ret as $key => $val) { |
| 4399 |
$results .= ucwords(apply_filters('pie_register_translate_'.$key,$key)) . ' : ' . $val . '<br />'; |
| 4400 |
} |
| 4401 |
} |
| 4402 |
$value = $results; |
| 4403 |
} |
| 4404 |
else if($this->type=="textarea" || ($this->type=="default" && $this->slug == "description") ){ |
| 4405 |
$value = nl2br($value); |
| 4406 |
} |
| 4407 |
else if($this->type=="upload" && is_array($value) ){ |
| 4408 |
$value = !empty($value) ? $value[0] : ''; |
| 4409 |
} |
| 4410 |
else if( is_array($value) ) |
| 4411 |
{ |
| 4412 |
$value = implode(",", $value); |
| 4413 |
} |
| 4414 |
return $value; |
| 4415 |
} |
| 4416 |
|
| 4417 |
public function admin_footer_text() |
| 4418 |
{ |
| 4419 |
$current_screen = get_current_screen(); |
| 4420 |
|
| 4421 |
// Add the dashboard pages |
| 4422 |
$pie_pages[] = 'toplevel_page_pie-register'; |
| 4423 |
$pie_pages[] = 'admin_page_pr_new_registration_form'; |
| 4424 |
$pie_pages[] = 'pie-register_page_pie-notifications'; |
| 4425 |
$pie_pages[] = 'pie-register_page_pie-invitation-codes'; |
| 4426 |
$pie_pages[] = 'pie-register_page_pie-social-sites'; |
| 4427 |
$pie_pages[] = 'pie-register_page_pie-gateway-settings'; |
| 4428 |
$pie_pages[] = 'pie-register_page_pie-settings'; |
| 4429 |
$pie_pages[] = 'pie-register_page_pie-import-export'; |
| 4430 |
$pie_pages[] = 'pie-register_page_pie-pie-black-listed-users'; |
| 4431 |
$pie_pages[] = 'pie-register_page_pie-pro-features'; |
| 4432 |
if( !get_option("pie_admin_footer_text_rated") ) |
| 4433 |
{ |
| 4434 |
if ( isset( $current_screen->id ) && in_array( $current_screen->id, $pie_pages ) ) { |
| 4435 |
?> |
| 4436 |
<p>If you like Pie Register please leave us a <a href="https://wordpress.org/support/plugin/pie-register/reviews/" target="_blank" class="pie-admin-rating-link" data-nonce="<?php echo esc_attr( wp_create_nonce( 'pie_rated_nonce' ) ); ?>" data-rated="<?php esc_attr_e( 'Thanks :)', 'pie-register' ); ?>"> ★★★★★</a> rating. A huge thanks in advance!</p> |
| 4437 |
|
| 4438 |
<script type="text/javascript"> |
| 4439 |
jQuery( 'a.pie-admin-rating-link' ).click(function() { |
| 4440 |
nonce_rated = jQuery( this ).data('nonce'); |
| 4441 |
jQuery.ajax({ |
| 4442 |
url: ajaxurl, |
| 4443 |
type: 'post', |
| 4444 |
data: { |
| 4445 |
nonce: nonce_rated, |
| 4446 |
action: 'pie_rated', |
| 4447 |
}, |
| 4448 |
success: function(){ |
| 4449 |
|
| 4450 |
} |
| 4451 |
}); |
| 4452 |
jQuery(this).parent().text( jQuery( this ).data( 'rated' ) ); |
| 4453 |
}); |
| 4454 |
</script> |
| 4455 |
<?php |
| 4456 |
|
| 4457 |
} |
| 4458 |
} |
| 4459 |
} |
| 4460 |
|
| 4461 |
public function piereg_admin_header() |
| 4462 |
{ |
| 4463 |
// Omit header from Welcome activation screen. |
| 4464 |
if ( isset($_REQUEST['page']) && 'pieregister-getting-started' === $_REQUEST['page'] ) |
| 4465 |
{ |
| 4466 |
return; |
| 4467 |
} |
| 4468 |
|
| 4469 |
if ( empty( $_REQUEST['page'] ) || ( (strpos( $_REQUEST['page'], 'pie' ) === false) && (strpos( $_REQUEST['page'], 'pr_' ) === false) )) { |
| 4470 |
return false; |
| 4471 |
} |
| 4472 |
|
| 4473 |
do_action( 'piereg_admin_header_before' ); |
| 4474 |
?> |
| 4475 |
<div id="piereg-header-temp"></div> |
| 4476 |
<div id="piereg-header" class="piereg-header"> |
| 4477 |
<div class="piereg-notice"> |
| 4478 |
<?php |
| 4479 |
if(!$this->piereg_pro_is_activate()) |
| 4480 |
{ |
| 4481 |
do_action( 'piereg_notice_in_header' ); |
| 4482 |
} |
| 4483 |
?> |
| 4484 |
</div> |
| 4485 |
<div class="piereg-logo"> |
| 4486 |
<img class="piereg-header-logo" src="<?php echo esc_url(plugins_url("assets/images/pie-register-logo.svg", dirname(__FILE__) )); ?>" alt="Pie Register Logo"> |
| 4487 |
</div> |
| 4488 |
</div> |
| 4489 |
<?php |
| 4490 |
do_action( 'piereg_admin_header_after' ); |
| 4491 |
} |
| 4492 |
|
| 4493 |
/** |
| 4494 |
* Get the list of allowed tags, used in pair with wp_kses() function. |
| 4495 |
* This allows getting rid of all potentially harmful HTML tags and attributes. |
| 4496 |
* |
| 4497 |
* @since 3.7.1.5 |
| 4498 |
* |
| 4499 |
* @return array Allowed Tags. |
| 4500 |
*/ |
| 4501 |
function piereg_forms_get_allowed_tags() { |
| 4502 |
|
| 4503 |
static $allowed_tags; |
| 4504 |
|
| 4505 |
if ( ! empty( $allowed_tags ) ) { |
| 4506 |
return $allowed_tags; |
| 4507 |
} |
| 4508 |
|
| 4509 |
$atts = [ 'align', 'class', 'type', 'id', 'for', 'style', 'src', 'rel', 'href', 'target', 'value', 'width', 'height', 'data-*', 'placeholder', 'name', 'method', 'action', 'min', 'max', 'enctype', 'checked', 'selected', 'disabled', 'alt', 'onclick', 'autocomplete', 'onsubmit', 'multiple', 'label']; |
| 4510 |
$tags = [ 'label', 'form', 'style', 'input','button', 'strong', 'small', 'table', 'span', 'abbr', 'code', 'pre', 'div', 'img', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'li', 'em', 'hr', 'br', 'th', 'tr', 'td', 'p', 'a', 'b', 'i', 'select', 'option', 'textarea', 's', 'optgroup' ]; |
| 4511 |
|
| 4512 |
$allowed_atts = array_fill_keys( $atts, true ); |
| 4513 |
$allowed_tags = array_fill_keys( $tags, $allowed_atts ); |
| 4514 |
|
| 4515 |
return $allowed_tags; |
| 4516 |
} |
| 4517 |
function pie_users_custom_column_name($column_name) { |
| 4518 |
|
| 4519 |
return $column_name; |
| 4520 |
|
| 4521 |
} |
| 4522 |
function piereg_get_uploaded_dir($user_id, $field_slug){ |
| 4523 |
$upload_dir = wp_upload_dir(); |
| 4524 |
$temp_dir = realpath($upload_dir['basedir'])."/piereg_users_files/".$user_id."/".$field_slug; |
| 4525 |
|
| 4526 |
return $temp_dir; |
| 4527 |
} |
| 4528 |
} |
| 4529 |
} |
| 4530 |
|