Set Classifieds to expire in one year

Hello,

I am switching from Another Wordpress Classifieds Plugin to wpmudev's Classifieds plugin. One of the troubles I'm running into is that I have a bunch of ads that I need to move over that are all paid up for a year. Is there a way to set the expiration date for these? I've tried setting them up and not choosing an expiration date, but after hitting "Publish" they will be visible initially, but when I check back a while later I find them unpublished again.

  • Arnold
    • El Macho WP

    You would need to write some code to run through the users and set it to what you want. For each user you'd need to set their status to "success" and the expiration date.

    $transaction = new CF_Transaction( $user_id, $blog_id); //blog_id for Multisite
    
    $transaction->status = 'success';
    $transaction->expires = The unix time stamp of when you want it to expire on.
    
    unset($transaction);
  • Arnold
    • El Macho WP

    Well that won;t do it by itself you'll need to add code to step through your users, decide which get updated and then apply that bit of code. Normally you'd make a temporary PHP file that you can run oncean dthen remove so no one else canrun it again.

  • AmyJoy
    • Design Lord, Child of Thor

    Hmmm... perhaps it'd be easier to give them enough credits to keep their ads running for the rest of the year?

    If I add additional weeks to the duration custom field, will this interact with the credits function to allow users to choose additional weeks based on the number of credits they have? I'm thinking they'd be quite annoyed if every four weeks they had to go back in and renew their ads again.

    Thanks again for the help. The plugin is great, and I'm really excited to get everything switched over to it.

  • Arnold
    • El Macho WP

    Credits would let them buy more time. You would want to setup a choice of time for X credits for say your year and add that to the Duration custom field.

    Like below where we added a 10 Years choice so we wouldn't constantly have our demo site expiring.

  • AmyJoy
    • Design Lord, Child of Thor

    Thanks Arnold. That sounds perfect.

    You would want to setup a choice of time for X credits for say your year
    Where would I do this? If I add a year option to the duration, I'm guessing that it won't know how many credits that would cost, so where would I need to put that information?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.