Last active
September 6, 2018 01:18
-
-
Save eto4detak/4bf3db5ca1ed83157816149870329e7a to your computer and use it in GitHub Desktop.
wp ask-me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//отправка письма sendEmail(get_bloginfo("admin_email"),get_bloginfo('name'),esc_html($posted['user_mail']),esc_html($get_user_by_mail->data->display_name),__("Сбросить пароль","vbegy"),$last_message_email); | |
//*** убрать форму стандартную регистрации пользавателя | |
// jQuery("html,body").animate({scrollTop:0},500); | |
// jQuery("body").prepend("<div class='wrap-pop'></div>"); | |
// wrap_pop(); | |
}); | |
</script> | |
<?php } | |
if (0) { | |
if ((isset($_POST["form_type"]) && ($_POST["form_type"] == "ask-signup" || $_POST["form_type"] == "empty-post")) || empty($_POST)) {?> | |
<div class="panel-pop" id="signup"> | |
<h2><?php _e("Register Now","vbegy");?><i class="icon-remove"></i></h2> | |
<div class="form-style form-style-3"> | |
<?php echo do_shortcode("[ask_signup]");?> | |
</div> | |
</div><!-- End signup --> | |
<?php } | |
//end*** | |
комент без регистрации | |
картинки в задать вопрос | |
<input type="text" name="email" value="[email protected]" class="form-control"> | |
<input type="checkbox" id="agree_terms-182" class="styled custom-checkbox" checked name="agree_terms" value="1"> | |
<input type="hidden" name="form_type" value="add_question"> | |
<input size="10" id="ask_captcha_182" name="ask_captcha" class="ask_captcha" value="1" type="text"><img class="ask_captcha_img" src="http://test3.dev-fecs.ru/wp-content/themes/ask-me/captcha/create_image.php" alt="Captcha" title="Click here to update the captcha" onclick="javascript:ask_get_captcha('http://test3.dev-fecs.ru/wp-content/themes/ask-me/captcha/create_image.php', 'ask_captcha_img_182');" id="ask_captcha_img_182"> | |
<input type="text" name="title" value="titleque" class="form-control"> | |
<?php echo ask_me_select_categories($rand_q,$posted['category'],null,'',ask_question_category); ?> | |
<?php echo '<input type="hidden" name="user_id" value="'.$str_id.'">'; ?> | |
// убрал из проверки вопроса | |
$yes_private != 1 | |
|| (is_user_logged_in() && isset($roles["show_question"]) && $roles["show_question"] == 1) | |
// вывести значок | |
if (isset($post->post_author) && $post->post_author > 0) { | |
// echo vpanel_get_badge($post->post_author); | |
} | |
// след вопрос | |
else if ($value_r == "next_previous") { | |
$post_navigation = vpanel_options("question_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 } | |
} | |
// AUTHOR | |
<div class="page-content"> | |
<div class="user-stats"> | |
<div class="user-stats-head"> | |
<div class="block-stats-1 stats-head"><?php _e("#","vbegy")?></div> | |
<div class="block-stats-2 stats-head"><?php _e("Today","vbegy")?></div> | |
<div class="block-stats-3 stats-head"><?php _e("Month","vbegy")?></div> | |
<div class="block-stats-4 stats-head"><?php _e("Total","vbegy")?></div> | |
</div> | |
<div class="user-stats-item"> | |
<div class="block-stats-1"><?php _e("Questions","vbegy")?></div> | |
<div class="block-stats-2"><?php echo ($add_questions_d == ""?0:$add_questions_d)?></div> | |
<div class="block-stats-3"><?php echo ($add_questions_m == ""?0:$add_questions_m)?></div> | |
<div class="block-stats-4"><?php echo ($add_questions == ""?0:$add_questions)?></div> | |
</div> | |
<div class="user-stats-item"> | |
<div class="block-stats-1"><?php _e("Answers","vbegy")?></div> | |
<div class="block-stats-2"><?php echo ($add_answer_d == ""?0:$add_answer_d)?></div> | |
<div class="block-stats-3"><?php echo ($add_answer_m == ""?0:$add_answer_m)?></div> | |
<div class="block-stats-4"><?php echo ($add_answer == ""?0:$add_answer)?></div> | |
</div> | |
<div class="user-stats-item user-stats-item-last"> | |
<div class="block-stats-1"><?php _e("Visitors","vbegy")?></div> | |
<div class="block-stats-2"><?php echo ($visit_profile_d == ""?0:$visit_profile_d)?></div> | |
<div class="block-stats-3"><?php echo ($visit_profile_m == ""?0:$visit_profile_m)?></div> | |
<div class="block-stats-4"><?php echo ($visit_profile == ""?0:$visit_profile)?></div> | |
</div> | |
</div><!-- End user-stats --> | |
</div><!-- End page-content --> | |
include (get_template_directory() . '/includes/author-head.php'); | |
<!-- виджет --> | |
<div class="blog-btns blog-btns-row"><div class="container"> | |
<div class="col"> | |
<a href="#" class="appointment-btn"> | |
<span class="appointment-ico"></span> | |
<span> | |
<span>Задать вопрос</span><br> | |
<span class="span2">Консультация юриста онлайн</span> | |
</span> | |
</a> | |
</div> | |
<div class="separator"></div> | |
<div class="col"> | |
<a href="#" class="appointment-btn callback-btn"> | |
<span class="appointment-ico"></span> | |
<span> | |
<span>Звонок юриста</span><br> | |
<span class="span2">Консультация по телефону</span> | |
</span> | |
</a> | |
</div> | |
<div class="separator"></div> | |
<div class="col"> | |
<a href="#" class="appointment-btn document-btn"> | |
<span class="appointment-ico"></span> | |
<span><span>Заказать документ</span> | |
<span class="span2">Составление документов юристом</span> | |
</span> | |
</a> | |
</div> | |
<div class="separator"></div> | |
<div class="col"> | |
<a href="#" class="appointment-btn yurist-btn"> | |
<span class="appointment-ico"></span> | |
<span> | |
<span>Запись к юристу</span> | |
<span class="span2"> | |
Личная консультация юриста | |
</span> | |
</span> | |
</a> | |
</div> | |
</div></div> | |
<!-- user --> | |
<div class="cartochka-vracha-right"> | |
<div class="cartochka-vracha-title"> | |
<div class="cartochka-vracha-title-top"> | |
<div class="header-row__title"><h1><?php echo $user_login->display_name?></h1></div> | |
</div> | |
<ul class="vrach-exp"> | |
<?php if(!empty($lawyer_age)){ ?> | |
<li><div class="inline"><span class="strong">Стаж</span> <?php echo esc_attr($lawyer_age); ?> года</div></li> | |
<?php } | |
if(!empty($lawyer_category)){ ?> | |
<li><div class="inline"><span class="strong">Категория: </span><?php echo esc_attr($lawyer_category); ?></div></li> | |
<?php } | |
if(!empty($lawyer_academic)){ ?> | |
<li><div class="inline"><span class="strong">Ученая степень: </span><?php echo esc_attr($lawyer_academic); ?></div></li> | |
<?php } | |
if(!empty($lawyer_level)){ ?> | |
<li><div class="inline"><span class="strong">Должность юриста: </span><?php echo esc_attr($lawyer_level); ?></div></li> | |
<?php } | |
if(!empty($lawyer_status)){ ?> | |
<li><div class="inline"><span class="strong">Статус юриста: </span><?php echo esc_attr($lawyer_status); ?></div></li> | |
<?php } | |
if(!empty($age)){ ?> | |
<li><div class="inline"><span class="strong">Возраст: </span><?php echo esc_attr($age); ?> года</div></li> | |
<?php } | |
if(!empty($lawyer_education)){ ?> | |
<li><div class="inline"><span class="strong">Образование: </span><?php echo esc_attr($lawyer_education); ?></div>ситет</li> | |
<?php } ?> | |
</ul> | |
</div> | |
<div class="product-block"> | |
<div class="podderjite-block"> | |
<div class="h4">Юрист помог вам?</div> | |
<p>Поддержите его! Отправьте | |
в благодарность небольшую | |
денежную сумму.</p> | |
<a href="#" class="btn">Отблагодарить</a> | |
</div> | |
<div class="product-box__location-wrap"> | |
<div class="product-box__location"> | |
<div class="h3">Место работы</div> | |
<p><a>Адвокатская палата Москвы</a></p> | |
<p>Начальник юридического отдела, стаж 5 лет</p> | |
</div> | |
</div> | |
<div class="card-btns"> | |
<a href="#" class="btn-question btn">Задать вопрос</a> | |
<a href="#" class="btn btn-appointment">Записаться on-line</a> | |
</div> | |
</div> | |
<div class="card-contacts"> | |
<ul> | |
<li class="card-phone"><span class="h4"><?php echo $phone; ?></span> | |
<div class="collapsed-plugin__hide cp-tel1"> | |
<div class="h4">+7 812 525-23-35</div> | |
<div class="h4">+7 812 525-23-35</div> | |
<div class="h4">+7 812 525-23-35</div> | |
</div> | |
<a href="#" data-class="cp-tel1" data-show="Еще телефоны" data-hide="Скрыть телефоны" class="collapsed-plugin__btn link"><span>Еще телефоны</span></a> | |
</li> | |
<?php if($follow_email){ ?> | |
<li class="card-mail"><a href="mailto:<?php echo $follow_email; ?>"><?php echo $follow_email; ?></a></li> | |
<?php } ?> | |
<li class="card-time">пн-пт с 10:00 до 20:00, сб: с 11:00 до 17:00, <span class="brown">вс выходной</span></li> | |
<li class="card-social"><a href="#">Vkontakte</a><?php if($facebook){ echo ','; ?><a href="<?php echo $facebook; ?>">Facebook</a><?php } ?><?php if($instagram){ echo ','; ?><a href="<?php echo $instagram; ?>">Instagram</a><?php } ?></li> | |
</ul> | |
</div> | |
</div> | |
<!-- вопросы --> | |
<ul class="clearfix"> | |
<li>Сортировать по:</li> | |
<li><a href="#">Все вопросы</a></li> | |
<li><a href="#">Платные</a></li> | |
<li><a href="#">Бесплатные</a></li> | |
<li><a href="#">Нерешенные</a></li> | |
<li><a href="#">Заданные вам</a></li> | |
</ul> | |
<input id="private_question-366" name="private_question" type="checkbox" value="1"> | |
<span class="question_poll"> | |
Active this question as a private question. | |
</span> | |
</input> | |
почта | |
[email protected] | |
function send_message_shortcode($atts, $content = null) { | |
global $posted,$settings; | |
$a = shortcode_atts( array( | |
'type' => '', | |
), $atts ); | |
$out = ''; | |
$send_message = vpanel_options("send_message"); | |
$send_message_no_register = vpanel_options("send_message_no_register"); | |
$custom_permission = vpanel_options("custom_permission"); | |
if (is_user_logged_in()) { | |
$user_get_current_user_id = get_current_user_id(); | |
$user_is_login = get_userdata($user_get_current_user_id); | |
$user_login_group = key($user_is_login->caps); | |
$roles = $user_is_login->allcaps; | |
} | |
if (($custom_permission == 1 && is_user_logged_in() && empty($roles["send_message"])) || ($custom_permission == 1 && !is_user_logged_in() && $send_message != 1)) { | |
$out .= '<div class="note_error"><strong>'.__("Sorry, you do not have a permission to send message.","vbegy").'</strong></div>'; | |
if (!is_user_logged_in()) { | |
$out .= '<div class="form-style form-style-3"><div class="note_error"><strong>'.__("You must login to send a message.","vbegy").'</strong></div>'.do_shortcode("[ask_login register_2='yes']").'</div>'; | |
} | |
}else if (!is_user_logged_in() && $send_message_no_register != 1) { | |
$out .= '<div class="form-style form-style-3"><div class="note_error"><strong>'.__("You must login to send a message.","vbegy").'</strong></div>'.do_shortcode("[ask_login register_2='yes']").'</div>'; | |
}else { | |
if ($_POST) { | |
$post_type = (isset($_POST["post_type"]) && $_POST["post_type"] != ""?esc_html($_POST["post_type"]):""); | |
}else { | |
$post_type = ""; | |
} | |
if (isset($_POST["post_type"]) && $_POST["post_type"] == "send_message") { | |
do_action('new_message'); | |
} | |
if ($post_type != "add_question" && $post_type != "edit_question" && $post_type != "add_post" && $post_type != "edit_post") { | |
$users_by_id = $get_user_id = 0; | |
if (isset($_GET["user_id"]) && $_GET["user_id"] != "") { | |
$get_user_id = (int)$_GET["user_id"]; | |
$get_users_by_id = get_users(array("include" => array($get_user_id))); | |
if (isset($get_users_by_id) && !empty($get_users_by_id)) { | |
$users_by_id = 1; | |
} | |
}else if (is_author()) { | |
$users_by_id = $get_user_id = 0; | |
$user_login = get_queried_object(); | |
if (isset($user_login) && is_object($user_login)) { | |
$user_login = get_userdata(esc_attr($user_login->ID)); | |
} | |
if (isset($user_login) && !is_object($user_login)) { | |
$user_login = get_user_by('login',urldecode(get_query_var('author_name'))); | |
} | |
if (isset($user_login) && !is_object($user_login)) { | |
$user_login = get_user_by('slug',urldecode(get_query_var('author_name'))); | |
} | |
if (isset($user_login) && is_object($user_login)) { | |
$users_by_id = 1; | |
$get_user_id = $user_login->ID; | |
} | |
} | |
if (is_user_logged_in() && $user_get_current_user_id == $get_user_id) { | |
echo '<div class="alert-message error"><p>'.__("You can't send message for yourself.","vbegy").'</p></div>'; | |
}else { | |
$comment_message = vpanel_options("comment_message"); | |
$out .= '<div class="form-posts"><div class="form-style form-style-3 message-submit"> | |
<div class="send_message"> | |
<div '.(!is_user_logged_in()?"class='if_no_login'":"").'>'; | |
$rand_q = rand(1,1000);?> | |
<?php | |
$out .= ' | |
<form class="new-message-form" method="post" enctype="multipart/form-data"> | |
<div class="note_error display"></div> | |
<div class="form-inputs clearfix">'; | |
if (!is_user_logged_in() && $send_message_no_register == 1) { | |
$out .= '<p> | |
<label for="message-username-'.$rand_q.'" class="required">'.__("Username","vbegy").'<span>*</span></label> | |
<input name="username" id="message-username-'.$rand_q.'" class="the-username" type="text" value="'.(isset($posted['username'])?$posted['username']:'').'"> | |
<span class="form-description">'.__("Please type your username .","vbegy").'</span> | |
</p> | |
<p> | |
<label for="message-email-'.$rand_q.'" class="required">'.__("E-Mail","vbegy").'<span>*</span></label> | |
<input name="email" id="message-email-'.$rand_q.'" class="the-email" type="text" value="'.(isset($posted['email'])?$posted['email']:'').'"> | |
<span class="form-description">'.__("Please type your E-Mail .","vbegy").'</span> | |
</p>'; | |
} | |
$out .= '<p> | |
<label for="message-title-'.$rand_q.'" class="required">'.__("Message Title","vbegy").'<span>*</span></label> | |
<input name="title" id="message-title-'.$rand_q.'" class="the-title" type="text" value="'.(isset($posted['title'])?ask_kses_stip($posted['title']):(isset($_POST["title"])?ask_kses_stip($_POST["title"]):"")).'"> | |
</p>'; | |
$out .= '</div> | |
<div class="details-area"> | |
<label for="message-details-'.$rand_q.'" '.($comment_message == 1?'class="required"':'').'>'.__("Details","vbegy").($comment_message == 1?'<span>*</span>':'').'</label>'; | |
$editor_message_details = vpanel_options("editor_message_details"); | |
if ($editor_message_details == 1) { | |
ob_start(); | |
wp_editor((isset($posted['comment'])?ask_kses_stip_wpautop($posted['comment']):(isset($_POST["comment"])?wp_kses_post($_POST["comment"]):"")),"message-details-".$rand_q,$settings); | |
$editor_contents = ob_get_clean(); | |
$out .= '<div class="the-details the-textarea">'.$editor_contents.'</div>'; | |
}else { | |
$out .= '<textarea name="comment" id="message-details-'.$rand_q.'" class="the-textarea" aria-required="true" cols="58" rows="8">'.(isset($posted['comment'])?ask_kses_stip($posted['comment']):(isset($_POST["comment"])?ask_kses_stip($_POST["comment"]):"")).'</textarea>'; | |
} | |
$out .= '<div class="clearfix"></div></div> | |
<div class="form-inputs clearfix">'; | |
$the_captcha = vpanel_options("the_captcha_message"); | |
$captcha_style = vpanel_options("captcha_style"); | |
$captcha_question = vpanel_options("captcha_question"); | |
$captcha_answer = vpanel_options("captcha_answer"); | |
$show_captcha_answer = vpanel_options("show_captcha_answer"); | |
if ($the_captcha == 1) { | |
if ($captcha_style == "question_answer") { | |
$out .= " | |
<p class='ask_captcha_p'> | |
<label for='ask_captcha-'.$rand_q.'' class='required'>".__("Captcha","vbegy")."<span>*</span></label> | |
<input size='10' id='ask_captcha-'.$rand_q.'' name='ask_captcha' class='ask_captcha captcha_answer' value='' type='text'> | |
<span class='question_poll ask_captcha_span'>".$captcha_question.($show_captcha_answer == 1?" ( ".$captcha_answer." )":"")."</span> | |
</p>"; | |
}else { | |
$out .= " | |
<p class='ask_captcha_p'> | |
<label for='ask_captcha_".$rand_q."' class='required'>".__("Captcha","vbegy")."<span>*</span></label> | |
<input size='10' id='ask_captcha_".$rand_q."' name='ask_captcha' class='ask_captcha' value='' type='text'><img class='ask_captcha_img' src='".get_template_directory_uri()."/captcha/create_image.php' alt='".__("Captcha","vbegy")."' title='".__("Click here to update the captcha","vbegy")."' onclick=";$out .='"javascript:ask_get_captcha';$out .="('".get_template_directory_uri()."/captcha/create_image.php', 'ask_captcha_img_".$rand_q."');";$out .='"';$out .=" id='ask_captcha_img_".$rand_q."'> | |
<span class='question_poll ask_captcha_span'>".__("Click on image to update the captcha .","vbegy")."</span> | |
</p>"; | |
} | |
} | |
$out .= '</div> | |
<p class="form-submit"> | |
<input type="hidden" name="post_type" value="send_message">'; | |
if (isset($a["type"]) && $a["type"] == "popup") { | |
$out .= '<input type="hidden" name="form_type" value="message-popup">'; | |
}else { | |
$out .= '<input type="hidden" name="form_type" value="send_message">'; | |
} | |
if ($users_by_id == 1) { | |
$out .= '<input type="hidden" name="user_id" value="'.$get_user_id.'">'; | |
} | |
$out .= '<input type="submit" value="'.__("Send Your Message","vbegy").'" class="button color small submit send-message"> | |
</p> | |
</form> | |
</div> | |
</div> | |
</div></div>'; | |
} | |
} | |
} | |
return $out; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment