Jeremy
Jeremy
Offline
0
I started another question but cannot read the question when I try it sends me to someone else's question. So I am trying again.

My JomSocial plugin does not seem to be working correctly. While new albums are being posted to the JomSocial Wall Comments are not. All 4 of the Notify options are set to yes in the Joomla dashboard plugin settings for the Music Collection JomSocial plugin. I have managed to add a 5th for Notify Song and it also is set to yes.

Comments are not showing at all on the wall. I do get the albums and artists showing when they are added and I even have User Points being added for that. I cannot get Comments showing or points added for comments.

I found the plugin plugin/muscol/jomsocial and the two files in it.
In jomsocial.xml I added the following;




It seemed to work as expected and added the Notify song button in the Joomla dashboard Music Collection JomSocial Plugin.

In jomsocial.php I added the following function to Save Songs
function onSaveSong($song_id)
{
if(file_exists( JPATH_BASE . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php') && $this->params->get('notify_song')){

CFactory::load( 'libraries' , 'activities' );
$user = JFactory::getUser();

$link = MusColHelper::routeSong($song_id);
$link = str_replace("administrator/", "", $link);

$act = new stdClass();
$act->actor = $user->id;
$act->target = 0;
$act->title = "{actor} ".JText::_('ADDED_SONG')." " . JRequest::getVar('name') ."" ;
$act->app = 'myalbums';
$act->cid = $user->id;

CActivityStream::add($act);
include_once JPATH_ROOT.'/components/com_community/libraries/core.php';
include_once JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
CuserPoints::assignPoint('muscol.add.asong');
}
}
The three lines after CActivityStream::add($act); are for adding User Points to the action of saving a song. I used the same three lines after saving an album and an artist and it worked fine.

I also added a file at components/com_muscol/ named jomsocial_rules.xml. This is how JomSocial said to add new Rules for User Points.
The file is;



com_muscol


Comment Made
Give point when Comment added.
muscol.comment.added
true
1
1


Add Song
Give point when song added.
muscol.add.asong
true
1
1


Add Show
Give point when a new Show is added.
muscol.add.ashow
true
1
1





A Show is what we use in place of Album as it is a live music site. All the points now show in the JomSocial User Points list. The only one working is the Add Show points. I did change all the appropriate references to Albums to Shows to make that work and show the way we wanted it to.

I have another question.

In the plugins/moscul/jomsocial.php file the original code had the jText as ('ADDED_ALBUM') but when it appeared in the JomSocial Wall it said, "added album". Where is that substitution done? Since I haven't found that spot yet it doesn't substitute anything at this point and just says, "ADDED_SHOW'. I am looking for the file to substitute "added Show" for that like it does when it was "ADDED_ALBUM".

Any help you can give would be appreciated. I think I am close to having this working but could use a little help.

Thank you.
Responses (1)
  • Accepted Answer

    Jeremy
    Jeremy
    Offline
    Wednesday, August 15 2018, 05:30 PM - #Permalink
    0
    My mistake, I should have realized that the code would not go through. I will close this and redo it.
    The reply is currently minimized Show
Your Reply