* abcdef * Graham So there is no way to retrieve device information
2014-08-08 04:03 · (0)
* Graham * abcdef I have finally figured out the issue but I do not think anything can be done about it
The en-us in the browser string is causing the contents of the ( ) to be evaluated as an expression
The problem is it is being evaluated in the first line so I don't think there is a way around it
2014-08-07 22:44 (edited 2014-08-07 22:50 by Graham ) · (0)
* abcdef * Graham Chromes so I tried on the emulator but not displayed. characters inside "(" and ")" has disappeared.

var $a=<xt:browser detail="3" />
var $a=call str_replace $subject=$a;$search=iPhone;$replace=[iPhone]
var $a=call str_replace $subject=$a;$search=iPad;$replace=[iPad]
var $a=call str_replace $subject=$a;$search=Android;$replace=[Android]
var $b =call strrpos $haystack=$a;$needle=[; $offset=0
var $c =call strrpos $haystack=$a;$needle=]; $offset=0
if $c
var $d = call substr $val=$a;$start=($b+1);$length=($c-$b-1);
print $d
endif

I'll let you see the photos on your Android device / ipadmini / iphone
2014-08-07 20:04
* * *
* ipadmini.jpg · image/jpeg · 76.01KB
* iphone.jpg · image/jpeg · 78.97KB
* android.jpg · image/jpeg · 78.14KB
(edited 2014-08-07 20:06 by abcdef ) · (0)
* Graham * abcdef I have tried this on all my mobiles and on chromes emulator and I have no problems
the only change the script needs is
if $c
var $d = call substr $val=$a;$start=($b+1);$length=($c-$b-1);
print $d
endif

to allow for non iphone/ipad/android devices
2014-08-07 11:54 (edited 2014-08-07 11:57 by Graham ) · (0)
* abcdef * Graham would like to getting my names device.

var $a=<xt:browser detail="3" />
var $a=call str_replace $subject=$a;$search=iPhone;$replace=[iPhone]
var $a=call str_replace $subject=$a;$search=iPad;$replace=[iPad]
var $a=call str_replace $subject=$a;$search=Android;$replace=[Android]
var $b =call strrpos $haystack=$a;$needle=[; $offset=0
var $c =call strrpos $haystack=$a;$needle=]; $offset=0
var $d = call substr $val=$a;$start=($b+1);$length=($c-$b-1);

print $d

Copy code


on accessible via Android hay ios, the left fails Ä‘ang not active
2014-08-07 02:48 · (0)
* Graham * abcdef so what do you see if you just use <xt:browser detail="3" /> not in a xtscript
show me the actual page
2014-08-07 02:39 (edited 2014-08-07 02:43 by Graham ) · (0)
* abcdef * Graham error still accessible by the small screen, the device is disabled str_replace
2014-08-07 02:26 · (0)
* abcdef * Graham thank graham. if it helps less for me many.
2014-08-07 02:21 · (0)
* Apkk * Graham thank graham.
2014-08-07 02:20 (edited 2014-08-07 02:20 by Apkk ) · (0)
* Graham * abcdef I cannot reproduce the problem on any of my mobiles .
And as xtscript is a server based code I cannot think why there would be any difference in the output
try this
var $a=<xt:browser detail="3" />
var $b=call chr $val=59
var $a=call str_replace $subject=$a;$search=(;$replace=&#40$b
var $a=call str_replace $subject=$a;$search=);$replace=&#41$b
print $a

Copy code

the line
var $b=call chr $val=59
takes care of the semicolon
(semicolons are ignored if they are the last char on a line)
2014-08-06 23:05 (edited 2014-08-07 02:14 by Graham ) · (1)

Online: Guests: 1