Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Browser Check



******    message to minivend-users from jojo@buchonline.net     ******

On 22 May, Thomas Hecker wrote:
> ******    message to minivend-users from "Thomas Hecker" <thomas.hecker@x9media.com>     ******
> 
> Hi List!
> I'm really sorry to bug you with those beginner questions, but I'm not very
> firm with Perl, so I hope that you can help me.
> I want to check the user's browser, to return conditionally based
> stylesheets.
> 
> I've used this function:
> 
> <LINK REL="stylesheet" TYPE="text/css"
> HREF="http://tradecontact.x9media.com/images/[if explicit]
>                      [condition]
>                      $ms = 'MSIE';
>                      $browser = '[data session browser]';
                                    ^^^^^^^^^^^^^^^^^^^^^^
>                      $pos = index($browser, $ms);
>                      return 1 if  $pos > -1;
>                      return 0;
>                      [/condition]
>                      [then]
>                      styles.css
>                      [/then]
>                      [else]
>                      nnstyles.css
>                      [/else]
>                      [/if]">
> 
> The problem is, that it doesent work. Minivend always returns nnstyles.css .
> I think it's because the browser string in the session database contains
> some semi-colons, so the the initialization of the $browser -variable stops
> when the first semi-colon is encountered.
> When I initialize $browser with something else like "testtestMSIE" the
> function works fine.
> 
> Can anyone help me with that Problem.

This will not work! I use 

[if session browser =~ /MSIE/]
special css stuff for MSIE
[else]
special css stuff other browser
[/else]
[/if]

Regards,

	Joachim

-- 
Hans-Joachim Leidinger
buch online                 jojo@buchonline.net
Munscheidstr. 14            FAX: +49 209 1671449
45886 Gelsenkirchen         FAX: 0209 1671449

-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: