aer92
Forum Replies Created
-
Was the problem solved? Out of 10 publications, this error appears in one
Forum: Plugins
In reply to: [XML Sitemap & Google News] Is any adive with Google Publisher possible?Can you tell me the name of the paid service?
Forum: Plugins
In reply to: [XML Sitemap & Google News] Is any adive with Google Publisher possible?Thanks for your time, even though this isn’t strictly plugin related.
Did you manage to solve the problem?
Forum: Plugins
In reply to: [QDiscuss] Great plugin. Russian languageWhy title tag (<title>QDiscuss</title>) does not change the code if we go in the post?
After all, the text specified in the title tag will be displayed in the google search.
Forum: Plugins
In reply to: [Yandex.News Feed by Teplitsa] Новая версия не работаетПроблема решилась. Вас спасибо большое за плагин!
Forum: Plugins
In reply to: [Yandex.News Feed by Teplitsa] Новая версия не работаетСпасибо ошибка исчезла. Вот только яндекс сообщает, что есть ошибка – Не удалось определить mime-тип тэга <media:content>
Forum: Plugins
In reply to: [Comments - wpDiscuz] Ability for commenters to edit their commentAdd to function.php:
if(!is_admin()) add_filter(‘comment_text’,’add_edit_link_ct’,10,2);
function add_edit_link_ct($text,$comment){
global $user_ID;
if(!$user_ID||$user_ID!=$comment->user_id) return $text;
$time_edit = 120;//time edit
$time_action = current_time(‘mysql’);
$unix_time_action = strtotime($comment->comment_date);
$unix_time = strtotime($time_action);
if($unix_time > $unix_time_action+$time_edit) return $text;
$text .= ‘ (Edit)
<form method=”post” action=”” class=”edit-form-ct comment-form”>
<textarea required class=”wp-editor-area” rows=”5″ cols=”40″ name=”comment”>’.esc_textarea($text).'</textarea>
<input type=”submit” value=”Edit”>
<input type=”hidden” name=”comment-edit-ct” value=”‘.$comment->comment_ID.'”> ‘.wp_nonce_field(‘comment-edit-ct’,’_wpnonce’,true,false).’
</form>’;
return $text;
}add to before body:
jQuery(function(){
jQuery(‘.edit-comment-ct’).click(function() {
jQuery(this).parent().next(‘.edit-form-ct’).slideToggle();
return false;
});
});it should be added to the plugin code tpl-comment.php:
function comment_edit_ct ( ) {
if ( isset( $_POST[‘comment-edit-ct’] ) ) {
if( !wp_verify_nonce( $_POST[‘_wpnonce’], ‘comment-edit-ct’ ) ) return false;
$commentarr = array();
$commentarr[‘comment_ID’] = $_POST[‘comment-edit-ct’];
$commentarr[‘comment_content’] = force_balance_tags($_POST[‘comment’]);
wp_update_comment( $commentarr );
wp_redirect(get_comment_link($_POST[‘comment-edit-ct’]));
exit;
}
}
add_action(‘init’, ‘comment_edit_ct’);After adding a comment, the user can edit their comments during the specified time.