Conflict with Simplepie?
8 posts by 5 authors in: Forums > CMS Builder
Last Post: August 11, 2011 (RSS)
For me, everything works fine when the CMSB code comes after Simplepie on the page. When it comes before Simplepie, I get errors (only on the Simplepie part) like this:
Strict Standards: Non-static method SimplePie_Misc::parse_date() should not be called statically...
When I use Simplepie (identically) on a page without any CMSB code, it also works without an issue.
Re: [dennisoneil] Conflict with Simplepie?
By Jason - April 14, 2010
Does the page display, even with the error?
I believe that this is a notice, not a fatal error. You can do a couple of things. If everything works so long as CMSB code comes first, then you can do that. The other thing would be to turn off notice errors in your php.ini file.
If you can access your php.ini file, find the line that says "error_reporting" and make sure it looks like this.
error_reporting = E_ALL & ~E_NOTICE
Let me know if that helps.
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [dennisoneil] Conflict with Simplepie?
By Dave - April 14, 2010
error_reporting(0);
Hope that helps.
interactivetools.com
Re: [Dave] Conflict with Simplepie?
-Dennis
Re: [dennisoneil] Conflict with Simplepie?
As per Dennis experience, the feed loads perfectly without CMSB coding, but as soon as I add any CMSB coding, the feed does not appear.
Can anyone please assist?
Re: [newmediachoice] Conflict with Simplepie?
By Damon - August 3, 2011
Can you let me know what the error message was?
Hopefully this will be a clue to tracking down the issue.
Damon Edis - interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Re: [Damon] Conflict with Simplepie?
Sorry for the slow response - I've been busy trying to work it out. The error message I received was:
[Wed Aug 03 19:58:31 2011] [error] [client 76.14.186.139] FastCGI: server "/var/www/fcgi/php-cgi" stderr: PHP Strict Standards: Non-static method SimplePie_Misc::normalize_url() should not be called statically, assuming $this from incompatible context in /home/web01/m/mywayrooftents.co.uk/user/htdocs/inc/simplepie.inc on line 9287
I appears that there is a conflict between simple pie and CMSB coding because I managed to solve it by calling the simplepie before the CMSB code, thus:
<?php
error_reporting(0);
include_once $_SERVER['DOCUMENT_ROOT'] . '/inc/simplepie.inc';
$feed = new SimplePie('http://mywayrooftents.wordpress.com/feed/');
$feed_items = array();
foreach ($feed->get_items(0, 3) as $item):
$m_date = $item->get_date('M');
$j_date = $item->get_date('j');
$item_title = $item->get_title();
$permalink = $item->get_permalink();
$feed_item = array(
"m_date" => $m_date,
"j_date" => $j_date,
"item_title" => $item_title,
"permalink" => $permalink
);
$feed_items[] = $feed_item;
endforeach;
?>
I then made reference to the simplepie in the body of the page thus:
<?php
$first = True;
foreach ($feed_items as $item):
if ($first) {
$first = False;
} else {
echo '<hr />';
}
?>
<div class="span-2 newsdate white center uppercase last">
<strong>
<?= $item["m_date"]; ?><br />
<?= $item["j_date"]; ?>
</strong>
</div>
<div class="span-6 last">
<span class="uppercase"><strong><?= $item["item_title"]; ?></strong></span><br />
<a href="<?= $item["permalink"]; ?>" class="red"><strong>... read article</strong></a>
</div>
<?php endforeach; ?>
I thought it would be useful to post the workaround in case it helps anyone else with the same problem. Everything is working perfectly now :).
Re: [newmediachoice] Conflict with Simplepie?
By Jason - August 11, 2011
Thanks for posting your solution. Glad to hear everything is working out now.
Let us know if you run into any other problems
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/