Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

how to install / reference Simplepie.php

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

how to install / reference Simplepie.php

Postby swmagic999 » Mon Nov 12, 2012 8:05 am

We've taken an old site (pre-3 WP) and upgraded to 3.4.2. But we are getting an error on a page:
Code: Select all
Warning: array_slice() expects parameter 1 to be array, null given in /home/content/k/p/w/kpw2006/html/4/wp-content/themes/calhousing/template-rss.php on line 51

Warning: array_reverse() [function.array-reverse]: The argument should be an array in /home/content/k/p/w/kpw2006/html/4/wp-content/themes/calhousing/template-rss.php on line 52

Warning: Invalid argument supplied for foreach() in /home/content/k/p/w/kpw2006/html/4/wp-content/themes/calhousing/template-rss.php on line 54


I installed WP-Debug, et.al. to discover that template-rss.php has been deprecated as of WP 3 and it recommends using Simplepie.php.

Message in WP-Debug "Use wp-includes/class-simplepie.php instead.
Deprecated in version 3.0."

How do I fix WP to reference that?

Paul
swmagic999
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Jul 30, 2012 12:10 pm

Re: how to install / reference Simplepie.php

Postby seandisanti » Tue Nov 13, 2012 9:39 am

have you looked at the file "class-simplepie.php" in the /wp-includes/ folder?

I'm not familiar with it myself, but it sounds like it has the functionality you seek. i would explore the file to get function names etc and once you've found what you're looking for, go to appearance>editor>header.php and add a require() or include() for the file and update your function calls to the new function names
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: how to install / reference Simplepie.php

Postby swmagic999 » Wed Nov 14, 2012 10:54 am

OK, this is a good first pass idea.

Now, I've noted that there's 477 functions. How do I discover which ones I need?
swmagic999
New php-forum User
New php-forum User
 
Posts: 3
Joined: Mon Jul 30, 2012 12:10 pm

Re: how to install / reference Simplepie.php

Postby seandisanti » Wed Nov 14, 2012 11:09 am

step one is identifying the deprecated functions that you were trying to use initially. Then identify what they do, hopefully the function names will be descriptive enough to remove a lot of the guesswork there. then browse through the code or documentation for the class-simplepie.php for functions with similar names. in the event that function names in one or both files are less than helpful, you can write up signatures for the deprecated functions; name, input parameters, return value and type. then go through simplepie looking for similar signature. Or you could just google for documentation, but I assumed you had already done
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron