if ($this->ipsclass->vars['ae_post'] == 1 && $topic['state'] == "open" && $topic['close_auction'] == 0){
$this->ipsclass->DB->simple_construct( array( 'select' => '*',
'from' => 'posts',
'where' => "topic_id ='{$topic['tid']}' AND post_date <= '{$end_date}'",
'limit' => array(0,1),
'order' => 'post_date ASC'
) );
$this->ipsclass->DB->simple_exec();
$p = $this->ipsclass->DB->fetch_row();
$p['post_date'] = $this->ipsclass->get_date($p['post_date'], 'LONG', 1 );
$content = "Auction Closed <br />Last valid Bid is: <br />[quote name='{$p['author_name']}' date='{$p['post_date']}' post='{$p['pid']}'] {$p['post']}[/quote]<br />Thanks for bidding";
$mod = $this->ipsclass->vars['ae_mod_id'];
$t = $topic['tid'];
$api->set_author_by_id($mod);
$api->set_post_content($content);
$api->set_topic_id($t);
$api->post_settings['show_signature'] = 1;
$api->create_new_reply();
$this->ipsclass->DB->do_update( 'topics', array(
'close_auction' => "1"),
'tid='.$topic['tid'] );
}
if ($this->ipsclass->vars['ae_close'] == 1){
$this->ipsclass->DB->do_update( 'topics', array(
'state' => "closed"),
'tid='.$topic['tid'] );
}
}
}
else{
$topic['auctionends'] = "";
}
sorry that was the code , well i want just to add to it to get the last post from that topic when the auction ends