Not displaying background image for mobile browser - نوشته شده در (1111 Views)
Average Member
Webbo
مطلب: 982
982
Is it possible to edit this code for calling up the background image of the forum so that it does not display it if a user is viewing the forum with a mobile browser?
The code:

Code:

if strPageBGImageURL = "" then
strTmpPageBGImageURL = ""
elseif Instr(strPageBGImageURL,"/") > 0 or Instr(strPageBGImageURL,"\") > 0 then
strTmpPageBGImageURL = " background=""" & strPageBGImageURL & """" & " bgproperties=""fixed"""
else
strTmpPageBGImageURL = " background=""" & strImageUrl & strPageBGImageURL & """" & " bgproperties=""fixed"""

end if

Thanks
 پیش‌فرض مرتب‌سازی برای تاریخ DESC به معنی جدیدترین است  
 تعداد در صفحه 
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
Try this:

Code:

if strPageBGImageURL = "" then
strTmpPageBGImageURL = ""
elseif Instr(strPageBGImageURL,"/") > 0 or Instr(strPageBGImageURL,"\") > 0 then
strTmpPageBGImageURL = " background=""" & strPageBGImageURL & """" & " bgproperties=""fixed"""
else
strTmpPageBGImageURL = " background=""" & strImageUrl & strPageBGImageURL & """" & " bgproperties=""fixed"""
end if
Dim Match
Set Regex = New RegExp
With Regex
.Pattern = "(Android|Avantgo|Bada|BlackBerry|Blazer|Compal|Dolfin|Dolphin|Elaine|en-ph|Fennec|Hiptop|(hpw|web)OS|iP(hone|od|ad)|Iris|Kindle|LGE|Maemo|midp|Minimo|mmp|Mobile|NetFront|Opera M(obi|ini)|Palm|pda|Plucker|Pocket|PSP|Samsung|Silk-Accelerated|Skyfire|smartphone|symbian|Treo|up.browser|up.link|Vodafone|wap|windows ce|XDA|Xiino|Zune)"
.IgnoreCase = True
.Global = True
End With
If Regex.Test(Request.ServerVariables("HTTP_USER_AGENT")) Then
strTmpPageBGImageURL = ""
End If
نوشته شده در
Average Member
Webbo
مطلب: 982
982
Works well on Blackberry. I'll see if any users report any problems

Many thanks
نوشته شده در
Advanced Member
Carefree
مطلب: 4224
4224
You're welcome. If they experience issues, we'll need to get a look at their user agent string.
 
شما باید یک متن وارد کنید