رفتن به مطلب

pcvt

عضو سایت
  • تعداد ارسال‌ها

    9
  • تاریخ عضویت

  • آخرین بازدید

نوشته‌ها ارسال شده توسط pcvt

  1. لطفا کد زیر رو با فایل کامنت فعلی جایگذاری کنید

    کدها اشتباه شده اند.


    <?php // Do not delete these lines
    if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');
    if (!empty($post->post_password)) { // if there's a password
    if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
    ?>
    <p>This post is password protected. Enter the password to view comments.<p>
    <?php
    return;
    }
    }
    /* This variable is for alternating comment background */
    $oddcomment = 'alt';
    ?>

    <!-- You can start editing here. -->
    <?php if ($comments) : ?>
    <div id="comments-div">
    <span id="comments-addcomment">
    <a href="#respond" rel="nofollow" title="براي پست <?php the_title(); ?> نظرتان را بيان کنيد"> نظر دهيد ...</a></span> <h2 id="comments" style="color: #502904;"><b><?php comments_number(__(' بدون دیدگاه '), __(' یک دیدگاه برای ','tenet'), __(' % دیدگاه برای ' ));?></b><?PHP the_title() ?> </h2>
    </div>
    <ol class="commentlist" id="thecomments">
    <?php foreach ($comments as $comment) : ?>
    <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
    <div id="comment-<?php comment_ID() ?>">
    <div class="comment-author vcard">
    <?php echo get_avatar($id_or_email, $size, $default, $alt); ?>
    <cite class="fn"><?php comment_author_link() ?>


    <span class="comment-meta commentmetadata"><a href="<?php bloginfo('url') ?>/tutorials/gzip-seo/comment-page-1#comment-<?php comment_ID() ?>"><?php comment_date(__('j F y ')) ?> <?php comment_time() ?></a><?php edit_comment_link('Edit Comment','',''); ?></span>
    </cite>
    </div><!-- #close comments_author -->



    <div class="comment-text">
    <?php comment_text() ?>
    <?php if ($comment->comment_approved == '0') : ?>
    <em>نظر شما در انتظار تایید مدیریت سایت است.</em>
    <?php endif; ?>
    </div> </div><!-- #close comments_text -->



    <div class="reply">
    <a class="comment-reply-link" href="<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>#respond" onclick="return addComment.moveForm('comment-<?php comment_ID() ?>', '<?php comment_ID() ?>', 'respond', '<?php comment_ID() ?>')">پاسخ دادن</a> </div>
    </li>

    <?php /* Changes every other comment to a different class */
    if ('alt' == $oddcomment) $oddcomment = '';
    else $oddcomment = 'alt';
    ?>
    <?php endforeach; /* end for each comment */ ?>
    </ol>
    <?php else : // this is displayed if there are no comments so far ?>
    <?php if ('open' == $post->comment_status) : ?>
    <!– If comments are open, but there are no comments. –>
    <?php else : // comments are closed ?>
    <!– If comments are closed. –>
    <p class="nocomments">امکان ارسال دیدگاه وجود ندارد.</p>
    <?php endif; ?>
    <?php endif; ?>
    <script type="text/javascript">
    /* <![CDATA[ */
    function grin(tag) {
    var myField;
    tag = ' ' + tag + ' ';
    if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {
    myField = document.getElementById('comment');
    } else {
    return false;
    }
    if (document.selection) {
    myField.focus();
    sel = document.selection.createRange();
    sel.text = tag;
    myField.focus();
    }
    else if (myField.selectionstart || myField.selectionstart == '0') {
    var startPos = myField.selectionstart;
    var endPos = myField.selectionend;
    var cursorPos = endPos;
    myField.value = myField.value.substring(0, startPos)
    + tag
    + myField.value.substring(endPos, myField.value.length);
    cursorPos += tag.length;
    myField.focus();
    myField.selectionstart = cursorPos;
    myField.selectionend = cursorPos;
    }
    else {
    myField.value += tag;
    myField.focus();
    }
    }
    /* ]]> */
    </script>
    <script type="text/javascript">
    function addcodetags(ctype){
    var val=document.getElementById('comment').value;
    if(ctype=='html')
    document.getElementById('comment').value=val+"\n[php]\nکد خود را در اینجا قرار دهید ...\n[/php]

    \n";

    }

    </script>

    <div id="respond">

    <?php if ('open' == $post->comment_status) : ?>

    <h3 id="reply-title">:: ديدگاه خود را مطرح کنيد ... <small><a rel="nofollow" id="cancel-comment-reply-link" href="<?php bloginfo('url'); ?>/#respond" style="display:none;"><small>X</small></a></small></h3>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>

    <p><?PHP _e(' شما باید ')?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?PHP _e(' برای ارسال نظر ')?></a><?PHP _e(' وارد شده باشید ')?></p>

    <?php else : ?>

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    <?php if ( $user_ID ) : ?>

    <p><?PHP _e(' وارد شده با نام ')?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account"><?PHP _e(' خروج » ')?></a></p>

    <?php else : ?>

    <p class="comment-form-author">

    <p><input type="text" class="textfield" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" lang="fa" />

    <label for="author"><small> <?php _e('نام'); if ($req) echo "(الزامی)"; ?></small></label></p>

    <p><input type="text" class="textfield" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />

    <label for="email"><small> <?php _e(' ایمیل (نشان داده نخواهد شد) '); if ($req) echo "(الزامی)"; ?></small></label></p>

    <p class="comment-form-url"><input type="text" class="textfield" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />

    <label for="url"><small><?PHP _e('سایت ','tenet');?></small></label></p>

    <?php endif; ?>

    <p class="smilies"><div class="notediv" style="margin-bottom:10px !important;">::

    سوالات غیرمرتبط با این مطلب را در <a target="_blank" href="<?php bloginfo('url') ?>/forums/" style="font-weight:bold">انجمن های سایت</a> مطرح کنید . در بخش نظرات فقط سوالات مرتبط با مطلب پاسخ داده خواهد شد .

    </div>

    <a href="javascript:grin(':oops:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_redface.gif" alt="" ></a>

    <a href="javascript:grin(':?:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_question.gif" alt="" ></a>

    <a href="javascript:grin(':razz:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_razz.gif" alt="" ></a>

    <a href="javascript:grin(':sad:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_sad.gif" alt="" ></a>

    <a href="javascript:grin(':!:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_exclaim.gif" alt="" ></a>

    <a href="javascript:grin(':smile:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_smile.gif" alt="" ></a>

    <a href="javascript:grin(':grin:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_biggrin.gif" alt="" ></a>

    <a href="javascript:grin(':shock:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_eek.gif" alt="" ></a>

    <a href="javascript:grin(':???:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_confused.gif" alt="" ></a>

    <a href="javascript:grin(':cool:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_cool.gif" alt="" ></a>

    <a href="javascript:grin(':lol:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_lol.gif" alt="" ></a>

    <a href="javascript:grin(':mad:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_mad.gif" alt="" ></a>

    <a href="javascript:grin(':roll:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_rolleyes.gif" alt="" ></a>

    <a href="javascript:grin(':wink:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_wink.gif" alt="" ></a>

    <a href="javascript:grin(':idea:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_idea.gif" alt="" ></a>

    <a href="javascript:grin(':arrow:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_arrow.gif" alt="" ></a>

    <a href="javascript:grin(':neutral:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_neutral.gif" alt="" ></a>

    <a href="javascript:grin(':cry:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_cry.gif" alt="" ></a>

    <span onclick="addcodetags('html')" style="background-color: #e2ffd6;border-radius: 5px;padding: 2px;cursor:pointer"> افزودن کد </span>

    </p><p class="comment-form-comment"><textarea aria-required="true" rows="8" cols="45" name="comment" id="comment" onkeydown="if(event.ctrlKey){if(event.keyCode==13){document.getElementById('submit').click();return false}};"></textarea></p> <p class="form-submit">

    <input name="submit" type="submit" id="submit" value="ارسال نظر">

    <input type='hidden' name='comment_post_ID' value='<?php echo $id; ?>' id='comment_post_ID'>

    <input type='hidden' name='comment_parent' id='comment_parent' value='0'>

    </p>

    <?php do_action('comment_form', $post->ID); ?>

    </form>

    <?php endif; // If registration required and not logged in ?>

    </div>

    <?php endif; // if you delete this the sky will fall on your head ?> <!-- close comments_list -->

    من احتمال میدم این کدها یه ایرادی دارن که اختلال ایجاد می کنند

  2. درود

    من یه قالبی رو ترجمه کردم و برای تست رو سایتم گذاشتم

    ولی با یه مشکل مواجه شدم

    اونم اینکه در فایل single.php برای نمایش بخش نظرات از تابع <?php comments_template(); ?> استفاده کردم ولی به جای اینکه فایل comments.php رو نمایش بده میره شیوه نظرات پیش فرض وردپرس رو نمایش میده

    این درحالی هست که تو لوکال هاست چنین مشکلی رو ندارم ولی وقتی رو هاست و سایتم نصب کردم این مشکل بوجود اومده

    میشه کمکم کنید؟

    اینم محتویات فایل comments.php:( لطفا کدهارو بررسی کنید تا اشتباهی کدنویسی نکرده باشم)

    <?php // Do not delete these lines

    if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))

    die ('Please do not load this page directly. Thanks!');

    if (!empty($post->post_password)) { // if there's a password

    if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie

    ?>

    <p>This post is password protected. Enter the password to view comments.<p>

    <?php

    return;

    }

    }

    /* This variable is for alternating comment background */

    $oddcomment = 'alt';

    ?>

    <!-- You can start editing here. -->

    <?php if ($comments) : ?>

    <div id="comments-div">

    <span id="comments-addcomment">

    <a href="#respond" rel="nofollow" title="براي پست <?php the_title(); ?> نظرتان را بيان کنيد"> نظر دهيد ...</a></span> <h2 id="comments" style="color: #502904;"><b><?php comments_number(__(' بدون دیدگاه '), __(' یک دیدگاه برای ','tenet'), __(' % دیدگاه برای ' ));?></b><?PHP the_title() ?> </h2>

    </div>

    <ol class="commentlist" id="thecomments">

    <?php foreach ($comments as $comment) : ?>

    <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">

    <div id="comment-<?php comment_ID() ?>">

    <div class="comment-author vcard">

    <?php echo get_avatar($id_or_email, $size, $default, $alt); ?>

    <cite class="fn"><?php comment_author_link() ?>

    <span class="comment-meta commentmetadata"><a href="<?php bloginfo('url') ?>/tutorials/gzip-seo/comment-page-1#comment-<?php comment_ID() ?>"><?php comment_date(__('j F y ')) ?> <?php comment_time() ?></a><?php edit_comment_link('Edit Comment','',''); ?></span>

    </cite>

    </div><!-- #close comments_author -->

    <div class="comment-text">

    <?php comment_text() ?>

    <?php if ($comment->comment_approved == '0') : ?>

    <em>نظر شما در انتظار تایید مدیریت سایت است.</em>

    <?php endif; ?>

    </div> </div><!-- #close comments_text -->

    <div class="reply">

    <a class="comment-reply-link" href="<?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?>#respond" onclick="return addComment.moveForm('comment-<?php comment_ID() ?>', '<?php comment_ID() ?>', 'respond', '<?php comment_ID() ?>')">پاسخ دادن</a> </div>

    </li>

    <?php /* Changes every other comment to a different class */

    if ('alt' == $oddcomment) $oddcomment = '';

    else $oddcomment = 'alt';

    ?>

    <?php endforeach; /* end for each comment */ ?>

    </ol>

    <?php else : // this is displayed if there are no comments so far ?>

    <?php if ('open' == $post->comment_status) : ?>

    <!– If comments are open, but there are no comments. –>

    <?php else : // comments are closed ?>

    <!– If comments are closed. –>

    <p class="nocomments">امکان ارسال دیدگاه وجود ندارد.</p>

    <?php endif; ?>

    <?php endif; ?>

    <script type="text/javascript">

    /* <![CDATA[ */

    function grin(tag) {

    var myField;

    tag = ' ' + tag + ' ';

    if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') {

    myField = document.getElementById('comment');

    } else {

    return false;

    }

    if (document.selection) {

    myField.focus();

    sel = document.selection.createRange();

    sel.text = tag;

    myField.focus();

    }

    else if (myField.selectionstart || myField.selectionstart == '0') {

    var startPos = myField.selectionstart;

    var endPos = myField.selectionend;

    var cursorPos = endPos;

    myField.value = myField.value.substring(0, startPos)

    + tag

    + myField.value.substring(endPos, myField.value.length);

    cursorPos += tag.length;

    myField.focus();

    myField.selectionstart = cursorPos;

    myField.selectionend = cursorPos;

    }

    else {

    myField.value += tag;

    myField.focus();

    }

    }

    /* ]]> */

    </script>

    <script type="text/javascript">

    function addcodetags(ctype){

    var val=document.getElementById('comment').value;

    if(ctype=='html')

    document.getElementById('comment').value=val+"\n

    \nکد خود را در اینجا قرار دهید ...\n

    \n";

    }

    </script>

    <div id="respond">

    <?php if ('open' == $post->comment_status) : ?>

    <h3 id="reply-title">:: ديدگاه خود را مطرح کنيد ... <small><a rel="nofollow" id="cancel-comment-reply-link" href="<?php bloginfo('url'); ?>/#respond" style="display:none;"><small>X</small></a></small></h3>

    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>

    <p><?PHP _e(' شما باید ')?> <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>"><?PHP _e(' برای ارسال نظر ')?></a><?PHP _e(' وارد شده باشید ')?></p>

    <?php else : ?>

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">

    <?php if ( $user_ID ) : ?>

    <p><?PHP _e(' وارد شده با نام ')?> <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account"><?PHP _e(' خروج » ')?></a></p>

    <?php else : ?>

    <p class="comment-form-author">

    <p><input type="text" class="textfield" name="author" id="author" value="<?php echo $comment_author; ?>" size="40" tabindex="1" lang="fa" />

    <label for="author"><small> <?php _e('نام'); if ($req) echo "(الزامی)"; ?></small></label></p>

    <p><input type="text" class="textfield" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="40" tabindex="2" />

    <label for="email"><small> <?php _e(' ایمیل (نشان داده نخواهد شد) '); if ($req) echo "(الزامی)"; ?></small></label></p>

    <p class="comment-form-url"><input type="text" class="textfield" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="40" tabindex="3" />

    <label for="url"><small><?PHP _e('سایت ','tenet');?></small></label></p>

    <?php endif; ?>

    <p class="smilies"><div class="notediv" style="margin-bottom:10px !important;">::

    سوالات غیرمرتبط با این مطلب را در <a target="_blank" href="<?php bloginfo('url') ?>/forums/" style="font-weight:bold">انجمن های سایت</a> مطرح کنید . در بخش نظرات فقط سوالات مرتبط با مطلب پاسخ داده خواهد شد .

    </div>

    <a href="javascript:grin(':oops:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_redface.gif" alt="" ></a>

    <a href="javascript:grin(':?:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_question.gif" alt="" ></a>

    <a href="javascript:grin(':razz:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_razz.gif" alt="" ></a>

    <a href="javascript:grin(':sad:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_sad.gif" alt="" ></a>

    <a href="javascript:grin(':!:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_exclaim.gif" alt="" ></a>

    <a href="javascript:grin(':smile:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_smile.gif" alt="" ></a>

    <a href="javascript:grin(':grin:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_biggrin.gif" alt="" ></a>

    <a href="javascript:grin(':shock:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_eek.gif" alt="" ></a>

    <a href="javascript:grin(':???:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_confused.gif" alt="" ></a>

    <a href="javascript:grin(':cool:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_cool.gif" alt="" ></a>

    <a href="javascript:grin(':lol:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_lol.gif" alt="" ></a>

    <a href="javascript:grin(':mad:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_mad.gif" alt="" ></a>

    <a href="javascript:grin(':roll:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_rolleyes.gif" alt="" ></a>

    <a href="javascript:grin(':wink:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_wink.gif" alt="" ></a>

    <a href="javascript:grin(':idea:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_idea.gif" alt="" ></a>

    <a href="javascript:grin(':arrow:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_arrow.gif" alt="" ></a>

    <a href="javascript:grin(':neutral:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_neutral.gif" alt="" ></a>

    <a href="javascript:grin(':cry:')"><img src="<?php bloginfo('url') ?>/wp-includes/images/smilies/icon_cry.gif" alt="" ></a>

    <span onclick="addcodetags('html')" style="background-color: #e2ffd6;border-radius: 5px;padding: 2px;cursor:pointer"> افزودن کد </span>

    </p><p class="comment-form-comment"><textarea aria-required="true" rows="8" cols="45" name="comment" id="comment" onkeydown="if(event.ctrlKey){if(event.keyCode==13){document.getElementById('submit').click();return false}};"></textarea></p> <p class="form-submit">

    <input name="submit" type="submit" id="submit" value="ارسال نظر">

    <input type='hidden' name='comment_post_ID' value='<?php echo $id; ?>' id='comment_post_ID'>

    <input type='hidden' name='comment_parent' id='comment_parent' value='0'>

    </p>

    <?php do_action('comment_form', $post->ID); ?>

    </form>

    <?php endif; // If registration required and not logged in ?>

    </div>

    <?php endif; // if you delete this the sky will fall on your head ?> <!-- close comments_list -->

×
×
  • اضافه کردن...