Results 1 to 1 of 1

Thread: How to determine whether an ad has expired

  1. #1
    Thread Starter
    Veteran almightyeric's Avatar
    Join Date
    Aug 2011
    Location
    Nothern CA, USA
    Posts
    416
    Thanks
    56
    Thanked 19 Times in 16 Posts

    How to determine whether an ad has expired

    Given the post_id of a given ad, you can determine whether that ad has expired by executing the following code:
    PHP Code:
     $ad_has_expired = ( current_time('timestamp') > strtotimeget_post_meta$post_id'cp_sys_expire_date'true ) ) ) ? TRUE FALSE
    The code causes the processor to compare the current real-world date/time to the ad's expiration date/time, and sets the variable $ad_has_expired to TRUE if the current real-world date/time is past the ad's expiration date/time. You can use this test when deciding whether to display an "EXPIRED" badge, etc.

    - - - Updated - - -

    I don't know why I can't use newlines in my posts. Does anyone else have that problem? I think I'd submit more tutorials if I could format them the way I want (e.g. with vertical spacing).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. in this ad expired
    By danielangou in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: November 19th, 2012, 07:02 AM
  2. Replies: 3
    Last Post: November 23rd, 2011, 08:35 AM
  3. Expired Ads
    By sonja0966 in forum Report ClassiPress Bugs
    Replies: 11
    Last Post: August 27th, 2011, 08:03 AM