ChrisGooding
02-15-10, 02:33 PM
Hi Guys,
Struggling here :(
We use the simplepie feed to pull our blog articles through from our blog. This works fine, however for some reason I cannot get it working on our whmcs pages, as whenever the code is on the page, it simply breaks, producing a white screen.
The code I use on our site is....
<?php
// Make sure SimplePie is included. You may need to change this to match the location of simplepie.inc.
require_once('my/include/path/simplepie.inc');
// Initialize new feed
$feedblog = new SimplePie('https://www.xtrgameservers.com/blog/feed/');
$feedblog->handle_content_type();
$i=0;
foreach ($feedblog->get_items() as $item) {
$i++;
if($i <= 4){
echo '<span class="title"><a href="'.$item->get_permalink().'" title="'.$item->get_title().'">';
echo $item->get_title().'</a></span>';
$post = $item->get_description();
$post = html_entity_decode(substr($post, 0, 65));
$pos = strrpos($post, " ");
if ($pos>0) {
$post = substr($post, 0, $pos);
}
echo '<p>'. $post .'... </p>';
}
}
?>
I have tried this a number of ways on the template, including all of the below
Substituting <php blah blah blah ?>
for
{php} blah blah blah {/php}
I have trie dpulling it through using both...
{php} include ('path/to/file/with/code/insideit.php'){/php}
and
{include_php file="path/to/file/with/code/insideit.php"}
And not to mention every god damn path variant known to man, just to rule out issues with file location.
Any ideas....... Im starting to think its an issue with the code itself that is used to pull the feeds.
Any help greatly appreciated.
Struggling here :(
We use the simplepie feed to pull our blog articles through from our blog. This works fine, however for some reason I cannot get it working on our whmcs pages, as whenever the code is on the page, it simply breaks, producing a white screen.
The code I use on our site is....
<?php
// Make sure SimplePie is included. You may need to change this to match the location of simplepie.inc.
require_once('my/include/path/simplepie.inc');
// Initialize new feed
$feedblog = new SimplePie('https://www.xtrgameservers.com/blog/feed/');
$feedblog->handle_content_type();
$i=0;
foreach ($feedblog->get_items() as $item) {
$i++;
if($i <= 4){
echo '<span class="title"><a href="'.$item->get_permalink().'" title="'.$item->get_title().'">';
echo $item->get_title().'</a></span>';
$post = $item->get_description();
$post = html_entity_decode(substr($post, 0, 65));
$pos = strrpos($post, " ");
if ($pos>0) {
$post = substr($post, 0, $pos);
}
echo '<p>'. $post .'... </p>';
}
}
?>
I have tried this a number of ways on the template, including all of the below
Substituting <php blah blah blah ?>
for
{php} blah blah blah {/php}
I have trie dpulling it through using both...
{php} include ('path/to/file/with/code/insideit.php'){/php}
and
{include_php file="path/to/file/with/code/insideit.php"}
And not to mention every god damn path variant known to man, just to rule out issues with file location.
Any ideas....... Im starting to think its an issue with the code itself that is used to pull the feeds.
Any help greatly appreciated.