Hi,
When I tried to create a new blog with the most recent Activity plugin, I got an error page, something about missing arguments. There are a number of problems with the code for logging newly created blogs with Activity. After playing with it for a while, I came up with a working code for plugin.cbactivity.php (**I did add a language constant here for new blogs):
public function cbblogs_onAfterCreateBlog( $row, $user, $plugin) {
// original public function cbblogs_onAfterCreateBlog( $row, $article, $user, $plugin ) {
global $_CB_framework, $_CB_database;
$myId = $_CB_framework->myId();
if ( $myId ) {
$userId = $user->get( 'id' );
if ( $this->params->get( 'activity_cbblogs_create', 1 ) ) {
$activity = new cbactivityActivity( $_CB_database );
// $activity->set( 'user_id', (int) $user->get( 'id' ) );
$activity->set( 'user_id', (int) $myId );
// original $activity->set( 'user_id', (int) $row->get( 'id' ) );
// $activity->set( 'user_id', $userId );
$activity->set( 'type', 'blogs' );
$activity->set( 'subtype', 'blog' );
// $activity->set( 'item', (int) $article-> get('id') );
$activity->set( 'item', (int) $row->get( 'id' ) );
// original $activity->set( 'item', (int) $article->id );
$activity->set( 'title', CBTxt::T( 'POSTED_BLOG_ENTRY' ) );
$activity->set( 'icon', 'comment' );
$activity->set( 'date', $_CB_framework->getUTCDate() );
$activity->store();
}
}
}
I hope this can be fixed in future releases of Activity. Thanks for all your great work.
Warmly,
Joseph