Forum Support

Shape 5
March 29, 2024, 09:33:19 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Deprecated: Function ereg() is deprecated  (Read 495 times)
uglyfashio
Jr. Member
**
Offline Offline

Posts: 247



« on: February 23, 2011, 03:07:50 PM »

Hi all,

My host has decided to update PHP, which is fine usually, but in this case it's cause this error to occur.

Deprecated: Function ereg() is deprecated

Now for those of you with sense, I will be told to turn off error reporting at all costs.  However, I do not have access to php.ini which is what I believe I need access too. 

As I know nothing about this I have temporarily edited the mod_s5_frontpage_display2.php file and put "@" in front of the offending lines, as so:

$brr = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.
if(@ereg("msie 6", $brr)) {
$is_ie6 = "yes";
}
else {
$is_ie6 = "no";
}

And on two other lines.  Now it appears to me to be something that decides whether the browser utilises the extension in question.  My query is (a) am I right (b) will this effect my sites usability in any way.  (c) any plans on an update.
Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #1 on: February 23, 2011, 03:24:57 PM »

Hello,

Change that code to the following:

$brr = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.

$browser = "other";

if(strrpos($brr,"msie 6") > 1) {
$is_ie6 = "yes";
}
else {
$is_ie6 = "no";
}

if(strrpos($brr,"msie 7") > 1) {
$is_ie7 = "yes";
}
else {
$is_ie7 = "yes";
}
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
uglyfashio
Jr. Member
**
Offline Offline

Posts: 247



« Reply #2 on: March 08, 2011, 03:58:28 PM »

Same question for version 1.0

if(ereg("opera", $br5)) {
$is_opera = "yes";
}

Logged
mikek
Administrator
*****
Offline Offline

Posts: 28743



WWW
« Reply #3 on: March 09, 2011, 09:06:59 AM »

Hello,

The following would work for that:


$br5 = strtolower($_SERVER['HTTP_USER_AGENT']); // what browser.

$browser = "other";

if(strrpos($br5,"msie 6") > 1) {
$is_ie6 = "yes";
}
else {
$is_ie6 = "no";
}

if(strrpos($br5,"msie 7") > 1) {
$is_ie7 = "yes";
}
else {
$is_ie7 = "no";
}

if(strrpos($br5,"opera") > 1) {
$is_opera = "yes";
}
else {
$is_opera = "no";
}
Logged

Mike Knott
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
uglyfashio
Jr. Member
**
Offline Offline

Posts: 247



« Reply #4 on: April 06, 2011, 05:17:19 PM »

Sweet, cheers Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.