コード例 #1
0
ファイル: widgets.php プロジェクト: linniepinski/perssistant
    /**
     * Outputs the HTML for this widget.
     *
     * @param array  An array of standard parameters for widgets in this theme
     * @param array  An array of settings for this widget instance
     * @return void Echoes it's output
     **/
    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        echo $before_widget;
        echo $before_title;
        echo $instance['title'];
        // Can set this with a widget option, or omit altogether
        echo $after_title;
        ?>
        <ul class="social-list-footer">
            <?php 
        if (ae_get_option('site_facebook')) {
            echo '<li><a href="' . ae_get_option('site_facebook') . '"><span><i class="fa fa-facebook"></i></span>' . __("Facebook", 'widgets-backend') . '</a></li>';
        }
        ?>
            <?php 
        if (ae_get_option('site_twitter')) {
            echo '<li><a href="' . ae_get_option('site_twitter') . '"><span><i class="fa fa-twitter"></i></span>' . __("Twitter", 'widgets-backend') . '</a></li>';
        }
        ?>

            <?php 
        if (ae_get_option('site_google')) {
            echo '<li><a href="' . ae_get_option('site_google') . '"><span><i class="fa fa-google-plus"></i></span>' . __("Google+", 'widgets-backend') . '</a></li>';
        }
        ?>
        </ul>
    <?php 
        echo $after_widget;
    }
コード例 #2
0
ファイル: profiles.php プロジェクト: linniepinski/perssistant
/**
 * Create a taxonomy
 *
 * @uses  Inserts new taxonomy object into the list
 * @uses  Adds query vars
 *
 * @param string  Name of taxonomy object
 * @param array|string  Name of the object type for the taxonomy object.
 * @param array|string  Taxonomy arguments
 * @return null|WP_Error WP_Error if errors, otherwise null.
 */
function fre_register_tax_skill()
{
    $status = false;
    $switch_skill = ae_get_option('switch_skill');
    if ($switch_skill) {
        $status = true;
    }
    $labels = array('name' => _x('Skills', 'Taxonomy plural name', 'profiles-backend'), 'singular_name' => _x('Skill', 'Taxonomy singular name', 'profiles-backend'), 'search_items' => __('Search Skills', 'profiles-backend'), 'popular_items' => __('Popular Skills', 'profiles-backend'), 'all_items' => __('All Skills', 'profiles-backend'), 'parent_item' => __('Parent Skill', 'profiles-backend'), 'parent_item_colon' => __('Parent Skill', 'profiles-backend'), 'edit_item' => __('Edit Skill', 'profiles-backend'), 'update_item' => __('Update Skill ', 'profiles-backend'), 'add_new_item' => __('Add New Skill ', 'profiles-backend'), 'new_item_name' => __('New Skill Name', 'profiles-backend'), 'add_or_remove_items' => __('Add or remove skill', 'profiles-backend'), 'choose_from_most_used' => __('Choose from most used enginetheme', 'profiles-backend'), 'menu_name' => __('Skills', 'profiles-backend'));
    $args = array('labels' => $labels, 'public' => true, 'show_in_nav_menus' => true, 'show_admin_column' => true, 'hierarchical' => $status, 'show_tagcloud' => true, 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => ae_get_option('skill_slug', 'skill')), 'query_var' => true, 'capabilities' => array('manage_terms', 'edit_terms', 'delete_terms', 'assign_terms'));
    register_taxonomy('skill', array(PROFILE, PORTFOLIO, PROJECT), $args);
}
コード例 #3
0
ファイル: user_actions.php プロジェクト: maratdev/alllancer
 function after_register($result)
 {
     $user = new WP_User($result);
     // add key confirm for user
     if (ae_get_option('user_confirm')) {
         update_user_meta($result, 'register_status', 'unconfirm');
         update_user_meta($result, 'key_confirm', md5($user->user_email));
     }
     /* === Send Email Register === */
     $this->mail->register_mail($result);
 }
コード例 #4
0
 public function get_current_style()
 {
     $current_style_id = ae_get_option('map_center_default', null);
     if ($current_style_id !== null && isset($current_style_id['style'])) {
         $current_style_id = $current_style_id['style'];
         $style_object = $this->get_style($current_style_id);
         if (!is_wp_error($style_object)) {
             return $style_object;
         }
     }
     return null;
 }
