Skip to Content Skip to Menu

[SOLVED] Bug in CB 2.0.7 Activity when logging and displaying new blogs

  • 900010000
  • 900010000
  • OFFLINE
  • Posts: 28
  • Thanks: 2
  • Karma: 0
9 years 7 months ago - 9 years 7 months ago #261940 by 900010000
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
Last edit: 9 years 7 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 7 months ago #261983 by krileon
CB Activity has not been upgraded for CB 2.x. It will not log CB Blogs activity as CB Blogs was rewritten. I'm currently in the middle of rewriting CB Activity. Note that next release of CB Activity won't log activity at all. It'll be purely responsible for parsing and displaying it. CB Blogs for example would be responsible for logging in.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • 900010000
  • 900010000
  • OFFLINE
  • Posts: 28
  • Thanks: 2
  • Karma: 0
9 years 7 months ago - 9 years 7 months ago #261985 by 900010000
Thanks Kyle. I look forward to seeing your work with thew new CB Activity. Using the code above, CB Activity is logging and displaying that a new blog was created by a certain member. I am not sure why exactly, but at least it works. :)

Best Wishes,
Joseph
Last edit: 9 years 7 months ago by 900010000. Reason: clarification

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum