晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/rainic/public_html/oldTZh/wp-content/plugins/digits/includes/plugins/ |
Upload File : |
<?php
if (!defined('ABSPATH')) {
exit;
}
add_action('bp_signup_pre_validate', 'dig_bp_signup_pre_validate', 20);
function dig_bp_signup_pre_validate()
{
global $bp;
$countrycode = sanitize_text_field($_POST['digt_countrycode']);
$mobile = sanitize_mobile_field_dig($_POST['mobile/email']);
$otp = sanitize_text_field($_POST['digit_ac_otp']);
$csrf = sanitize_text_field($_POST['csrf']);
$validateMob = dig_validateMobileNumber($countrycode, $mobile, $otp, $csrf, 2, $_POST['code'], true);
if ($validateMob['success'] === false) {
$bp->signup->errors['signup_mobile'] = $validateMob['msg'];
}
}
function dig_bp_add_user_meta($user_id, $user_login, $user_password, $user_email, $usermeta)
{
if (!is_wp_error($user_id)) {
$countrycode = sanitize_text_field($_POST['digt_countrycode']);
$mobile = sanitize_text_field($_POST['mobile/email']);
update_user_meta($user_id, 'digt_countrycode', $countrycode);
update_user_meta($user_id, 'digits_phone_no', $mobile);
update_user_meta($user_id, 'digits_phone', $countrycode . $mobile);
}
}
add_action('bp_core_signup_user', 'dig_bp_add_user_meta', 10, 5);
function dig_bp_validation_error()
{
global $bp;
if (!isset($bp->signup->errors['signup_mobile'])) {
return;
}
echo '<div class="error">' . $bp->signup->errors['signup_mobile'] . '</div>';
}
add_action('bp_account_details_fields', 'dig_bp_show_mobile_number');
function dig_bp_show_mobile_number()
{
?>
<div>
<label for="username"><?php _e('Mobile Number', 'digits'); ?><?php _e('(required)', 'buddypress'); ?></label>
<input type="text" name="username" id="username" value="" mob="1"/>
</div>
<?php dig_bp_validation_error(); ?>
<?php
}
add_action('bp_account_details_fields', 'dig_otp_bp_reg', 1000);
function dig_otp_bp_reg()
{
?>
<input type="hidden" name="dig_nounce" class="dig_nounce" value="<?php echo wp_create_nonce('dig_form') ?>">
<div id="dig_bp_reg_otp">
<label for="digit_ac_otp"><?php _e("OTP", "digits"); ?> <span class="required">*</span></label>
<input type="text" class="input-text" name="digit_ac_otp" id="digit_ac_otp"/>
</div>
<?php
//echo "<div class=\"dig_bp_enb\" style='display:none;'>";
}
function dig_createUser($name, $mobileormail, $csrf, $code)
{
}
//add_action('bp_account_details_fields','dig_bp_reg_end',1);
function dig_bp_reg_end()
{
//echo "</div>";
}
add_action('bp_before_registration_submit_buttons', 'dig_bp_sub_reg', 1);
function dig_bp_sub_reg()
{
?>
<input type="hidden" name="code" id="dig_bp_reg_code">
<input type="hidden" name="csrf" id="dig_bp_reg_csrf">
<?php
}
add_action('bp_after_registration_submit_buttons', 'dig_bp_reg_end', 1);
add_action('bp_core_general_settings_before_submit', 'addCurrentmobHidden');
function addCurrentmobHidden()
{
?>
<label><?php _e("Mobile Number", "digits"); ?></label>
<input type="text" name="bp_edit_user_mobile" id="username" mob="1" f-mob="1"
countryCode="<?php echo esc_attr(get_the_author_meta('digt_countrycode', get_current_user_id())); ?>"
value="<?php echo esc_attr(get_the_author_meta('digits_phone_no', get_current_user_id())); ?>"/>
<input type="hidden" name="dig_nounce" class="dig_nounce" value="<?php echo wp_create_nonce('dig_form') ?>">
<input type="hidden" name="code" id="dig_bp_ea_code"/>
<input type="hidden" name="csrf" id="dig_bp_ea_csrf"/>
<?php if (is_super_admin()) : ?>
<input type="hidden" id="dig_superadmin">
<?php endif; ?>
<input type="hidden" name="current_mob" id="dig_bp_current_mob"
value="<?php echo esc_attr(get_the_author_meta('digits_phone_no', get_current_user_id())); ?>"/>
<div id="bp_otp_dig_ea" style="display: none;"><label for="digit_ac_otp"><?php _e("OTP", "digits"); ?> <span
class="required">*</span></label>
<input type="text" class="input-text" name="digit_ac_otp" id="digit_ac_otp"/>
</div>
<?php
}
add_action('bp_core_general_settings_after_submit', 'add_dig_otp_bp');
function add_dig_otp_bp()
{
echo "<div class=\"dig_resendotp dig_bp_ac_ea_resend\" id=\"dig_man_resend_otp_btn\" style='text-align: inherit;' dis='1'>" . __('Resend OTP', 'digits') . " <span>(00:<span>" . dig_getOtpTime() . "</span>)</span></div>";
}
add_action('bp_actions', 'dig_bp_settings_action_general');
function dig_bp_settings_action_general()
{
if (isset($_POST['mobile/email']) && isset($_POST['dig_nounce']) && is_user_logged_in()) {
$phone = sanitize_mobile_field_dig($_POST['mobile/email']);
$countrycode = sanitize_text_field($_POST['digt_countrycode']);
if (empty($phone) || !is_numeric($phone)) {
return;
}
$otp = sanitize_text_field($_POST['digit_ac_otp']);
if (!is_super_admin()) {
if (empty($otp)) {
return;
}
if (verifyOTP($countrycode, $phone, $otp, true)) {
$mob = $countrycode . $phone;
} else {
return;
}
}
if (!empty($mob)) {
$user = getUserFromPhone($mob);
if ($phone != 0 && $user == null) {
update_user_meta(get_current_user_id(), 'digt_countrycode', $countrycode);
update_user_meta(get_current_user_id(), 'digits_phone_no', $phone);
update_user_meta(get_current_user_id(), 'digits_phone', $countrycode . $phone);
}
}
}
}