You are not logged in.
Hi Patrick
I’m looking at your plugin for a small project and I’m wondering if it will be appropriate to use.
I am trying to find a way to load some particular page content if the referrer comes from a particular page and/or subdomain of my site (so the referrer comes from the same domain).
Something like
... if_referrer list="subdomain.domain.tld, domain.tld/some_page"
<txp:some_txp_tags>
/if_referrer
...
Can your plugin handle the above?
Last edited by colak (2012-04-21 05:22:46)
neme.org | neme-imca.org | hblack.net | LABS
Offline
Hi Yiannis.
First: Actually, pat_referrers is a single tag, not a container one. So you can’t. But that’s an idea ;)
Second: The plugin can’t distinguish sub-domains from domain names. I’d thinking on this new feature but it seems that the source code will be more complex. Do you think it’s very important to add that kind of feature?
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline
Pat64 wrote:
First: Actually, pat_referrers is a single tag, not a container one. So you can’t. But that’s an idea ;)
Second: The plugin can’t distinguish sub-domains from domain names. I’d thinking on this new feature but it seems that the source code will be more complex. Do you think it’s very important to add that kind of feature?
Hi Patrick,
Many thanks for your response. It’ll be very selfish of me to say yes as I am needing that kind of functionality now. I’m not asking you to do it unless others feel that they can use it too.
neme.org | neme-imca.org | hblack.net | LABS
Offline
Hi Patrick,
I slept over it and thought that your plugin could do the job if two enhancements were implemented
The code I was thinking of:
<txp:variable name="refpage" value='<txp:pat_referrers list="http://www.domain.tld/some_page, http://subdomain.domain.tld" redirect="0" />' />
<txp:if_variable name="refpage" value="http://subdomain.domain.tld/" />
<txp:some_tags />
</txp:if_variable>
<txp:if_variable name="refpage" value="http://www.domain.tld/some_page">
<txp:some_other_tags />
</txp:if_variable>
Edited to add a simpler code:
<txp:variable name="refpage" value='<txp:pat_referrers list="http://www.domain.tld/some_page, http://subdomain.domain.tld" redirect="0" />' />
<txp:if_variable name="refpage" value="" />
<txp:else />
<txp:some_tags />
</txp:if_variable>
Last edited by colak (2012-04-22 06:59:51)
neme.org | neme-imca.org | hblack.net | LABS
Offline
Yiannis,
Container tag is’nt difficult, sub domains checker is more disfficult. I’ll provide a new version tomorow with container feature.
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline
redirect attribute can be omitted (Thanks Colak).
external attribute added (v0.3): accepts external Url redirection (Thanks Ralitza).
status attribute added. If sets a “301 Moved Permanently” is send. Useful to tell search engine bots that the TXP section must never more to be indexed.
Help text updated.
Next (very difficult) challenge: subdomain sniffing.
Check, test, comment or hate :D
WP version available soon ;)
Last edited by Pat64 (2012-04-28 09:01:35)
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline
@Ralitza
@Colak
Just for you: v.05 available
Supports domain and sub domain names ;)
Check, test, comment, love or hate :D
Last edited by Pat64 (2012-04-28 15:16:09)
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline
hey Patrick, You did it!
Unfortunately I get
Parse error: syntax error, unexpected ')', expecting ';' in /home/xxx/xxx/textpattern/lib/txplib_misc.php(653) : eval()'d code on line 42
The above errors were caused by the plugin:pat_referrers
The code I am using
<txp:variable name="refpage" value='<txp:pat_referrers list="http://sub.domain.com" />' />
<txp:if_variable name="refpage" value="" />
<txp:rvm_css format="link" />
<!--[if IE]>
<txp:rvm_css n="ie" format="link" />
<![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<txp:rvm_css name="ie7"/>" type="text/css" media="screen" /><![endif]-->
<txp:else />
<txp:pro_mobile>
<link rel="stylesheet" media="handheld, only screen and (max-device-width: 480px)" href="/css/small_screen.css" />
<link rel="stylesheet" media="handheld, only screen and (min-device-width: 768px)" href="/css/default.css" />
<link rel="stylesheet" media="only screen and (-webkit-min-device-pixel-ratio: 2)" type="text/css" href="/css/small_screen.css" />
<txp:else />
<txp:rvm_css format="link" />
<!--[if IE]>
<txp:rvm_css n="ie" format="link" />
<![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="<txp:rvm_css name="ie7"/>" type="text/css" media="screen" /><![endif]-->
</txp:pro_mobile>
</txp:if_variable>
> Edited to add: The error above appears on all pages, regardless of the template on the front end of the site on ‘live’ mode.
Last edited by colak (2012-04-28 15:07:02)
neme.org | neme-imca.org | hblack.net | LABS
Offline
Sorry Colak. Corrected. Re-upload
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline
… And finaly v0.6.alpha
A very experimental version where the plugin can be used as a single or a container tag.
Patrick.
Txp Tricks & Tips by french users : http://txp-fr.net | G+
@Devs : Can’t find the punched tape version of TXP and I need it!
Happy user of TXP 1.0RC1
Offline