コード例 #5
0
ファイル: google.php プロジェクト: maratdev/alllancer
 public function __construct()
 {
     parent::__construct('google', 'et_google_id', array('title' => __('SIGN IN WITH GOOGLE+', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your Google+ account.If you already have an account, please log in using the form below to link it to your Facebook account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->add_ajax('ae_gplus_auth', 'ae_gplus_redirect');
     $this->gplus_client_id = ae_get_option('gplus_client_id');
     $this->gplus_secret_key = ae_get_option('gplus_secret_id');
     $this->gplus_base_url = 'https://accounts.google.com/o/oauth2/auth';
     $this->gplus_exchange_url = 'https://www.googleapis.com/oauth2/v3/token';
     $this->gplus_token_info_url = 'https://www.googleapis.com/oauth2/v1/userinfo';
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'gplus_auth_callback') {
         if (!empty($this->gplus_client_id) && !empty($this->gplus_secret_key) && !is_user_logged_in()) {
             $this->auth_google();
         } else {
             _e('Please enter your Google client id and secret key in setting page!', ET_DOMAIN);
             exit;
         }
     }
 }
コード例 #6
0
ファイル: linkedin.php プロジェクト: maratdev/alllancer
 public function __construct()
 {
     parent::__construct('linkedin', 'et_linkedin_id', array('title' => __('SIGN IN WITH LINKEDIN', ET_DOMAIN), 'content' => __("This seems to be your first time signing in using your LinkedIn account.If you already have an account, please log in using the form below to link it to your LinkedIn account. Otherwise, please enter an email address and a password on the form, and a username on the next page to create an account.You will only do this step ONCE. Next time, you'll get logged in right away.", ET_DOMAIN), 'content_confirm' => __("Please provide a username to continue", ET_DOMAIN)));
     $this->state = md5(uniqid());
     $this->add_ajax('ae_linked_auth', 'lkin_redirect');
     $this->linkedin_api_key = ae_get_option('linkedin_api_key');
     $this->linkedin_secret_key = ae_get_option('linkedin_secret_key');
     $this->linkedin_base_url = 'https://www.linkedin.com/uas/oauth2/authorization';
     $this->linkedin_token_url = 'https://www.linkedin.com/uas/oauth2/accessToken';
     $this->linkedin_people_url = 'https://api.linkedin.com/v1/people/~:(id,location,picture-url,specialties,public-profile-url,email-address,formatted-name)?format=json';
     if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'linked_auth_callback') {
         if (!empty($this->linkedin_api_key) && !empty($this->linkedin_secret_key) && !is_user_logged_in()) {
             $this->linked_auth();
         } else {
             _e('Please enter your Linkedin App id and secret key!', ET_DOMAIN);
             exit;
         }
     }
 }
コード例 #7
0
ファイル: ppadaptive.php プロジェクト: maratdev/alllancer
 /**
  * description
  * @param $appID
  * @param $api_username
  * @param $api_password
  * @param $api_signature
  * @param $enpoint_url
  * @since 1.2
  * @author Dakachi
  */
 function __construct($data = array())
 {
     // if (isset($DataArray['Sandbox'])) $this->Sandbox = $DataArray['Sandbox'];
     // elseif (isset($DataArray['BetaSandbox'])) $this->Sandbox = $DataArray['BetaSandbox'];
     // else $this->Sandbox = true;
     $api = ae_get_option('escrow_paypal_api');
     $this->api_username = isset($api['username']) ? $api['username'] : '******';
     $this->api_password = isset($api['password']) ? $api['password'] : '******';
     $this->api_signature = isset($api['signature']) ? $api['signature'] : 'A6LFoneN6dpKOQkj2auJBwoVZBiLAE-QivfFWXkjxrvJZ6McADtMu8Pe';
     $this->appID = isset($api['appID']) ? $api['appID'] : 'APP-80W284485P519543T';
     $testmode = ae_get_option('test_mode');
     // test mod is on
     $this->endpoint = 'https://svcs.sandbox.paypal.com/AdaptivePayments/';
     $this->paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=';
     // live mod is on
     if (!$testmode) {
         $this->endpoint = 'https://svcs.paypal.com/AdaptivePayments/';
         $this->paypal_url = 'https://www.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey=';
     }
 }
コード例 #8
0
 public function print_scripts()
 {
     $this->add_existed_script('jquery');
     // tam thoi add de xai
     $this->add_script('jquery-validator', TEMPLATEURL . '/js/libs/jquery.validate.min.js', 'jquery');
     $this->add_script('ae-colorpicker', ae_get_url() . '/assets/js/colorpicker.js', array('jquery'));
     // ae core js appengine
     $this->add_script('appengine', ae_get_url() . '/assets/js/appengine.js', array('jquery', 'underscore', 'backbone', 'plupload', 'ae-colorpicker'));
     // control backend user list
     $this->add_script('backend-user', ae_get_url() . '/assets/js/user-list.js', array('appengine'));
     //  option settings and save
     $this->add_script('option-view', ae_get_url() . '/assets/js/option-view.js', array('appengine'));
     // control option translate
     $this->add_script('language-view', ae_get_url() . '/assets/js/language-view.js', array('appengine', 'option-view'));
     // control pack view add delete update pack
     $this->add_script('pack-view', ae_get_url() . '/assets/js/pack-view.js', array('appengine', 'option-view'));
     // backend js it should be separate by theme
     $this->add_script('backend', ae_get_url() . '/assets/js/backend.js', array('appengine'));
     wp_localize_script('appengine', 'ae_globals', array('ajaxURL' => apply_filters('ae_ajax_url', admin_url('admin-ajax.php')), 'pending_answers' => ae_get_option("pending_answers", 0), 'imgURL' => ae_get_url() . '/assets/img/', 'jsURL' => ae_get_url() . '/assets/js/', 'loadingImg' => '<img class="loading loading-wheel" src="' . ae_get_url() . '/assets/img/loading.gif" alt="' . __('Loading...', ET_DOMAIN) . '">', 'loading' => __('Loading', ET_DOMAIN), 'plupload_config' => array('max_file_size' => '3mb', 'url' => admin_url('admin-ajax.php'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), 'filters' => array(array('title' => __('Image Files', ET_DOMAIN), 'extensions' => 'jpg,jpeg,gif,png')))));
 }
コード例 #9
0
function ae_ppdigital_render_button()
{
    $ppdigital_key = ae_get_option('ppdigital');
    if (!isset($ppdigital_key['username'])) {
        return;
    }
    if (!$ppdigital_key['username'] || !$ppdigital_key['password'] || !$ppdigital_key['signature']) {
        return false;
    }
    if (!isset($ppdigital_key['title']) || !$ppdigital_key['title']) {
        $ppdigital_key['title'] = __("Paypal DG", ET_DOMAIN);
    }
    if (!isset($ppdigital_key['desc']) || !$ppdigital_key['desc']) {
        $ppdigital_key['desc'] = __("Send your payment to our Paypal account", ET_DOMAIN);
    }
    ?>
    <li id="ppdigital-payment">
        <form action="" method="post" id="ppexpress_form" class="ppexpress-form" style="margin-top:0;">
            <span class="title-plan ppdigital-payment" data-type="ppdigital">
                <?php 
    echo $ppdigital_key['title'];
    ?>
                <span><?php 
    echo $ppdigital_key['desc'];
    ?>
</span>
            </span>
            <button href="#" class="btn btn-submit-price-plan other-payment" id="ppdigital-button" data-type="ppdigital"><?php 
    _e("Select", ET_DOMAIN);
    ?>
</button>
        </form>
    </li>
    
<?php 
}
コード例 #10
0
                <button type="button" class="close" data-dismiss="modal"><i class="fa fa-times"></i>
                </button>
                <?php 
if (!(ae_get_option('invited_to_bid') && !fre_check_invited($user_ID, $post->ID))) {
    ?>
                    <h4 class="modal-title"><?php 
    _e('Set your bid:', 'modal-add-bid');
    ?>
</h4>
                <?php 
}
?>
            </div>
            <div class="modal-body">
                <?php 
if (ae_get_option('invited_to_bid') && !fre_check_invited($user_ID, $post->ID)) {
    echo '<p class="lead  warning">';
    _e("Oops, You must be invited to bid this project", 'modal-add-bid');
    echo '</p>';
} else {
    ?>

                    <form id="bid_form" class="bid-form">
                        <div class="form-group">
                            <label for="bid_budget">
                                <?php 
    if (get_post_meta($post->ID, 'type_budget', true) == 'hourly_rate') {
        _e('Hourly rate', 'modal-add-bid');
    } else {
        _e('Budget', 'modal-add-bid');
    }
コード例 #11
0
<?php

/**
 * The template for displaying admin control button to edit project
 * @since 1.0
 * @author Dakachi
 */
global $post;
$featured = get_post_meta($post->ID, 'et_featured', true);
if (current_user_can('manage_options')) {
    ?>
    <?php 
    if ($post->post_status == 'complete' && ae_get_option('use_escrow')) {
        // success update order data
        $bid_id_accepted = get_post_meta($post->ID, 'accepted', true);
        $order = get_post_meta($bid_id_accepted, 'fre_bid_order', true);
        $order_status = get_post_field('post_status', $order);
        if ($order_status != 'finish') {
            ?>
            <a class="btn btn-project-status btn-excecute-project manual-transfer"  title="<?php 
            _e("Transfer Money To Freelancer", ET_DOMAIN);
            ?>
" href="#">
                <?php 
            _e("Transfer Money", ET_DOMAIN);
            ?>
            </a>
        <?php 
        } else {
            ?>
            <a class="btn btn-project-status btn-excecute-project"  href="#">
コード例 #12
0
 public static function limit_free_plan($package)
 {
     // check and limit seller user free plan
     $limit_free_plan = ae_get_option('limit_free_plan');
     $instance = self::get_instance();
     $package = $instance->get($package);
     $response = array('success' => false);
     if ($package && $package->et_price == 0 && $limit_free_plan) {
         /**
          * update number of free plan seller used
          */
         $number = self::update_used_free_plan();
         if ($number > $limit_free_plan) {
             $response['success'] = true;
             $response['msg'] = __("You have reached the maximum number of Free posts. Please select another plan.", 'aecore-class-ae-package-backend');
             return $response;
         }
     }
     return $response;
 }
コード例 #13
0
ファイル: header.php プロジェクト: linniepinski/perssistant
    $class_trans = 'class="trans-color"';
} else {
    $class_trans = 'class="not-page-home"';
}
?>
<!-- HEADER -->
<?php 
if (has_nav_menu('et_header') || !has_nav_menu('et_header_standard')) {
    get_template_part('head/fullscreen', 'header');
} else {
    get_template_part('head/standard', 'header');
}
?>

<!-- HEADER / END -->

<?php 
if (is_page_template('page-home.php')) {
    if (ae_get_option('header_youtube_id')) {
        get_template_part('head/video', 'youtube');
    } else {
        get_template_part('head/video', 'background');
    }
}
if (!is_user_logged_in()) {
    get_template_part('template-js/header', 'login');
}
global $user_ID;
if ($user_ID) {
    echo '<script type="data/json"  id="user_id">' . json_encode(array('id' => $user_ID, 'ID' => $user_ID)) . '</script>';
}
コード例 #14
0
<?php

global $wp_query, $ae_post_factory, $post;
$post_object = $ae_post_factory->get('testimonial');
$currency = ae_get_option('content_currency', array('align' => 'left', 'code' => 'USD', 'icon' => '$'));
?>
<div class="header-sub-wrapper header-sub-wrapper-tan">   
    <div class="number-project-wrapper">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <h2 class="number-project">
                    <?php 
$found_posts = '<span class="found_post">' . $wp_query->found_posts . '</span>';
$plural = sprintf(__('%s Testimonials for you', ET_DOMAIN), $found_posts);
$singular = sprintf(__('%s testimonial for you', ET_DOMAIN), $found_posts);
?>
                        <span class="plural <?php 
if ($wp_query->found_posts <= 1) {
    echo 'hide';
}
?>
" >
                            <?php 
echo $plural;
?>
                        </span>
                        <span class="singular <?php 
if ($wp_query->found_posts > 1) {
    echo 'hide';
}
コード例 #15
0
ファイル: projects.php プロジェクト: linniepinski/perssistant
 /**
  * validate data
  */
 public function validate_data($data)
 {
     global $user_ID;
     if (is_wp_error($data)) {
         return $data;
     }
     $require_fields = apply_filters('fre_project_required_fields', array('et_budget', 'project_category'));
     if (!current_user_can('manage_options')) {
         if (isset($data['renew']) && !isset($data['et_payment_package']) && $this->disable_plan) {
             return new WP_Error('empty_package', __("Cannot create a place with an empty package.", 'projects-backend'));
         }
         if (!isset($data['post_content']) || $data['post_content'] == '') {
             return new WP_Error('ad_empty_content', __("You should enter short description for your place.", 'projects-backend'));
         }
         if (!isset($data['post_title']) || $data['post_title'] == '') {
             return new WP_Error('ad_empty_content', __("Your place should have a title.", 'projects-backend'));
         }
         if (!isset($data['project_category']) && in_array('project_category', $require_fields) && !is_admin()) {
             return new WP_Error('invalid_category', __("Your project should has a category!", 'projects-backend'));
         }
         if (!isset($data['et_budget']) && in_array('et_budget', $require_fields)) {
             return new WP_Error('invalid_budget', __("Your have to enter a budget for your requirement!", 'projects-backend'));
         }
     }
     if (in_array('et_budget', $require_fields) && $data['et_budget'] <= 0) {
         return new WP_Error('budget_less_than_zero', __("Your budget have to greater than zero!", 'projects-backend'));
     }
     /**
      * unsert featured et_featured param if user cannot  edit others posts
      */
     if (!ae_user_can('edit_others_posts')) {
         unset($data['et_featured']);
         // unset($data['post_status']);
         unset($data['et_expired_date']);
         unset($data['post_views']);
     }
     /**
      * check payment package is valid or not
      * set up featured if this package is featured
      */
     if (isset($data['et_payment_package'])) {
         /**
          * check package plan exist or not
          */
         global $ae_post_factory;
         $package = $ae_post_factory->get('pack');
         $plan = $package->get($data['et_payment_package']);
         if (!$plan) {
             return new WP_Error('invalid_plan', __("You have selected an invalid plan.", 'projects-backend'));
         }
         /**
          * if user can not edit others posts the et_featured will no be unset and check,
          * this situation should happen when user edit/add post in backend.
          * Force to set featured post
          */
         if (!isset($data['et_featured']) || !$data['et_featured']) {
             $data['et_featured'] = 0;
             if (isset($plan->et_featured) && $plan->et_featured) {
                 $data['et_featured'] = 1;
             }
         }
     }
     /**
      * check max category options, filter ad category
      */
     $max_cat = ae_get_option('max_cat', 3);
     if ($max_cat && !current_user_can('edit_others_posts')) {
         /**
          * check max category user can set for a place
          */
         $num_of_cat = count($data['project_category']);
         if ($max_cat < $num_of_cat) {
             for ($i = $max_cat; $i < $num_of_cat; $i++) {
                 unset($data['place_category'][$i]);
             }
         }
     }
     return apply_filters('fre_project_validate_data', $data);
 }
コード例 #16
0
ファイル: theme.php プロジェクト: linniepinski/perssistant
function fre_number_format($amount, $echo = true)
{
    $number_format = ae_get_option('number_format');
    $decimal = isset($number_format['et_decimal']) ? $number_format['et_decimal'] : get_theme_mod('et_decimal', 2);
    $decimal_point = isset($number_format['dec_point']) && $number_format['dec_point'] ? $number_format['dec_point'] : get_theme_mod('et_decimal_point', '.');
    $thousand_sep = isset($number_format['thousand_sep']) && $number_format['thousand_sep'] ? $number_format['thousand_sep'] : get_theme_mod('et_thousand_sep', ',');
    if ($echo) {
        echo number_format((double) $amount, $decimal, $decimal_point, $thousand_sep);
    } else {
        return number_format((double) $amount, $decimal, $decimal_point, $thousand_sep);
    }
}
コード例 #17
0
    if (ae_get_option('twitter_login', false)) {
        ?>
					<li class="tw">
						<a href="<?php 
        echo add_query_arg('action', 'twitterauth', home_url());
        ?>
" class="sc-icon color-twitter">
							<i class="fa fa-twitter-square"></i>
						</a>
					</li>
				<?php 
    }
    ?>
				<!-- facebook plus login -->
				<?php 
    if (ae_get_option('facebook_login', false)) {
        ?>
					<li class="fb">
						<a href="#" id="facebook_auth_btn" class="sc-icon color-facebook">
							<i class="fa fa-facebook-square"></i>
						</a>
					</li>
				<?php 
    }
    ?>
				</ul>   
				<?php 
}
?>
 
	        </form>
コード例 #18
0
ファイル: header.php プロジェクト: herosrx/qaengine
echo body_class('cbp-spmenu-push');
?>
>
    	<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="cbp-spmenu-s1">
			<?php 
get_sidebar('left-tablet');
?>
		</nav>
		<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id="cbp-spmenu-s2">
			<?php 
get_sidebar('right-tablet');
?>
		</nav>
		<?php 
global $current_user;
$site_logo = ae_get_option('site_logo');
?>
		<div class="container-fluid">
			<div class="row">
				<header id="header">
					<div class="col-md-2 col-xs-2" id="logo">
						<a href="<?php 
echo home_url();
?>
">
							<?php 
if (!empty($site_logo)) {
    ?>
							<img src="<?php 
    echo $site_logo['large'][0];
    ?>
コード例 #19
0
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><i class="fa fa-times"></i></button>
				<h4 class="modal-title modal-title-sign-in" id="myModalLabel"><?php 
_e("Insert Images", ET_DOMAIN);
?>
</h4>
			</div>
			<div class="modal-body">
				<div class="upload-location" id="images_upload_container">
					<span class="title"><?php 
_e('Upload an image', ET_DOMAIN);
?>
</span>
					<div class="input-file">
						<?php 
$disabled = !ae_get_option('ae_upload_images') ? 'disabled="disabled" style="opacity:0.7;"' : '';
if (ae_get_option('ae_upload_images')) {
    $file_text = is_user_logged_in() ? __("No file chosen.", ET_DOMAIN) : __("Please log in to use this function.", ET_DOMAIN);
} else {
    $file_text = __('Admin has disabled this function.', ET_DOMAIN);
}
?>
						<button <?php 
echo $disabled;
?>
 id="images_upload_browse_button" onclick="return false;" class=""><?php 
_e("Browse", ET_DOMAIN);
?>
</button>
						<!--<input type="button" <?php 
echo $disabled;
?>
コード例 #20
0
 static function get_api()
 {
     return ae_get_option('ppdigital', array('api_username' => '', 'api_password' => '', 'api_signature' => ''));
 }
コード例 #21
0
ファイル: functions.php プロジェクト: maratdev/alllancer
 function add_user_meta_fields($default)
 {
     $default = wp_parse_args(array('user_hour_rate', 'user_profile_id', 'user_currency', 'user_skills', 'user_available'), $default);
     if (ae_get_option('use_escrow')) {
         $default[] = 'paypal';
     }
     return $default;
 }
コード例 #22
0
ファイル: paypal.php プロジェクト: linniepinski/perssistant
/**
 * finish project, send money when freelancer review project
 * @param int $project_id
 * @since 1.3
 * @author Dakachi
 */
function fre_finish_escrow($project_id)
{
    if (ae_get_option('use_escrow')) {
        $bid_id_accepted = get_post_meta($project_id, 'accepted', true);
        if (!ae_get_option('manual_transfer')) {
            // cho nay co the dung action
            // execute payment and send money to freelancer
            $pay_key = get_post_meta($bid_id_accepted, 'fre_paykey', true);
            if ($pay_key) {
                $ppadaptive = AE_PPAdaptive::get_instance();
                $response = $ppadaptive->executePayment($pay_key);
                if (strtoupper($response->responseEnvelope->ack) == 'SUCCESS') {
                    // success update order data
                    $order = get_post_meta($bid_id_accepted, 'fre_bid_order', true);
                    if ($order) {
                        wp_update_post(array('ID' => $order, 'post_status' => 'finish'));
                        $mail = Fre_Mailing::get_instance();
                        $mail->alert_transfer_money($project_id, $bid_id_accepted);
                    }
                }
            }
        } else {
            $mail = Fre_Mailing::get_instance();
            $mail->alert_transfer_money($project_id, $bid_id_accepted);
        }
    }
}
コード例 #23
0
</div>
                                <a href="#" class="attach-file-button" id="report_docs_browse_button">
                                    <i class="fa fa-paperclip"></i><?php 
    _e("Attach file", 'project-report');
    ?>
                                </a>
                                <ul class="file-attack-report apply_docs_file_list" id="apply_docs_file_list">
                                    <!-- report file list -->
                                </ul>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                    </form>                
                    <?php 
}
if (current_user_can('manage_options') && ae_get_option('use_escrow') && $post->post_status == 'disputing') {
    ?>
                        <form class="transfer-escrow">
                            <span class="text-transfer-escrow"><?php 
    _e("Escrow transfer to", 'project-report');
    ?>
</span>
                            <div class="form-group">
                                <select class="transfer-select">
                                    <option value="freelancer"><?php 
    _e("Freelancer", 'project-report');
    ?>
</option>
                                    <option value="employer"><?php 
    _e("Employer", 'project-report');
    ?>
コード例 #24
0
    echo $currency['code'];
} else {
    _e('USD', 'page-profile-mobile');
}
?>
                                                        </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="form-group-mobile skill-profile-control">
            	
                <?php 
$switch_skill = ae_get_option('switch_skill');
if (!$switch_skill) {
    ?>
                    <div class="wrapper-skill">
                        <label><?php 
    _e("Your Skills", 'page-profile-mobile');
    ?>
</label>
                        <a href="#" class="btn-sumary btn-add-skill add-skill"><?php 
    _e("Add", 'page-profile-mobile');
    ?>
</a>
                        <input type="text" id="skill" class="skill" placeholder="<?php 
    _e("Skills", 'page-profile-mobile');
    ?>
">
コード例 #25
0
 /**
  * catch event publish a post and set up order
  * @param int $ad_id
  * @since 1.1
  * @author Dakachi
  */
 function publish_post_action($ad_id)
 {
     if (get_post_type($ad_id) != $this->post_type) {
         return;
     }
     $order = get_post_meta($ad_id, 'et_ad_order', true);
     if ($order) {
         /**
          * update order status
          */
         //if (!isset($_POST['_et_nonce'])) {
         wp_update_post(array('ID' => $order, 'post_status' => 'publish'));
         //}
         $ads = new WP_Query(array('post_type' => $this->post_type, 'post_status' => array('pending'), 'meta_value' => $order, 'meta_key' => 'et_ad_order', 'posts_per_page' => -1, 'orderby' => 'post_date', 'order' => 'DESC', 'post__not_in' => array($ad_id)));
         if (!$ads->have_posts()) {
             return;
         }
         /**
          * update ads in same package
          */
         $use_pending = ae_get_option('use_pending');
         if ($use_pending) {
             foreach ((array) $ads->posts as $ad) {
                 wp_update_post(array('ID' => $ad->ID, 'post_status' => 'pending'));
                 update_post_meta($ad->ID, 'et_paid', 1);
             }
         } else {
             foreach ((array) $ads->posts as $ad) {
                 wp_update_post(array('ID' => $ad->ID, 'post_status' => 'publish'));
                 update_post_meta($ad->ID, 'et_paid', 1);
             }
         }
     }
 }
コード例 #26
0
ファイル: footer.php プロジェクト: linniepinski/perssistant
        </div>
    </div>
</footer>
<?php 
} else {
    $flag = false;
}
?>
<div class="copyright-wrapper <?php 
if (!$flag) {
    echo 'copyright-wrapper-margin-top';
}
?>
 ">
<?php 
$copyright = ae_get_option('copyright');
//__("© 2016 Perssistant - Plugin Initiative",'footer');
$has_nav_menu = has_nav_menu('et_footer');
$col = 'col-md-6';
if ($has_nav_menu) {
    $col = 'col-md-4';
}
?>
	<div class="container">
        <div class="row">
            <div class="col-sm-4 <?php 
echo $col;
?>
">
            	<a href="<?php 
echo home_url();
コード例 #27
0
ファイル: theme.php プロジェクト: callmeaatrey/zap-query
 /**
  * Send email after report success
  */
 public function et_reported_email($thread_id, $report_message)
 {
     global $current_user;
     if ($thread_id && $report_message) {
         $thread = get_post($thread_id);
         $user_send = get_users('role=administrator');
         foreach ($user_send as $user) {
             $user_email = $user->user_email;
             $message = ae_get_option('report_mail_template');
             /* ============ filter placeholder ============ */
             $message = str_ireplace('[display_name]', $user->display_name, $message);
             $message = str_ireplace('[thread_title]', $thread->post_title, $message);
             $message = str_ireplace('[thread_content]', $thread->post_content, $message);
             $message = str_ireplace('[thread_link]', get_permalink($thread_id), $message);
             $message = str_ireplace('[report_message]', $report_message, $message);
             $message = str_ireplace('[blogname]', get_option('blogname'), $message);
             $message = et_filter_authentication_placeholder($message, $user->ID);
             $subject = '[#' . $thread_id . ']' . __("There's a new report ", ET_DOMAIN);
             $headers = 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
             $headers .= "From: " . get_option('blogname') . " < " . $current_user->user_email . "> \r\n";
             if ($user_email) {
                 $test = wp_mail($user_email, $subject, $message, $headers);
             }
         }
     }
 }
コード例 #28
0
    </div>
</section>
<!-- Breadcrumb Blog / End -->

<!-- Page Post Place -->
<section id="blog-page">
	<div class="container">
    	<div class="row">
            
        	<!-- Column left -->
        	<div class="col-md-9 col-sm-12 col-xs-12">
            	<div class="post-place-warpper" id="post-place">
                	
                    <?php 
// check disable payment plan or not
$disable_plan = ae_get_option('disable_plan', false);
if (!$disable_plan) {
    // template/post-place-step1.php
    get_template_part('template/post-project', 'step1');
}
if (!$user_ID) {
    // template/post-place-step2.php
    get_template_part('template/post-project', 'step2');
}
// template/post-place-step3.php
get_template_part('template/post-project', 'step3');
if (!$disable_plan) {
    // template/post-place-step4.php
    get_template_part('template/post-project', 'step4');
}
?>
コード例 #29
0
ファイル: questions.php プロジェクト: callmeaatrey/zap-query
 /**
  * Additional methods in theme
  */
 public static function insert_answer($question_id, $content, $author = false, $answer_id = 0)
 {
     $instance = self::get_instance();
     global $current_user;
     if (!$current_user->ID) {
         return new WP_Error('logged_in_required', __('Login Required', ET_DOMAIN));
     }
     if ($author == false) {
         $author = $current_user->ID;
     }
     $question = get_post($question_id);
     $content = preg_replace('/\\[quote\\].*(<br\\s*\\/?>\\s*).*\\[\\/quote\\]/', '', $content);
     $data = array('post_title' => 'RE: ' . $question->post_title, 'post_content' => $content, 'post_parent' => $question_id, 'author' => $author, 'post_type' => 'answer', 'post_status' => ae_get_option('pending_answers') && !(current_user_can('manage_options') || qa_user_can('approve_answer')) ? 'pending' : 'publish', 'et_answer_parent' => $answer_id);
     $result = $instance->_insert($data);
     // if item is inserted successfully, update statistic
     if ($result) {
         //update user answers count
         $count = et_count_user_posts($current_user->ID, 'answer');
         update_user_meta($current_user->ID, 'et_answer_count', $count);
         //update user following questions
         $follow_questions = (array) get_user_meta($current_user->ID, 'qa_following_questions', true);
         if (!in_array($question_id, $follow_questions)) {
             array_push($follow_questions, $question_id);
         }
         $follow_questions = array_unique(array_filter($follow_questions));
         update_user_meta($current_user->ID, 'qa_following_questions', $follow_questions);
         // update question's update date
         update_post_meta($question_id, 'et_updated_date', current_time('mysql'));
         // update last update author
         update_post_meta($question_id, 'et_last_author', $author);
         // update answer_authors
         $answer_authors = get_post_meta($question_id, 'et_answer_authors', true);
         $answer_authors = is_array($answer_authors) ? $answer_authors : array();
         if (!in_array($author, $answer_authors)) {
             $answer_authors[] = $author;
             update_post_meta($question_id, 'et_answer_authors', $answer_authors);
         }
         // update answer author for answer
         if ($answer_id) {
             $answer_authors = get_post_meta($answer_id, 'et_answer_authors', true);
             $answer_authors = is_array($answer_authors) ? $answer_authors : array();
             if (!in_array($author, $answer_authors)) {
                 $answer_authors[] = $author;
                 update_post_meta($answer_id, 'et_answer_authors', $answer_authors);
             }
         }
         if ($answer_id == 0) {
             QA_Questions::count_comments($question->ID);
         } else {
             QA_Answers::count_comments($answer_id);
         }
     }
     return $result;
 }
コード例 #30
0
ファイル: social_auth.php プロジェクト: rinodung/wp-question
 public function auth_google()
 {
     try {
         // turn on session
         if (!isset($_SESSION)) {
             ob_start();
             @session_start();
         }
         $data = $_POST['content'];
         // find usser
         $user = false;
         $return = array('redirect_url' => home_url());
         $gplus_client_id = ae_get_option('gplus_client_id');
         $gplus_secret_id = ae_get_option('gplus_secret_id');
         // if user is already authenticated before
         if (isset($_POST['gplus_token']) && isset($_POST['gplus_code'])) {
             $userinfor = wp_remote_get('https://www.googleapis.com/oauth2/v1/userinfo?access_token=' . $_POST['gplus_token']);
             $userinfor = json_decode($userinfor['body']);
             if ($userinfor->id !== $data['id']) {
                 $resp = array('success' => false, 'msg' => __('Please login by using your Google plus account again!', ET_DOMAIN));
             }
         } else {
             $resp = array('success' => false, 'msg' => __('Please login by using your Google plus account again!', ET_DOMAIN));
         }
         // if user is already authenticated before
         if (isset($data['id']) && ($user = $this->get_user($data['id']))) {
             //
             $result = $this->logged_user_in($data['id']);
             $userdata = QA_Member::convert($user);
             $nonce = array('reply_thread' => wp_create_nonce('insert_reply'), 'upload_img' => wp_create_nonce('et_upload_images'));
             $return = array('user' => $userdata, 'nonce' => $nonce);
         } else {
             // avatar
             $ava_response = isset($data['picture']) ? $data['picture'] : '';
             $sizes = get_intermediate_image_sizes();
             $avatars = array();
             if ($ava_response) {
                 foreach ($sizes as $size) {
                     $avatars[$size] = array($ava_response);
                 }
             } else {
                 $avatars = false;
             }
             // username
             //$username 	= $data['displayName'];
             $username = $data['name'];
             $params = array('user_login' => $username, 'user_email' => isset($data['email']) ? $data['email'] : false, 'et_avatar' => $avatars);
             //remove avatar if cant fetch avatar
             foreach ($params as $key => $param) {
                 if ($param == false) {
                     unset($params[$key]);
                 }
             }
             $_SESSION['et_auth'] = serialize($params);
             $_SESSION['et_social_id'] = $data['id'];
             $_SESSION['et_auth_type'] = 'google';
             $return['params'] = $params;
             $return['redirect_url'] = $this->auth_url;
             // et_get_page_link('social-connect');
         }
         $resp = array('success' => true, 'msg' => __('You have logged in successfully', ET_DOMAIN), 'redirect' => home_url(), 'data' => $return);
     } catch (Exception $e) {
         $resp = array('success' => false, 'msg' => $e->getMessage());
     }
     wp_send_json($resp);
 }