9ответ(ов) в теме
<?php
function fng_get_request_box($post_id){
global $user_ID;
if(!$user_ID) return false;
$post = get_post($post_id);
$content = '';
if($post->post_author == $user_ID)
$content .= ''.__('Добавленные заявки').'
';
$args = array(
'task_id' => $post_id,
'request_status' => 1,
'number' => -1,
'order' => 'ASC'
);
if($post->post_author != $user_ID){
$args['author_id'] = $user_ID;
}
require_once 'classes/class-fng-requests-list.php';
$Walker = new FNG_Requests_List($args);
$content .= '';
if(isset($args['author_id']) && $Walker->requests){
$content .= ''.__('Ваша заявка к заданию').'
';
}
if(!$Walker->requests){
if($post->post_author == $user_ID)
$content .= ''.__('Ни одной заявки пока не добавлено.').'
';
}else{
$content .= $Walker->get_list();
global $post;
echo rcl_get_chat_private($post->post_author);
}
$content .= '';
$reqs = false;
if($post->post_author != $user_ID && !$Walker->requests){
$reqs = fng_get_requests(array(
'author_id'=>$user_ID,
'task_id'=>$post_id,
'request_status__not_in' => 1
));
}
if($post->post_author != $user_ID && !$Walker->requests && !$reqs)
$content .= fng_get_request_form($post_id);
$content .= '';
return $content;
}
function fng_get_request_form($post_id){
$content .= rcl_chat_shortcode ;
$content = '';
$content .= ''.__('Форма заявки к заданию').'
';
$content .= rcl_get_form(apply_filters('fng_request_form_args', array(
'fields' => array(
array(
'slug' => 'request-price',
'type' => 'number',
'title' => __('Желаемая стоимость заказа'),
'notice' => __('укажите стоимость заказа, которая устроила бы вас как исполнителя, может быть изменено позднее'),
'required' => 1
),
array(
'slug' => 'request-content',
'type' => 'textarea',
//'tinymce' => 1,
//'quicktags' => 'strong,em,link,close,block,del,file_upload',
'title' => __('Текст заявки'),
'request' => __('Ваша заявка будет видна только автору задания'),
'required' => 1
),
array(
'slug' => 'request-task',
'type' => 'hidden',
'value' => $post_id
)
),
'submit' => __('Добавить заявку'),
'onclick' => 'rcl_send_form_data("fng_ajax_add_request",this);return false;'
), $post_id)
);
$content .= '';
return $content;
}
Куда добавить этот код чтобы работал
Вы не имеете права на публикацию сообщений в этой теме