function widgets_init()
{
    global $post;
    $sidebars = get_option('sidebars');
    if ($sidebars) {
        $before_widget = '<div id="%1$s" class="widget %2$s">';
        $after_widget = '</div>';
        $before_title = '<h3 class="widget_title">';
        $after_title = '</h3>';
        foreach ($sidebars as $sidebar) {
            register_sidebar(array('name' => esc_html($sidebar), 'id' => sanitize_title(esc_html($sidebar)), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
        }
    }
    $footer_layout = vpanel_options("footer_layout");
    $before_widget = '<div id="%1$s" class="widget %2$s">';
    $after_widget = '</div>';
    $before_title = '<h3 class="widget_title">';
    $after_title = '</h3>';
    if ($footer_layout == "footer_1c" || $footer_layout == "footer_2c" || $footer_layout == "footer_3c" || $footer_layout == "footer_4c" || $footer_layout == "footer_5c") {
        register_sidebar(array('name' => __("The first footer widget area", "vbegy"), 'id' => "footer_1c_sidebar", 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
    }
    if ($footer_layout == "footer_2c" || $footer_layout == "footer_3c" || $footer_layout == "footer_4c" || $footer_layout == "footer_5c") {
        register_sidebar(array('name' => __("The Second footer widget area", "vbegy"), 'id' => "footer_2c_sidebar", 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
    }
    if ($footer_layout == "footer_3c" || $footer_layout == "footer_4c" || $footer_layout == "footer_5c") {
        register_sidebar(array('name' => __("The Third footer widget area", "vbegy"), 'id' => "footer_3c_sidebar", 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
    }
    if ($footer_layout == "footer_4c" || $footer_layout == "footer_5c") {
        register_sidebar(array('name' => __("The Fourth footer widget area", "vbegy"), 'id' => "footer_4c_sidebar", 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
    }
}
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        if (is_user_logged_in()) {
            echo $before_widget;
            if ($title) {
                echo $before_title . esc_attr($title) . $after_title;
            }
            ?>
				<div class="widget_profile">
					<?php 
            $out = '';
            $user_login = get_userdata(get_current_user_id());
            $active_points = vpanel_options("active_points");
            $out .= '
						<ul class="user_quick_links">
							<li><a href="' . vpanel_get_user_url($user_login->ID) . '"><i class="icon-home"></i>' . __("Profile page", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('question_user_page')))) . '"><i class="icon-question-sign"></i>' . __("Questions", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('answer_user_page')))) . '"><i class="icon-comment"></i>' . __("Answers", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('favorite_user_page')))) . '"><i class="icon-star"></i>' . __("Favorite Questions", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('i_follow_user_page')))) . '"><i class="icon-user-md"></i>' . __("Authors I Follow", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('followers_user_page')))) . '"><i class="icon-user"></i>' . __("Followers", "vbegy") . '</a></li>';
            if ($active_points == 1) {
                $out .= '<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('point_user_page')))) . '"><i class="icon-heart"></i>' . __("Points", "vbegy") . '</a></li>';
            }
            $out .= '<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('follow_question_page')))) . '"><i class="icon-question-sign"></i>' . __("Follow questions", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('follow_answer_page')))) . '"><i class="icon-comment"></i>' . __("Follow answers", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('post_user_page')))) . '"><i class="icon-file-alt"></i>' . __("Posts", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('follow_post_page')))) . '"><i class="icon-file-alt"></i>' . __("Follow posts", "vbegy") . '</a></li>
							<li><a href="' . esc_url(add_query_arg("u", esc_attr($user_login->ID), get_page_link(vpanel_options('follow_comment_page')))) . '"><i class="icon-comments"></i>' . __("Follow comments", "vbegy") . '</a></li>
							<li><a href="' . get_page_link(vpanel_options('user_edit_profile_page')) . '"><i class="icon-pencil"></i>' . __("Edit profile", "vbegy") . '</a></li>
							<li><a href="' . wp_logout_url(home_url()) . '"><i class="icon-signout"></i>' . __("Logout", "vbegy") . '</a></li>
						</ul>';
            ?>
				</div>
				<?php 
            echo $out;
            echo $after_widget;
        }
    }
Exemple #3
0
    echo do_shortcode("[ask_login]");
    ?>
										</div>
									</div><!-- End page-content -->
								</div><!-- End col-md-6 -->
								<?php 
    if (!is_user_logged_in()) {
        ?>
									<div class="col-md-6">
										<div class="page-content">
											<h2><?php 
        _e("Register Now", "vbegy");
        ?>
</h2>
											<p><?php 
        echo stripslashes(vpanel_options("register_content"));
        ?>
</p>
											<a class="button small color signup"><?php 
        _e("Create an account", "vbegy");
        ?>
</a>
										</div><!-- End page-content -->
									</div><!-- End col-md-6 -->
								<?php 
    }
    ?>
							</div><!-- End row -->
						</div><!-- End login -->
						<?php 
    get_footer();
<?php

/* Template name: Follow question */
global $user_ID;
if (empty($_GET['u'])) {
    wp_redirect(home_url());
}
$user_login = get_userdata($_GET['u']);
if (empty($user_login)) {
    wp_redirect(home_url());
}
$owner = false;
if ($user_ID == $user_login->ID) {
    $owner = true;
}
if (vpanel_options("show_point_favorite") == 0 && $owner == false) {
    wp_redirect(home_url());
}
get_header();
include get_template_directory() . '/includes/author-head.php';
$following_me = get_user_meta($user_login->ID, "following_me");
$following_me_array = $following_me[0];
if (is_array($following_me_array)) {
    $following_me_array = array_filter($following_me_array);
}
?>
	<div class="page-content page-content-user">
		<div class="user-questions">
			<?php 
if (isset($following_me_array) && is_array($following_me_array) && !empty($following_me_array)) {
    $paged = get_query_var("paged") != "" ? (int) get_query_var("paged") : (get_query_var("page") != "" ? (int) get_query_var("page") : 1);
function process_vpanel_edit_posts()
{
    global $posted;
    set_time_limit(0);
    $errors = new WP_Error();
    $posted = array();
    $fields = array('ID', 'title', 'comment', 'category', 'attachment', 'post_tag');
    foreach ($fields as $field) {
        if (isset($_POST[$field])) {
            $posted[$field] = trim(stripslashes(htmlspecialchars($_POST[$field])));
        } else {
            $posted[$field] = '';
        }
    }
    /* Validate Required Fields */
    $get_post = isset($posted['ID']) ? (int) $posted['ID'] : 0;
    $get_post_q = get_post($get_post);
    if (isset($get_post) && $get_post != 0 && $get_post_q && get_post_type($get_post) == "post") {
        $user_login_id_l = get_user_by("id", $get_post_q->post_author);
        if ($user_login_id_l->ID != get_current_user_id()) {
            $errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' :&nbsp;</strong> ' . __("Sorry you can't edit this post .", "vbegy"));
        }
    } else {
        $errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' :&nbsp;</strong> ' . __("Sorry no post select or not found .", "vbegy"));
    }
    if (empty($posted['title'])) {
        $errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' :&nbsp;</strong> ' . __("There are required fields ( title ).", "vbegy"));
    }
    if (empty($posted['category']) || $posted['category'] == '-1') {
        $errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' :&nbsp;</strong> ' . __("There are required fields ( category ).", "vbegy"));
    }
    if (vpanel_options("content_post") == 1) {
        if (empty($posted['comment'])) {
            $errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' :&nbsp;</strong> ' . __("There are required fields ( content ).", "vbegy"));
        }
    }
    if (sizeof($errors->errors) > 0) {
        return $errors;
    }
    $post_id = $get_post;
    /* Edit post */
    $data = array('ID' => esc_attr($post_id), 'post_content' => esc_attr($posted['comment']), 'post_title' => esc_attr($posted['title']), 'post_name' => esc_attr($posted['title']));
    wp_update_post($data);
    $terms = array();
    if ($posted['category']) {
        $terms[] = get_term_by('id', $posted['category'], 'category')->slug;
    }
    if (sizeof($terms) > 0) {
        wp_set_object_terms($post_id, $terms, 'category');
    }
    $attachment = '';
    require_once ABSPATH . "wp-admin" . '/includes/image.php';
    require_once ABSPATH . "wp-admin" . '/includes/file.php';
    if (isset($_FILES['attachment']) && !empty($_FILES['attachment']['name'])) {
        $attachment = wp_handle_upload($_FILES['attachment'], array('test_form' => false), current_time('mysql'));
        if (isset($attachment['error'])) {
            $errors->add('upload-error', __("Attachment Error: ", "vbegy") . $attachment['error']);
            return $errors;
        }
    }
    if ($attachment) {
        $attachment_data = array('post_mime_type' => $attachment['type'], 'post_title' => preg_replace('/\\.[^.]+$/', '', basename($attachment['file'])), 'post_content' => '', 'post_status' => 'inherit', 'post_author' => !is_user_logged_in() && $add_post_no_register == 1 ? 0 : get_current_user_id());
        $attachment_id = wp_insert_attachment($attachment_data, $attachment['file'], $post_id);
        $attachment_metadata = wp_generate_attachment_metadata($attachment_id, $attachment['file']);
        wp_update_attachment_metadata($attachment_id, $attachment_metadata);
        set_post_thumbnail($post_id, $attachment_id);
    }
    /* Tags */
    if (isset($posted['post_tag']) && $posted['post_tag']) {
        $tags = explode(',', trim(stripslashes($posted['post_tag'])));
        $tags = array_map('strtolower', $tags);
        $tags = array_map('trim', $tags);
        if (sizeof($tags) > 0) {
            wp_set_object_terms($post_id, $tags, 'post_tag');
        }
    }
    do_action('vpanel_edit_posts', $post_id);
    /* Successful */
    return $post_id;
}
<?php

get_header();
global $vbegy_sidebar;
$blog_style = vpanel_options("home_display");
get_template_part("loop-question", "archive");
vpanel_pagination();
get_footer();
Exemple #7
0
<?php

get_header();
global $vbegy_sidebar;
$blog_style = vpanel_options("home_display");
$vbegy_sidebar_all = vpanel_options("sidebar_layout");
if ($post->post_type == "question") {
    get_template_part("loop-question", "search");
} else {
    get_template_part("loop", "search");
}
vpanel_pagination();
get_footer();
    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;
        }
    }
Exemple #9
0
		        </div>
	        	<div class="cancel-comment-reply"><?php 
        cancel_comment_reply_link();
        ?>
</div>
		        <p class="form-submit">
		        	<input name="submit" type="submit" id="submit" value="<?php 
        _e('Post Comment', 'vbegy');
        ?>
" class="button small color">
		        	<?php 
        comment_id_fields();
        ?>
		        	<?php 
        do_action('comment_form', $post->ID);
        ?>
		        </p>
		    </form>
		<?php 
    } else {
        ?>
			<p class="no-login-comment"><?php 
        printf(__('You must <a href="%s" class="login-comments">login</a> or <a href="%s" class="signup">register</a> to add a new comment .', 'vbegy'), get_page_link(vpanel_options('login_register_page')), get_page_link(vpanel_options('login_register_page')));
        ?>
</p>
		<?php 
    }
    ?>
	</div>
<?php 
}
Exemple #10
0
            the_author_posts_link();
            ?>
</span>
					    <span class="meta-date"><i class="icon-time"></i><?php 
            the_time($date_format);
            ?>
</span>
					    <span class="meta-comment"><i class="icon-comments-alt"></i><?php 
            comments_popup_link(__('0 Comments', 'vbegy'), __('1 Comment', 'vbegy'), '% ' . __('Comments', 'vbegy'));
            ?>
</span>
					</div>
				<?php 
        }
        ?>
				<div class="post-content">
					<?php 
        the_content();
        ?>
					<div class="clearfix"></div>
				</div>
			</div><!-- End post-inner -->
		</article><!-- End article.post -->
		<?php 
        $post_comments = vpanel_options("post_comments");
        if ($post_comments == 1 && $post_comments_s == "" || $post_comments == 1 && isset($custom_page_setting) && $custom_page_setting == 0 || $post_comments == 1 && isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_comments_s) && $post_comments_s != 0 || isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_comments_s) && $post_comments_s == 1) {
            comments_template();
        }
    }
}
get_footer();
Exemple #11
0
    echo do_shortcode("[ask_login]");
    ?>
										</div>
									</div><!-- End page-content -->
								</div><!-- End col-md-6 -->
								<?php 
    if (!is_user_logged_in()) {
        ?>
									<div class="col-md-6">
										<div class="page-content">
											<h2><?php 
        _e("Register Now", "vbegy");
        ?>
</h2>
											<p><?php 
        echo vpanel_options("register_content");
        ?>
</p>
											<a class="button small color signup"><?php 
        _e("Create an account", "vbegy");
        ?>
</a>
										</div><!-- End page-content -->
									</div><!-- End col-md-6 -->
								<?php 
    }
    ?>
							</div><!-- End row -->
						</div><!-- End login -->
						<?php 
    get_footer();
