{
$ad_code = str_replace("xxxx",$_SESSION['user_id'],$resultset->description);
$ad_code = str_replace("XXXX",$_SESSION['user_id'],$ad_code);
echo '<tr>';
echo '<td class="col2"><strong>'.$resultset->name.'</strong></td>';
echo '<td><textarea cols=65 rows=5>';
echo $ad_code;
echo "</textarea></td>";
echo '</tr>';
}
I'm using a plugin called WordPress Affiliate Platform, which created (I think) users in a seperate table than the typical WP users so as not to mix affiliate users and WP users.
I'd like to retrieve the user ID of the logged in affilite so I can list the affiliate's current page referral url:
- Example of a site wide referral url:
http://domain.com/?ap_id=AMEEKER
- Example of a page specific referral URL:
http://domain.com/myproduct?ap_id=AMEEKER
The plugin itself doesn't offer that option, instead just giving the instructions to tell affiliates to paste ?ap_id=AMEEKER
after the current page URL to get their affiliate link. That's fine, but a little tedious and can open affiliates up to errors that aren't really their fault.
I'm sure there's a way to just echo out the current page URL, followed by ?ap_id= and the affiliate's user id, but I'm having trouble figuring out how to retrieve the affiliate's user ID.
The plugin itself does it by transforming xxxx to the user id somehow.
domain.com/myproduct?ap_id=XXXX
I've pasted above some code from the affiliate's dashboard, and area where the plugin DOES pull the affiliate's ID and display it dynamically for the logged in user. Looking at that template in the plugin's files, I found what I think is the code that's dynamically turning XXXX into the actual affiliate ID but I don't know what to do with this, or if this alone can help me get what I want. I mean, I can look at it and KIND of see what it's doing, but not enough to know if or what I can do with it now!
(not a programmer, more like a tinkerer).
I've asked the plugin author, who seems to give very good support, but this feature has been requested it seems on their site several times and their answer is the same. No hard feelings, but I'd like to see if it can be done.
Any help would be appreciated.