当前位置: 首页>>代码示例>>PHP>>正文


PHP userpro_get_option函数代码示例

本文整理汇总了PHP中userpro_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP userpro_get_option函数的具体用法?PHP userpro_get_option怎么用?PHP userpro_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了userpro_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: userpro_fields_validation

function userpro_fields_validation($errors, $form)
{
    global $userpro;
    $phonefields = userpro_get_option('phonefields');
    if (!$phonefields) {
        $phonefields = array('');
    } else {
        $phonefields = explode(',', $phonefields);
    }
    if (userpro_get_option('max_field_length_active')) {
        $max_field_length_include = userpro_get_option('max_field_length_include');
        if ($max_field_length_include != '') {
            $max_field_length_include = explode(',', $max_field_length_include);
        } else {
            $max_field_length_include = array('');
        }
    }
    // validate form
    foreach ($form as $k => $v) {
        if ($userpro->field_exists($k) && in_array($k, $phonefields) && $v != '' && !preg_match(userpro_get_option('phonefields_regex'), $v)) {
            $errors[$k] = __('Please enter a correct phone number', 'userpro');
        }
        if (isset($max_field_length_include)) {
            if ($userpro->field_exists($k) && $userpro->field_type($k) == 'text' && $v != '' && strlen($v) > userpro_get_option('max_field_length') && $userpro->field_label($k) && in_array($k, $max_field_length_include)) {
                $errors[$k] = sprintf(__('%s must not exceed %s characters', 'userpro'), $userpro->field_label($k), userpro_get_option('max_field_length'));
            }
        }
    }
    return $errors;
}
开发者ID:Darciro,项目名称:PPM,代码行数:30,代码来源:fields-filters.php

示例2: userpro_before_form_submit

function userpro_before_form_submit($args)
{
    global $userpro;
    extract($args);
    if ($args['template'] == 'register' && userpro_get_option('terms_agree') == 1) {
        ?>
			
			<div class="userpro-column">
				<div class="userpro-field userpro-maxwidth" data-required="1" data-required_msg="<?php 
        _e('You must accept our terms and conditions', 'userpro');
        ?>
">
					<div class="userpro-input">
					
						<div class='userpro-checkbox-wrap'>
							<label class='userpro-checkbox full'>
								<span></span>
								<input type='checkbox' name='terms' id="terms" /><?php 
        echo html_entity_decode(userpro_get_option('terms_agree_text'));
        ?>
							</label>
						</div>
						
					</div>
				</div>
			</div><div class="userpro-clear"></div>
			
			<?php 
    }
}
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:30,代码来源:terms-agreement.php

示例3: userpro_get_avatar

function userpro_get_avatar($avatar, $id_or_email, $size, $default, $alt = '')
{
    global $userpro;
    if (isset($id_or_email->user_id)) {
        $id_or_email = $id_or_email->user_id;
    } elseif (is_email($id_or_email)) {
        $user = get_user_by('email', $id_or_email);
        $id_or_email = $user->ID;
    }
    if ($id_or_email && userpro_profile_data('profilepicture', $id_or_email)) {
        $url = $userpro->file_uri(userpro_profile_data('profilepicture', $id_or_email));
        $crop = userpro_url . "lib/timthumb.php?src=" . $url . "&amp;w={$size}&amp;h={$size}&amp;a=t&amp;q=100";
        $return = '<img src="' . $crop . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="modified avatar" />';
    } else {
        if ($id_or_email && userpro_profile_data('gender', $id_or_email)) {
            $gender = strtolower(userpro_profile_data('gender', $id_or_email));
        } else {
            $gender = 'male';
            // default gender
        }
        $userpro_default = userpro_url . 'img/default_avatar_' . $gender . '.jpg';
        $return = '<img src="' . $userpro_default . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="default avatar" />';
    }
    if (userpro_profile_data('profilepicture', $id_or_email) != '') {
        return $return;
    } else {
        if (userpro_get_option('use_default_avatars') == 1) {
            return $avatar;
        } else {
            return $return;
        }
    }
}
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:33,代码来源:hooks-filters.php

示例4: userpro_get_avatar

