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.

Class not found when using ajax call to custom module

11 years 3 months ago
  • lafemme's Avatar
    Topic Author
  • lafemme
  • Offline
  • Fresh Boarder
  • Posts: 72
  • Thank you received: 9
Licenses:
JomSocial Active

Hi,

We are building a custom module that uses this example code

    	$act            = new stdClass();
    	$act->cmd 	= 'example.task';
    	$act->actor 	= '505';
    	$act->target 	= '0';
    	$act->title 	= 'String';
    	$act->content 	= 'Your activity content';
	// Pay close attention on this
    	$act->app 		= 'example.action';
	$act->access  	= 0; // 0 = Public; 20 = Site members; 30 = Friends Only; 40 = Only Me
	$act->cid       = 0;
	CActivityStream::add($act);

This works fine on pageload, but when a call the method using ajax i get the error that the class "CActivityStream" is not found.
Do you have any tips how can we solve this?

Kind regards.

11 years 3 months ago
Licenses:

Hi,

try to include:

include_once(JPATH_BASE . '/components/com_community/defines.community.php');
require_once(JPATH_BASE . '/components/com_community/libraries/core.php');
include_once(COMMUNITY_COM_PATH . '/libraries/activities.php');
include_once(COMMUNITY_COM_PATH . '/helpers/time.php');

Regards

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