Shape 5

Joomla Club Extensions => Frontpage Display Version 2 - Club => : uglyfashio February 23, 2011, 03:07:50 PM



: Deprecated: Function ereg() is deprecated
: uglyfashio 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.


: Re: Deprecated: Function ereg() is deprecated
: mikek 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";
}


: Re: Deprecated: Function ereg() is deprecated
: uglyfashio March 08, 2011, 03:58:28 PM
Same question for version 1.0

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



: Re: Deprecated: Function ereg() is deprecated
: mikek 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";
}


: Re: Deprecated: Function ereg() is deprecated
: uglyfashio April 06, 2011, 05:17:19 PM
Sweet, cheers :)