function userpro_get_avatar($avatar, $id_or_email, $size, $default, $alt = '')
{
    global $userpro;
    require_once userpro_path . 'lib/BFI_Thumb.php';
    if (isset($id_or_email->user_id)) {
        $id_or_email = $id_or_email->user_id;
    } elseif (is_email($id_or_email)) {
        $user = get_user_by('email', $id_or_email);
        $id_or_email = $user->ID;
    }
    if ($id_or_email && userpro_profile_data('profilepicture', $id_or_email)) {
        $url = $userpro->file_uri(userpro_profile_data('profilepicture', $id_or_email), $id_or_email);
        $params = array('width' => $size, 'height' => $size, 'quality' => 100);
        $crop = bfi_thumb(get_site_url() . (strpos($url, "http") !== false ? urlencode($url) : $url), $params);
        $return = '<img src="' . $crop . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="modified avatar" />';
    } else {
        if ($id_or_email && userpro_profile_data('gender', $id_or_email)) {
            $gender = strtolower(userpro_profile_data('gender', $id_or_email));
        } else {
            $gender = 'male';
            // default gender
        }
        $userpro_default = userpro_url . 'img/default_avatar_' . $gender . '.jpg';
        $return = '<img src="' . $userpro_default . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="default avatar" />';
    }
    if (userpro_profile_data('profilepicture', $id_or_email) != '') {
        return $return;
    } else {
        if (userpro_get_option('use_default_avatars') == 1) {
            return $avatar;
        } else {
            return $return;
        }
    }
}
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:35,代码来源:hooks-filters.php

示例5: userpro_remove_admin_bar

function userpro_remove_admin_bar()
{
    if (!current_user_can('manage_options') && !is_admin()) {
        if (userpro_get_option('hide_admin_bar')) {
            show_admin_bar(false);
        }
    }
}
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:8,代码来源:hooks-actions.php

示例6: userpro_admin_users_badges

function userpro_admin_users_badges($value, $column_name, $user_id)
{
    global $userpro;
    $user = get_userdata($user_id);
    if (userpro_get_option('backend_users_change')) {
        if ('userpro_username' == $column_name) {
            $res = '<div class="upadmin-avatar">' . get_avatar($user_id, 40) . '</div>';
            $res .= '<strong><a href="' . $userpro->permalink($user_id) . '" target="_blank" title="' . __('View Profile', 'userpro') . '">' . $user->user_login . '</a></strong><br />';
            $res .= '<span class="upadmin-small-name">(' . userpro_profile_data('display_name', $user_id) . ')</span>';
            $res .= '<div class="row-actions"><span class="edit"><a href="' . $userpro->permalink($user_id, 'edit') . '" target="_blank">' . __('Edit Profile', 'userpro') . '</a></span></div>';
            return $res;
        }
    }
    if ('userpro_admin_badges' == $column_name) {
        $res = userpro_show_badges($user_id, true);
        return $res;
    }
    if ('userpro_verify' == $column_name) {
        $res = '<div class="upadmin-verify-v2">';
        if ($userpro->get_verified_status($user_id) == 0) {
            $res .= '<a href="#" class="button upadmin-verify-u" data-user="' . $user_id . '">' . userpro_get_badge('unverified') . '</a>';
        } else {
            if (userpro_is_admin($user_id)) {
                $res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
            } else {
                $res .= '<a href="#" class="button button-primary upadmin-unverify-u" data-user="' . $user_id . '">' . userpro_get_badge('verified') . '</a>';
            }
        }
        if ($userpro->get_verified_status($user_id) == 0) {
            if ($userpro->invited_to_verify($user_id)) {
                $res .= '&nbsp;&nbsp;' . __('Invitation sent!', 'userpro');
            } else {
                $res .= '<a href="#" class="button upadmin-invite-u" data-user="' . $user_id . '">' . __('Verified Invite', 'userpro') . '</a>';
            }
        }
        $res .= '</div>';
        return $res;
    }
    if ('block_users' == $column_name) {
        $res = '<div class="upadmin-block-v2">';
        if ($userpro->get_account_status($user_id) == 0) {
            $res .= '<a href="#" class="button upadmin-block-u" data-user="' . $user_id . '">' . userpro_get_badge('unblocked') . '</a>';
        } else {
            if (userpro_is_admin($user_id)) {
                $res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
            } else {
                $res .= '<a href="#" class="button upadmin-unblock-u" data-user="' . $user_id . '">' . userpro_get_badge('blocked') . '</a>';
            }
        }
        if ($userpro->get_account_status($user_id) == 1) {
            $res .= '<span class="button" data-user="' . $user_id . '">' . __('Account Blocked', 'userpro') . '</span>';
        }
        $res .= '</div>';
        $res .= '</div>';
        return $res;
    }
    return $value;
}
开发者ID:Darciro,项目名称:PPM,代码行数:58,代码来源:admin-users.php

