0
我發佈一條消息,直到某個日期,所以我創建了一個時間變量作爲Smarty的日期上使用TPL文件
$announcedate = strtotime('+6 day');
$now = "1382960040";
$smarty->assign('announcedate', $announcedate);
$smarty->assign('now', $now);
而且包括在第三方物流文件
{if $now > $announcedate}My Announcement{/if}
我想請務必在使用之前確認並在第6天后特別結束通知。
這是正確的方法嗎?還是有其他的指導?
這不按預期工作。我想在第六天結束時宣佈結束。我想我的更大的if語句是不正確的 – sammry
如果你想要一個特定的結束日期,那麼只需要用特定的日期替換你的'$ announceate'(pe'$ announceate = strtotime('2013-11-30 12:00:00' );'或者類似的東西)。 – Bjoern
我試過$ announceate = strtotime('2013-10-30 12:00:00'); $ now = strtotime('now'); $ smarty-> assign('announceate',$ announceate); $ smarty-> assign('now',$ now);在tpl文件中,{if $ now> $ announceate} My Announcement {/ if} .......仍然不能按預期工作。一旦時間結束,它會顯示,而不是在時間內,請幫助 – sammry