NAME

BSE::UI::Affiliate - set the affiliate code for new orders or display a user info page


SYNOPSIS

# display a user's information or affiliate page

http://your.site.com/cgi-bin/affiliate.pl?id=number

http://your.site.com/cgi-bin/affiliate.pl?lo=logon

http://your.site.com/cgi-bin/affiliate.pl?co=affiliate name

# set the stored affiliate code and refresh to the top of the site

http://your.site.com/cgi-bin/affiliate.pl?a_set=1&id=code

# set the stored affiliate code and refresh to url

http://your.site.com/cgi-bin/affiliate.pl?a_set=1&id=code&r=url


DESCRIPTION

This is the implementation of the affiliate.pl manpage.


TARGETS

a_set

This is called to set the affiliate code.

Requires that an id parameter be supplied with the affiliate code which is stored in the user session. This is then stored in the order record if the user creates an order before the cookie expires. This id can be any string, it need not be a user on the current site.

Optionally, you can supply a r parameter which will be refreshed to after the affiliate code is set. If this is not supplied there will be a refresh to either default_refresh in [affiliate] in bse.cfg or to the top of the site.

If your site url and site secureurl are different then there will be an intermediate refresh to a_set2 to set the affiliate code on the other side of the site. a_set2 will then refresh to your supplied r parameter or its default.

You can also configure which referer header values are permitted in bse.cfg. See [affiliate] in the config manpage for more information.

If [affiliate].set_cookie is set then it is used as the name of a cookie to set to the affiliate id.

If [affiliate].other_cookies is set then it is used as a comma separated list of cookie names to be set from parameters passed to this target. eg. if other_cookies is set to alpha, and an alpha paremeter is assed to this target, then the alpha cookie is set to that value.

a_set2

Sets the affiliate code for the "other" side of the site.

This should only be linked to by the a_set target.

This does no referer checks.

a_show

Display the affiliate page based on a either a user id number supplied in the id paramater, a logon name supplied in the lo parameter or an affiliate name supplied in the co parameter.

This is the default target, so you do not need to supply a target parameter.

The page is displayed based on the affiliate.tmpl template.

The basic user side tags are available, as well as the siteuser tag which gives access to the site user's record.

Be careful about which information you display.


AUTHOR

Tony Cook <tony@develop-help.com>