Пример #1
0
<li rel="posts-<?php 
echo $comment->comment_post_ID;
?>
" class="comment" id="comment-<?php 
echo $comment->comment_ID;
?>
">
	<div class="comment-body clearfix" rel="post-<?php 
echo $comment->comment_post_ID;
?>
">
		<div class="avatar-img">
			<?php 
if ($comment->user_id != 0) {
    if (get_the_author_meta('you_avatar', $comment->user_id)) {
        $you_avatar_img = get_aq_resize_url(esc_attr(get_the_author_meta('you_avatar', $comment->user_id)), "full", 65, 65);
        echo "<img alt='" . $comment->comment_author . "' src='" . $you_avatar_img . "'>";
    } else {
        echo get_avatar($comment, 60);
    }
} else {
    echo get_avatar($comment->comment_author_email, 60);
}
?>
		</div>
		<div class="comment-text">
		    <div class="author clearfix">
		    	<div class="comment-author">
		    		<?php 
if ($comment->user_id != 0) {
    ?>
Пример #2
0
function vbegy_answer($comment, $args, $depth)
{
    global $post;
    $GLOBALS['comment'] = $comment;
    $add_below = '';
    $comment_vote = get_comment_meta($comment->comment_ID, 'comment_vote');
    $comment_vote = !empty($comment_vote) ? $comment_vote[0]["vote"] : "";
    $the_best_answer = get_post_meta($post->ID, "the_best_answer", true);
    $comment_best_answer = $the_best_answer == $comment->comment_ID ? "comment-best-answer" : "";
    $active_reports = vpanel_options("active_reports");
    $active_vote = vpanel_options("active_vote");
    $GLOBALS['comment'] = $comment;
    ?>
    <li <?php 
    comment_class('comment ' . $comment_best_answer);
    ?>
 id="li-comment-<?php 
    comment_ID();
    ?>
">
    	<div id="comment-<?php 
    comment_ID();
    ?>
" class="comment-body clearfix" rel="post-<?php 
    echo $post->ID;
    ?>
">
    	    <div class="avatar-img">
    	    	<?php 
    if ($comment->user_id != 0) {
        $vpanel_get_user_url = vpanel_get_user_url($comment->user_id, get_the_author_meta('user_nicename', $comment->user_id));
        if (get_the_author_meta('you_avatar', $comment->user_id)) {
            $you_avatar_img = get_aq_resize_url(esc_attr(get_the_author_meta('you_avatar', $comment->user_id)), "full", 65, 65);
            echo "<img alt='" . $comment->comment_author . "' src='" . $you_avatar_img . "'>";
        } else {
            echo get_avatar($comment, 65);
        }
    } else {
        $vpanel_get_user_url = $comment->comment_author_url != "" ? $comment->comment_author_url : "vpanel_No_site";
        echo get_avatar($comment->comment_author_email, 65);
    }
    ?>
    	    </div>
    	    <div class="comment-text">
    	        <div class="author clearfix">
    	        	<div class="comment-author">
    	        		<?php 
    if ($vpanel_get_user_url != "" && $vpanel_get_user_url != "vpanel_No_site") {
        ?>
    	        			<a href="<?php 
        echo esc_url($vpanel_get_user_url);
        ?>
">
    	        		<?php 
    }
    echo get_comment_author();
    if ($vpanel_get_user_url != "" && $vpanel_get_user_url != "vpanel_No_site") {
        ?>
    	        			</a>
    	        		<?php 
    }
    ?>
    	        	</div>
    	        	<?php 
    if ($active_vote == 1) {
        ?>
	    	        	<div class="comment-vote">
	    	            	<ul class="single-question-vote">
	    	            		<?php 
        if (is_user_logged_in()) {
            ?>
	    	            			<li class="loader_3"></li>
	    	            			<li><a href="#" class="single-question-vote-up comment_vote_up<?php 
            echo isset($_COOKIE['comment_vote' . $comment->comment_ID]) ? " " . $_COOKIE['comment_vote' . $comment->comment_ID] . "-" . $comment->comment_ID : "";
            ?>
" title="<?php 
            _e("Like", "vbegy");
            ?>
" id="comment_vote_up-<?php 
            echo $comment->comment_ID;
            ?>
"><i class="icon-thumbs-up"></i></a></li>
	    	            			<li><a href="#" class="single-question-vote-down comment_vote_down<?php 
            echo isset($_COOKIE['comment_vote' . $comment->comment_ID]) ? " " . $_COOKIE['comment_vote' . $comment->comment_ID] . "-" . $comment->comment_ID : "";
            ?>
" id="comment_vote_down-<?php 
            echo $comment->comment_ID;
            ?>
" title="<?php 
            _e("Dislike", "vbegy");
            ?>
"><i class="icon-thumbs-down"></i></a></li>
	    	            		<?php 
        } else {
            ?>
	    	            			<li class="loader_3"></li>
	    	            			<li><a href="#" class="single-question-vote-up comment_vote_up vote_not_user" title="<?php 
            _e("Like", "vbegy");
            ?>
"><i class="icon-thumbs-up"></i></a></li>
	    	            			<li><a href="#" class="single-question-vote-down comment_vote_down vote_not_user" title="<?php 
            _e("Dislike", "vbegy");
            ?>
"><i class="icon-thumbs-down"></i></a></li>
	    	            		<?php 
        }
        ?>
	    	            	</ul>
	    	        	</div>
	    	        	<span class="question-vote-result question_vote_result <?php 
        echo $comment_vote < 0 ? "question_vote_red" : "";
        ?>
"><?php 
        echo $comment_vote != "" ? $comment_vote : 0;
        ?>
</span>
    	        	<?php 
    }
    ?>
    	        	<div class="comment-meta">
    	                <div class="date"><i class="icon-time"></i><?php 
    printf(__('%1$s at %2$s', 'vbegy'), get_comment_date(), get_comment_time());
    ?>
</div> 
    	            </div>
    	            <div class="comment-reply">
	    	            <?php 
    edit_comment_link(__("Edit", "vbegy"), '  ', '');
    if ($active_reports == 1) {
        ?>
    	                	<a class="question_r_l comment_l report_c" href="#"><i class="icon-flag"></i><?php 
        _e("Report", "vbegy");
        ?>
</a>
    	                <?php 
    }
    comment_reply_link(array_merge($args, array('reply_text' => '<i class="icon-reply"></i>' . __('Reply', 'vbegy'), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    	            </div>
    	        </div>
    	        <div class="text">
    	        	<?php 
    if ($active_reports == 1) {
        ?>
	    	        	<div class="explain-reported">
	    	        		<h3><?php 
        _e("Please briefly explain why you feel this answer should be reported .", "vbegy");
        ?>
</h3>
	    	        		<textarea name="explain-reported"></textarea>
	    	        		<div class="clearfix"></div>
	    	        		<div class="loader_3"></div>
	    	        		<a class="color button small report"><?php 
        _e("Report", "vbegy");
        ?>
</a>
	    	        		<a class="color button small dark_button cancel"><?php 
        _e("Cancel", "vbegy");
        ?>
</a>
	    	        	</div><!-- End reported -->
    	        	<?php 
    }
    if ($comment->comment_approved == '0') {
        ?>
    	        	    <em><?php 
        _e('Your comment is awaiting moderation.', 'vbegy');
        ?>
</em><br>
    	        	<?php 
    }
    echo nl2br(makeClickableLinks($comment->comment_content));
    ?>
    	        	<div class="clearfix"></div>
    	        	<?php 
    $added_file = get_comment_meta($comment->comment_ID, 'added_file', true);
    if ($added_file != "") {
        echo "<div class='clearfix'></div><br><a href='" . wp_get_attachment_url($added_file) . "'>" . __("Attachment", "vbegy") . "</a>";
    }
    ?>
    	        </div>
    	        <div class="clearfix"></div>
	        	<div class="loader_3"></div>
    	        <?php 
    $admin_best_answer = vpanel_options("admin_best_answer");
    if ($the_best_answer == $comment->comment_ID) {
        echo '<div class="commentform question-answered question-answered-done"><i class="icon-ok"></i>' . __("Best answer", "vbegy") . '</div>
    	        	<div class="clearfix"></div>';
        if ((is_user_logged_in() && get_current_user_id() == $post->post_author || $admin_best_answer == 1 && is_super_admin(get_current_user_id())) && $the_best_answer != 0) {
            echo '<a class="commentform best_answer_re question-report" title="' . __("Cancel the best answer", "vbegy") . '" href="#">' . __("Cancel the best answer", "vbegy") . '</a>';
        }
    }
    if ((is_user_logged_in() && get_current_user_id() == $post->post_author || $admin_best_answer == 1 && is_super_admin(get_current_user_id())) && ($the_best_answer == 0 or $the_best_answer == "")) {
        ?>
    	        	<a class="commentform best_answer_a question-report" title="<?php 
        _e("Select as best answer", "vbegy");
        ?>
" href="#"><?php 
        _e("Select as best answer", "vbegy");
        ?>
</a>
    	        <?php 
    }
    ?>
    	        <div class="no_vote_more"></div>
    	    </div>
    	</div>
	<?php 
}
Пример #3
0
function ask_edit_profile_shortcode($atts, $content = null)
{
    global $user_identity, $posted, $public_display;
    $out = '';
    if (!is_user_logged_in()) {
        $out .= '<div class="note_error"><strong>' . __("Please login to edit profile .", "vbegy") . '</strong></div>
		<div class="form-style form-style-3">
			' . do_shortcode("[ask_login]") . '
		</div>';
    } else {
        do_action('ask_edit_profile_form');
        $out .= '<form class="edit-profile-form vpanel_form" method="post" enctype="multipart/form-data">';
        $user_info = get_userdata(get_current_user_id());
        $you_avatar = get_the_author_meta('you_avatar', $user_info->ID);
        $url = get_the_author_meta('url', $user_info->ID);
        $twitter = get_the_author_meta('twitter', $user_info->ID);
        $facebook = get_the_author_meta('facebook', $user_info->ID);
        $youtube = get_the_author_meta('youtube', $user_info->ID);
        $google = get_the_author_meta('google', $user_info->ID);
        $linkedin = get_the_author_meta('linkedin', $user_info->ID);
        $follow_email = get_the_author_meta('follow_email', $user_info->ID);
        $display_name = get_the_author_meta('display_name', $user_info->ID);
        $country = get_the_author_meta('country', $user_info->ID);
        $city = get_the_author_meta('city', $user_info->ID);
        $age = get_the_author_meta('age', $user_info->ID);
        $phone = get_the_author_meta('phone', $user_info->ID);
        $sex = get_the_author_meta('sex', $user_info->ID);
        $instagram = get_the_author_meta('instagram', $user_info->ID);
        $pinterest = get_the_author_meta('pinterest', $user_info->ID);
        $out .= '
			
			<div class="form-inputs clearfix">
				<p>
					<label>' . __("First Name", "vbegy") . '</label>
					<input name="first_name" id="first_name" type="text" value="' . $user_info->first_name . '">
				</p>
				<p>
					<label>' . __("Last Name", "vbegy") . '</label>
					<input name="last_name" id="last_name" type="text" value="' . $user_info->last_name . '">
				</p>
				<p>
					<label>' . __("Display name", "vbegy") . '</label>
					<input name="display_name" id="display_name" type="text" value="' . $user_info->display_name . '">
				</p>
				<p>
					<label for="email" class="required">' . __("E-Mail", "vbegy") . '<span>*</span></label>
					<input name="email" id="email" type="email" value="' . $user_info->user_email . '">
				</p>
				<p>
					<label for="newpassword" class="required">' . __("Password", "vbegy") . '<span>*</span></label>
					<input name="pass1" id="newpassword" type="password" value="">
				</p>
				<p>
					<label for="newpassword2" class="required">' . __("Confirm Password", "vbegy") . '<span>*</span></label>
					<input name="pass2" id="newpassword2" type="password" value="">
				</p>
				<p>
					<label for="follow_email">' . __("Follow-up email", "vbegy") . '</label>
					<input name="follow_email" id="follow_email" type="text" value="' . $follow_email . '">
				</p>';
        $phone_register = vpanel_options("phone_register");
        $phone_required = vpanel_options("phone_required");
        $user_phone = vpanel_options("user_phone");
        if ($phone_register == 1 && $user_phone != 1) {
            $out .= '<p>
						<label for="phone" ' . ($phone_required == 1 ? 'class="required"' : '') . '>' . __("Phone", "vbegy") . ($phone_required == 1 ? '<span>*</span>' : '') . '</label>
						<input type="text" ' . ($phone_required == 1 ? 'class="required-item"' : '') . ' name="phone" id="phone" value="' . $phone . '">
					</p>';
        }
        $country_register = vpanel_options("country_register");
        $country_required = vpanel_options("country_required");
        $city_register = vpanel_options("city_register");
        $city_required = vpanel_options("city_required");
        $age_register = vpanel_options("age_register");
        $age_required = vpanel_options("age_required");
        $sex_register = vpanel_options("sex_register");
        $sex_required = vpanel_options("sex_required");
        $user_country = vpanel_options("user_country");
        $user_city = vpanel_options("user_city");
        $user_age = vpanel_options("user_age");
        $user_sex = vpanel_options("user_sex");
        $user_url = vpanel_options("user_url");
        if ($country_register == 1 && $user_country != 1) {
            $out .= '
					<p>
						<label for="country" ' . ($country_required == 1 ? 'class="required"' : '') . '>' . __("Country", "vbegy") . ($country_required == 1 ? '<span>*</span>' : '') . '</label>
						<span class="styled-select">
							<select name="country" id="country" ' . ($country_required == 1 ? 'class="required-item"' : '') . '>
								<option value="">' . __('Select a country&hellip;', 'vbegy') . '</option>';
            foreach (vpanel_get_countries() as $key => $value) {
                $out .= '<option value="' . esc_attr($key) . '"' . selected($country, esc_attr($key), false) . '>' . esc_html($value) . '</option>';
            }
            $out .= '</select>
						</span>
					</p>';
        }
        if ($city_register == 1 && $user_city != 1) {
            $out .= '<p>
						<label for="city" ' . ($city_required == 1 ? 'class="required"' : '') . '>' . __("City", "vbegy") . ($city_required == 1 ? '<span>*</span>' : '') . '</label>
						<input type="text" ' . ($city_required == 1 ? 'class="required-item"' : '') . ' name="city" id="city" value="' . $city . '">
					</p>';
        }
        if ($age_register == 1 && $user_age != 1) {
            $out .= '<p>
						<label for="age" ' . ($age_required == 1 ? 'class="required"' : '') . '>' . __("Age", "vbegy") . ($age_required == 1 ? '<span>*</span>' : '') . '</label>
						<input type="text" ' . ($age_required == 1 ? 'class="required-item"' : '') . ' name="age" id="age" value="' . $age . '">
					</p>';
        }
        if ($sex_register == 1 && $user_sex != 1) {
            $out .= '<p>
						<label ' . ($sex_required == 1 ? 'class="required"' : '') . '>' . __("Sex", "vbegy") . ($sex_required == 1 ? '<span>*</span>' : '') . '</label>
						<input id="sex_male" name="sex" type="radio" value="1"' . ($sex == "male" || $sex == "1" ? ' checked="checked"' : ' checked="checked"') . '>
						<label for="sex_male">' . __("Male", "vbegy") . '</label>
						<input id="sex_female" name="sex" type="radio" value="2"' . ($sex == "female" || $sex == "2" ? ' checked="checked"' : '') . '>
						<label for="sex_female">' . __("Female", "vbegy") . '</label>
					</p>';
        }
        $out .= '</div>
			<div class="form-style form-style-2 form-style-3">';
        if ($you_avatar) {
            $you_avatar_img = get_aq_resize_url(esc_attr($you_avatar), "full", 79, 79);
            $out .= "<div class='user-profile-img'><img alt='" . $user_info->display_name . "' src='" . $you_avatar_img . "'></div>";
        }
        $out .= '
					<label for="you_avatar">' . __("Profile Picture", "vbegy") . '</label>
					<div class="fileinputs">
						<input type="file" name="you_avatar" id="you_avatar" value="' . $you_avatar . '">
						<div class="fakefile">
							<button type="button" class="small margin_0">Select file</button>
							<span><i class="icon-arrow-up"></i>Browse</span>
						</div>
					</div>
				<div class="clearfix"></div>
				<p></p>
				
				<p>
					<label for="description">' . __("About Yourself", "vbegy") . '</label>
					<textarea name="description" id="description" cols="58" rows="8">' . $user_info->description . '</textarea>
				</p>
			</div>
			<div class="form-inputs clearfix">';
        if ($user_url != 1) {
            $out .= '<p>
						<label>' . __("Website", "vbegy") . '</label>
						<input name="url" id="url" type="text" value="' . $url . '">
					</p>';
        }
        $out .= '<p>
					<label for="facebook">' . __("Facebook", "vbegy") . '</label>
					<input type="text" name="facebook" id="facebook" value="' . $facebook . '">
				</p>
				<p>
					<label for="twitter">' . __("Twitter", "vbegy") . '</label>
					<input type="text" name="twitter" id="twitter" value="' . $twitter . '">
				</p>
				<p>
					<label for="youtube">' . __("Youtube", "vbegy") . '</label>
					<input type="text" name="youtube" id="youtube" value="' . $youtube . '">
				</p>
				<p>
					<label for="linkedin">' . __("Linkedin", "vbegy") . '</label>
					<input type="text" name="linkedin" id="linkedin" value="' . $linkedin . '">
				</p>
				<p>
					<label for="google">' . __("Google plus", "vbegy") . '</label>
					<input type="text" name="google" id="google" value="' . $google . '">
				</p>
				<p>
					<label for="instagram">' . __("Instagram", "vbegy") . '</label>
					<input type="text" name="instagram" id="instagram" value="' . $instagram . '">
				</p>
				<p>
					<label for="pinterest">' . __("Pinterest", "vbegy") . '</label>
					<input type="text" name="pinterest" id="pinterest" value="' . $pinterest . '">
				</p>
			</div>
			
			<p class="form-submit">
				<input type="hidden" name="action" value="update">
				<input type="hidden" name="admin_bar_front" value="1">
				<input type="hidden" name="user_id" id="user_id" value="' . $user_info->ID . '">
				<input type="hidden" name="user_login" id="user_login" value="' . $user_info->user_login . '">
				<input type="submit" value="' . __("Save", "vbegy") . '" class="button color small login-submit submit">
			</p>
		
		</form>';
    }
    return $out;
}
Пример #4
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $user_per_page = (int) $instance['user_per_page'];
        $active_points = vpanel_options("active_points");
        if ($active_points == 1) {
            echo $before_widget;
            if ($title) {
                echo $before_title . esc_attr($title) . $after_title;
            }
            ?>
				<div class="widget_highest_points">
					<ul>
						<?php 
            $blogusers = get_users(array('fields' => 'all_with_meta', 'order' => 'DESC', 'meta_query' => array(array('key' => 'points', 'value' => 1, 'compare' => '>=', 'type' => 'number'))));
            usort($blogusers, 'cmp');
            $i = 0;
            foreach ($blogusers as $user) {
                $i++;
                $points_u = get_user_meta($user->ID, "points", true);
                $user_profile_page = vpanel_get_user_url($user->ID);
                $you_avatar = get_the_author_meta('you_avatar', $user->ID);
                ?>
							<li>
								<div class="author-img">
									<a href="<?php 
                echo $user_profile_page;
                ?>
">
										<?php 
                if ($you_avatar) {
                    $you_avatar_img = get_aq_resize_url(esc_attr($you_avatar), "full", 65, 65);
                    echo "<img alt='" . $user->display_name . "' src='" . $you_avatar_img . "'>";
                } else {
                    echo get_avatar(get_the_author_meta('user_email', $user->ID), '60', '');
                }
                ?>
									</a>
								</div> 
								<h6><a href="<?php 
                echo $user_profile_page;
                ?>
"><?php 
                echo $user->display_name;
                ?>
</a></h6>
								<span class="comment"><?php 
                echo $points_u != "" ? $points_u : "0";
                ?>
 <?php 
                _e("Points", "vbegy");
                ?>
</span>
								<div class="clearfix"></div>
							</li>
						<?php 
                if ($i == $user_per_page) {
                    break;
                }
            }
            ?>
					</ul>
				</div>
				<?php 
            echo $after_widget;
        }
    }
Пример #5
0
                    $post_author_box = vpanel_options("post_author_box");
                    if ($post_author_box == 1 && $post_author_box_s == "" || $post_author_box == 1 && isset($custom_page_setting) && $custom_page_setting == 0 || $post_author_box == 1 && isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_author_box_s) && $post_author_box_s != 0 || isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_author_box_s) && $post_author_box_s == 1) {
                        if ($post->post_author != 0) {
                            ?>
							<div class="about-author clearfix">
							    <div class="author-image">
							    	<a href="<?php 
                            echo vpanel_get_user_url($authordata->ID, $authordata->user_nicename);
                            ?>
" original-title="<?php 
                            the_author();
                            ?>
" class="tooltip-n">
							    		<?php 
                            if (get_the_author_meta('you_avatar', get_the_author_meta('ID'))) {
                                $you_avatar_img = get_aq_resize_url(esc_attr(get_the_author_meta('you_avatar', get_the_author_meta('ID'))), "full", 65, 65);
                                echo "<img alt='" . $authordata->display_name . "' src='" . $you_avatar_img . "'>";
                            } else {
                                echo get_avatar(get_the_author_meta('user_email', $authordata->ID), '65', '');
                            }
                            ?>
							    	</a>
							    </div>
							    <div class="author-bio">
							        <h4><?php 
                            _e("About the Author", "vbegy");
                            ?>
</h4>
							        <?php 
                            the_author_meta('description');
                            ?>
Пример #6
0
?>
"><?php 
echo $user_login->display_name;
?>
</a></h2>
				<div class="user-profile-img">
					<a original-title="<?php 
echo $user_login->display_name;
?>
" class="tooltip-n" href="<?php 
echo vpanel_get_user_url($user_login->ID);
?>
">
						<?php 
if ($you_avatar) {
    $you_avatar_img = get_aq_resize_url(esc_attr($you_avatar), "full", 65, 65);
    echo "<img alt='" . $user_login->display_name . "' src='" . $you_avatar_img . "'>";
} else {
    echo get_avatar(get_the_author_meta('user_email', $user_login->ID), '65', '');
}
?>
					</a>
				</div>
				<div class="ul_list ul_list-icon-ok about-user">
					<?php 
$user_registered = vpanel_options("user_registered");
$user_country = vpanel_options("user_country");
$user_phone = vpanel_options("user_phone");
$user_age = vpanel_options("user_age");
$user_sex = vpanel_options("user_sex");
$user_url = vpanel_options("user_url");