I'm making an addon for my mods and everything working fine but i have one problem.
When a mod use it his postcount resets to 0 and also the reply count of the topic.
But i really cant see the problem or solution :p
Piece of the cake :p
if($this->request['postREPLY'] == 'y')
{
$reply_author = "".$_COOKIE['member_id']."";
$reply_author_name = $this->DB->buildAndFetch( array( 'select' => 'name', 'from' => 'members', 'where' => "member_id={$reply_author}") );
$time_stamp = time();
$mod_message = $this->request['reason'];
$search = array( "/%topic_title%/", "/%topic_link%/", "/%reason_note%/" );
$replace = array( $this->topic['title'], "[url='{$this->settings['board_url']}/index.php?showtopic={$this->topic['tid']}']{$this->settings['board_url']}/index.php?showtopic={$this->topic['tid']}[/url]", $mod_message );
$tmessage = $this->settings['bs_advancedmodtools_disapprove_tm'];
$tmessage = str_replace("\n", "<br />", $tmessage );
$tmessage = preg_replace( $search, $replace, $tmessage );
$this->DB->insert( 'posts', array(
'author_id' => $reply_author,
'author_name' => $reply_author_name,
'ip_address' => '127.0.0.1',
'post_date' => $time_stamp,
'post' => $tmessage,
'topic_id' => $this->topic['tid'] ,
) );
$this->DB->update( 'topics', array( 'posts' => 'posts+1',
'last_poster_id' => $reply_author,
'last_post' => $time_stamp,
'last_poster_name' => $reply_author_name['name']
),
'tid=' . $this->topic['tid']
);
$this->DB->update( 'members', array( 'posts' => 'posts+1' ),
'member_id=' . $reply_author
);
}

Sign In
Register
Help


Bookmark
Del.icio.us
Digg
Email
Facebook
Google
Mixx
Reddit
StumbleUpon
MultiQuote

