• 0
Sign in to follow this  
ShadzeB

Depreciation Error

Question

Hi Guys,

 

I purchased the DFG-BF3-v3 theme on the site a couple of month ago and wondered if you can 

help me with an error I am getting with the theme I have upgraded my site to PHP version 5.4 but I

am getting 1 error with the theme which is:

 

[16-May-2014 16:55:51 America/New_York] PHP Deprecated: Function ereg_replace() is deprecated in /home/kazroeb/public_html/themes/DFG-BF3-v3/theme.php on line 223

 

That line contains this code:

 

$title2 = ereg_replace("_", " ", "<b>$title</b>");

 

Could someone let me know what I need to do with this line to make the error go away please.

 

Thanks 

 

 

Shadz

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0

ShadzeB,

 

If you can, would you mind posting your solution for any future visitors with this problem?

 

 ~ Eddie

Share this post


Link to post
Share on other sites
  • 0

Bahh, I hate it when people use regular expression functions in php for basic string replaces.  It is so inefficient.

 

That line is a simple fix.  Just change

$title2 = ereg_replace("_", " ", "<b>$title</b>");

 with 

$title2 = str_replace("_", " ", "<b>$title</b>");

Share this post


Link to post
Share on other sites
  • 0
Guest

 

Bahh, I hate it when people use regular expression functions in php for basic string replaces.  It is so inefficient.

 

That line is a simple fix.  Just change

$title2 = ereg_replace("_", " ", "<b>$title</b>");

 with 

$title2 = str_replace("_", " ", "<b>$title</b>");

Gosh Meis ... I like it when you talk like that!!

Share this post


Link to post
Share on other sites
  • 0

This error in particular just really annoys me, as I have had to fix it around 1.6 billion times in Joomla at work.

 

I am not the biggest fan of this current trend of "just develop it, don't worry about how much processing it takes because everyone has super-powerful computers now anyway".  The guys that do this usually don't realize that people run more than one program on their computer at a time, and if they all do this it just makes everything run really slowly.  Learn to code efficiently, make it instinctive, and it doesn't take any more time to create stuff than doing it the inefficient way, but it runs way better.

Share this post


Link to post
Share on other sites
  • 0
Guest

The person who did the coding for that theme actually considers himself as the official guru of code and he feels the same as you do when it comes to coding. 

 

He simply doesn't like messy code. 

 

Now, I'm wondering ... could it be that all the coders have their own way of using the language and manipulating the code in such a way that only they can make the edits?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this