NakedCrook
09-04-2010, 09:44 PM
Alright...I am working on a bit of code for my forum style and this is the general premis.
In my postbit legacy, I give my users the ability to display their PSN and XBL gamercards. Now...this causes a bit of lag with mobile browsers so I want the ability to not show certain images or certain things for mobile browsers to improve load times. I have a bit of code in mind to do this but I am having difficulty with it.
In my style template, I have something like this:
<if condition="$_SERVER['HTTP_USER_AGENT'] == SOMETHING">
DO STUFF
</if>
that SOMETHING is supposed to be, say for example, the mobile safari user agent. I could turn that something into 'iPhone' but I would need an equivalent to a contains comparison as opposed to an ==.does anyone know the comparator for "contains"? I want to change the == to something that represents "contains" or "string contains"
In my postbit legacy, I give my users the ability to display their PSN and XBL gamercards. Now...this causes a bit of lag with mobile browsers so I want the ability to not show certain images or certain things for mobile browsers to improve load times. I have a bit of code in mind to do this but I am having difficulty with it.
In my style template, I have something like this:
<if condition="$_SERVER['HTTP_USER_AGENT'] == SOMETHING">
DO STUFF
</if>
that SOMETHING is supposed to be, say for example, the mobile safari user agent. I could turn that something into 'iPhone' but I would need an equivalent to a contains comparison as opposed to an ==.does anyone know the comparator for "contains"? I want to change the == to something that represents "contains" or "string contains"