Skip to Content Skip to Menu

[SOLVED] New Gallery Images not displayed by CB Activity with CB 2.0.7

  • 900010000
  • 900010000
  • OFFLINE
  • Posts: 28
  • Thanks: 2
  • Karma: 0
9 years 7 months ago - 9 years 6 months ago #261946 by 900010000
Hi, the CB activity plugin in is not displaying new images posted by users with CB Gallery. I tried, but cannot get it to work. Please help.

Warmly,
Joseph
Last edit: 9 years 6 months ago by krileon.

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 7 months ago #261953 by nant

900010000 wrote: Hi, the CB activity plugin in is not displaying new images posted by users with CB Gallery. I tried, but cannot get it to work. Please help.

Warmly,
Joseph


Yes, the CB Activity add-on has not been upgraded for CB 2.0 compatibility (nor to support the new CB Gallery plugin).

Kyle is working on this and is getting closer to release - please check other responses Kyle has already given on the forums about this.

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 #262011 by 900010000
I have been able to get CB Activity to log and display new image uploads. However, the only problem is, it is logging and displaying it twice. Any quick fix to make it display only once? Instead of detecting an image or file, I made the message "an image or file," and there is no thumbnail. This is the code from plugin.cbactivity.php:


public function onAfterUserProfileDisplay( $user ) {
global $_CB_framework, $_CB_database;

$myId = $_CB_framework->myId();

if ( $myId ) {
$userId = $user->get( 'id' );

if ( class_exists( 'pbProfileBookEntry' ) ) {
$pbComment = stripslashes( cbGetParam( $_POST, 'profilebookpostercomments' ) );
$pbGuest = $this->params->get( 'activity_pb_guest_create', 1 );
$pbWall = $this->params->get( 'activity_pb_wall_create', 1 );
$pbBlog = $this->params->get( 'activity_pb_blog_create', 1 );

if ( $pbComment && ( $pbGuest || $pbWall || $pbBlog ) ) {
$query = 'SELECT ' . $_CB_database->NameQuote( 'id' )
. "\n FROM " . $_CB_database->NameQuote( '#__comprofiler_plug_profilebook' )
. "\n WHERE " . $_CB_database->NameQuote( 'postercomment' ) . " = " . $_CB_database->Quote( $pbComment )
. "\n AND " . $_CB_database->NameQuote( 'posterid' ) . " = " . (int) $myId
. "\n ORDER BY " . $_CB_database->NameQuote( 'date' ) . " DESC";
$_CB_database->setQuery( $query );
$pbEntry = $_CB_database->loadResult();

if ( $pbEntry ) {
if ( $pbGuest && ( cbGetParam( $_POST, 'profilebookformactiong' ) == 'new' ) ) {
$activity = new cbactivityActivity( $_CB_database );

$activity->set( 'user_id', (int) $myId );
$activity->set( 'user', (int) $userId );
$activity->set( 'type', 'profilebook' );
$activity->set( 'subtype', 'guest' );
$activity->set( 'item', (int) $pbEntry );
$activity->set( 'title', 'posted a guestbook entry to [user_linked]' );
$activity->set( 'icon', 'book' );
$activity->set( 'date', $_CB_framework->getUTCDate() );

$activity->store();
} elseif ( $pbWall && ( cbGetParam( $_POST, 'profilebookformactionw' ) == 'new' ) ) {
$activity = new cbactivityActivity( $_CB_database );

$activity->set( 'user_id', (int) $myId );
$activity->set( 'type', 'profilebook' );
$activity->set( 'subtype', 'wall' );
$activity->set( 'item', (int) $pbEntry );
$activity->set( 'icon', 'comment' );
$activity->set( 'date', $_CB_framework->getUTCDate() );

if ( $myId != $userId ) {
$activity->set( 'user', (int) $userId );
$activity->set( 'title', CBTxt::T( 'POSTED_WALL_ENTRY_TO' ) );
} else {
$activity->set( 'title', CBTxt::T( 'POSTED_WALL_ENTRY' ) );
}

$activity->store();
} elseif ( $pbBlog && ( cbGetParam( $_POST, 'profilebookformactionb' ) == 'new' ) ) {
$activity = new cbactivityActivity( $_CB_database );

$activity->set( 'user_id', (int) $myId );
$activity->set( 'type', 'profilebook' );
$activity->set( 'subtype', 'blog' );
$activity->set( 'item', (int) $pbEntry );
$activity->set( 'title', CBTxt::T( 'POSTED_BLOG_ENTRY' ) );
$activity->set( 'icon', 'font' );
$activity->set( 'date', $_CB_framework->getUTCDate() );

$activity->store();
}
}
}
}

// if ( class_exists( 'getProfileGalleryTab' ) ) {
// $pgTitle = stripslashes( cbGetParam( $_POST, 'profilegallerypgitemtitle' ) );

if ( $this->params->get( 'activity_pg_create', 1 ) ) {
// if ( $pgTitle && $this->params->get( 'activity_pg_create', 1 ) ) {
/* $query = 'SELECT *'
. "\n FROM " . $_CB_database->NameQuote( '#__comprofiler_plug_profilegallery' )
. "\n WHERE " . $_CB_database->NameQuote( 'pgitemtitle' ) . " = " . $_CB_database->Quote( $pgTitle )
. "\n AND " . $_CB_database->NameQuote( 'userid' ) . " = " . (int) $myId
. "\n ORDER BY " . $_CB_database->NameQuote( 'pgitemdate' ) . " DESC";
$_CB_database->setQuery( $query );
$pgEntry = null;
$_CB_database->loadObject( $pgEntry );

if ( $pgEntry ) {
if ( in_array( $pgEntry->pgitemtype, array( 'jpg', 'jpeg', 'gif', 'png', 'bmp' ) ) ) {
$isImage = true;
} else {
$isImage = false;
}
*/
$activity = new cbactivityActivity( $_CB_database );

$activity->set( 'user_id', (int) $myId );
$activity->set( 'type', 'profilegallery1' );
$activity->set( 'item', (int) $pgEntry->id );
$activity->set( 'date', $_CB_framework->getUTCDate() );

// if ( $isImage ) {
$activity->set( 'subtype', 'image1' );
$activity->set( 'title', CBTxt::T( 'UPLOADED_GALLERY_IMAGE_OR_FILE' ) );
$activity->set( 'icon', 'picture' );
/* } else {
$activity->set( 'subtype', 'file' );
$activity->set( 'title', CBTxt::T( 'UPLOADED_GALLERY_FILE' ) );
$activity->set( 'icon', 'download-alt' );
}
*/
$activity->store();
}
}
}
// }
// }



Warmly,
Joseph

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 - 9 years 7 months ago #262018 by krileon
We are not providing quickfixes for this. All of the API is changing. Activity logging behavior is also changing. In fact that file doesn't even exist in next release. Please note this new activity you are logging will not be compatible with next release and may display oddly.

The best I can suggest at this time is to use CB Auto Actions to log your new activity by acting on CB Gallery triggers and using the CB Activity action, but again your new activity will not be compatible as CB Gallery will be updated to manage its activity entries.


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.
Last edit: 9 years 7 months ago by krileon.

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 #262020 by 900010000
Ok, thank you for your assistance.

Warmly,
Joseph

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

Moderators: beatnantkrileon
Powered by Kunena Forum