Wordpress'te admin gibi yorum yapanlara karşı
11
●580
- 09-01-2016, 21:00:24Ekledim hocam_PatroN_ adlı üyeden alıntı: mesajı görüntüle
http://dosya.co/0wrek6cll06c/comments.rar.html - 09-01-2016, 21:12:52Yükledim hocam_PatroN_ adlı üyeden alıntı: mesajı görüntüle
http://dosya.co/f4iztv0fnhcu/comment.rar.html - 09-01-2016, 22:40:10Ne yazayim pmde hocam anlamadimkonmaster adlı üyeden alıntı: mesajı görüntüle
- 10-01-2016, 12:45:12neyse hocam sizin için güzel bir kaynak buldum.
functions.php dosyasına ekleyin...
// Yorum Listeleme Özelliği function konmaster_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <?php $PostAuthor = false; if($comment->comment_author_email == get_the_author_email()) { $PostAuthor = true;} elseif($comment->comment_author_email == 'mailadresiniz@mail.com') { $PostAuthor = true;} ?> <li <?php if($PostAuthor) {echo "class='authorcomment' ";} ?> id="li-yorum-<?php comment_ID() ?>"> <div class="yorum"> <div class="yorumkullanici"> <!-- Yorum Avatar --> <div class="yorumavatar"> <?php echo get_avatar($comment,$size='54'); ?> </div> <!-- #Yorum Avatar --> <!-- Kullanıcı Adı ve Tarih --> <h3><?php printf(__('%s'), get_comment_author_link()) ?></h3> <div class="yorumtarih"> <i class="yorumtarihikon"></i><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(get_comment_date()); ?></a> <a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php printf(get_comment_time()); ?></a> </div> <!-- #Kullanıcı Adı ve Tarih --> </div> <?php if ($comment->comment_approved == '0') : ?> <em class="yorumonay">Yorumunuz onaylandıktan sonra görüntülenecektir.</em> <?php endif; ?> <div class="yorumyazi"><?php comment_text() ?></div> <div class="cevapla"> <i class="cevaplaikon"></i><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?> </div> </div> <?php }comments.php dosyasına ekleyin...
<?php if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) die ('Lütfen bu sayfaya doğrudan yükleme yapmayınız, teşekkürler.'); if (post_password_required()) { ?> <p class="nocomments">Bu yazı parola korumalıdır, yorumları görebilmek için parolayı girin.</p> <?php return; } ?> <!-- Düzenlemeye buradan başlayabilirsiniz. --> <?php if ( have_comments() ) : ?> <h4 class="kacyorum">Yorumlar (<?php comments_number('0 Yorum :/', '1 Yorum', '% Yorum' );?>)</h4> <!-- Yorumları Listele --> <ul class="yorumlistele"> <?php wp_list_comments('type=all&callback=konmaster_comment'); ?> </ul> <!-- #Yorumları Listele --> <?php else : ?> <?php if ( comments_open() ) : ?> <?php else : ?> <p class="nocomments">Bu yazı yorumlara kapatılmıştır.</p> <?php endif; ?> <?php endif; ?> <?php ?> <?php global $trackbacks; ?> <?php if ($trackbacks) : ?> <?php $comments = $trackbacks; ?> <div id="pingback-trackback"> <h3 id="trackbacks">Geri bildirimler: <?php echo sizeof($trackbacks); ?></h3> <ol class="pings"> <?php foreach ($comments as $comment) : ?> <!-- Geriizleme başlangıç --> <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"> <cite><?php comment_author_link() ?></cite> <?php if ($comment->comment_approved == '0') : ?> <em>Yorumunuz denetim için bekliyor.</em> <?php endif; ?> </li> <!-- Geriizleme bitiş --> <?php $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; ?> <?php endforeach; ?> </ol> </div> <?php endif; ?> <?php ?> <?php if ( comments_open() ) : ?> <div id="respond"> <h4> <?php comment_form_title( 'Yazı hakkında görüşlerinizi belirtmek istermisiniz?', 'Şuanda %s adlı kişinin yorumuna cevap yazıyorsunuz.' ); ?> <span class="cancel-comment-reply"> <small><?php cancel_comment_reply_link(); ?></small> </span> </h4> <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?> <p>Yorum yapabilmek için <a href="<?php echo wp_login_url( get_permalink() ); ?>">giriş</a> yapmalısınız.</p> <?php else : ?> <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <?php if ( is_user_logged_in() ) : ?> <p id="yorumgiris">Sisteme <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a> olarak giriş yapılmış. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Çıkış yapın">Çıkış yap »</a></p> <?php else : ?> <!-- Ziyaretçi Bilgisi --> <script type="text/javascript"> //<![CDATA[ (function() { document.write('<input type="text" name="author" id="author" value="" placeholder="İsim & Soyisim" size="22" tabindex="1"/>'); document.write('<input type="text" name="email" id="email" value="" placeholder="E-Posta" size="22" tabindex="2" />'); document.write('<input type="text" name="url" id="url" value="" placeholder="Website" size="22" tabindex="3" />'); })(); //]]> </script> <!-- #Ziyaretçi Bilgisi --> <?php endif; ?> <script type="text/javascript"> //<![CDATA[ (function() { document.write('<textarea name="comment" class="comment" placeholder="Yorumunuzu buraya yazabilirsiniz." tabindex="4"></textarea>'); })(); //]]> </script> <input name="submit" type="submit" id="submit" tabindex="5" value="Gönder" /><?php comment_id_fields(); ?> <?php do_action('comment_form', $post->ID); ?> </form> <?php endif; ?> </div> <?php endif; ?>style.css dosyası yorum alanı düzenleme
/* Yorum */ h4.kacyorum {font-weight: bold;font-size: 18px; color: #404040;line-height: 28px;margin: 15px 0;} .yorum {margin-bottom: 25px;} .yorum a {color: #404040;} .yorumavatar {float: left; margin-right: 15px;} .yorumavatar img {width: 60px; height: 60px;} .yorumavatar img:hover {border-radius: 1px;} .yorumkullanici h3 {font-size :15px; font-weight: bold;color: #404040; margin-bottom: 5px;} .yorumtarih {margin-top: 10px;margin-bottom: 14px; font-size: 11px;} .yorumtarih a {color: #aaaaaa;} i.yorumtarihikon {float: left; background: url("images/tarih.png") no-repeat; width: 16px; height: 16px; display: block; margin-top: 0px; margin-right: 5px;} .yorumyazi {font-size: 14px;color: #626262;line-height: 24px;} .yorumyazi p { margin-left: 75px; text-indent: 0px; } ul.children{padding:0px 0px 0px 60px !important;} .cevapla {margin-left: 75px; font-size: 12px; margin-top: 5px;} i.cevaplaikon {float: left; background: url("images/cevapla.png") no-repeat; width: 16px; height: 16px; display: block; margin-top: 0px; margin-right: 5px;} em.yorumonay {font-size:12px;} /* Yorum Ekle */ #respond {overflow: hidden; background-color: #F5F5F5;border: 2px solid #FFFFFF;border-radius: 0 0 2px 2px; padding: 10px; width: 100%;} #respond h4 {font-family: 'Open Sans', sans-serif; margin-bottom: 5px; font-size: 13px;} #respond h4 a {color: #D45255;} #respond .comment {width: 98%; font-family: 'Open Sans', sans-serif; border: none; padding: 15px 10px 30px 15px; margin-top: 10px; border-radius: 2px;} #respond input[type='text']{float: left; border: none; border-radius: 2px; padding: 12px 10px 11px 10px; margin-right: 10px;} #respond input[type='submit'] {float: right; margin-right: -5px; border: none; background-color: #00979d; padding: 12px 10px 11px 10px; color: #fff;font-weight: bold; border-radius: 2px} p#yorumgiris {font-size: 13px;} p.comment-subscription-form {display: none;}şimdi sizin verdiğiniz kodlarda yorum alanını düzenleyemeyiz...
buradaki kodlarla yeni yorum kodlarını değiştirin ardından admin kullanıcısın bulunduğu yorum alanını css kodlarından .authorcomment kafanıza göre düzenleyin...