How To Add JomSocial Point Value

More
8 years 11 months ago #28468 by amelcher
I created the xml file as shown in the jomsocial documents wiki. Here is what I have so far:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE jomsocial>
<jomsocial>
<component>com_myplayer</component>
<rules>
<rule>
<name>MyPlayer Add Music Track</name>
<description>Give points when a song is added.</description>
<action_string>myplayer.add.song</action_string>
<publish>true</publish>
<points>3</points>
<access_level>1</access_level>
</rule>
<rule>
<name>MyPlayer Remove Music Track</name>
<description>Remove points when a song is removed.</description>
<action_string>myplayer.remove.song</action_string>
<publish>true</publish>
<points>-3</points>
<access_level>1</access_level>
</rule>
</rules>
</jomsocial>

Can you tell me what files to add this in the myplayer files so it gives the community an incentive to add music?

include_once JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
CuserPoints::assignPoint('myplayer.add.song');

and
CuserPoints::assignPoint('myplayer.remove.song');

Thanks!
On another note, I have been searching for something like this for a LOOONNGG time and so far, this is the closest I have come. I have MusicCollection as well and that has some good features, but this is straight to the point and I can see how this can go viral in our community if it's set up right. I know this is version 1.0.0, but hopefully I can help you add more features that will enhance the component and make it undeniable...

Adam

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago - 8 years 11 months ago #28470 by nordmograph
Hi Adam,

Happy you like the MyPlayer
The file you should look at is the administration/table/track
You can add tyour code close to the Jomsocial Activity stream announcement code.

And in the delete function.
Problem is the the Jomsocial API for points doesn't seem to have a parameter for userid.
So when a track will be deleted by admin from the backend, points will not be deducted.

Problem would not occure with AUP or Easysocial points ...

- Need help? Post the URL of the related page (eventualy as confidential info), it will help solve your issue faster.
- An error, notice or warning? report the exact message including the line number
- If you get a white page , enable error reporting and / or check your server error logs.
Last edit: 8 years 11 months ago by nordmograph.

Please Log in or Create an account to join the conversation.

More
8 years 11 months ago #28471 by amelcher
like this?
// process activity stream
$enable_activitystream = $cparams->get('enable_activitystream', 1);
$enable_podcast = $cparams->get('enable_podcast', 1);
$profileman = $cparams->get('profileman', '0');
$default_privacy = $cparams->get('default_privacy', '0');
include_once JPATH_ROOT.'/components/com_community/libraries/userpoints.php';
CuserPoints::assignPoint('myplayer.add.song');

if($enable_activitystream && !$array && $array && ($array OR $array ))
{

Please Log in or Create an account to join the conversation.

Time to create page: 0.337 seconds
Powered by Kunena Forum
Disclaimer: Nordmograph is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.