|
 |
|
ต้องการโชว์ รูป new หลังกระทู้โดยสามาถกำหนดวันได้ คือผมต้องการให้แสดงรูป new หลังกระทู้เมื่อมีการโพส |
|
 |
|
|
 |
 |
|
ขอบคุณครับ ดูแล้วครับ แต่ยังไม่เก็จครับ ไม่รู้จะเอามาใช้ยังไง
|
 |
 |
 |
 |
Date :
2009-05-06 14:06:01 |
By :
pee69 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำได้แล้วครับเลยเอามาบอก สามารถเทียบได้ทั้ง วัน เดือน ปี แบะเวลา ครับ
Code (PHP)
<?php
//new - hot
$new_topic = 5; //จำนวนวันที่ให้เป็นหัวข้อใหม่
$hot_topic =10; //จำนวนผู้อ่านทีให้ HOT
$img_hot="";
if($topic_replies>=$hot_topic)
{
$img_hot="<img src=\"images/icon_hot.gif\" border=\"0\">";
}
$today = date("Y-m-d"); // 2009.10.30
$exp1 = "$today";
$exp2 = "$post_time";
$strdate = explode("-",$exp1);
$strdat = explode("-",$exp2);
$d1= mktime(0, 0, 0, $strdat['1'], $strdat['2'], $strdat['0']+$next);
$d2= mktime(0, 0, 0, $strdate['1'], $strdate['2'], $strdate['0']+$next);
$Monthdiff = "".floor(($d2-$d1)/2628000) . "";
$Daydiff ="".floor(($d2-$d1)/86400) . "";
$Yeardiff ="".floor(($d2-$d1)/31536000) . "";
{
$img_new="";
if($Daydiff <=$new_topic)
{
$img_new="<img src=\"images/icon_new.gif\" border=\"0\">";
}
}
?>
|
 |
 |
 |
 |
Date :
2009-05-06 23:46:02 |
By :
pee69 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มีตัวแบบนี้ด้วยแฮะ
เปลี่ยนมาใช้แบบนี้มั้งดีก่า ใช้ mktime อยุ่ ยาวไปหน่อย อันนี้สั้นดี อิอิ(ทีอย่างนี้หล่ะชอบสั้นๆน่ะ เอริ้กๆ)
|
 |
 |
 |
 |
Date :
2009-05-07 11:48:43 |
By :
arsachi |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอเอาไว้ไปศึกษาบ้างนะค่ะ
|
 |
 |
 |
 |
Date :
2009-05-09 10:55:06 |
By :
amides |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นำไปใช้ยังไงครับ พึ่งเริ่มหัดเขียน
|
 |
 |
 |
 |
Date :
2009-11-05 13:14:17 |
By :
com_mans |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|