Title: Cubepoint   BuddyShare Modification
Last modified: August 20, 2016

---

# Cubepoint BuddyShare Modification

 *  [webwarrior.wng](https://wordpress.org/support/users/webwarriorwng/)
 * (@webwarriorwng)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/cubepoint-buddyshare-modification/)
 * I have installed four following plug-ins.
 * 1. Cubepoint
    2. Cubepoint Buddyshare Integration 3. Buddypress 4. Buddyshare
 * I can reward the points to the user if he/she posts or comments or any activity
   in the ‘Activity’ tab. Now, i want to reward user some points if he/she clicks
   on Facebook Share Button (The Facebook Image Icon). Please help me out. I have
   put some javascript/php code in ‘/wp-content/plugins/buddypress-share-it/buddy-
   share-it.php’.
    I have added the function of PHP to the header, but how to add
   my javascript code?
 * If i add:
    <?php echo ‘ <script language=javascript> function addpts() { alert(“
   <? cp_alterPoints(cp_currentUser(), +8); ?>”); } </script>’; . ..After that I
   have put the function on click event … echo ‘<li class=”bpsi”>[<img src=”‘ .$pluginpath . ‘/buddypress-share-it/img/’.$bpsi_iconsize.’px/Facebook.png” alt=”Share on Facebook”>](http://www.facebook.com/sharer.php?t=&apos;.$activitytitle.&apos;&u=&apos; . $activitylink . &apos;)‘;?
   >
 * But it is not working onclick, it doesnot wait for the ‘onclick’ event.
    I want
   to know if i can add any PHP function in HTML onclick event.
 * I would be very much thankful to you.
 * [http://wordpress.org/extend/plugins/plugins/](http://wordpress.org/extend/plugins/plugins/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [webwarrior.wng](https://wordpress.org/support/users/webwarriorwng/)
 * (@webwarriorwng)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/cubepoint-buddyshare-modification/#post-3182538)
 * Ow, i came up with this code in ‘bp-share-it.php’
 * <?php
    . .. … function addpts() { if( function_exists(‘cp_alterPoints’) && is_user_logged_in()){
   cp_alterPoints(cp_currentUser(),get_option(‘bp_share_post_add_cp_bp’) ); } } 
   add_action(‘bp_media_after_activity_meta’,’addpts’); … .. . ?>
 * Now, could anyone please tell me add_action(‘bp_media_after_activity_meta’,’addpts’);
   this function’s 1st parameter? i think i have to put the correct parameter so
   that ‘addpts()’ function will be call on that particular FB icon click.
 * Thanks in advance!

Viewing 1 replies (of 1 total)

The topic ‘Cubepoint BuddyShare Modification’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/plugins.svg)
 * [Plugins](https://wordpress.org/plugins/plugins/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/plugins/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/plugins/)
 * [Active Topics](https://wordpress.org/support/plugin/plugins/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/plugins/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/plugins/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [webwarrior.wng](https://wordpress.org/support/users/webwarriorwng/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/cubepoint-buddyshare-modification/#post-3182538)
 * Status: not resolved