2006/Dec/04

นั่งเขียนอยู่แป๊บเดียว
เอามาแจก


สำหรับคนมีบล็อค wordpress
ให้เอาโค๊ดนี้ไปใส่ในช่องคอมเมนต์ของธีม

(ทดสอบกับธีม Ocean Mist แล้ว)


ให้ดู

<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a></p>
<ul class="buttons">
<li><a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></li>
</ul>


<?php else : ?>
<li><a href="#" title="มาจาก Exteen" onclick="cmexteen();">มาจาก Exteen</a></li>
</ul>
<p><label for="author">Name<span class="req">*</span></label><br>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" class="field"/><br>
<label for="email">Email<span class="req">*</span></label><br>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" class="field" /><br>
<label for="url">Website</label><br>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" class="field" /></p>



(อยู่ล่างๆ)


ให้เติม

<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a></p>
<ul class="buttons">
<li><a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></li>
</ul>


<?php else : ?>
<script>
//Come from exteen
function cmexteen(){
a = prompt("กรุณาใส่ Username ใน Exteen ด้วยครับ");
document.getElementById('author').value = a+" (จาก Exteen.com)";
document.getElementById('url').value = "http://"+a+".exteen.com";
document.getElementById('url').type = "hidden"; //ใส่ตรงนี้ถ้าจะให้ซ่อนช่องเวลาบอกว่ามาจาก Exteen
document.getElementById('author').type = "hidden";
//ใส่ตรงนี้ถ้าจะให้ซ่อนช่องเวลาบอกว่ามาจาก Exteen
}
</script>
<ul class="buttons">
<li><a href="#" title="มาจาก Exteen" onclick="cmexteen();">มาจาก Exteen</a></li>
</ul>
<p><label for="author">Name<span class="req">*</span></label><br>
<input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" class="field"/><br>
<label for="email">Email<span class="req">*</span></label><br>
<input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" class="field" /><br>
<label for="url">Website</label><br>
<input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" class="field" /></p>

เข้าไป ก็จะเห็นปุ่ม(ถ้าล็อคอินจะไม่เห็น)














ปล ท่านแชมป์ไม่ติดที่ tpagon บ้างหละ

edit @ 2006/12/04 19:35:20
ชื่อ: 
เว็บไซต์: 
คอมเมนต์:




smilebig smileopen-mounthed smileconfused smilesad smileangry smiletonguequestionembarrassedsurprised smilewinkdouble winkcry
userอะไรล่ะจะaddไปหา(เราออนบ่อยนา..สนใจป๊ะ?)
เอ่อ

ไม่เข้าใจว่าคืออะไรครับ

แต่สำหรับตัวนี้จะทำให้ user exteen กรอกข้อมูลไวขึ้น


ส่วน msn ผม manatsawin [แอด] gmail ดอทคอม ครับ
#2  by  WHS At 2006-12-04 20:33, 

<< Home


วิน (vuai-hua-khin)
View full profile