ThaiSEOBoard.com

พัฒนาเว็บไซต์ => Programming => ข้อความที่เริ่มโดย: รอสซี่ ที่ 14 ธันวาคม 2011, 13:50:25



หัวข้อ: พี่ๆใครช่วยดูโค้ดให้หน่อยครับงมมาทั้งวันแล้ว T0T
เริ่มหัวข้อโดย: รอสซี่ ที่ 14 ธันวาคม 2011, 13:50:25
โค๊ด:
<?php // Do not delete these lines
if (&#39;comments.php&#39; == basename($_SERVER[&#39;SCRIPT_FILENAME&#39;]))
die (&#39;Please do not load this page directly. Thanks!&#39;);

if (!empty($post->post_password)) { // if there&#39;s a password
if ($_COOKIE[&#39;wp-postpass_&#39; . COOKIEHASH] != $post->post_password) {  // and it doesn&#39;t match the cookie
?>


<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

<?php
return;
}
}

?>


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

<div id="left_left">
<div class="margin10">
<div id="comm1"></div>
<div id="comm2">
<div id="comments">

<ol><li class="nolist">

<div id="comments-list" class="comments">
<?php if ($comments) : ?>
<!-- <h3><?php comments_number(&#39;No Comment&#39;, &#39;One Comment&#39;, &#39;% Comments&#39; );?> <a href="#respond" title="<?php _e("Leave a comment"); ?>">&raquo;</a></h3> -->
<div id="comm6"></div>
<div class="comments-list2">
<div class="red"><a href=""></a></div>
<?php foreach ($comments as $comment) : ?>

<?php
$isByAuthor false;
if($comment->comment_author_email == get_the_author_email()) {
$isByAuthor true;
}?>

<!-- <ol class="nolist2"><li id="comment-<?php comment_ID() ?>" <?php if($isByAuthor ) { echo &#39;class="comment c1 c-y2011 c-m12 c-d14 c-h05&#39;;} ?>"> -->
<div class="comment-author_vcard"><!-- <?php echo get_avatar$comment$size = &#39;55&#39; ); ?> <span class="fn n"></span> --><span class="black">โดยคุณ:</span>&nbsp;<?php comment_author_link() ?> <?php if($isByAuthor ) { echo &#39;(author)&#39;;} ?> </div>
<div class="comment-meta">Posted <?php comment_date(&#39;j F Y&#39;) ?> at <?php comment_time() ?><span class="meta-sep">|</span> <!-- <a href="" title="Permalink to this comment">Permalink</a> --></div>
<?php if ($comment->comment_approved == &#39;0&#39;) : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<p><?php comment_text() ?></p>
<!-- </li></ol> -->
</div>
<div class="comm5"></div>

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

</div><!-- #comments-list .comments -->

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

<?php if (&#39;open&#39; == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>

<?php endif; ?>

<div id="comm4"></div>

<div id="comm3"></div>
<?php if (&#39;open&#39; == $post->comment_status) : ?>
<div id="respond">
<!-- <h3>แสดงความคิดเห็น </h3> -->
<div class="formcontainer">
<?php if ( get_option(&#39;comment_registration&#39;) && !$user_ID ) : ?>

<p id="comment-notes">You must be <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>

<?php else : ?>

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

<?php if ( $user_ID ) : ?>

<p id="comment-notes">Logged in as <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-admin/profile.php"><?php echo $user_identity?></a>. <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>

<?php else : ?>

<!-- <p>Add your comment below, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. You can also <?php comments_rss_link(&#39;subscribe to these comments&#39;); ?> via RSS.</p> -->

<p id="comment-notes"><!-- Your email is <em>never</em> shared .--> กรุณากรอกชื่อและอีเมลล์ <span class="required">*</span></p>

<div class="form-label"><label for="author">Name</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>

<div class="form-input"><input id="author" name="author" class="text required" type="text" value="<?php echo $comment_author?>" size="30" maxlength="50" tabindex="3" /></div>

<div class="form-label"><label for="email">Email</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>
<div class="form-input"><input id="email" name="email" class="text required" type="text" value="<?php echo $comment_author_email?>" size="30" maxlength="50" tabindex="4" /></div>

<!-- <div class="form-label"><label for="url">Website</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>
<div class="form-input"><input id="url" name="url" class="text" type="text" value="<?php echo $comment_author_url?>" size="30" maxlength="50" tabindex="5" /></div> -->


<div class="form-label"><label for="comment">Comment</label></div>

<div class="form-textarea"><textarea id="comment" name="comment" class="text required" cols="45" rows="4" tabindex="6"></textarea></div>

<!-- <p>You can use these tags:<br/><code><?php echo allowed_tags(); ?></code></p>
<p>This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at <a href="http://www.gravatar.com">Gravatar</a>.</p> -->

<div class="form-submit"><input id="submit" name="submit" class="button" type="submit" value="Post Comment" tabindex="7" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id?>" /></div>

<div class="form-option"><p style="display: none;"><?php do_action(&#39;comment_form&#39;, $post->ID); ?></p></div>

</form><!-- #commentform -->

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

<?php endif; ?>

</div><!-- .formcontainer -->

</div><!-- #respond -->

</div>
<div id="comm10"></div>

</div><!-- #comments -->
</div><!-- comm2 -->
</div><!-- margin10 -->
</div><!-- left_left -->

Parse error: syntax error, unexpected $end in C:\AppServ\httpdocs\wp\wp-content\themes\default\comments.php on line 132

ขอบคุณมากครับ  :wanwan017:


หัวข้อ: Re: พี่ๆใครช่วยดูโค้ดให้หน่อยครับงมมาทั้งวันแล้ว T0T
เริ่มหัวข้อโดย: เฮียเล้ง ที่ 14 ธันวาคม 2011, 15:01:33
if อันนี้ <?php if ('open' == $post->comment_status) : ?> ไม่มี endif; รึป่าวคับ


หัวข้อ: Re: พี่ๆใครช่วยดูโค้ดให้หน่อยครับงมมาทั้งวันแล้ว T0T
เริ่มหัวข้อโดย: รอสซี่ ที่ 14 ธันวาคม 2011, 15:17:32
ขอบคุณครับ +1


หัวข้อ: Re: พี่ๆใครช่วยดูโค้ดให้หน่อยครับงมมาทั้งวันแล้ว T0T
เริ่มหัวข้อโดย: LoadRang ที่ 14 ธันวาคม 2011, 15:19:02
เจอแล้ววว


หัวข้อ: Re: พี่ๆใครช่วยดูโค้ดให้หน่อยครับงมมาทั้งวันแล้ว T0T
เริ่มหัวข้อโดย: KONINW ที่ 14 ธันวาคม 2011, 15:22:55
โค๊ด:
<?php // Do not delete these lines
if (&#39;comments.php&#39; == basename($_SERVER[&#39;SCRIPT_FILENAME&#39;]))
die (&#39;Please do not load this page directly. Thanks!&#39;);

if (!empty($post->post_password)) { // if there&#39;s a password
if ($_COOKIE[&#39;wp-postpass_&#39; . COOKIEHASH] != $post->post_password) {  // and it doesn&#39;t match the cookie
?>


<p class="nocomments">This post is password protected. Enter the password to view comments.</p>

<?php
return;
}
}

?>


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

<div id="left_left">
<div class="margin10">
<div id="comm1"></div>
<div id="comm2">
<div id="comments">

<ol><li class="nolist">

<div id="comments-list" class="comments">
<?php if ($comments) : ?>
<!-- <h3><?php comments_number(&#39;No Comment&#39;, &#39;One Comment&#39;, &#39;% Comments&#39; );?> <a href="#respond" title="<?php _e("Leave a comment"); ?>">&raquo;</a></h3> -->
<div id="comm6"></div>
<div class="comments-list2">
<div class="red"><a href=""></a></div>
<?php foreach ($comments as $comment) : ?>

<?php
$isByAuthor false;
if($comment->comment_author_email == get_the_author_email()) {
$isByAuthor true;
}?>

<!-- <ol class="nolist2"><li id="comment-<?php comment_ID() ?>" <?php if($isByAuthor ) { echo &#39;class="comment c1 c-y2011 c-m12 c-d14 c-h05&#39;;} ?>"> -->
<div class="comment-author_vcard"><!-- <?php echo get_avatar$comment$size = &#39;55&#39; ); ?> <span class="fn n"></span> --><span class="black">โดยคุณ:</span>&nbsp;<?php comment_author_link() ?> <?php if($isByAuthor ) { echo &#39;(author)&#39;;} ?> </div>
<div class="comment-meta">Posted <?php comment_date(&#39;j F Y&#39;) ?> at <?php comment_time() ?><span class="meta-sep">|</span> <!-- <a href="" title="Permalink to this comment">Permalink</a> --></div>
<?php if ($comment->comment_approved == &#39;0&#39;) : ?>
<em>Your comment is awaiting moderation.</em>
<?php endif; ?>
<p><?php comment_text() ?></p>
<!-- </li></ol> -->
</div>
<div class="comm5"></div>

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

</div><!-- #comments-list .comments -->

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

<?php if (&#39;open&#39; == $post->comment_status) : ?>
<!-- If comments are open, but there are no comments. -->
<?php else : // comments are closed ?>
<!-- If comments are closed. -->
<p class="nocomments">Comments are closed.</p>
<?php endif; ?>

<?php endif; ?>

<div id="comm4"></div>

<div id="comm3"></div>
<?php if (&#39;open&#39; == $post->comment_status) : ?>
<div id="respond">
<!-- <h3>แสดงความคิดเห็น </h3> -->
<div class="formcontainer">
<?php if ( get_option(&#39;comment_registration&#39;) && !$user_ID ) : ?>

<p id="comment-notes">You must be <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>

<?php else : ?>

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

<?php if ( $user_ID ) : ?>

<p id="comment-notes">Logged in as <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-admin/profile.php"><?php echo $user_identity?></a>. <a href="<?php echo get_option(&#39;siteurl&#39;); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>

<?php else : ?>

<!-- <p>Add your comment below, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. You can also <?php comments_rss_link(&#39;subscribe to these comments&#39;); ?> via RSS.</p> -->

<p id="comment-notes"><!-- Your email is <em>never</em> shared .--> กรุณากรอกชื่อและอีเมลล์ <span class="required">*</span></p>

<div class="form-label"><label for="author">Name</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>

<div class="form-input"><input id="author" name="author" class="text required" type="text" value="<?php echo $comment_author?>" size="30" maxlength="50" tabindex="3" /></div>
<?php endif; ?>
<div class="form-label"><label for="email">Email</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>
<div class="form-input"><input id="email" name="email" class="text required" type="text" value="<?php echo $comment_author_email?>" size="30" maxlength="50" tabindex="4" /></div>

<!-- <div class="form-label"><label for="url">Website</label> <?php if ($req) echo &#39;<span class="required">*</span>&#39;; ?></div>
<div class="form-input"><input id="url" name="url" class="text" type="text" value="<?php echo $comment_author_url?>" size="30" maxlength="50" tabindex="5" /></div> -->


<div class="form-label"><label for="comment">Comment</label></div>

<div class="form-textarea"><textarea id="comment" name="comment" class="text required" cols="45" rows="4" tabindex="6"></textarea></div>

<!-- <p>You can use these tags:<br/><code><?php echo allowed_tags(); ?></code></p>
<p>This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at <a href="http://www.gravatar.com">Gravatar</a>.</p> -->

<div class="form-submit"><input id="submit" name="submit" class="button" type="submit" value="Post Comment" tabindex="7" />
<input type="hidden" name="comment_post_ID" value="<?php echo $id?>" /></div>

<div class="form-option"><p style="display: none;"><?php do_action(&#39;comment_form&#39;, $post->ID); ?></p></div>

</form><!-- #commentform -->

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

<?php endif; ?>

</div><!-- .formcontainer -->

</div><!-- #respond -->

</div>
<div id="comm10"></div>

</div><!-- #comments -->
</div><!-- comm2 -->
</div><!-- margin10 -->
</div><!-- left_left -->

 :P