latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Auto affiliate kb article

Home Forums Community Forum Auto affiliate kb article

This topic contains 5 replies, has 2 voices. Last updated by  Skip Shean 3 years, 11 months ago.

Topic Author Topic
Posted: Saturday Jan 19th, 2013 at 12:44 pm #38310
Skip Shean
Username: skipshean

Hey guys. I read Jason’s post at http://www.s2member.com/kb/auto-create-idevaffiliate-accounts/

My question is, I’d like to put the new affiliate’s tracking link in their member dashboard page so they see it when they log in. Is there a custom field or bit of code to drop in a file that would make it appear?

Thanks.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Sunday Jan 20th, 2013 at 4:40 pm #38481
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

I’m not aware of this being possible under any of the default tools built into iDev. This would be a great question to ask the iDev support team about though. Please let us know what you find out :-)

Posted: Monday Jan 21st, 2013 at 1:24 pm #38596
Skip Shean
Username: skipshean

filed a ticket with them, will let you know what they say!

Posted: Monday Jan 21st, 2013 at 5:06 pm #38671
Skip Shean
Username: skipshean

No joy. Here’s their response:

“No I’m sorry there is no way to display the affiliate information in your wordpress page. When the account is created, the new affiliate gets an email with the login to their account where they can see all the information about their account.

Sincerely,
Jim Webster
iDevAffiliate Technical Support”

But couldn’t we do something to look in that idevaffiliate database, match on email address, and pull the affiliate id out of there?

Posted: Wednesday Jan 23rd, 2013 at 5:06 am #39148
Staff Member

Thanks for the follow-up :-)

Yes, definitely a possible alternative. I was hoping they might have something a little simpler, but you could always query the database for that information. The username in WordPress should match up with the username in iDevAffiliate. So you would just query the iDevAffiliate database for the affiliate’s ID number, and then generate an affiliate link based on that.

Perhaps a better approach would be a custom API script integrated with iDevAffiliate.

Instructions

Step #1.

Create this file: /idevaffiliate/API/scripts/affiliate_url_via_username.php
This assumes you’re running iDevAffiliate with the SEO Links Module.

<?php
require_once('../../API/config.php');
include_once('../../includes/validation_functions.php');

if (isset($_REQUEST&#91;'username'&#93;) && mysql_num_rows($select = mysql_query("SELECT `id` FROM `idevaff_affiliates` WHERE `username` LIKE '".mysql_real_escape_string($_REQUEST&#91;'username'&#93;)."' LIMIT 1")))
{
$ID = mysql_result($select, 0);
$URL = 'http://'.$_SERVER&#91;'HTTP_HOST'&#93;.'/'.$ID.'.html';
echo "document.write('".$URL."');";
}
&#91;/hilite&#93;

<h4>Step #2.</h4>

Add this code snippet into a Post or Page within WordPress®, where a logged-in User will be.
This will display the affiliate URL wherever it is inserted in your HTML code.

<script type="text/javascript" src="/idevaffiliate/API/scripts/affiliate_url_via_username.php?username=&#91;&#91;s2Get user_field="user_login" /&#93;&#93;"></script>
Posted: Wednesday Jan 23rd, 2013 at 9:24 am #39161
Skip Shean
Username: skipshean

This is great, thanks. Looks to me like you have 80% of your “part 2” blog post following up on the last one… ;-)

If you do do that, would also love to know what would be different if NOT using the SEO Links module.

  • This reply was modified 3 years, 11 months ago by  Skip Shean.
Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.