[pmwiki-users] MarkupExpressionsExtensions

christian.ridderstrom at gmail.com christian.ridderstrom at gmail.com
Mon Apr 16 04:13:18 CDT 2007


On Mon, 16 Apr 2007, Hans wrote:

>> (which is why PHP calls its variable $_SERVER).
>
> Is there a need for a {(server ...)} markup expression? Would it not be 
> more fitting to use page variables for things like the user's browser 
> name or the ip address? And then I would use terms like {$Browser} and 
> {$IPAddress}. Just a short while ago Pm gave a definition for use of 
> "browser" in conditional markup. Who would want to use {(server 
> HTTP_USER_AGENT)} as wiki markup?

Apologies for not having followed this thread and butting in.

A side note: I'm probably missing something here... but why not use 
{$HTTP_USER_AGENT}... If it's a security concern, couldn't a $Enable...=0 
clear the sensitive variables? You've probably talked about this, just 
ignore in that case.

>> By suggesting that we use the actual names, I _am_ advocating for and 
>> thinking of the non-programmers, because when a non-programmer does a 
>> Google search for things like "how do I find out the user's browser?" 
>> or "how do I find out the address a user is coming from?", that 
>> non-programmer is going to find references to HTTP_USER_AGENT and 
>> HTTP_REMOTE_ADDR and not 'browser' or 'ip'.
>
> So a user who does not read much documentation, or does not memorise it 
> very well, tries to use {(server browser)} and this does not work. so he 
> will have to look up the meaning of {(server..)}, and finds mention of 
> HTTP_USER_AGENT. Then he is supposed to "google" on that term to get 
> more information?

Adding links to good W3 pages or similar that explain HTTP_USER_AGENT is 
easier and faster for us. Writing good documentation takes a lot of time.

What the user probably wants most of all are examples of how to actually 
use it...

> To help a non-programming user it would be good to have a page variable 
> {$Browser}, which return a simple browser name, and perhaps also 
> {$BrowserVersion} to return a simple version info, good enough to do any 
> conditional switching.

I have never programmed to get different HTML for different browsers, but 
I'm not sure it's that easy to categorize the browsers in a useful way. 
Nor am I sure there are 'simple' browser names... at least when I've made 
Opera identify as different browsers there seems to be a lot to choose 
from.

So if we created our own categories of browsers (in terms of the simple 
names), I suspect it'd be quite a bit of work to create, maintain and 
document.

Best regards
/Christian

-- 
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr


More information about the pmwiki-users mailing list