Conflict with Simplepie?

8 posts by 5 authors in: Forums > CMS Builder
Last Post: August 11, 2011   (RSS)

Has anyone experienced conflicts when using CMS Builder and Simplepie on the same site?

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 Dave - April 14, 2010

Or try just turning of error reporting right before your SimplePie code with:

error_reporting(0);

Hope that helps.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Conflict with Simplepie?

Turning off the error reporting right before the SimplePie worked perfectly. Thanks!

-Dennis

Re: [dennisoneil] Conflict with Simplepie?

I am also having this issue, but turning off the error reporting before the Simplepie didn't work for me.

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

Hi,

Can you let me know what the error message was?

Hopefully this will be a clue to tracking down the issue.
Cheers,
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?

Hi Damon
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

Hi,

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/