示例7: userpro_register_redirect_uri

function userpro_register_redirect_uri()
{
    global $userpro;
    $possible = userpro_get_option('register_redirect_users');
    if ($possible == 1) {
        return $userpro->permalink(0, 'register');
    }
    if ($possible == 2) {
        return userpro_get_option('register_redirect_users_url');
    }
}
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:11,代码来源:common-functions.php

示例8: userpro_remove_admin_bar

function userpro_remove_admin_bar()
{
    global $userpro;
    if (!current_user_can('manage_options') && !is_admin()) {
        if (userpro_get_option('hide_admin_bar')) {
            if (userpro_get_option('allow_dashboard_for_these_roles') && userpro_is_logged_in() && $userpro->user_role_in_array(get_current_user_id(), explode(',', userpro_get_option('allow_dashboard_for_these_roles')))) {
            } else {
                show_admin_bar(false);
            }
        }
    }
}
开发者ID:httvncoder,项目名称:151722441,代码行数:12,代码来源:hooks-actions.php

示例9: userpro_unverify_verified_account

function userpro_unverify_verified_account($form, $user_id)
{
    global $userpro;
    // validate display name change
    if (!userpro_is_admin($user_id) && userpro_get_option('unverify_on_namechange') && $userpro->get_verified_status($user_id) == 1 && !current_user_can('manage_options')) {
        if (isset($form['display_name'])) {
            $old_displayname = userpro_profile_data('display_name', $user_id);
            $new_displayname = $form['display_name'];
            if ($new_displayname != $old_displayname) {
                $userpro->unverify($user_id);
            }
        }
    }
}
开发者ID:httvncoder,项目名称:151722441,代码行数:14,代码来源:fields-hooks.php

示例10: widget

    public function widget($args, $instance)
    {
        if (userpro_get_option('userpro_invite_emails_enable') == 1 && is_user_logged_in()) {
            $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']);
            echo $args['before_widget'];
            if (!empty($instance['title'])) {
                echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
            }
            ?>
	
	<?php 
            include userpro_path . "templates/inviter_user_widgets.php";
            echo $args['after_widget'];
        }
    }
开发者ID:Darciro,项目名称:PPM,代码行数:15,代码来源:invite_users_widgets.php

示例11: userpro_update_1024

function userpro_update_1024()
{
    if (!userpro_update_installed('1024') && get_option('userpro_pages')) {
        $pages = get_option('userpro_pages');
        if (!isset($pages['logout_page'])) {
            $slug_logout = userpro_get_option('slug_logout');
            $logout_page = array('post_title' => __('Logout', 'userpro'), 'post_content' => '', 'post_name' => $slug_logout, 'comment_status' => 'closed', 'post_type' => 'page', 'post_status' => 'publish', 'post_author' => 1);
            $logout_page = wp_insert_post($logout_page);
            $pages['logout_page'] = $logout_page;
            $post = get_post($logout_page, ARRAY_A);
            userpro_set_option('slug_logout', $post['post_name']);
            update_option('userpro_pages', $pages);
            update_option("userpro_update_1024", 1);
        }
    }
}
开发者ID:Darciro,项目名称:PPM,代码行数:16,代码来源:userpro_1.0.24.php

示例12: new_notification

 function new_notification($to, $user_id = 0, $action)
 {
     global $userpro;
     $headers = 'From: ' . userpro_get_option('mail_from_name') . ' <' . userpro_get_option('mail_from') . '>' . "\r\n";
     switch ($action) {
         case 'new_follow':
             $subject = sprintf(__('%s is now following you!', 'userpro'), userpro_profile_data('display_name', $user_id));
             $message = __('Hi there,', 'userpro') . "\r\n\r\n";
             $message .= sprintf(__("%s is now following you on %s! You can click the following link to view his/her profile:", "userpro"), userpro_profile_data('display_name', $user_id), userpro_get_option('mail_from_name')) . "\r\n";
             $message .= $userpro->permalink($user_id) . "\r\n\r\n";
             $message .= __("Or view your profile at:", "userpro") . "\r\n";
             $message .= $userpro->permalink($to->ID) . "\r\n\r\n";
             $message .= __('This is an automated notification that was sent to you by UserPro. No further action is needed.', 'userpro');
             break;
     }
     wp_mail($to->user_email, $subject, $message, $headers);
 }
