• Go to content
  • Go to welcome information
  • Go to search
  • Go to footer
Content last modified Monday 28 March 2016
Need help [ ? ]
hop to #bottom
Home → Directory → Plugins directory → Plugins →
Plugins
Categories:
URLs
section
Author:
Patrick LEFEVRE
Current version:
0.5
About It:
Forum thread
Article permalink
Author's edit link
Get it:
Download File
Rate it:
  • Helpful?
  • 11249 Yes
  • 01249 No
Flag it:
Contact Reason [ ? ]

pat_referrers

This (very simple) plugin had been done from my article on the txp-fr community website and a request by Lawrence. It support multiple website inbound links (see list attribute below) and makes distinction upon domains and sub domain names for referrers.

Purpose

For maketing reasons, you could wish to redirect your visitors who come from others websites you made when they click on your personal website Url (inbound links). The only thing you need before using this plugin, is to have your personal website Url on external websites (i.e. my-domain.com link shown on the textpattern.com website). Multiple inbound websites possible see list attribute below.

Installation & usage

Install this plugin as always, then activate it.
Place the only one tag available in the very top of your “default” page as this:

<txp:pat_referrers list="" separator="," redirect="" external="" status="" default=""/>

Attributes

Six attributes are available to make your work:

  • list: [required] a comma separated list of website Urls (Default: empty).
  • separator: [optional] separator sign used into the list above (Default: “,” comma)
  • redirect: [required] section name of your redirection for referrers listed in the “list” attribute above (Default: empty).
  • status: boolean [optional], if set to 1 a “301 Moved Permanently” status is send. Useful to tell search engine bots that the TXP section must never more to be indexed. Note: in this case, redirect attribute must to be set. Default: 0 (no status send).
  • external: Url [optional], a full external website Url to redirect your visitors (i.e. external="google.com" as external website address). Default: empty.
  • default: [optional] your section name for all other visitors they don’t came from websites listed in the “list” above. (Default “” empty = your main page)

Example

<txp:pat_referrers list="forum.textpattern.com,apple.com" redirect="my-portfolio" default="" />

The example above redirect to your my-portfolio page all vistors who came from the forum.textpattern.com or apple.com websites where your website Url is shown. While all other visitors will have access to your home page.

Credits

Many thanks for all TXP plugin creators from whom I learn lot. Special thanks to Jukka Svahn who reviewed this code.
Thanks to Ralitza” for the external new feature idea and Colak for the redirect attribute improvement.

Changelog

9 march 2012: v0.1 initial commit.
9 march 2012: v0.2 public version with code reviewed.
02 april 2012: v0.3 accept external websites redirection (Thanks Ralitza ;).
27 april 2012: v0.4 Status attribute added. Redirect attribute accepts empty value for non redirection rendering (Thanks Colak). Help text updated.
28 april 2012: v0.5 Makes distinction upon domain and sub domain names.

Download: pat_referrers_v0.5

Article Request Count:
15865
Initially released:
09 Mar 2012
Posted here:
10 Mar 2012
Article modified:
28 Apr 2012

spacer spacer spacer spacer spacer spacer spacer [?]

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

textile on
gravatars on
Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

← geo_vote cbe_members →

Categories


Articles

There are also tag clouds, 'cause those are fun.
TxP · Joyent
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.