Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
This is a great plugin!
I have a client who is certain that having seven domain names will solve all of her problems. So I’m wondering if there is there an easy way to compare multiple domains.
Something along the lines of:
<txp:ied_if_domain domain="www.url1.com" domain="www.url2.com" domain="www.url3.com">
Print this
<txp:else />
Print this one instead
</txp:ied_if_domain />
I tried this and thought it was working, but it doesn’t seem to be. I feel like I’m missing something obvious here…
Last edited by visualpeople (2007-03-21 01:26:24)
Offline
#32 2007-11-27 00:52:14
- AlexStacey
- Member
- Registered: 2007-11-09
- Posts: 22
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
nice plugin! thank you kindly =]
Offline
#33 2007-11-27 01:15:17
- AlexStacey
- Member
- Registered: 2007-11-09
- Posts: 22
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
now i’ve just got to work out how to fix the rss links for the other domain =]
Offline
#34 2007-11-27 02:53:31
- AlexStacey
- Member
- Registered: 2007-11-09
- Posts: 22
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
I have two subdomains both pointing to the same installation but I want them to display different content. This plugin works perfectly for this except that the The RSS / Atom links were showing the default domain for textpattern on both of the subdomains and I want them to each show their respective sections (with the right subdomain) This is far from elegant but it seems to be working ok and it might help someone. I botched these two lines into lib/txplib_db.php in the get_prefs() function…
note: change subdomain for your subdomain and mysite.com for your domain
function get_prefs()
{
$r = safe_rows_start('name, val', 'txp_prefs', 'prefs_id=1');
if ($r) {
while ($a = nextRow($r)) {
$out[$a['name']] = $a['val'];
}
// subdomain hack*****************************
$sd = 'subdomain';
if ( $sd == substr($_SERVER['SERVER_NAME'], 0, strlen($sd)) )
$out['siteurl'] = $sd . '.mysite.com';
// end hack***********************************
return $out;
}
return false;
}
Offline
#35 2008-09-09 12:41:07
- mikkeX
- Archived Plugin Author
- Registered: 2004-02-26
- Posts: 74
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Great plugin.
How do you hack so the comments permlink work as on it is on the subdomain?
Offline
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
I’m trying to use sections to differentiate my different sub-domains.
So let’s say I have 3 sub-domains (each have different names)- mysite.com
- example.com
- sitename.com
I would then create 3 sections with the exact same names
- mysite.com
- example.com
- sitename.com
Now for my question:
Is there a way to detect the current sub-domain and populate the section="" attribute of article_custom?
Example:
<txp:article_custom form="articles" section="$current-sub-domain.com" />
—
Tom
Last edited by renobird (2009-02-24 18:16:50)
Offline
#37 2009-03-31 17:26:50
- brunodario
- Member

- From: Belo Horizonte, Brasil
- Registered: 2007-09-19
- Posts: 75
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Download page isn´t working at all: http://inspired.kiev.ua/txp/ied_if_domain
Returns: Fatal error: Call to undefined function xml_parser_create() in /home/yura/data/valid.org.ua/subdomains/inspired.valid.org.ua/app/webroot/textpattern/lib/IXRClass.php on line 147
Where can i get the plugin?
Offline
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
TXP Builders – finely-crafted code, design and txp
Offline
#39 2009-03-31 20:34:24
- brunodario
- Member

- From: Belo Horizonte, Brasil
- Registered: 2007-09-19
- Posts: 75
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
jakob wrote:
Hi Bruno,
Where can i get the plugin?
His site seems to be down. Is google down for you too? ;-)
4th entry: http://inspired.kiev.ua/files/ied_if_domain.txt
Allright Jakob,
Thx for pointing that to me and sorry for that lazy behavior, you have a point.
Offline
#40 2009-04-07 19:24:18
- utamu
- Member
- From: upstate NY, USA
- Registered: 2006-12-05
- Posts: 20
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Amazingly useful plug-in!! Seriously…
Offline
#41 2009-04-08 00:38:04
- makss
- Plugin Author
- From: Ukraine
- Registered: 2008-10-21
- Posts: 355
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
renobird wrote:
Is there a way to detect the current sub-domain and populate the
section=""attribute ofarticle_custom?
Example:
<txp:article_custom form="articles" section="$current-sub-domain.com" />
Try it:
<txp:asy_wondertag> <txp:article_custom form="articles" section="<txp:aks_evar avar='SERVER_NAME' regexp="/^www\./i" to="" />" /> </txp:asy_wondertag>
aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)
Offline
#42 2009-04-22 22:40:44
- lehan
- Member
- Registered: 2008-12-17
- Posts: 24
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Getting the following error when loading my subdomain:
bq.
Warning: include(/var/www/html/blog/textpattern/lib/constants.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/blog/index.php on line 24
Warning: include() [function.include]: Failed opening ‘/var/www/html/blog/textpattern/lib/constants.php’ for inclusion (include_path=’.:/php/includes:/usr/share/php’) in /var/www/html/blog/index.php on line 24
Warning: include(/var/www/html/blog/textpattern/lib/txplib_misc.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/blog/index.php on line 25
Warning: include() [function.include]: Failed opening ‘/var/www/html/blog/textpattern/lib/txplib_misc.php’ for inclusion (include_path=’.:/php/includes:/usr/share/php’) in /var/www/html/blog/index.php on line 25
Warning: include(/var/www/html/blog/textpattern/publish.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/blog/index.php on line 32
Warning: include() [function.include]: Failed opening ‘/var/www/html/blog/textpattern/publish.php’ for inclusion (include_path=’.:/php/includes:/usr/share/php’) in /var/www/html/blog/index.php on line 32
Fatal error: Call to undefined function textpattern() in /var/www/html/blog/index.php on line 33
main site: www.lehan.ca
subdomain: blog.lehan.ca
Thanks!
Offline
#43 2009-04-23 16:29:58
- lehan
- Member
- Registered: 2008-12-17
- Posts: 24
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
it looks like the index.php file is looking for constants.php, txplib_misc.php, and publish.php in the subdomain, when it should be looking in the main textpattern directory.
Can I point it to the correct directory?
Offline
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Hi,
I have this working to some degree on a subdomain. If I go to: m.domain.com I can see all the content ok and so forth.
However my main issue at the moment is the permlinks. Article links just go to the main site.
http://forum.textpattern.com/viewtopic.php?pid=123323#p123323
Is there a simple solution to this? Can I customise the permlink for a subdomain? Am I going mad?
Offline
#45 2010-11-11 15:49:39
- Tarokun
- New Member
- Registered: 2010-11-04
- Posts: 3
Re: [plugin] [ORPHAN] ied_if_domain - manage multiple domains with only one TXP
Hello
May I reiterate this question please? I’ve been trying to read up about this but I just can’t figure out how to use the solution posted previously.
smdnetau wrote:
Hi,
I have this working to some degree on a subdomain. If I go to: m.domain.com I can see all the content ok and so forth.
However my main issue at the moment is the permlinks. Article links just go to the main site.
http://forum.textpattern.com/viewtopic.php?pid=123323#p123323
Is there a simple solution to this? Can I customise the permlink for a subdomain? Am I going mad?
Offline