Loading...
 
Skip to main content

Features / Usability


Change hostname if users uses different host

Hi,

I have a question..
I have a tikiwiki running over here. And this can be access via different urls.
For example :
http://www.one.xxQuestion
http://www.two.xxQuestion
http://www.three.xxQuestion

And all those links are poiting to the same tikiwiki installation.
Now, in my 'header' of tikiwiki I want to have the text: (for example)

'This is www.one.xxQuestion' if the user user www.one.xxQuestion
'This is www.two.xxQuestion' if the user user www.two.xxQuestion
...

Anybody who knows how I can do that, if possible?


Bart

Put this in tiki-top_bar.tpl (or wherever you want it to appear):

Copy to clipboard
This is {$smarty.server.SERVER_NAME}.

Anyway, that'll return the name of the server; I don't know what will happen in your situation.

-- Gary - themes.tw.oQuestion

> Put this in tiki-top_bar.tpl (or wherever you want it to appear):
>

>
Copy to clipboard
This is {$smarty.server.SERVER_NAME}.

> Anyway, that'll return the name of the server; I don't know what will happen in your situation.
>
> — Gary - themes.tw.oQuestion

Hi,

I already tried this before, but this doesn't work.
I think the $smarty.server.SERVER_NAME} is coming from the setting in the admin page, where you set the server name. And as you can only set 1 address, it's always giving that one.


Bart

> I already tried this before, but this doesn't work.
> I think the $smarty.server.SERVER_NAME} is coming from the setting in the admin page, where you set the server name. And as you can only set 1 address, it's always giving that one.

$smarty.server.SERVER_NAME comes from the webserver as a PHP reserved variable. (See http://smarty.php.net/manual/en/language.variables.smarty.phpQuestion and http://jp.php.net/reserved.variablesQuestion.) I imagine the admin page setting is in case the Tiki admin wants something else indicated, as PHP/Smarty/Tiki — AFAIK --are able to know the domain name as part of their environment whether the admin inputs it or not. But if you put that Smarty statement in a template and it returned only one server name no matter which URL was used, then that's the one recognized as the environment and some other way is needed.

-- Gary