Plugin Directory

Changeset 175624


Ignore:
Timestamp:
11/20/2009 05:34:48 PM (16 years ago)
Author:
jpatterson
Message:

Update to accomodate the ListPipe Randomizer as well as the site admin is tagged as the author

File:
1 edited

Legend:

Unmodified
Added
Removed
  • listpipe/trunk/listpipe.php

    r171719 r175624  
    44Plugin URI: http://www.listpipe.com/plugins.php
    55Description: The ListPipe Pugin for WordPress pulls Powerful Custom Content from your ListPipe account and inserts it into your posts.
    6 Version: 2.1
     6Version: 2.2
    77Author: Square Compass, LLC
    88Author URI: http://www.squarecompass.com
     
    1212//Functions
    1313function listpipe_get_content() {
     14    global $wpdb;
    1415    switch(@$_REQUEST['action']) {
    1516        case 'GetDraft':
     
    6162                        )
    6263                    );
     64                    //Get this Blogs Admin User
     65                    $admin_user_id = $wpdb->get_var($wpdb->prepare("SELECT id FROM $wpdb->users WHERE user_email=%s;",get_option("admin_email")));
    6366                    // Save Post
     67                    $publish_timestamp = strtotime("+ ".rand(0,3000)." seconds");
    6468                    $postID = wp_insert_post(array(
     69                        "post_author"=>$admin_user_id,
    6570                        "post_status"=>($is_draft?"draft":"publish"),
    6671                        "post_type"=>"post",
    6772                        "post_title"=>$contents[0],
    6873                        "post_content"=>$contents[1],
    69                         "post_category"=>array($cat_id)
     74                        "post_category"=>array($cat_id),
     75                        "post_date"=>date("Y-m-d H:i:s",$publish_timestamp),
     76                        "post_date_gmt"=>gmdate("Y-m-d H:i:s",$publish_timestamp)
    7077                    ));
    7178                    if(empty($postID))
Note: See TracChangeset for help on using the changeset viewer.