' . get_the_title() . '' . "\r\n\r\n";
$authorNav .= '
' . "\r\n\r\n";
// профиль
if (isset($_GET['profile']) || isset($_GET['updated'])) {
$error = '';
if ($_POST['action'] == 'updateProfile') {
require_once( ABSPATH . WPINC . '/registration.php');
global $demo;
if (!$demo) {
if(isset($_POST['display_name'])) {
wp_update_user(array('ID' => $current_user->ID, 'display_name' => $_POST['display_name']));
}
}
if(empty($_POST['user_email'])) {
$error .= '' . __('ERROR : Please enter an e-mail address.') . '
';
} elseif (!is_email($_POST['user_email'])) {
$error .= '' . __('ERROR : The e-mail address isn’t correct.') . '
';
} else {
if (!$demo) {
wp_update_user(array('ID' => $current_user->ID, 'user_email' => $_POST['user_email']));
}
}
if (!$demo) {
if(isset($_POST['url'])) {
wp_update_user(array('ID' => $current_user->ID, 'user_url' => $_POST['url']));
}
}
if (!$demo) {
if(isset($_POST['description'])) {
wp_update_user(array('ID' => $current_user->ID, 'description' => strip_tags($_POST['description'])));
}
}
if (empty($_POST['pass1']) && !empty($_POST['pass2']) or !empty($_POST['pass1']) && empty($_POST['pass2']) or !empty($_POST['pass1']) && !empty($_POST['pass2'])) {
if ($_POST['pass1'] != $_POST['pass2']) {
$error .= '' . __('ERROR : Please enter the same password in the two password fields.') . '
';
} else {
if (!$demo) {
wp_update_user(array('ID' => $current_user->ID, 'user_pass' => esc_attr( $_POST['pass1'])));
}
}
}
if (!$error) {
if (strpos($uri, '&updated') === false ) {
wp_redirect($uri . '&updated');
} else {
wp_redirect($uri);
}
exit;
} else {
$error = $error;
}
}
get_header();
echo $authorNav;
if (isset($_GET['updated'])) {
if (!$error) echo '' . __('User updated.') . '
';
}
if ($error) echo '' . $error . '
';
?>
wp_filter_nohtml_kses($_POST['title']),
'post_content' => $_POST['post'],
'post_status' => $post_status,
'post_author' => $user_ID,
'post_type' => 'post',
'post_category' => $_POST['cats'],
'tags_input' => implode(',',$tags)
);
if (empty($_POST['title'])) {
$error .= '' . __('ERROR', 'article-directory') . ' : ' . __('Specify the article title.', 'article-directory') . '
';
}
if (empty($_POST['post'])) {
$error .= '' . __('ERROR', 'article-directory') . ' : ' . __('Specify the article text.', 'article-directory') . '
';
}
if (empty($_POST['cats']) || $_POST['cats'][0] == -1) {
$error .= '' . __('ERROR', 'article-directory') . ' : ' . __('Select a category.', 'article-directory') . '
';
}
if (strlen($_POST['post']) < $aOptions['minimum_symbols']) {
$error .= '' . __('ERROR', 'article-directory') . ' : ' . __('The minimum number of characters allowed in the article', 'article-directory') . ': ' . $aOptions['minimum_symbols'] . '
';
}
preg_match_all('#href\s*=\s*("|\')?(.*?)("|\'|\s|> )#si', $_POST['post'], $matches);
if (count($matches[0]) > $aOptions['maximum_links']) {
$error .= '' . __('ERROR', 'article-directory') . ' : ' . __('The maximum number of links allowed in the article', 'article-directory') . ': ' . $aOptions['maximum_links'] . '
';
}
$submitted = '';
if (get_option('permalink_structure') == '') {
$submitted = '&submitted';
} else {
$submitted = '?submitted';
}
if (!$error) {
global $demo;
if (!$demo) {
$post_id = wp_insert_post($new_post);
}
if (strpos($uri, $submitted) === false ) {
wp_redirect($uri . $submitted);
} else {
wp_redirect($uri);
}
exit;
} else {
$error = $error;
}
}
get_header();
echo $authorNav;
if (isset($_GET['submitted'])) {
if (!$error) {
if ( $aOptions['article_status'] == '1' ) {
echo '' . __('Thank you! Your article has been published.', 'article-directory') . '
';
} else {
echo '' . __('Thank you! Your article has been added and is awaiting review by the administrator.', 'article-directory') . '
';
}
}
}
if ($error) echo '' . $error . '
';
if (!empty($aOptions['publish_terms_text'])) {
?>
#quicktags {display:none}';
wp_editor($_POST['post'], 'post' , '', false);
}
?>
&taxonomy=category&hide_empty=0&name=cats[]&orderby=name&hierarchical=1'); ?>
(.*)<\/option>\s*/', $categories, $matches, PREG_SET_ORDER);
echo '
';
foreach ($matches as $match) {
echo ''.$match[3].' ';
}
echo " \n";
}
?>
' . get_the_title() . '';
the_content();
endwhile; endif;
get_sidebar();
get_footer();
}
?>