本文整理汇总了PHP中vpanel_options函数的典型用法代码示例。如果您正苦于以下问题:PHP vpanel_options函数的具体用法?PHP vpanel_options怎么用?PHP vpanel_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了vpanel_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widgets_init
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));
}
}
示例2: widget
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;
}
}
示例3: do_shortcode
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();
示例4: wp_redirect
<?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);
示例5: process_vpanel_edit_posts
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") . ' : </strong> ' . __("Sorry you can't edit this post .", "vbegy"));
}
} else {
$errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' : </strong> ' . __("Sorry no post select or not found .", "vbegy"));
}
if (empty($posted['title'])) {
$errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' : </strong> ' . __("There are required fields ( title ).", "vbegy"));
}
if (empty($posted['category']) || $posted['category'] == '-1') {
$errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' : </strong> ' . __("There are required fields ( category ).", "vbegy"));
}
if (vpanel_options("content_post") == 1) {
if (empty($posted['comment'])) {
$errors->add('required-field', '<strong>' . __("Error", "vbegy") . ' : </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;
}
示例6: get_header
<?php
get_header();
global $vbegy_sidebar;
$blog_style = vpanel_options("home_display");
get_template_part("loop-question", "archive");
vpanel_pagination();
get_footer();
示例7: get_header
<?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();
示例8: widget
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;
}
}
示例9: cancel_comment_reply_link
</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
}
示例10: the_author_posts_link
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();
示例11: ob_start
<?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 {
示例12: vpanel_options
</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 : "";
示例13: wp_redirect
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);
示例14: woocommerce_bn_cart_button
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;
}
}
}
示例15: wp_reset_query
</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>' . __(' Previous question', 'vbegy'));
?>
</p>
<p class="next-post">
<?php
next_post_link('%link', __('Next question ', 'vbegy') . '<i class="icon-double-angle-right"></i>');
?>
</p>
</div><!-- End post-next-prev -->
<?php