开发者ID:ingridlima,项目名称:userpro-custom,代码行数:17,代码来源:api.php

示例13: userpro_sc_bar

function userpro_sc_bar($args)
{
    global $userpro, $userpro_social;
    extract($args);
    if (!userpro_get_option('modstate_social')) {
        return false;
    }
    // where to add the hook
    if (in_array($args['template'], array('view', 'following', 'followers')) && !isset($args['no_style'])) {
        ?>
		
		<div class="userpro-sc-bar">
		
			<div class="userpro-sc-left">
				<a href="<?php 
        echo $userpro->permalink($user_id, 'following', 'userpro_sc_pages');
        ?>
" class="userpro-count-link"><?php 
        echo $userpro_social->following_count($user_id);
        ?>
</a>
				<a href="<?php 
        echo $userpro->permalink($user_id, 'followers', 'userpro_sc_pages');
        ?>
" class="userpro-count-link"><?php 
        echo $userpro_social->followers_count($user_id);
        ?>
</a>
			</div>
			
			<div class="userpro-sc-right">
				<?php 
        echo $userpro_social->follow_text($user_id, get_current_user_id());
        ?>
				<?php 
        do_action('userpro_social_buttons', $user_id);
        ?>
			</div>
			
			<div class="userpro-clear"></div>
		
		</div>
		
		<?php 
    }
}
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:46,代码来源:hooks-actions.php

示例14: email_broadcaster

 function email_broadcaster($to, $msg)
 {
     global $userpro;
     if (userpro_msg_get_option('email_notifications') == 1) {
         $user = get_userdata($to);
         $display_name = userpro_profile_data('display_name', userpro_get_option('mail_from'));
         $subject = sprintf(__('Your Message has been Broadcast Successful!', 'userpro-msg'), $display_name);
         // message
         $msg = stripslashes($msg);
         $body = __('Hi there,', 'userpro-msg') . "<br>";
         $body .= sprintf(__('Your message has been broadcasted successfully', 'userpro-msg'), userpro_get_option('mail_from_name'), $display_name) . "<br>";
         $body .= sprintf(__('The message you have broadcasted is :', 'userpro-msg')) . "<br>";
         $body .= "===========================================" . "<br>";
         $body .= $msg . "<br>";
         $body .= "===========================================" . "<br>";
         $headers = 'From: ' . userpro_get_option('mail_from_name') . ' <' . userpro_get_option('mail_from') . '>' . "\r\n";
         $headers .= "MIME-Version: 1.0" . "\r\n";
         $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
         wp_mail($user->user_email, $subject, $body, $headers);
     }
 }
开发者ID:fritzdenim,项目名称:pangMoves,代码行数:21,代码来源:api.php

示例15: userpro_init

function userpro_init()
{
    if (!isset($_SESSION)) {
        session_start();
    }
    global $userpro;
    $result = get_option("userpro_invite_check");
    if (empty($result)) {
        $user_invite_template = userpro_get_option('userpro_invite_emails_template');
        $userpro_options = get_option('userpro');
        $userpro_options['userpro_invite_emails_template'] = str_replace("inivitelink", "invitelink", userpro_get_option('userpro_invite_emails_template'));
        update_option('userpro', $userpro_options);
        update_option("userpro_invite_check", "1");
    }
    $userpro->do_uploads_dir();
    load_plugin_textdomain('userpro', false, dirname(plugin_basename(__FILE__)) . '/languages');
    /* include libs */
    require_once userpro_path . '/lib/envato/Envato_marketplaces.php';
    if (!class_exists('UserProMailChimp')) {
        require_once userpro_path . '/lib/mailchimp/MailChimp.php';
    }
}
开发者ID:Darciro,项目名称:PPM,代码行数:22,代码来源:index.php


注:本文中的userpro_get_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。