Posted by cerup on March 20, 2010 at 1:36am
3 followers
Jump to:
| Project: | Affiliates |
| Version: | 6.x-1.9 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
It would be a nice option to have the link back to the site be to the user profile rather than the website. This way it can be used as 'visit my profile on XX.com' and people can promote not just the site, but their profile on the site.
This could be a simple checkbox in the settings.
Comments
#1
Would it be possible to put php or use tokens in the redirect url.
If you nice to be able to redirect by either doing
/users/<?php global $user; print $user->uid?>or
/users/[uid]Has anyone done anything like this without hacking the module?
#2
This isn't the most elegant 'fix', but you you can add in affiliates.module file under the function
"function affiliates_click() {"
<?phpif($redirect == "profile"){
drupal_goto('user/' . $uid);
}
?>
above where it says
<?php
if ($redirect) {
header("Location: " . $redirect);
}
else {
// Redirect to the home page if there is no
drupal_goto();
}
?>
so the final code reads
<?php
if($redirect == "profile"){
drupal_goto('user/' . $uid);
}
else if ($redirect) {
header("Location: " . $redirect);
}
else {
// Redirect to the home page if there is no
drupal_goto();
}
?>
This will let you put 'profile' (without the quotes) into the redirect field and it will redirect the person who clicks to that users profile (assuming it's at user/uid). A more elegant solution would be better, but this will work.
#3
Thanks for this 'workaround'! Really needed this functionality.