Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Can not like a custom CActivityStream::add() entry

8 years 3 months ago
  • Cavere's Avatar
    Topic Author
  • Cavere
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Licenses:
JomSocial Active

Hi,

I am posting custom messages onto user's timelines using the Stream API . This is working very well, except that if someone Likes the entry in the stream, it doesn't show up after a refresh.

I found the same issue described in another forum post here: www.jomsocial.com/component/kunena/profi...stom-activity#155305

I had the exact same problem first (comments not showing up) and managed to fix this thanks to the example in that thread. However I can't find a solution for the Likes.

My code looks like this:

$act            = new stdClass();
                $act->cmd 	    = 'wall.write';
                $act->actor 	= $user->getId();
                $act->target 	= 0;
                $act->title 	= $translator->translate('Book review');
                $act->content 	= "I posted a review of a book.";
                $act->app 	    = 'mycomponent.system';
                $act->access    = 20;

                CFactory::load('libraries', 'activities');
                $act->comment_type = 'profile.status';
                $act->comment_id    = CActivities::COMMENT_SELF;

                CActivityStream::add($act);

Any idea how I can fix this?

Thanks for your help,
Cavere

8 years 3 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Cavere,

Please you also create your the stream rule, you can see the sample / you can add new xml inside this file components/com_community/jomsoical_rule.xml

Did you know that we also provide Private Support Tickets?
Just use this form: www.jomsocial.com/submit-support
Support provided that way is much faster and all your license details are added to the ticket so you don't need to send them :)

thank you!

8 years 3 months ago
  • Cavere's Avatar
    Topic Author
  • Cavere
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
Licenses:
JomSocial Active

Hi Dimas,

Thanks for your suggestions. I can see the example had some code I was missing. I got it to work by adding this:

$act->like_type     = 'profile.status';
$act->like_id     = CActivities::LIKE_SELF;
Should I still add something to jomsocial_rule.xml then? And if so, what exactly? Does that also mean I will have to update that file each time I upgrade JomSocial?

If you want I 'll create a private support ticket but this seems like an issue other people might be interested in too?

Thanks again for your help,
Cavere

8 years 3 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Cavere.

Oh you are using the exsiting type, so you dont need add new rule, if you create new type so you need define it on xml file first :)

Yeah in case you wanna create another topic privately you can use our new support system :)

thank you!

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW