This TXP 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) with/without individual page (ie. http://domain.com/ sample-page.html) and makes distinction upon domains and sub domain names for referrers.
For maketing – or personal – reasons, you could wish to redirect your visitors who come from others websites you made when they click on your TXP personal website Url (inbound links). The only thing you need before using this plugin, is to have your personal TXP website Url on external websites (i.e. http://my-domain.com shown on the textpattern.com website).
Installation & usage
Install this plugin as always in your TXP administration interface, then activate it.
Place the only one tag available in the very top of your TXP “default” page gabarit as this:
<txp:pat_referrers list="" separator="" redirect="" external="" status="" default="" />
TXP tag Attributes
Six attributes are available to make your work:
list: String [required] a comma separated list of website Urls (Default: empty).
separator: String [optional] separator sign used into the list above to separate each domain names (Default:
redirect: String [optional] your TXP section name to redirect the 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 Default: empty (i.e.
http://google.comas external website address).
default: String [optional] your TXP section name for all other visitors they don’t came from websites listed into the
"list"attribute above. (Default
""empty = your TXP “default” main page)
<txp:pat_referrers list="forum.textpattern.com,apple.com" redirect="my-portfolio" default="" />
Note: optional tags can be omitted (blank one). Protocol ‘http://’ can be omitted too.
The example above redirect to your my-portfolio TXP page all vistors who came from the http://forum.textpattern.com or http://apple.com websites where your TXP website Url is shown.
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.
9 march 2012: v0.1 initial commit.
9 march 2012: v0.2 public version with code reviewed.
02 april 2012: v0.3 accept
external attribute for external website Url (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.
Some simplifications are made into the code. All previous downloads made before the modification date of this post should be re-uploaded. I apologize for this inconvenience.
Last edited by Pat64 (2012-04-29 07:49:39)
Hi Ralitza ;)
No need to give full Url(s) just refer the domain as this example below:
<txp:pat_referrers list="txptips.com,txpmag.com,txp-fr.net" redirect="textpattern-network" default="" />
In the case above, for all your http://www.inkscar.de/ address shown on http://txptips.com or http://txpmag.com or http://txp-fr.net websites, when a visitor click on your website link, he will be redirect on your “textpattern-network” personal page.
For all other visitors, your “default” page (see
default attribute) wil be shown (i.e. if visitors come from Google after a search).
This plugin can be useful if you want to target visitors for marketing campaigns (in my case, cause I made lot of “furnished accommodations” websites for my clients, I use it to redirect all my referrers to a special page based on tourism subject).
Last edited by Pat64 (2012-04-02 12:07:30)
:) I thought you might not understand what I mean because of it being a bit unusual. Let me explain: There is one link to my site at a template that I developed a long time ago and is now used on Tumblr. One of the sites my template is used on is not where I would like to get visits from but my url is on it anyway. I was wondering if I could use this plugin to actually send visitors back to say… tumblr. Quite nefarious, I know.
Oh I see: you want to redirect to… an external website (i.e. tumblr)?
In this case, this plugin can’t… for the moment (it’s an idea, maybe a good one tks ;)
I’ll study this new feature when I’ve got a moment (Sorry, but I’m actually very busy :(
I think it is done (v0.3 see first post above): now accept
external attribute to specify a full external website Url.
Please test it, and tell me if you’re happy :D
:D Tested and after some fiddling (because I didn’t read carefully) it works! Lovely!
P.S. Makes me giggle like some evil movie character. I am sending people from a titties&butts site off back to a page with my two Tumblr themes. Talk about being helpful evil grin
Last edited by datorhaexa (2012-04-02 15:44:39)
..So, I’d tried this (which works pretty well):
<txp:pat_referrers list="inkscar.de,textpattern.com" external="http://automotivated.tumblr.com/" />
Could you show us your code (change your tumblr website address if you want)?
(Note: inkscar.de,textpattern.com is an example: I don’t want to show my domain names used)
Last edited by Pat64 (2012-04-02 16:14:52)