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);
?>
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.
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
I included the cPanel credentials.
Thanks Albertus.
Thank you Albertus.
Hopefully we'll solve this soon!
Thank you!
It worked for the comments Albertus, but unfortunately not for the 'likes'
The same comments are reproduced for every activity / route that someone shares
:(
I managed to solve the problem.
Thanks for your help Albertus!