Plugin Directory

Changeset 1478772


Ignore:
Timestamp:
08/19/2016 01:17:36 PM (10 years ago)
Author:
thekrotek
Message:

Updated stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • search-for-ipboard/trunk/ipboard-search.php

    r1435912 r1478772  
    4848    {
    4949        add_action('admin_enqueue_scripts', array($this, 'loadAdminScripts'));
     50        add_action('the_post', array($this, 'updatePostData'));
    5051       
    5152        add_filter('plugin_row_meta', array($this, 'updatePluginMeta'), 10, 2);
     
    189190           
    190191                if (!empty($results)) {
    191                     if (!empty($_COOKIE['ips4_ipsTimezone'])) {
    192                         $data->post_date = $this->properTime($data->post_date, $_COOKIE['ips4_ipsTimezone']);
    193                     }
    194                                        
    195                     foreach ($results as $key => $post) {                   
     192                    foreach ($results as $key => $post) {
     193                        if (!empty($_COOKIE['ips4_ipsTimezone'])) {
     194                            $post_date = $this->properTime($post->post_date, $_COOKIE['ips4_ipsTimezone']);
     195                        } else {
     196                            $post_date = $post->post_date;
     197                        }
     198                       
    196199                        $post->ID = 0;
    197200                        $post->post_author = 0;
    198                         $post->post_date = date('Y-m-d H:i:s', $post->post_date);
    199                         $post->post_date_gmt = date('Y-m-d H:i:s', $post->post_date);
     201                        $post->post_date = date('Y-m-d H:i:s', $post_date);
     202                        $post->post_date_gmt = date('Y-m-d H:i:s', $post_date);
    200203                        $post->post_excerpt = "";
    201204                        $post->post_status = "publish";
     
    205208                        $post->to_ping =  "";
    206209                        $post->pinged = "";
    207                         $post->post_modified = date('Y-m-d H:i:s', $post->post_date);
    208                         $post->post_modified_gmt = date('Y-m-d H:i:s', $post->post_date);
     210                        $post->post_modified = date('Y-m-d H:i:s', $post_date);
     211                        $post->post_modified_gmt = date('Y-m-d H:i:s', $post_date);
    209212                        $post->post_content_filtered = "";
    210213                        $post->post_parent = 0;
     
    250253    }
    251254   
     255    public function updatePostData($post)
     256    {
     257        global $authordata;
     258       
     259        if ($post->post_type == "ipboard") {
     260            $authordata = new stdClass();
     261            $authordata->ID = $post->post_author;
     262            $authordata->user_email = $post->email;
     263            $authordata->user_url = $post->author_link;
     264            $authordata->user_nicename = $post->author_seo;
     265            $authordata->display_name = $post->author_name;
     266        }
     267       
     268        return $post;
     269    }
     270       
    252271    public function updatePostLink($link)
    253272    {
Note: See TracChangeset for help on using the changeset viewer.