WordPress.org

Ready to get started?Download WordPress

Forums

Plugins
Cubepoint + BuddyShare Modification (2 posts)

  1. webwarrior.wng
    Member
    Posted 1 year ago #

    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">';
    ?>

    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/

  2. webwarrior.wng
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic