Results 1 to 9 of 9

Thread: Ad Expirations

  1. #1
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Ad Expirations

    Is it possible to set expiration dates rather than a number of days?

  2. #2
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Anyone? Is there any way to do this?

  3. #3
    jschodde's Avatar
    Join Date
    Apr 2009
    Location
    Anthem, AZ
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Well, the expiration date is stored in a meta field on the post. I suppose you could modify the ad posting form to use a date instead of a number, then remove the logic to calculate the date...not for the faint of heart. ;)

  4. #4
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Quote Originally Posted by jschodde
    then remove the logic to calculate the date...
    Where is that located in the files?

    Thanks!

  5. #5
    jschodde's Avatar
    Join Date
    Apr 2009
    Location
    Anthem, AZ
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    I'm no expert but it looks like this expression:

    Code:
    $expires = date('m/d/Y G:i:s', strtotime("+" . $ad_length . " days"));
    calculates the expiration date. I found this in /wp-content/themes/classipress/form_process.php on line 39. My line numbers might be off a little because I have made modifications to my code in various places. :geek:

    Some please chime in if I'm incorrect.

  6. #6
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Quote Originally Posted by jschodde
    I'm no expert but it looks like this expression:

    Code:
    $expires = date('m/d/Y G:i:s', strtotime("+" . $ad_length . " days"));
    calculates the expiration date. I found this in /wp-content/themes/classipress/form_process.php on line 39. My line numbers might be off a little because I have made modifications to my code in various places. :geek:

    Some please chime in if I'm incorrect.
    Yeah, I found that too. I was trying to think how to change it to the the day after the date field I added, which is e_date.

    Something like this maybe?

    Code:
    $expires = date('m/d/Y G:i:s', e_date("+" . 1 . " days"));
    :roll:

  7. #7
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Well I changed it to

    Code:
    $expires = date('m/d/Y G:i:s', e_date("+" . $ad_length . " days"));
    and set ad length to 1 in the settings but that doesn't seem to have worked.

    Any idea how to fix this? :oops:

  8. #8
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    Does this look like it might work?

    Where 'e_date' is an 'Expiration Date' field in the form.

    Code:
      $expires = date('Y-m-d', mktime(0,0,0,date('m',$e_date),date('d',$e_date)+$ad_length,date('Y',$e_date)));

  9. #9
    Thread Starter
    Senior Member jakesterz's Avatar
    Join Date
    Aug 2009
    Posts
    194
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Ad Expirations

    This could probably be moved to the Theme Support area now, btw, if a mod feels so inclined.

    Thanks.

Thread Information

Users Browsing this Thread

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