Mass re-activate listings?

Discussion in 'GeoCraft WordPress Theme' started by proele, Jul 12, 2013.

  1. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
    All my listings expired, any way to Mass re-activate listings?
     
  2. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
  3. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
    I am a bit code impaired, is the process to add the code you provided and add a listing? Also where in functions does it go? top bottom ?
     
  4. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
  5. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to function.php present in your theme directory and add the code given below

    Code:
    global $wpdb;
    $data="SELECT * FROM wp_posts WHERE post_status = 'draft'";
    $queries = $wpdb->get_results($data);
    foreach ($queries as $query) {
    echo $post_id=$query->ID;
    $meta_key='gc_listing_duration';
    $post_status='post_status';
    $posttable='wp_posts';
    $meta_value='06/20/2013 07:15:45';
    update_post_meta($post_id, $meta_key, $meta_value);
    $wpdb->update($posttable,array($post_status =>'publish'), array( 'ID' =>$post_id ),array('%s'),array( '%d' ));
    }

    Sending image for reference

    2013-07-13_1132.png




    "$meta_value" defines as the date at which you want to expire your listing, So fill "$meta_value" as per your requirements.

    Firstly save that code in the bottom of function.php file and then refresh your dashboard and website, It will activate your all listings after that remove that code and again save your file.
     
  6. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
    I have completed the steps given with no result.

    The "wp-content" dir. name has been changed would that cause any problems?

    Additionally when adding listings via the mass up loader can the expire date be changed on upload so this does not occur again?
     
  7. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
  8. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160
    Hello,

    All listings are published now. Please check your site.
     
  9. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
    When adding listings via the mass up loader can the expire date be changed on upload so this does not occur again?
     
  10. proele

    proele Member

    Joined:
    Feb 1, 2012
    Messages:
    68
    Likes Received:
    0
    Also can you email me details as to what I was not doing correctly?
     
  11. Nitesh

    Nitesh Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    5,165
    Likes Received:
    160

    Hello,

    Expiry depends on what you have set in the payment settings > Free payment package, One time payment package
    Suppose if you have set payment settings "listing active period" to 1 year and after that import csv then all imported listing expiry date will be set to 1 year.

    And we have renewed your all listings through code posted above. Previously it was not working because prefix (wp) used in the code and prefix you are using are not same.
    Through your dashboard we have identified your prefix and added it to the code.
     

Share This Page