Notice

The forum is in read only mode.

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.

No comments/likes stored for custom activity

9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

ISSUE SUMMARY: I wrote a simple script in order to share routes to the activity stream, but after refreshing the page no likes or comments are stored


STEPS TO REPLICATE:
1 Go to seniorscycle.co.uk/index.php/routes2
2 Share a route
3 Go to www.seniorscycle.co.uk/index.php/my-community and like comment the route you just posted
4 Refresh the page
5
RESULT Likes and comments are not stored
EXPECTED RESULT
BROWSER Chrome, Mozilla

The script:

<?php
define( '_JEXEC', 1 ); 
define( '_VALID_MOS', 1 ); 
define( 'JPATH_BASE', realpath(dirname(__FILE__))); 
define( 'DS', DIRECTORY_SEPARATOR ); 
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' ); 
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' ); 
$mainframe =& JFactory::getApplication('site'); 
$mainframe->initialise(); 


$user = & JFactory::getUser();
//echo $user->guest;
//echo $user->username;

$jcheck = JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php';
echo $jcheck;
//if (file_exists($jcheck)) {
			require_once($jcheck);

	$RouteID = $_REQUEST["RouteID"];
	$RouteDate = $_REQUEST["RouteDate"];
	$routeLink = "<a href='http://seniorscycle.co.uk/mapRoute.php?RouteID=" . $RouteID . "&UserName=" . $user->username . "'>Click here to see the actual map</a>";
	$act = new stdClass();
	$act->cmd 	= 'wall.write';
	$act->actor 	= $user->id;
	$act->target 	= 0; // no target
	$act->title  = JText::_("<a href='/index.php/my-profile/$user->id'>$user->username</a>" . ' posted a new route:<br/>'.$routeLink);
	$act->content 	= "Duration: $RouteDate
						<p> Distance: $RouteDate";
	$act->app 	= 'wall';
	$act->cid 	= 0;
			 
	CFactory::load('libraries', 'activities');
	CActivityStream::add($act);

?>

Thanks very much to anyone who can help

Attachments:
9 years 2 months ago
Licenses:

Hi,

I can see the like + comment on that stream:



please let me know if I missing something.

FYI: every share URL must access able for public/guest user.

Regards

Attachments:
9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

Hi Albertus and thanks for posting.

The screenshot you uploaded appears when a user shares someone's else's activity that has already been posted.

The problem is related to the initial post.

9 years 2 months ago
Licenses:

Hi,

could you please provide me cpanel access detail? I need to have a look at database.
please edit your first post at this topic and put it at site info section (private)

Regards

The following user(s) said Thank You: Konstantinos
9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

I included the cPanel credentials.
Thanks Albertus.

9 years 2 months ago
Licenses:

Hi,

please give me time for this.

Regards

9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

Thank you Albertus.

Hopefully we'll solve this soon!

9 years 2 months ago
Licenses:

Hi,

at your code, there is:

$act->app = 'wall';
$act->cid 	= 0;

please add
$act->comment_type = 'profile.status';

after that try to post new map again. and comment it.

Regards

9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

Thank you!

It worked for the comments Albertus, but unfortunately not for the 'likes'

9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

The same comments are reproduced for every activity / route that someone shares

:(

9 years 2 months ago
Licenses:
JomSocial Expired Socialize Expired

I managed to solve the problem.
Thanks for your help Albertus!

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