Jeremy
Jeremy
Offline
0
This is my third try at this question, let's see if I can get it right this time.

I cannot get Comments to be added to the JomSocial Wall. Adding Artists and Albums is working fine. I have also got User Points added for both of them and that is also working fine. I added User Points for the Comments but that is also not working.

In the Joomla dashboard when I go to Plugins/Music Collection - JomSocial all the boxes are set to Yes. I even added one for Notify Songs and it is also showing Yes. I just added another field class into the jomsocial.xml file in the plugins/muscol/l/jomsocial directory.

<field class="btn-group" name="notify_song" type="radio" default="1" label="Notify Song addition" description="Post new song additions
into the JomSocial Wall">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

Of course, that does not get Song added working in the notifications or points.
For that I added a Song function in the jomsocial.php file in the same directory.

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')." <a href='".$link."'>" . JRequest::getVar('name') ."</a>" ;
$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 the CActivityStream line are for adding the User Points to the action. That is how I added User Points for the Album and Artist and it works fine. I also added a file to the components/com_muscol directory name jomsocial_rules.xml. That is how JomSocial says new User Points have to be added and it worked fine for adding the Rules to the JomSocial User Points list. The only two actually working are the points for adding an Artist and for adding an Album.

Comments and Songs are not working. Neither showing up in the JomSocial Wall or getting points. I am thinking the problem of showing up in the Wall will also solve the points problem as the points are working for the two that are showing up in the Wall. I am thinking that I am missing some kind of helper file with the Adding Song function and I have no idea with the Add Comments not working.

I have another question. In the original code for the Adding an Album function the jText is ('ADDING_ALBUM') while it shows on the Wall as "added album". Where is that substitution made? I am looking for that file but have not found it yet. I need to change the substituted text.

My Comments function is not working with the original code. By that I mean it doesn't show up in the activity or JomSocial Wall when a comment is made in any of the spots mentioned in the code.

Any help would be greatly appreciated as I really need to get this working.

Thank you.
Responses (2)
  • Accepted Answer

    Jeremy
    Jeremy
    Offline
    Thursday, August 16 2018, 06:02 PM - #Permalink
    0
    I found the fix for the added show part. I needed to add a ADDED_SHOW="added show" in the en-GB.com_muscol.ini. I had changed the ADDED_ALBUM to "added show" but the Album/Show changes had already changed that to ADDED_SHOW so it wasn't showing right until I added the extra entry.

    This is the answer for the part above that I have copied below.
    "I have another question. In the original code for the Adding an Album function the jText is ('ADDING_ALBUM') while it shows on the Wall as "added album". Where is that substitution made? I am looking for that file but have not found it yet. I need to change the substituted text"

    So a small part fixed but I still need to get the comments working and I would like to have the songs working also.
    The reply is currently minimized Show
  • Accepted Answer

    Jeremy
    Jeremy
    Offline
    Friday, August 17 2018, 02:06 PM - #Permalink
    0
    When I said Wall maybe I mean the Activity Stream. That is what shows up on the page when an action has been done.
    The reply is currently minimized Show
Your Reply