Hi,

thanks for the module, is there a way to get this to work with Share Buttons by AddToAnymodule? So the user can share their referral link using the widgets?

It's possible to print referral code using the code below but i'm unsure of how to get the two to work together.

$referralLink = url('referral/'. _referral_uid2ref($GLOBALS['user']->uid), array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE));

Hope you're well.

Thanks!

Comments

nyleve101’s picture

Update: a solution was cooked up by Ozwebapps to post User Referral links with the addtoany module

<?php
$referralLink = url('referral/'. _referral_uid2ref($GLOBALS['user']->uid), array('query' => NULL, 'fragment' => NULL, 'absolute' => TRUE));
?>
<div style="width: 100%; margin: 50px auto; text-align:center;">
Your referral link:
<div style="width: 400px; height: 40px; border: 1px solid #ccc; padding: 10px; margin-bottom: 15px; margin: 10px auto;">
<?php echo $referralLink; ?>
</div>
<div class="a2a_kit a2a_kit_size_32 a2a_default_style" style="width: 180px; margin: 0 auto;">
    <a class="a2a_button_facebook"></a>
    <a class="a2a_button_twitter"></a>
    <a class="a2a_button_google_plus"></a>
    <a class="a2a_button_pinterest"></a>
    <a class="a2a_dd" href="http://www.addtoany.com/share_save"></a>
</div>
</div>
<!-- AddToAny START -->
<script type="text/javascript">
var a2a_config = a2a_config || {};
a2a_config.linkname = 'SendMeToothbrushes.com';
a2a_config.linkurl = '<?php echo $referralLink; ?>';
a2a_config.num_services = 10;
a2a_config.show_title = 1;
</script>

<script type="text/javascript" src="//static.addtoany.com/menu/page.js"></script>
<!-- AddToAny END -->

Hope it helps someone else.

E

ankitsmart63’s picture

If you are still facing problem then see by an example how I have placed it on my Website.