<?php

ob_start();
/* Template Name: Edit post */
get_header();
$get_post = isset($_GET["edit_post"]) ? (int) $_GET["edit_post"] : 0;
$get_post_p = get_post($get_post);
$can_edit_post = vpanel_options("can_edit_post");
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
		<div class="page-content">
			<div class="boxedtitle page-title"><h2><?php 
        the_title();
        ?>
</h2></div>
			<?php 
        the_content();
        if (isset($get_post) && $get_post != 0 && $get_post_p && get_post_type($get_post) == "post") {
            if ($can_edit_post == 1 && $get_post_p->post_author != 0) {
                $user_login_id_l = get_user_by("id", $get_post_p->post_author);
                if ($user_login_id_l->ID == get_current_user_id()) {
                    echo do_shortcode("[vpanel_edit_post]");
                } else {
                    _e("Sorry you can't edit this post .", "vbegy");
                }
            } else {
                _e("Sorry you can't edit this post .", "vbegy");
            }
        } else {
Exemple #13
0
</span>
			<?php 
    $question_bump = vpanel_options("question_bump");
    if ($question_bump == 1 && isset($question_bump_template) && $question_bump_template == true) {
        ?>
				<span class="question-points"><i class="icon-heart"></i><?php 
        $question_points = get_post_meta($post->ID, 'question_points', true);
        echo $question_points != "" ? $question_points : 0;
        ?>
 <?php 
        _e("points", "vbegy");
        ?>
</span>
			<?php 
    }
    $active_vote = vpanel_options("active_vote");
    if ($question_vote_show == 1 && $active_vote == 1) {
        ?>
				<span class="single-question-vote-result question_vote_result"><?php 
        echo $question_vote != "" ? $question_vote : 0;
        ?>
</span>
				<ul class="single-question-vote">
					<?php 
        if (is_user_logged_in()) {
            ?>
						<li><a href="#" id="question_vote_down-<?php 
            echo $post->ID;
            ?>
" class="single-question-vote-down question_vote_down<?php 
            echo isset($_COOKIE['question_vote' . $post->ID]) ? " " . $_COOKIE['question_vote' . $post->ID] . "-" . $post->ID : "";
if (empty($_GET['u'])) {
    wp_redirect(home_url());
}
$user_login = get_userdata($_GET['u']);
if (empty($user_login)) {
    wp_redirect(home_url());
}
$owner = false;
if ($user_ID == $user_login->ID) {
    $owner = true;
}
if (vpanel_options("show_point_favorite") == 0 && $owner == false) {
    wp_redirect(home_url());
}
get_header();
$active_points = vpanel_options("active_points");
if ($active_points == 1) {
    include get_template_directory() . '/includes/author-head.php';
    ?>
		<div class="page-content page-content-user">
			<div class="user-questions">
				<?php 
    $rows_per_page = get_option("posts_per_page");
    $_points = get_user_meta($user_login->ID, $user_login->user_login . "_points", true);
    $paged = get_query_var("paged") != "" ? (int) get_query_var("paged") : (get_query_var("page") != "" ? (int) get_query_var("page") : 1);
    for ($points = 1; $points <= $_points; $points++) {
        $point_one[] = get_user_meta($user_login->ID, $user_login->user_login . "_points_" . $points);
    }
    if (isset($point_one) and is_array($point_one)) {
        $point = array_reverse($point_one);
        $current = max(1, $paged);
Exemple #15
0
 function woocommerce_bn_cart_button()
 {
     $nav_cart = vpanel_options('nav_cart');
     $nav_cart = 1;
     if ($nav_cart == 1) {
         if (class_exists('woocommerce')) {
             global $woocommerce;
             $cart_url = $woocommerce->cart->get_cart_url();
             $num = $woocommerce->cart->cart_contents_count;
         }
         $in_woo = vpanel_options('nav_cart_in_woo');
         $output = '<li><a href="' . $cart_url . '" class="nav-button nav-cart"><i class="enotype-icon-cart"></i><span class="numofitems" data-num="' . $num . '">' . $num . '</span></a></li>';
         if ($in_woo) {
             if (function_exists('is_woocommerce') && woocommerce_is_woocommerce_page()) {
                 return $output;
             }
         } else {
             return $output;
         }
     }
 }
								</ul>
							</div><!-- End related-posts -->
						<?php 
                            }
                            $post = $orig_post;
                            wp_reset_query();
                        }
                    } else {
                        if ($value_r == "comments") {
                            $post_comments = vpanel_options("post_comments");
                            if ($post_comments == 1 && $post_comments_s == "" || $post_comments == 1 && isset($custom_page_setting) && $custom_page_setting == 0 || $post_comments == 1 && isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_comments_s) && $post_comments_s != 0 || isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_comments_s) && $post_comments_s == 1) {
                                comments_template("/question-comments.php");
                            }
                        } else {
                            if ($value_r == "next_previous") {
                                $post_navigation = vpanel_options("post_navigation");
                                if ($post_navigation == 1 && $post_navigation_s == "" || $post_navigation == 1 && isset($custom_page_setting) && $custom_page_setting == 0 || $post_navigation == 1 && isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_navigation_s) && $post_navigation_s != 0 || isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_navigation_s) && $post_navigation_s == 1) {
                                    ?>
						<div class="post-next-prev clearfix">
						    <p class="prev-post">
						        <?php 
                                    previous_post_link('%link', '<i class="icon-double-angle-left"></i>' . __('&nbsp;Previous question', 'vbegy'));
                                    ?>
						    </p>
						    <p class="next-post">
						    	<?php 
                                    next_post_link('%link', __('Next question&nbsp;', 'vbegy') . '<i class="icon-double-angle-right"></i>');
                                    ?>
						    </p>
						</div><!-- End post-next-prev -->
					<?php 
Exemple #17
0
function vbegy_login_logo()
{
    if (vpanel_options("login_logo") != "") {
        echo '<style type="text/css"> h1 a {  background-image:url(' . vpanel_options("login_logo") . ')  !important; background-size: auto !important; } </style>';
    }
}
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;
}
Exemple #19
0
                                                        dynamic_sidebar(sanitize_title($vbegy_what_sidebar));
                                                    } else {
                                                        if ($vbegy_what_sidebar == "" || $vbegy_what_sidebar == "default") {
                                                            $else_sidebar = vpanel_options("else_sidebar");
                                                            if ($else_sidebar == "" || $else_sidebar == "default") {
                                                                dynamic_sidebar('sidebar_default');
                                                            } else {
                                                                dynamic_sidebar(sanitize_title($else_sidebar));
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            } else {
                                $else_sidebar = vpanel_options("else_sidebar");
                                if ($else_sidebar == "" || $else_sidebar == "default") {
                                    dynamic_sidebar('sidebar_default');
                                } else {
                                    dynamic_sidebar(sanitize_title($else_sidebar));
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Exemple #20
0
<?php

global $blog_style, $vbegy_sidebar_all;
$posts_meta = vpanel_options("post_meta");
$date_format = vpanel_options("date_format") ? vpanel_options("date_format") : get_option("date_format");
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $vbegy_what_post = rwmb_meta('vbegy_what_post', 'select', $post->ID);
        $vbegy_sidebar = $vbegy_sidebar_all;
        $vbegy_google = rwmb_meta('vbegy_google', "textarea", $post->ID);
        $video_id = rwmb_meta('vbegy_video_post_id', "select", $post->ID);
        $video_type = rwmb_meta('vbegy_video_post_type', "text", $post->ID);
        $vbegy_slideshow_type = rwmb_meta('vbegy_slideshow_type', 'select', $post->ID);
        if ($video_type == 'youtube') {
            $type = "http://www.youtube.com/embed/" . $video_id;
        } else {
            if ($video_type == 'vimeo') {
                $type = "http://player.vimeo.com/video/" . $video_id;
            } else {
                if ($video_type == 'daily') {
                    $type = "http://www.dailymotion.com/swf/video/" . $video_id;
                }
            }
        }
        ?>
	<article <?php 
        post_class('post  clearfix ' . ($blog_style == "blog_2" ? "blog_2" : "") . (is_sticky() ? " sticky_post" : ""));
        ?>
 role="article" itemscope="" itemtype="http://schema.org/Article">
		<div class="post-inner">
Exemple #21
0
							<li class="linkedin"><a target="_blank" original-title="<?php 
        _e("Linkedin", "vbegy");
        ?>
" class="tooltip-n" href="<?php 
        echo $linkedin_icon_f;
        ?>
"><i class="social_icon-linkedin font17"></i></a></li>
						<?php 
    }
    if ($rss_icon_f == 1) {
        ?>
							<li class="rss"><a original-title="<?php 
        _e("Rss", "vbegy");
        ?>
" class="tooltip-n" href="<?php 
        echo vpanel_options("rss_icon_f_other") != "" ? vpanel_options("rss_icon_f_other") : bloginfo('rss2_url');
        ?>
"><i class="social_icon-rss font17"></i></a></li>
						<?php 
    }
    ?>
					</ul>
				</div><!-- End social_icons -->
			<?php 
}
?>
		</section><!-- End container -->
	</footer><!-- End footer-bottom -->
</div><!-- End wrap -->

<div class="go-up"><i class="icon-chevron-up"></i></div>
Exemple #22
0
    // Exit if accessed directly
}
global $product;
if (get_option('woocommerce_enable_review_rating') === 'no') {
    return;
}
$rating_count = $product->get_rating_count();
$average = $product->get_average_rating();
if ($rating_count > 0) {
    ?>

	<div class="woocommerce-product-rating" itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
		<?php 
    global $post, $product;
    $cat_count = sizeof(get_the_terms($post->ID, 'product_cat'));
    $posts_meta = vpanel_options("post_meta");
    $post_meta_s = rwmb_meta('vbegy_post_meta_s', 'checkbox', $post->ID);
    $custom_page_setting = rwmb_meta('vbegy_custom_page_setting', 'checkbox', $post->ID);
    if ($posts_meta == "on" && $post_meta_s == "" || $posts_meta == "on" && isset($custom_page_setting) && $custom_page_setting == 0 || $posts_meta == "on" && isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_meta_s) && $post_meta_s != 0 || isset($custom_page_setting) && $custom_page_setting == 1 && isset($post_meta_s) && $post_meta_s == 1) {
        echo $product->get_categories(', ', '<h4 class="posted_in">' . _n('Category :', 'Categories :', $cat_count, 'woocommerce') . ' ', '.</h4>');
        ?>
			<h4><?php 
        _e('Reviews :', 'vbegy');
        ?>
	</h4>
			<div class="star-rating" title="<?php 
        printf(__('Rated %s out of 5', 'woocommerce'), $average);
        ?>
">
				<span style="width:<?php 
        echo $average / 5 * 100;
Exemple #23
0
<?php

get_header();
global $vbegy_sidebar;
$blog_style = vpanel_options("home_display");
$vbegy_sidebar_all = vpanel_options('sidebar_layout');
get_template_part("loop", "archive");
vpanel_pagination();
get_footer();
">
						<h3>
							<?php 
            if ($user_ID == $user_login->ID) {
                ?>
								<span class="question-edit">
									<a href="<?php 
                echo esc_url(add_query_arg("q", $post->ID, get_page_link(vpanel_options('edit_question'))));
                ?>
" original-title="<?php 
                _e("Edit the question", "vbegy");
                ?>
" class="tooltip-n"><i class="icon-edit"></i></a>
								</span>
								<?php 
                $question_delete = vpanel_options("question_delete");
                if ($question_delete == 1) {
                    ?>
									<span class="question-delete">
										<a href="<?php 
                    echo esc_url(add_query_arg("delete", $post->ID, get_permalink($post->ID)));
                    ?>
" original-title="<?php 
                    _e("Delete the question", "vbegy");
                    ?>
" class="tooltip-n"><i class="icon-remove"></i></a>
									</span>
								<?php 
                }
            }
            ?>
Exemple #25
0
<span> ( <span><?php 
    echo esc_attr($follow_answers);
    ?>
</span> ) </span></a></li>
								<li class="follow_posts"><i class="icon-file-alt"></i><a href="<?php 
    echo esc_url(add_query_arg("u", esc_attr($get_query_var), get_page_link(vpanel_options('follow_post_page'))));
    ?>
"><?php 
    _e("Follow posts", "vbegy");
    ?>
<span> ( <span><?php 
    echo esc_attr($follow_posts);
    ?>
</span> ) </span></a></li>
								<li class="follow_comments"><i class="icon-comments"></i><a href="<?php 
    echo esc_url(add_query_arg("u", esc_attr($get_query_var), get_page_link(vpanel_options('follow_comment_page'))));
    ?>
"><?php 
    _e("Follow comments", "vbegy");
    ?>
<span> ( <span><?php 
    echo esc_attr($follow_comments);
    ?>
</span> ) </span></a></li>
							<?php 
}
?>
						</ul>
					</div>
				</div><!-- End user-profile-widget -->
			</div><!-- End page-content -->
function vpanel_save_extra_profile_fields($user_id)
{
    if (!current_user_can('edit_user', $user_id)) {
        return false;
    }
    $google = isset($_POST['google']) ? $_POST['google'] : "";
    update_user_meta($user_id, 'google', esc_attr($google));
    $twitter = isset($_POST['twitter']) ? $_POST['twitter'] : "";
    update_user_meta($user_id, 'twitter', esc_attr($twitter));
    $facebook = isset($_POST['facebook']) ? $_POST['facebook'] : "";
    update_user_meta($user_id, 'facebook', esc_attr($facebook));
    $youtube = isset($_POST['youtube']) ? $_POST['youtube'] : "";
    update_user_meta($user_id, 'youtube', esc_attr($youtube));
    $linkedin = isset($_POST['linkedin']) ? $_POST['linkedin'] : "";
    update_user_meta($user_id, 'linkedin', esc_attr($linkedin));
    $instagram = isset($_POST['instagram']) ? $_POST['instagram'] : "";
    update_user_meta($user_id, 'instagram', esc_attr($instagram));
    $pinterest = isset($_POST['pinterest']) ? $_POST['pinterest'] : "";
    update_user_meta($user_id, 'pinterest', esc_attr($pinterest));
    $follow_email = isset($_POST['follow_email']) ? $_POST['follow_email'] : "";
    update_user_meta($user_id, 'follow_email', esc_attr($follow_email));
    $you_avatar = isset($_POST['you_avatar']) ? $_POST['you_avatar'] : "";
    update_user_meta($user_id, 'you_avatar', esc_attr($you_avatar));
    $country = isset($_POST['country']) ? $_POST['country'] : "";
    update_user_meta($user_id, 'country', esc_attr($country));
    $city = isset($_POST['city']) ? $_POST['city'] : "";
    update_user_meta($user_id, 'city', esc_attr($city));
    $age = isset($_POST['age']) ? $_POST['age'] : "";
    update_user_meta($user_id, 'age', esc_attr($age));
    $sex = isset($_POST['sex']) ? $_POST['sex'] : "";
    update_user_meta($user_id, 'sex', esc_attr($sex));
    $phone = isset($_POST['phone']) ? $_POST['phone'] : "";
    update_user_meta($user_id, 'phone', esc_attr($phone));
    $active_points = vpanel_options("active_points");
    if (is_super_admin(get_current_user_id()) && $active_points == 1) {
        $add_remove_point = "";
        $the_points = "";
        $the_reason = "";
        if (isset($_POST['add_remove_point'])) {
            $add_remove_point = esc_attr($_POST['add_remove_point']);
        }
        if (isset($_POST['the_points'])) {
            $the_points = (int) esc_attr($_POST['the_points']);
        }
        if (isset($_POST['the_reason'])) {
            $the_reason = esc_attr($_POST['the_reason']);
        }
        if ($the_points > 0) {
            $current_user = get_user_by("id", $user_id);
            $_points = get_user_meta($user_id, $current_user->user_login . "_points", true);
            $_points++;
            $points_user = get_user_meta($user_id, "points", true);
            if ($add_remove_point == "remove") {
                $add_remove_point_last = "-";
                $the_reason_last = "admin_remove_points";
                update_user_meta($user_id, "points", $points_user - $the_points);
            } else {
                $add_remove_point_last = "+";
                $the_reason_last = "admin_add_points";
                update_user_meta($user_id, "points", $points_user + $the_points);
            }
            $the_reason = isset($the_reason) && $the_reason != "" ? $the_reason : $the_reason_last;
            update_user_meta($user_id, $current_user->user_login . "_points", $_points);
            add_user_meta($user_id, $current_user->user_login . "_points_" . $_points, array(date_i18n('Y/m/d', current_time('timestamp')), date_i18n('g:i a', current_time('timestamp')), $the_points, $add_remove_point_last, $the_reason));
        }
    }
}
ob_start();
/* Template Name: Login 2 */
get_header();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
		<div class="login">
			<div class="row">
				<?php 
        if (is_user_logged_in()) {
            ?>
					<div class="col-md-12">
						<div class="page-content">
							<?php 
            echo is_user_logged_in_data(vpanel_options("user_links"));
            ?>
						</div>
					</div><!-- End col-md-12 -->
				<?php 
        } else {
            ?>
					<div class="col-md-6">
						<div class="page-content">
							<h2><?php 
            _e("Login", "vbegy");
            ?>
</h2>
							<div class="form-style form-style-3">
								<?php 
            echo do_shortcode("[ask_login forget='false']");
Exemple #28
0
    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'), 'vbegy'), get_comment_date(), get_comment_time());
?>
</div> 
		        </div>
		        <div class="comment-reply">
		            <?php 
edit_comment_link('Edit', '  ', '');
$active_reports = vpanel_options("active_reports");
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 
}
?>
		        </div>
		    </div>
		    <div class="text">
		    	<?php 
if ($active_reports == 1) {
    ?>
function ask_add_admin_page_reports()
{
    $active_reports = vpanel_options("active_reports");
    if ($active_reports == 1) {
        global $count_report_new, $count_report_answer_new;
        $count_report_new = count($count_report_new);
        $count_report_answer_new = count($count_report_answer_new);
        $count_lasts = $count_report_new + $count_report_answer_new;
        $vpanel_page = add_menu_page('Reports', 'Reports <span class="count_report_new awaiting-mod count-' . $count_lasts . '"><span class="pending-count count_lasts">' . $count_lasts . '</span></span>', 'manage_options', 'r_questions', 'r_questions', 'dashicons-email-alt');
        add_submenu_page('r_questions', 'Questions', 'Questions <span class="count_report_new awaiting-mod count-' . $count_report_new . '"><span class="pending-count count_report_question_new">' . $count_report_new . '</span></span>', 'manage_options', 'r_questions', 'r_questions');
        add_submenu_page('r_questions', 'Answers', 'Answers <span class="count_report_new awaiting-mod count-' . $count_report_answer_new . '"><span class="pending-count count_report_answer_new">' . $count_report_answer_new . '</span></span>', 'manage_options', 'r_answers', 'r_answers');
    }
}