Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

simplepie-support · SimplePie Support

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 1485
  • Category: Open Source
  • Founded: Jan 31, 2008
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Messages

Advanced
Messages Help
Messages 4192 - 4224 of 5877   Oldest  |  < Older  |  Newer >  |  Newest
Messages: Show Message Summaries Sort by Date ^  
#4192 From: "zach21uk" <zach21uk@...>
Date: Sat Aug 1, 2009 11:45 am
Subject: [SimplePie] Re: Styling on Character Limit
zach21uk
Send Email Send Email
 
I just want to elaborate further to avoid confusion:

This is my code: http://pastie.org/566854

I am using this function:
http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions - - - to
limit the number of characters that my RSS Feed Displays, however, the function
strips out "Smart" Punctuation and Replaces it with a single space in this
string:

     // Convert 'smart' punctuation to 'dumb' punctuation, strip the HTML tags,
     // and convert all tabs and line-break characters to single spaces.
     $short_desc = trim(str_replace(array("\r","\n", "\t"), ' ',
strip_tags($string)));


I would like to keep the character limit, but stop the function from stripping
out the line-breaks and new-lines, because its causing the content to display
all on one line, ignoring any new lines that should be there.

I tried modifying the function myself, but my understanding of PHP isnt great
and it caused an error, so I am hoping someone here knows how to modify it so it
leaves the line-breaks/new-lines, in there, but still limits the charcters.

Thanks
Zach

--- In simplepie-support@yahoogroups.com, "zach21uk" <zach21uk@...> wrote:
>
> I understand what you are saying but not how to implement it:
>
> Here is my code as it stands right now:
>
> http://pastie.org/566854
>
> Where would I amend to include that, so that the lines are not stripped out of
the code?
>
> Thanks
>
> --- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@>
wrote:
> >
> > You have to use a linebreak character.
> >
> > echo 'This is my first line' . "\n" . 'This is my second line.'
> >
> > Notice the difference between single and double quotes. Control
> > characters like this need to be double quoted.
> >
> >
> > On 7/31/2009 1:06 AM, zach21uk wrote:
> > > Can Anyone help with this last issue? pleasseee?!
> > >
> > > In simplepie-support@yahoogroups.com, "zach21uk"<zach21uk@>  wrote:
> > >
> > >> Thats Perfect. The styling is there now. Just one more question
however.....
> > >>
> > >> http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
> > >>
> > >> All of the text is displaying on one line now, ignoring any new lines. 
How can I amend the script to leave new lines in there?
> > >>
> > >> --- In simplepie-support@yahoogroups.com, Ryan Parman<simplepie.support@>
wrote:
> > >>
> > >>> This should resolve your issue: http://pastie.org/565358
> > >>>
> > >>> If it helps, here is a collection of tutorials called "PHP for the
> > >>> absolute beginner." http://devzone.zend.com/node/view/id/627
> > >>>
> > >>> The first tutorial in the list, "Down the rabbit hole," goes over the
> > >>> dot operator and the basics of string concatenation.
http://devzone.zend.com/node/view/id/625
> > >>>
> > >>> Hope this helps! :)
> > >>>
> > >>> --
> > >>> Ryan Parman
> > >>> <http://ryanparman.com>
> > >>>
> > >>> Please don't email/IM me directly. That's why we have a mailing list. ;)
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Jul 30, 2009, at 6:46 AM, zach21uk wrote:
> > >>>
> > >>>
> > >>>> Yes I have tried it as stated in that article.
> > >>>>
> > >>>> When I try to use the code you provided below, no content is
> > >>>> displayed at all.  Its just empty.
> > >>>>
> > >>>>
> > >>>>
> > >>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
> > >>>> <bernhardbuhl@>  wrote:
> > >>>>
> > >>>>> Ah now I see I googled it. Did you took this from here?
> > >>>>> http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
> > >>>>>
> > >>>>> Did you setup the function shorten as it stands above?
> > >>>>> And if then try
> > >>>>>
> > >>>>> echo "<div class='newscontent'>";
> > >>>>> shorten($item->get_content(), 150);
> > >>>>> echo "</div>";
> > >>>>>
> > >>>>> --- In simplepie-support@yahoogroups.com, "zach21uk"<zach21uk@>
> > >>>>> wrote:
> > >>>>>
> > >>>>>> When I try to put it around the code, it either causes an error,
> > >>>>>> or the styling does not take effect.
> > >>>>>>
> > >>>>>> This Causes an Error:
> > >>>>>>
> > >>>>>> echo '<div class="newscontent">'; shorten($item->get_content(),
> > >>>>>> 150)'</div>';
> > >>>>>>
> > >>>>>> Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
> > >>>>>> in /home/hailingf/public_html/HF2009/includes/ourtopstory.php on
> > >>>>>> line 52
> > >>>>>>
> > >>>>>>
> > >>>>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
> > >>>>>> <bernhardbuhl@>  wrote:
> > >>>>>>
> > >>>>>>> Don`t understand you really...why can't you put that around that
> > >>>>>>> code?
> > >>>>>>>
> > >>>>>>> like
> > >>>>>>> echo "<div class='headlines'>";
> > >>>>>>>
> > >>>>>>> <pseudocode>the code which ever you choose to take</pseudocode>
> > >>>>>>>
> > >>>>>>> echo "</div>";
> > >>>>>>>
> > >>>>>>> But maybe I get you wrong sorry for that my language skills are bad
> > >>>>>>> kind regards
> > >>>>>>>
> > >>>>>>> --- In simplepie-support@yahoogroups.com, "zach21uk"<zach21uk@>
> > >>>>>>> wrote:
> > >>>>>>>
> > >>>>>>>> That dosent really help me with the styling issue.
> > >>>>>>>>
> > >>>>>>>> I want to apply my "<div class="headlines"></div>" to the
> > >>>>>>>> content string, as I had it before.
> > >>>>>>>>
> > >>>>>>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
> > >>>>>>>> <bernhardbuhl@>  wrote:
> > >>>>>>>>
> > >>>>>>>>> I'm using a bit different code, so maybe you want to try this
> > >>>>>>>>> out:
> > >>>>>>>>>
> > >>>>>>>>> $str = $item->get_content();
> > >>>>>>>>>
> > >>>>>>>>> function truncateString($str, $max, $rep = '...') {
> > >>>>>>>>>   if(strlen($str)>  $max) {
> > >>>>>>>>>     $leave = $max - strlen($rep);
> > >>>>>>>>>     return substr_replace($str, $rep, $leave);
> > >>>>>>>>>   } else {
> > >>>>>>>>>     return $str;
> > >>>>>>>>>   }
> > >>>>>>>>> }
> > >>>>>>>>>
> > >>>>>>>>> echo truncateString($str, 10);
> > >>>>>>>>>
> > >>>>>>>>> 10 means at the end the numbers of characters which shall be
> > >>>>>>>>> displayed inclusive the "..." to show your members that there
> > >>>>>>>>> normally is more to read.
> > >>>>>>>>>
> > >>>>>>>>> Well at least there is just more then one way and not usual to
> > >>>>>>>>> make a function of it. Another way would be:
> > >>>>>>>>>
> > >>>>>>>>> $content = strlen($item->get_content());
> > >>>>>>>>>
> > >>>>>>>>> if ($content>  23) // How long should the content be
> > >>>>>>>>>   {
> > >>>>>>>>>    echo substr($item->get_content(),0,23); // Don't forget to
> > >>>>>>>>> adjust the numbers of characters should be shown here too.
> > >>>>>>>>>   }
> > >>>>>>>>>
> > >>>>>>>>> else
> > >>>>>>>>> {
> > >>>>>>>>>   echo $item->get_content();
> > >>>>>>>>> }
> > >>>>>>>>>
> > >>>>>>>>> kind regards
> > >>>>>>>>>
> > >>>>>>>>> --- In simplepie-support@yahoogroups.com, "zach21uk"
> > >>>>>>>>> <zach21uk@>  wrote:
> > >>>>>>>>>
> > >>>>>>>>>> Hi There.  Just a quicky.....
> > >>>>>>>>>>
> > >>>>>>>>>> I have just used this code which I found in another support
> > >>>>>>>>>> post, to limit my content:
> > >>>>>>>>>>
> > >>>>>>>>>> echo shorten($item->get_content(), 150);
> > >>>>>>>>>>
> > >>>>>>>>>> This was my existing code:
> > >>>>>>>>>>
> > >>>>>>>>>> echo '<div class="newscontent">'  . $item->get_content() . '</
> > >>>>>>>>>> div>';
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>>>>>>> How can I apply my styling to the shortend version?  I have
> > >>>>>>>>>> tried a couple of things but I get an error.
> > >>>>>>>>>>
> > >>>>>>>>>> Thanks
> > >>>>>>>>>> Zach
> > >>>>>>>>>>
> > >>>>>>>>>>
> > >>>>
> > >>>>
> > >>>> ------------------------------------
> > >>>>
> > >>>> Yahoo! Groups Links
> > >>>>
> > >>>>
> > >>>>
> > >>>>
> > >
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> >
>

#4193 From: "Chaunce" <foo@...>
Date: Sun Aug 2, 2009 5:14 am
Subject: Pull "url" from "enclosure"
chauncerodri...
Send Email Send Email
 
Hello Everyone,

I'm trying to pull the url from the following line in my rss feed:

<enclosure length="28892490" type="application/x-shockwave-flash"
url="http://vimeo.com/moogaloop.swf?clip_id=5418168" />

I have tried this but it's not working:

<?php
include_once 'includes/simplepie.inc.php';
$feed = new SimplePie('http://vimeo.com/channels/campbell/videos/rss');
?>

<h1>Latest post from <?php print $feed->get_title(); ?></h1>
<?php $item = $feed->get_item();
$enclosure = $item->get_enclosure();
?>
<a href="<?php print $enclosure->get_url(); ?>"><h2><?php print
$item->get_title(); ?></h2></a>
<?php print $item->get_description(); ?>

Could anyone give me a suggestion on what I'm doing wrong? I'm getting this
error:

Fatal error: Call to undefined method SimplePie_Enclosure::get_url() in
/home/.backstitching/charley/foochuck.com/vimeo.php on line 20

Thanks

Foochuck

#4194 From: Ryan Parman <simplepie.support@...>
Date: Sun Aug 2, 2009 5:21 am
Subject: Re: [SimplePie] Pull "url" from "enclosure"
skyzyxufks
Send Email Send Email
 
See http://twitter.com/SimplePie/status/3082329730

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Aug 1, 2009, at 10:14 PM, Chaunce wrote:

> Hello Everyone,
>
> I'm trying to pull the url from the following line in my rss feed:
>
> <enclosure length="28892490" type="application/x-shockwave-flash"
> url="http://vimeo.com/moogaloop.swf?clip_id=5418168" />
>
> I have tried this but it's not working:
>
> <?php
> include_once 'includes/simplepie.inc.php';
> $feed = new SimplePie('http://vimeo.com/channels/campbell/videos/
> rss');
> ?>
>
> <h1>Latest post from <?php print $feed->get_title(); ?></h1>
> <?php $item = $feed->get_item();
> $enclosure = $item->get_enclosure();
> ?>
> <a href="<?php print $enclosure->get_url(); ?>"><h2><?php print
> $item->get_title(); ?></h2></a>
> <?php print $item->get_description(); ?>
>
> Could anyone give me a suggestion on what I'm doing wrong? I'm
> getting this error:
>
> Fatal error: Call to undefined method SimplePie_Enclosure::get_url()
> in /home/.backstitching/charley/foochuck.com/vimeo.php on line 20
>
> Thanks
>
> Foochuck
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4195 From: "kizkoool" <kizkoool@...>
Date: Mon Aug 3, 2009 9:01 am
Subject: [SimplePie 1.2] critical bug on PHP5 ?
kizkoool
Send Email Send Email
 
Hi,


I've played a bit with SimplePie 1.2 and I stumbled upon a bug so critical
that's quite unbelievable.


Here is the simple php code I used:

<?php
require('application/libraries/Simplepie.php');

$feed = new SimplePie();

$feed->set_feed_url('http://www.lemonde.fr');

$feed->enable_order_by_date(false);
$feed->enable_cache(false);

$feed->init();

if($feed->data){
	 foreach($feed->get_items() as $item) {
		 echo "<div>";
		 echo $item->get_title();
		 echo "</div>";
	 }
} else echo $feed->error;
?>


If I execute the script on a PHP4 server, it renders correctly the news titles
from the website: http://www.lemonde.fr

But, if I execute the exact same php code on a PHP5 server, it renders this:
A feed could not be found at http://www.lemonde.fr


Could you confirm this bug with SimplePie 1.2 and PHP5 ? Or is there something
I'm missing ?


Thanks,
Philippe L.

#4196 From: Ryan Parman <simplepie.support@...>
Date: Mon Aug 3, 2009 3:09 pm
Subject: Re: [SimplePie] [SimplePie 1.2] critical bug on PHP5 ?
skyzyxufks
Send Email Send Email
 
Try setting $feed->force_feed(true). http://ref.simplepie.org/force_feed

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Aug 3, 2009, at 2:01 AM, kizkoool wrote:

> Hi,
>
>
> I've played a bit with SimplePie 1.2 and I stumbled upon a bug so
> critical that's quite unbelievable.
>
>
> Here is the simple php code I used:
>
> <?php
> require('application/libraries/Simplepie.php');
>
> $feed = new SimplePie();
>
> $feed->set_feed_url('http://www.lemonde.fr');
>
> $feed->enable_order_by_date(false);
> $feed->enable_cache(false);
>
> $feed->init();
>
> if($feed->data){
>  foreach($feed->get_items() as $item) {
> 	 echo "<div>";
> 	 echo $item->get_title();
> 	 echo "</div>";
>  }
> } else echo $feed->error;
> ?>
>
>
> If I execute the script on a PHP4 server, it renders correctly the
> news titles from the website: http://www.lemonde.fr
>
> But, if I execute the exact same php code on a PHP5 server, it
> renders this:
> A feed could not be found at http://www.lemonde.fr
>
>
> Could you confirm this bug with SimplePie 1.2 and PHP5 ? Or is there
> something I'm missing ?
>
>
> Thanks,
> Philippe L.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4197 From: "kizkoool" <kizkoool@...>
Date: Mon Aug 3, 2009 4:20 pm
Subject: Re: [SimplePie] [SimplePie 1.2] critical bug on PHP5 ?
kizkoool
Send Email Send Email
 
Ok, I just tried using $feed->force_feed(true) on my previous example.

I have the same output both on PHP4 and on PHP5:
XML error: syntax error at line 3, column 45

That's a strange error message because as you can see the feed
http://www.lemonde.fr/rss/une.xml is only 2 lines long.

And that doesn't explain why without $feed->force_feed(true), simplepie shows
different a different behaviour running nicely on PHP4 but not founding the
feeds of www.lemonde.fr when run on PHP5.


Regards,
Philippe L.


--- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@...>
wrote:
>
> Try setting $feed->force_feed(true). http://ref.simplepie.org/force_feed
>
> --
> Ryan Parman
> <http://ryanparman.com>
>
> Please don't email/IM me directly. That's why we have a mailing list. ;)
>
>
>
>
>
>
> On Aug 3, 2009, at 2:01 AM, kizkoool wrote:
>
> > Hi,
> >
> >
> > I've played a bit with SimplePie 1.2 and I stumbled upon a bug so
> > critical that's quite unbelievable.
> >
> >
> > Here is the simple php code I used:
> >
> > <?php
> > require('application/libraries/Simplepie.php');
> >
> > $feed = new SimplePie();
> >
> > $feed->set_feed_url('http://www.lemonde.fr');
> >
> > $feed->enable_order_by_date(false);
> > $feed->enable_cache(false);
> >
> > $feed->init();
> >
> > if($feed->data){
> >  foreach($feed->get_items() as $item) {
> > 	 echo "<div>";
> > 	 echo $item->get_title();
> > 	 echo "</div>";
> >  }
> > } else echo $feed->error;
> > ?>
> >
> >
> > If I execute the script on a PHP4 server, it renders correctly the
> > news titles from the website: http://www.lemonde.fr
> >
> > But, if I execute the exact same php code on a PHP5 server, it
> > renders this:
> > A feed could not be found at http://www.lemonde.fr
> >
> >
> > Could you confirm this bug with SimplePie 1.2 and PHP5 ? Or is there
> > something I'm missing ?
> >
> >
> > Thanks,
> > Philippe L.
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>

#4198 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 3:15 pm
Subject: Re: [SimplePie] [SimplePie 1.2] critical bug on PHP5 ?
skyzyxufks
Send Email Send Email
 
It could potentially be any number of things.

* Which version of PHP 4/5 are you running?
* Which version of libxml2 is installed in your system?
* Do you have iconv & mbstring installed?
* What version of PCRE support is compiled in?

And the feed being 2 lines long doesn't mean anything -- especially
since that second line is the entire feed.

It's important to understand that RSS, Atom, and feed handling in
general is really, really dirty work. MOST feeds aren't even valid
XML, and server headers, mime types, and character encodings all play
a part as well.

If you can put together a very specific test case for us and file a
bug, then we can make sure we get this fixed. Personally, I'm not
having this issue at all -- which tells me that there's a problem with
one of the variables: SimplePie, the feed, or a component of your
system.

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Aug 3, 2009, at 9:20 AM, kizkoool wrote:

> Ok, I just tried using $feed->force_feed(true) on my previous example.
>
> I have the same output both on PHP4 and on PHP5:
> XML error: syntax error at line 3, column 45
>
> That's a strange error message because as you can see the feed
http://www.lemonde.fr/rss/une.xml
>  is only 2 lines long.
>
> And that doesn't explain why without $feed->force_feed(true),
> simplepie shows different a different behaviour running nicely on
> PHP4 but not founding the feeds of www.lemonde.fr when run on PHP5.
>
>
> Regards,
> Philippe L.
>
>
> --- In simplepie-support@yahoogroups.com, Ryan Parman
> <simplepie.support@...> wrote:
>>
>> Try setting $feed->force_feed(true). http://ref.simplepie.org/force_feed
>>
>> --
>> Ryan Parman
>> <http://ryanparman.com>
>>
>> Please don't email/IM me directly. That's why we have a mailing
>> list. ;)
>>
>>
>>
>>
>>
>>
>> On Aug 3, 2009, at 2:01 AM, kizkoool wrote:
>>
>>> Hi,
>>>
>>>
>>> I've played a bit with SimplePie 1.2 and I stumbled upon a bug so
>>> critical that's quite unbelievable.
>>>
>>>
>>> Here is the simple php code I used:
>>>
>>> <?php
>>> require('application/libraries/Simplepie.php');
>>>
>>> $feed = new SimplePie();
>>>
>>> $feed->set_feed_url('http://www.lemonde.fr');
>>>
>>> $feed->enable_order_by_date(false);
>>> $feed->enable_cache(false);
>>>
>>> $feed->init();
>>>
>>> if($feed->data){
>>>  foreach($feed->get_items() as $item) {
>>> 	 echo "<div>";
>>> 	 echo $item->get_title();
>>> 	 echo "</div>";
>>>  }
>>> } else echo $feed->error;
>>> ?>
>>>
>>>
>>> If I execute the script on a PHP4 server, it renders correctly the
>>> news titles from the website: http://www.lemonde.fr
>>>
>>> But, if I execute the exact same php code on a PHP5 server, it
>>> renders this:
>>> A feed could not be found at http://www.lemonde.fr
>>>
>>>
>>> Could you confirm this bug with SimplePie 1.2 and PHP5 ? Or is there
>>> something I'm missing ?
>>>
>>>
>>> Thanks,
>>> Philippe L.
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4199 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 3:18 pm
Subject: Re: [SimplePie] Re: Curl errors 6 and 28 only in some feeds
skyzyxufks
Send Email Send Email
 
Well, this is a cURL-specific error. It could be that the remote
servers are slow, or perhaps there's a problem with the network
between your server and the remote servers. It might also be an issue
with the version of cURL on your system.

Another option is to force SimplePie to use fsockopen() instead.
http://ref.simplepie.org/force_fsockopen

If it's a cURL-only issue, then this should work. If it's a network or
remote server issue, this won't help either.

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Jul 31, 2009, at 5:31 AM, Dave wrote:

> yeh I'm getting this too - maddening!
> have tried inserting the line of code
> $feed->force_fsockopen(true);
>
> but that doesn't work - and the fix you tried (lengthening the time-
> out)
>
> no joy
>
> I have tried upgrading from PHP4.x to PHP5.2 but that makes no
> difference
>
> this works:
> http://news.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml
> http://news.google.com/?output=atom
> http://www.gumtree.com/london/206.xml
>
> these don't:
> http://feeds.guardian.co.uk/theguardian/society/rss
> http://simplepie.org/blog/feed
> http://pipes.yahoo.com/pipes/pipe.run?_id=ZrCipTB83hGC8FQOyFTjqg&_render=rss
> (and a whole load more)
>
> cURL error 28: connect() timed out!
> cURL error 7: couldn't connect to host
>
> Any suggestions as to why some feeds work and not others welcome.
>
> It's driving me nuts!
>
> David
>
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4200 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 3:22 pm
Subject: Re: [SimplePie] Re: Styling on Character Limit
skyzyxufks
Send Email Send Email
 
It's the strip_tags() function. The problem is that this function
counts the number of characters to truncate to. HTML is counted in
those characters. We remove the HTML so that we can get an accurate
character count. This is why everything is on a single line -- there
is no HTML to break it all apart.

If you can discover a reliable way to truncate characters while
leaving HTML intact, we'd all appreciate knowing how to do this. :)

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Aug 1, 2009, at 4:45 AM, zach21uk wrote:

> I just want to elaborate further to avoid confusion:
>
> This is my code: http://pastie.org/566854
>
> I am using this function:
http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
>  - - - to limit the number of characters that my RSS Feed Displays,
> however, the function strips out "Smart" Punctuation and Replaces it
> with a single space in this string:
>
>    // Convert 'smart' punctuation to 'dumb' punctuation, strip the
> HTML tags,
>    // and convert all tabs and line-break characters to single spaces.
>    $short_desc = trim(str_replace(array("\r","\n", "\t"), ' ',
> strip_tags($string)));
>
>
> I would like to keep the character limit, but stop the function from
> stripping out the line-breaks and new-lines, because its causing the
> content to display all on one line, ignoring any new lines that
> should be there.
>
> I tried modifying the function myself, but my understanding of PHP
> isnt great and it caused an error, so I am hoping someone here knows
> how to modify it so it leaves the line-breaks/new-lines, in there,
> but still limits the charcters.
>
> Thanks
> Zach
>
> --- In simplepie-support@yahoogroups.com, "zach21uk" <zach21uk@...>
> wrote:
>>
>> I understand what you are saying but not how to implement it:
>>
>> Here is my code as it stands right now:
>>
>> http://pastie.org/566854
>>
>> Where would I amend to include that, so that the lines are not
>> stripped out of the code?
>>
>> Thanks
>>
>> --- In simplepie-support@yahoogroups.com, Ryan Parman
>> <simplepie.support@> wrote:
>>>
>>> You have to use a linebreak character.
>>>
>>> echo 'This is my first line' . "\n" . 'This is my second line.'
>>>
>>> Notice the difference between single and double quotes. Control
>>> characters like this need to be double quoted.
>>>
>>>
>>> On 7/31/2009 1:06 AM, zach21uk wrote:
>>>> Can Anyone help with this last issue? pleasseee?!
>>>>
>>>> In simplepie-support@yahoogroups.com, "zach21uk"<zach21uk@>  wrote:
>>>>
>>>>> Thats Perfect. The styling is there now. Just one more question
>>>>> however.....
>>>>>
>>>>> http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
>>>>>
>>>>> All of the text is displaying on one line now, ignoring any new
>>>>> lines.  How can I amend the script to leave new lines in there?
>>>>>
>>>>> --- In simplepie-support@yahoogroups.com, Ryan
>>>>> Parman<simplepie.support@>  wrote:
>>>>>
>>>>>> This should resolve your issue: http://pastie.org/565358
>>>>>>
>>>>>> If it helps, here is a collection of tutorials called "PHP for
>>>>>> the
>>>>>> absolute beginner." http://devzone.zend.com/node/view/id/627
>>>>>>
>>>>>> The first tutorial in the list, "Down the rabbit hole," goes
>>>>>> over the
>>>>>> dot operator and the basics of string concatenation.
http://devzone.zend.com/node/view/id/625
>>>>>>
>>>>>> Hope this helps! :)
>>>>>>
>>>>>> --
>>>>>> Ryan Parman
>>>>>> <http://ryanparman.com>
>>>>>>
>>>>>> Please don't email/IM me directly. That's why we have a mailing
>>>>>> list. ;)
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Jul 30, 2009, at 6:46 AM, zach21uk wrote:
>>>>>>
>>>>>>
>>>>>>> Yes I have tried it as stated in that article.
>>>>>>>
>>>>>>> When I try to use the code you provided below, no content is
>>>>>>> displayed at all.  Its just empty.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
>>>>>>> <bernhardbuhl@>  wrote:
>>>>>>>
>>>>>>>> Ah now I see I googled it. Did you took this from here?
>>>>>>>> http://simplepie.org/wiki/tutorial/shorten_titles_and_descriptions
>>>>>>>>
>>>>>>>> Did you setup the function shorten as it stands above?
>>>>>>>> And if then try
>>>>>>>>
>>>>>>>> echo "<div class='newscontent'>";
>>>>>>>> shorten($item->get_content(), 150);
>>>>>>>> echo "</div>";
>>>>>>>>
>>>>>>>> --- In simplepie-support@yahoogroups.com, "zach21uk"<zach21uk@>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> When I try to put it around the code, it either causes an
>>>>>>>>> error,
>>>>>>>>> or the styling does not take effect.
>>>>>>>>>
>>>>>>>>> This Causes an Error:
>>>>>>>>>
>>>>>>>>> echo '<div class="newscontent">'; shorten($item-
>>>>>>>>> >get_content(),
>>>>>>>>> 150)'</div>';
>>>>>>>>>
>>>>>>>>> Parse error: syntax error, unexpected
>>>>>>>>> T_CONSTANT_ENCAPSED_STRING
>>>>>>>>> in /home/hailingf/public_html/HF2009/includes/
>>>>>>>>> ourtopstory.php on
>>>>>>>>> line 52
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
>>>>>>>>> <bernhardbuhl@>  wrote:
>>>>>>>>>
>>>>>>>>>> Don`t understand you really...why can't you put that around
>>>>>>>>>> that
>>>>>>>>>> code?
>>>>>>>>>>
>>>>>>>>>> like
>>>>>>>>>> echo "<div class='headlines'>";
>>>>>>>>>>
>>>>>>>>>> <pseudocode>the code which ever you choose to take</
>>>>>>>>>> pseudocode>
>>>>>>>>>>
>>>>>>>>>> echo "</div>";
>>>>>>>>>>
>>>>>>>>>> But maybe I get you wrong sorry for that my language skills
>>>>>>>>>> are bad
>>>>>>>>>> kind regards
>>>>>>>>>>
>>>>>>>>>> --- In simplepie-support@yahoogroups.com,
>>>>>>>>>> "zach21uk"<zach21uk@>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> That dosent really help me with the styling issue.
>>>>>>>>>>>
>>>>>>>>>>> I want to apply my "<div class="headlines"></div>" to the
>>>>>>>>>>> content string, as I had it before.
>>>>>>>>>>>
>>>>>>>>>>> --- In simplepie-support@yahoogroups.com, "bernhardbuhl@"
>>>>>>>>>>> <bernhardbuhl@>  wrote:
>>>>>>>>>>>
>>>>>>>>>>>> I'm using a bit different code, so maybe you want to try
>>>>>>>>>>>> this
>>>>>>>>>>>> out:
>>>>>>>>>>>>
>>>>>>>>>>>> $str = $item->get_content();
>>>>>>>>>>>>
>>>>>>>>>>>> function truncateString($str, $max, $rep = '...') {
>>>>>>>>>>>>  if(strlen($str)>  $max) {
>>>>>>>>>>>>    $leave = $max - strlen($rep);
>>>>>>>>>>>>    return substr_replace($str, $rep, $leave);
>>>>>>>>>>>>  } else {
>>>>>>>>>>>>    return $str;
>>>>>>>>>>>>  }
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> echo truncateString($str, 10);
>>>>>>>>>>>>
>>>>>>>>>>>> 10 means at the end the numbers of characters which shall
>>>>>>>>>>>> be
>>>>>>>>>>>> displayed inclusive the "..." to show your members that
>>>>>>>>>>>> there
>>>>>>>>>>>> normally is more to read.
>>>>>>>>>>>>
>>>>>>>>>>>> Well at least there is just more then one way and not
>>>>>>>>>>>> usual to
>>>>>>>>>>>> make a function of it. Another way would be:
>>>>>>>>>>>>
>>>>>>>>>>>> $content = strlen($item->get_content());
>>>>>>>>>>>>
>>>>>>>>>>>> if ($content>  23) // How long should the content be
>>>>>>>>>>>>  {
>>>>>>>>>>>>   echo substr($item->get_content(),0,23); // Don't forget
>>>>>>>>>>>> to
>>>>>>>>>>>> adjust the numbers of characters should be shown here too.
>>>>>>>>>>>>  }
>>>>>>>>>>>>
>>>>>>>>>>>> else
>>>>>>>>>>>> {
>>>>>>>>>>>>  echo $item->get_content();
>>>>>>>>>>>> }
>>>>>>>>>>>>
>>>>>>>>>>>> kind regards
>>>>>>>>>>>>
>>>>>>>>>>>> --- In simplepie-support@yahoogroups.com, "zach21uk"
>>>>>>>>>>>> <zach21uk@>  wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi There.  Just a quicky.....
>>>>>>>>>>>>>
>>>>>>>>>>>>> I have just used this code which I found in another
>>>>>>>>>>>>> support
>>>>>>>>>>>>> post, to limit my content:
>>>>>>>>>>>>>
>>>>>>>>>>>>> echo shorten($item->get_content(), 150);
>>>>>>>>>>>>>
>>>>>>>>>>>>> This was my existing code:
>>>>>>>>>>>>>
>>>>>>>>>>>>> echo '<div class="newscontent">'  . $item-
>>>>>>>>>>>>> >get_content() . '</
>>>>>>>>>>>>> div>';
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> How can I apply my styling to the shortend version?  I
>>>>>>>>>>>>> have
>>>>>>>>>>>>> tried a couple of things but I get an error.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks
>>>>>>>>>>>>> Zach
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------
>>>>>>>
>>>>>>> Yahoo! Groups Links
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------
>>>>
>>>> Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4201 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 3:25 pm
Subject: Re: [SimplePie] Conditional formatting for multiple feeds
skyzyxufks
Send Email Send Email
 
You can look at $feed->get_permalink() to see if the feed you're
handling is your own. Or even, $feed->subscribe_url().

If it is, then handle it differently. If not, handle it normally.

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Jul 30, 2009, at 12:50 PM, Chris wrote:

> As of now, my functional code is relatively simple
>
> http://simplepie.pastebin.com/m6c78c957
>
> The secondary(blog) formatting is essentially the same, with
> inclusion of a few other tags to pull the body etc.
>
> I tried a simple php if/else command based on the $feedlink
> property, but with no luck.
>
> --- In simplepie-support@yahoogroups.com, Ryan Parman
> <simplepie.support@...> wrote:
>>
>> What code have you written so far?
>>
>> --
>> Ryan Parman
>> <http://ryanparman.com>
>>
>> Please don't email/IM me directly. That's why we have a mailing
>> list. ;)
>>
>>
>>
>>
>>
>>
>> On Jul 30, 2009, at 12:12 PM, Chris wrote:
>>
>>> Similar questions have been asked in the past, but nothing exactly
>>> along the lines of what i'm trying to do.
>>>
>>> Essentially, i want simplepie to display on the favicon, date/time
>>> and title of a feed post for everything with the exception of my
>>> personal blog (coranto-based, but modified to output posts as
>>> complete rss).
>>>
>>> So what i need to do is to essentially have two types of formatting
>>> for my feeds. One simple format for digg, current, last.fm etc, and
>>> a completely different set of formatting for my personal blog that
>>> includes everything.
>>>
>>> Evidently it's not as simple as passing a simple conditional if/else
>>> php statement.
>>>
>>> Anyone have any ideas? I've been battling to wrap my head around
>>> this for a few days now. Finally decided to give in and ask.
>>>
>>> -Chris
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4202 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 3:40 pm
Subject: Re: [SimplePie] Conditional formatting for multiple feeds
skyzyxufks
Send Email Send Email
 
If you're merging multiple feeds together, you can look at the feed
object for each item.

$item->get_feed()->subscribe_url()

http://simplepie.org/wiki/reference/simplepie_item/get_feed
http://simplepie.org/wiki/faq/typical_multifeed_gotchas#missing_data_from_feed

If you're parsing a LOT of feeds using the Multifeed feature, take
heed to the notes in http://simplepie.org/wiki/faq/i_m_getting_memory_leaks

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Jul 30, 2009, at 12:50 PM, Chris wrote:

> As of now, my functional code is relatively simple
>
> http://simplepie.pastebin.com/m6c78c957
>
> The secondary(blog) formatting is essentially the same, with
> inclusion of a few other tags to pull the body etc.
>
> I tried a simple php if/else command based on the $feedlink
> property, but with no luck.
>
> --- In simplepie-support@yahoogroups.com, Ryan Parman
> <simplepie.support@...> wrote:
>>
>> What code have you written so far?
>>
>> --
>> Ryan Parman
>> <http://ryanparman.com>
>>
>> Please don't email/IM me directly. That's why we have a mailing
>> list. ;)
>>
>>
>>
>>
>>
>>
>> On Jul 30, 2009, at 12:12 PM, Chris wrote:
>>
>>> Similar questions have been asked in the past, but nothing exactly
>>> along the lines of what i'm trying to do.
>>>
>>> Essentially, i want simplepie to display on the favicon, date/time
>>> and title of a feed post for everything with the exception of my
>>> personal blog (coranto-based, but modified to output posts as
>>> complete rss).
>>>
>>> So what i need to do is to essentially have two types of formatting
>>> for my feeds. One simple format for digg, current, last.fm etc, and
>>> a completely different set of formatting for my personal blog that
>>> includes everything.
>>>
>>> Evidently it's not as simple as passing a simple conditional if/else
>>> php statement.
>>>
>>> Anyone have any ideas? I've been battling to wrap my head around
>>> this for a few days now. Finally decided to give in and ask.
>>>
>>> -Chris
>>>
>>>
>>>
>>> ------------------------------------
>>>
>>> Yahoo! Groups Links
>>>
>>>
>>>
>>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4203 From: "Mark" <rlhs76@...>
Date: Tue Aug 4, 2009 4:12 pm
Subject: How do I fix this error
rlhs76
Send Email Send Email
 
The RSS on my site gives this error

"Warning: ./cache/0627324bbf4cab581ca058615c258d60.spi is not writeable in
/home4/gorilla5/public_html/php/simplepie.inc on line 13183"

How do I fix the problem?  I think some of the cache folders were deleted a few
days ago.

#4204 From: Ryan Parman <simplepie.support@...>
Date: Tue Aug 4, 2009 4:34 pm
Subject: Re: [SimplePie] How do I fix this error
skyzyxufks
Send Email Send Email
 
http://simplepie.org/wiki/faq/i_m_getting_cache_error_messages

--
Ryan Parman
<http://ryanparman.com>

Please don't email/IM me directly. That's why we have a mailing list. ;)






On Aug 4, 2009, at 9:12 AM, Mark wrote:

> The RSS on my site gives this error
>
> "Warning: ./cache/0627324bbf4cab581ca058615c258d60.spi is not
> writeable in /home4/gorilla5/public_html/php/simplepie.inc on line
> 13183"
>
> How do I fix the problem?  I think some of the cache folders were
> deleted a few days ago.
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4205 From: "kizkoool" <kizkoool@...>
Date: Tue Aug 4, 2009 8:29 pm
Subject: Re: [SimplePie 1.2] critical bug on PHP5 ?
kizkoool
Send Email Send Email
 
Ok, I just filled a bug report here: http://bugs.simplepie.org/issues/show/143

Anyway, SimplePie worked like a charm on the hosting service of my development
environment which I switched to PHP4 due to that problem I encountered with
SimplePie on the PHP5 environment.

Too bad that the hosting service providing my production environment doesn't
give me the choice between PHP4 and PHP5. It's PHP5 only :/
I also tried to run that test script on it with no luck.
So, I'm stuck for now :(


Regards,
Philippe L.


--- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@...>
wrote:
>
> It could potentially be any number of things.
>
> * Which version of PHP 4/5 are you running?
> * Which version of libxml2 is installed in your system?
> * Do you have iconv & mbstring installed?
> * What version of PCRE support is compiled in?
>
> And the feed being 2 lines long doesn't mean anything -- especially
> since that second line is the entire feed.
>
> It's important to understand that RSS, Atom, and feed handling in
> general is really, really dirty work. MOST feeds aren't even valid
> XML, and server headers, mime types, and character encodings all play
> a part as well.
>
> If you can put together a very specific test case for us and file a
> bug, then we can make sure we get this fixed. Personally, I'm not
> having this issue at all -- which tells me that there's a problem with
> one of the variables: SimplePie, the feed, or a component of your
> system.
>
> --
> Ryan Parman
> <http://ryanparman.com>
>
> Please don't email/IM me directly. That's why we have a mailing list. ;)
>
>
>
>
>
>
> On Aug 3, 2009, at 9:20 AM, kizkoool wrote:
>
> > Ok, I just tried using $feed->force_feed(true) on my previous example.
> >
> > I have the same output both on PHP4 and on PHP5:
> > XML error: syntax error at line 3, column 45
> >
> > That's a strange error message because as you can see the feed
http://www.lemonde.fr/rss/une.xml
> >  is only 2 lines long.
> >
> > And that doesn't explain why without $feed->force_feed(true),
> > simplepie shows different a different behaviour running nicely on
> > PHP4 but not founding the feeds of www.lemonde.fr when run on PHP5.
> >
> >
> > Regards,
> > Philippe L.
> >
> >
> > --- In simplepie-support@yahoogroups.com, Ryan Parman
> > <simplepie.support@> wrote:
> >>
> >> Try setting $feed->force_feed(true). http://ref.simplepie.org/force_feed
> >>
> >> --
> >> Ryan Parman
> >> <http://ryanparman.com>
> >>
> >> Please don't email/IM me directly. That's why we have a mailing
> >> list. ;)
> >>
> >>
> >>
> >>
> >>
> >>
> >> On Aug 3, 2009, at 2:01 AM, kizkoool wrote:
> >>
> >>> Hi,
> >>>
> >>>
> >>> I've played a bit with SimplePie 1.2 and I stumbled upon a bug so
> >>> critical that's quite unbelievable.
> >>>
> >>>
> >>> Here is the simple php code I used:
> >>>
> >>> <?php
> >>> require('application/libraries/Simplepie.php');
> >>>
> >>> $feed = new SimplePie();
> >>>
> >>> $feed->set_feed_url('http://www.lemonde.fr');
> >>>
> >>> $feed->enable_order_by_date(false);
> >>> $feed->enable_cache(false);
> >>>
> >>> $feed->init();
> >>>
> >>> if($feed->data){
> >>>  foreach($feed->get_items() as $item) {
> >>> 	 echo "<div>";
> >>> 	 echo $item->get_title();
> >>> 	 echo "</div>";
> >>>  }
> >>> } else echo $feed->error;
> >>> ?>
> >>>
> >>>
> >>> If I execute the script on a PHP4 server, it renders correctly the
> >>> news titles from the website: http://www.lemonde.fr
> >>>
> >>> But, if I execute the exact same php code on a PHP5 server, it
> >>> renders this:
> >>> A feed could not be found at http://www.lemonde.fr
> >>>
> >>>
> >>> Could you confirm this bug with SimplePie 1.2 and PHP5 ? Or is there
> >>> something I'm missing ?
> >>>
> >>>
> >>> Thanks,
> >>> Philippe L.
> >>>
> >>>
> >>>
> >>> ------------------------------------
> >>>
> >>> Yahoo! Groups Links
> >>>
> >>>
> >>>
> >>
> >
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>

#4207 From: "silvasonic" <pablo@...>
Date: Thu Aug 6, 2009 12:06 am
Subject: PHP Fatal error: Call to a member function get_base() on a non-object
silvasonic
Send Email Send Email
 
ERROR LOG:

[05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function get_base() on
a non-object in /home/my-server/public_html/lib/php/simplepie.inc on line 3150

Hey everyone,

I've tried everything I could possibly think to fix this --
check/change/re-check all paths (simplepie.inc, multifeeds.php,
handler_image.php, cache folder, etc.) Does anyone have any idea why this is
happening?

The live URL in question is: http://silvasonic.com/multifeeds.php and everything
else is in http://silvasonic.com/lib/

Thanks a lot in advance!

#4208 From: "jackdewey" <ylefebvre@...>
Date: Thu Aug 6, 2009 12:38 am
Subject: Warning: file_get_contents issue when trying to use SimpiePie in Wordpress plugi
jackdewey
Send Email Send Email
 
Hi,

I am currently working on a new version of a Wordpress plugin using SimplePie
1.2.

The issue that I am having is that when I include SimplePie, I get the following
warning when my plugin runs:

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open
stream: No such file or directory in
/home/.../wp-content/plugins/link-library/simplepie/simplepie.inc on line 7853

Here is the URL on my site showing this error:

http://yannickcorner.nayanna.biz/links-page-with-preview/

From looking at the code, I believe that the problem comes from the fact that
the SimplePie_file class is trying to find a copy of the SimplePie.inc file by
using the page URL. However, the URL does not match the location of the file
since the file is in my plugin folder but is being used on other pages.

Now, what I don't get is why something is complaining about Simplepie_File when
I don't call that class or the set_file function directly? Is there another core
API that initializes the Simplepie_file class?

As a temporary workaround, I commented out the lines:

7853 	 //if (!$this->body = file_get_contents($url))
7854 	 //{
7855 	 // $this->error = 'file_get_contents could not read the file';
7856 	 // $this->success = false;
			 }

This makes the warning go away but I am wondering if it might break anything
else. For one, the cache that I am specifying does not seem to work right with
this code commented.

I have used Simplepie successfully on another page that does not use the same
plugin mechanism.

I considered using the Wordpress plugin mentioned on the Wordpress page but it
seems to be very out-of-date compared to the latest version available on the
site. They also don't seem to support versions of Wordpress higher than 2.5.

Any advice to offer for such a situation where the URL where Simplepie is used
is not the same as its location on disk? Thanks in advance,

Yannick Lefebvre

#4209 From: Ryan Parman <simplepie.support@...>
Date: Thu Aug 6, 2009 2:10 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
skyzyxufks
Send Email Send Email
 
Show us your source code.

--
Ryan Parman
http://ryanparman.com
Sent from my iPhone

On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@...> wrote:

> ERROR LOG:
>
> [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> get_base() on a non-object in /home/my-server/public_html/lib/php/
> simplepie.inc on line 3150
>
> Hey everyone,
>
> I've tried everything I could possibly think to fix this -- check/
> change/re-check all paths (simplepie.inc, multifeeds.php,
> handler_image.php, cache folder, etc.) Does anyone have any idea why
> this is happening?
>
> The live URL in question is: http://silvasonic.com/multifeeds.php
> and everything else is in http://silvasonic.com/lib/
>
> Thanks a lot in advance!
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

#4210 From: "silvasonic" <pablo@...>
Date: Thu Aug 6, 2009 8:09 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
silvasonic
Send Email Send Email
 
LIVE URL: http://silvasonic.com/multifeeds.php

PHP SCRIPTS:
multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g

No further modifications...

Thanks a lot, Ryan!


--- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@...>
wrote:
>
> Show us your source code.
>
> --
> Ryan Parman
> http://ryanparman.com
> Sent from my iPhone
>
> On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@...> wrote:
>
> > ERROR LOG:
> >
> > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > simplepie.inc on line 3150
> >
> > Hey everyone,
> >
> > I've tried everything I could possibly think to fix this -- check/
> > change/re-check all paths (simplepie.inc, multifeeds.php,
> > handler_image.php, cache folder, etc.) Does anyone have any idea why
> > this is happening?
> >
> > The live URL in question is: http://silvasonic.com/multifeeds.php
> > and everything else is in http://silvasonic.com/lib/
> >
> > Thanks a lot in advance!
> >
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>

#4211 From: "rarrst" <contact@...>
Date: Fri Aug 7, 2009 6:19 am
Subject: Converting SimplePie object for Magpie-like output
rarrst
Send Email Send Email
 
WordPress recently got native SimplePie support but one of my favorite widget
announced sticking with Magpie. I wrote some code to make it
SimplePie-compatible.

Because of tricky way widget handles stuff (running Magpie array against
pseudo-code markup) only way I figured out is faking Magpie-like output to feed
it.

No particular request, just could use someone to go over my code (I am not too
good with PHP) for things I might've missed or point out if there is easier way
to do it. TIA

function MagpieItemsFromSimplePieFeed($feed) {
	 $i=0;
	 foreach ($feed->get_items() as $item) {
		 $temp[$i]=MagpieItemFromSimplePieItem($item->data['child']);
		 $i+=1;
	 }
	 return $temp;
}

function MagpieItemFromSimplePieItem($item) {
	 $output='';
	 foreach($item as $namespace=>$tag) {
		 foreach($tag as $name=>$data) {
			 if (is_array($data[0]['child'])) {
				 $output[$name]=MagpieItemFromSimplePieItem($data[0]['child']);
			 }
			 elseif (count($data)>1) {
				 foreach($data as $key=>$value) {
					 if($name=='link'&&empty($value[$key]['data'])) {
						 $output[$name][$key]=$data[$key]['attribs']['']['href'];
					 } else {
						 $output[$name][$key]=$value[$key]['data'];
					 }
				 }
			 } else {
				 $output[$name]=$data[0]['data'];
			 }
		 }
	 }
	 return $output;
}

#4212 From: "jackdewey" <ylefebvre@...>
Date: Fri Aug 7, 2009 8:39 pm
Subject: Re: Warning: file_get_contents issue when trying to use SimpiePie in Wordpress plugi
jackdewey
Send Email Send Email
 
After seeing someone mention that Wordpress not uses Simplepie within its core
libraries, I changed my plugin code so that it calls the fetch_feed Wordpress
function instead of my own instance of the plugin.

Unfortunately, that did not work so well and on top of the error about the
file_get_contents, I also seem to have exceeded a memory limit in Wordpress:

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open
stream: No such file or directory in /home/.../wp-includes/class-feed.php on
line 97

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate
262454 bytes) in /home/.../wp-includes/functions.php on line 959

Yannick

--- In simplepie-support@yahoogroups.com, "jackdewey" <ylefebvre@...> wrote:
>
> Hi,
>
> I am currently working on a new version of a Wordpress plugin using SimplePie
1.2.
>
> The issue that I am having is that when I include SimplePie, I get the
following warning when my plugin runs:
>
> Warning: file_get_contents(http:) [function.file-get-contents]: failed to open
stream: No such file or directory in
/home/.../wp-content/plugins/link-library/simplepie/simplepie.inc on line 7853
>
> Here is the URL on my site showing this error:
>
> http://yannickcorner.nayanna.biz/links-page-with-preview/
>
> From looking at the code, I believe that the problem comes from the fact that
the SimplePie_file class is trying to find a copy of the SimplePie.inc file by
using the page URL. However, the URL does not match the location of the file
since the file is in my plugin folder but is being used on other pages.
>
> Now, what I don't get is why something is complaining about Simplepie_File
when I don't call that class or the set_file function directly? Is there another
core API that initializes the Simplepie_file class?
>
> As a temporary workaround, I commented out the lines:
>
> 7853 	 //if (!$this->body = file_get_contents($url))
> 7854 	 //{
> 7855 	 // $this->error = 'file_get_contents could not read the file';
> 7856 	 // $this->success = false;
> 		 }
>
> This makes the warning go away but I am wondering if it might break anything
else. For one, the cache that I am specifying does not seem to work right with
this code commented.
>
> I have used Simplepie successfully on another page that does not use the same
plugin mechanism.
>
> I considered using the Wordpress plugin mentioned on the Wordpress page but it
seems to be very out-of-date compared to the latest version available on the
site. They also don't seem to support versions of Wordpress higher than 2.5.
>
> Any advice to offer for such a situation where the URL where Simplepie is used
is not the same as its location on disk? Thanks in advance,
>
> Yannick Lefebvre
>

#4213 From: "silvasonic" <pablo@...>
Date: Fri Aug 7, 2009 9:22 pm
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
silvasonic
Send Email Send Email
 
Any ideas, Ryan? Anyone? Thanks!

--- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@...> wrote:
>
> LIVE URL: http://silvasonic.com/multifeeds.php
>
> PHP SCRIPTS:
> multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
>
> No further modifications...
>
> Thanks a lot, Ryan!
>
>
> --- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@>
wrote:
> >
> > Show us your source code.
> >
> > --
> > Ryan Parman
> > http://ryanparman.com
> > Sent from my iPhone
> >
> > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> >
> > > ERROR LOG:
> > >
> > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > > simplepie.inc on line 3150
> > >
> > > Hey everyone,
> > >
> > > I've tried everything I could possibly think to fix this -- check/
> > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > handler_image.php, cache folder, etc.) Does anyone have any idea why
> > > this is happening?
> > >
> > > The live URL in question is: http://silvasonic.com/multifeeds.php
> > > and everything else is in http://silvasonic.com/lib/
> > >
> > > Thanks a lot in advance!
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > Yahoo! Groups Links
> > >
> > >
> > >
> >
>

#4214 From: "beachie1976" <c@...>
Date: Sat Aug 8, 2009 9:40 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2 and I now
get this error.  If I downgrade to 1.1.3 I have no problem.

--- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@...> wrote:
>
> Any ideas, Ryan? Anyone? Thanks!
>
> --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> >
> > LIVE URL: http://silvasonic.com/multifeeds.php
> >
> > PHP SCRIPTS:
> > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> >
> > No further modifications...
> >
> > Thanks a lot, Ryan!
> >
> >
> > --- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@>
wrote:
> > >
> > > Show us your source code.
> > >
> > > --
> > > Ryan Parman
> > > http://ryanparman.com
> > > Sent from my iPhone
> > >
> > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > >
> > > > ERROR LOG:
> > > >
> > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > > > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > > > simplepie.inc on line 3150
> > > >
> > > > Hey everyone,
> > > >
> > > > I've tried everything I could possibly think to fix this -- check/
> > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > handler_image.php, cache folder, etc.) Does anyone have any idea why
> > > > this is happening?
> > > >
> > > > The live URL in question is: http://silvasonic.com/multifeeds.php
> > > > and everything else is in http://silvasonic.com/lib/
> > > >
> > > > Thanks a lot in advance!
> > > >
> > > >
> > > >
> > > > ------------------------------------
> > > >
> > > > Yahoo! Groups Links
> > > >
> > > >
> > > >
> > >
> >
>

#4215 From: "beachie1976" <c@...>
Date: Sat Aug 8, 2009 10:09 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Ah ha!  This has something to do with a piece of code that I originally cut and
pasted from one of the SimplePie demos that was in the 1.1.3 ZIP file. It was
initially assigning:

$feed = new SimplePie();

But later, within a while loop, was assigning:

$feed = $item->get_feed();

When I renamed the latter $feed variable to something else it works perfectly! 
No idea why it works fine with 1.1.3 and not 1.2 though, but there must be some
difference.

Cheers,
Chris.


--- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
>
> Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2 and I now
get this error.  If I downgrade to 1.1.3 I have no problem.
>
> --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> >
> > Any ideas, Ryan? Anyone? Thanks!
> >
> > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > >
> > > LIVE URL: http://silvasonic.com/multifeeds.php
> > >
> > > PHP SCRIPTS:
> > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > >
> > > No further modifications...
> > >
> > > Thanks a lot, Ryan!
> > >
> > >
> > > --- In simplepie-support@yahoogroups.com, Ryan Parman <simplepie.support@>
wrote:
> > > >
> > > > Show us your source code.
> > > >
> > > > --
> > > > Ryan Parman
> > > > http://ryanparman.com
> > > > Sent from my iPhone
> > > >
> > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > >
> > > > > ERROR LOG:
> > > > >
> > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > > > > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > > > > simplepie.inc on line 3150
> > > > >
> > > > > Hey everyone,
> > > > >
> > > > > I've tried everything I could possibly think to fix this -- check/
> > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > handler_image.php, cache folder, etc.) Does anyone have any idea why
> > > > > this is happening?
> > > > >
> > > > > The live URL in question is: http://silvasonic.com/multifeeds.php
> > > > > and everything else is in http://silvasonic.com/lib/
> > > > >
> > > > > Thanks a lot in advance!
> > > > >
> > > > >
> > > > >
> > > > > ------------------------------------
> > > > >
> > > > > Yahoo! Groups Links
> > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>

#4216 From: "beachie1976" <c@...>
Date: Sat Aug 8, 2009 10:14 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Sorry for the multiple posts - it was multifeeds.php from the demo directory
that I originally cut and pasted the code from; line 20 and line 81 both assign
the $feed variable differently.

Hope that's of some help.

--- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
>
> Ah ha!  This has something to do with a piece of code that I originally cut
and pasted from one of the SimplePie demos that was in the 1.1.3 ZIP file. It
was initially assigning:
>
> $feed = new SimplePie();
>
> But later, within a while loop, was assigning:
>
> $feed = $item->get_feed();
>
> When I renamed the latter $feed variable to something else it works perfectly!
No idea why it works fine with 1.1.3 and not 1.2 though, but there must be some
difference.
>
> Cheers,
> Chris.
>
>
> --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> >
> > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2 and I
now get this error.  If I downgrade to 1.1.3 I have no problem.
> >
> > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > >
> > > Any ideas, Ryan? Anyone? Thanks!
> > >
> > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > >
> > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > >
> > > > PHP SCRIPTS:
> > > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > >
> > > > No further modifications...
> > > >
> > > > Thanks a lot, Ryan!
> > > >
> > > >
> > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > >
> > > > > Show us your source code.
> > > > >
> > > > > --
> > > > > Ryan Parman
> > > > > http://ryanparman.com
> > > > > Sent from my iPhone
> > > > >
> > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > >
> > > > > > ERROR LOG:
> > > > > >
> > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > > > > > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > > > > > simplepie.inc on line 3150
> > > > > >
> > > > > > Hey everyone,
> > > > > >
> > > > > > I've tried everything I could possibly think to fix this -- check/
> > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > handler_image.php, cache folder, etc.) Does anyone have any idea why
> > > > > > this is happening?
> > > > > >
> > > > > > The live URL in question is: http://silvasonic.com/multifeeds.php
> > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > >
> > > > > > Thanks a lot in advance!
> > > > > >
> > > > > >
> > > > > >
> > > > > > ------------------------------------
> > > > > >
> > > > > > Yahoo! Groups Links
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4217 From: "silvasonic" <pablo@...>
Date: Sat Aug 8, 2009 7:34 pm
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
silvasonic
Send Email Send Email
 
Hi beachie1976. Thanks for the reply!

I'm sure a significant part of the problem is that I'm not a programmer, so I
need to sort of guess my way through many of these things. Having said that...

1.1.3 used to work for me too, no problem, then when 1.2 came out I decided to
upgrade it before going live, and that's when I encountered the problem
described below. I know that the focus has been shifted to SP 2.0 now, but I
didn't want to start my project with an old version of the parser, you know? (I
want to avoid upgrades after I launch it as much as possible -- it needs to be
on autopilot, if at all possible).

Could you please copy & paste the exact modifications you've applied to SP 1.2
please?

I guess I need to stop being lazy and just learn how to use SimpleXML =)

Thanks again!



--- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
>
> Sorry for the multiple posts - it was multifeeds.php from the demo directory
that I originally cut and pasted the code from; line 20 and line 81 both assign
the $feed variable differently.
>
> Hope that's of some help.
>
> --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> >
> > Ah ha!  This has something to do with a piece of code that I originally cut
and pasted from one of the SimplePie demos that was in the 1.1.3 ZIP file. It
was initially assigning:
> >
> > $feed = new SimplePie();
> >
> > But later, within a while loop, was assigning:
> >
> > $feed = $item->get_feed();
> >
> > When I renamed the latter $feed variable to something else it works
perfectly!  No idea why it works fine with 1.1.3 and not 1.2 though, but there
must be some difference.
> >
> > Cheers,
> > Chris.
> >
> >
> > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > >
> > > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2 and I
now get this error.  If I downgrade to 1.1.3 I have no problem.
> > >
> > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > >
> > > > Any ideas, Ryan? Anyone? Thanks!
> > > >
> > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > > >
> > > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > > >
> > > > > PHP SCRIPTS:
> > > > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > > >
> > > > > No further modifications...
> > > > >
> > > > > Thanks a lot, Ryan!
> > > > >
> > > > >
> > > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > > >
> > > > > > Show us your source code.
> > > > > >
> > > > > > --
> > > > > > Ryan Parman
> > > > > > http://ryanparman.com
> > > > > > Sent from my iPhone
> > > > > >
> > > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > > >
> > > > > > > ERROR LOG:
> > > > > > >
> > > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member function
> > > > > > > get_base() on a non-object in /home/my-server/public_html/lib/php/
> > > > > > > simplepie.inc on line 3150
> > > > > > >
> > > > > > > Hey everyone,
> > > > > > >
> > > > > > > I've tried everything I could possibly think to fix this -- check/
> > > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > > handler_image.php, cache folder, etc.) Does anyone have any idea
why
> > > > > > > this is happening?
> > > > > > >
> > > > > > > The live URL in question is: http://silvasonic.com/multifeeds.php
> > > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > > >
> > > > > > > Thanks a lot in advance!
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ------------------------------------
> > > > > > >
> > > > > > > Yahoo! Groups Links
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4220 From: "beachie1976" <c@...>
Date: Sun Aug 9, 2009 5:57 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Hi silvasonic :)

I didn't make changes to the main simplepie.inc file - just to *my* code, some
of which I had copied from the multifeeds.php example in the 1.1.3 demo
directory.  If you can paste your code, or email it to me, I can take a look.

Cheers,
Chris.

--- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@...> wrote:
>
> Hi beachie1976. Thanks for the reply!
>
> I'm sure a significant part of the problem is that I'm not a programmer, so I
need to sort of guess my way through many of these things. Having said that...
>
> 1.1.3 used to work for me too, no problem, then when 1.2 came out I decided to
upgrade it before going live, and that's when I encountered the problem
described below. I know that the focus has been shifted to SP 2.0 now, but I
didn't want to start my project with an old version of the parser, you know? (I
want to avoid upgrades after I launch it as much as possible -- it needs to be
on autopilot, if at all possible).
>
> Could you please copy & paste the exact modifications you've applied to SP 1.2
please?
>
> I guess I need to stop being lazy and just learn how to use SimpleXML =)
>
> Thanks again!
>
>
>
> --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> >
> > Sorry for the multiple posts - it was multifeeds.php from the demo directory
that I originally cut and pasted the code from; line 20 and line 81 both assign
the $feed variable differently.
> >
> > Hope that's of some help.
> >
> > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > >
> > > Ah ha!  This has something to do with a piece of code that I originally
cut and pasted from one of the SimplePie demos that was in the 1.1.3 ZIP file.
It was initially assigning:
> > >
> > > $feed = new SimplePie();
> > >
> > > But later, within a while loop, was assigning:
> > >
> > > $feed = $item->get_feed();
> > >
> > > When I renamed the latter $feed variable to something else it works
perfectly!  No idea why it works fine with 1.1.3 and not 1.2 though, but there
must be some difference.
> > >
> > > Cheers,
> > > Chris.
> > >
> > >
> > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > >
> > > > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2 and
I now get this error.  If I downgrade to 1.1.3 I have no problem.
> > > >
> > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > > >
> > > > > Any ideas, Ryan? Anyone? Thanks!
> > > > >
> > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > > > >
> > > > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > > > >
> > > > > > PHP SCRIPTS:
> > > > > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > > > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > > > >
> > > > > > No further modifications...
> > > > > >
> > > > > > Thanks a lot, Ryan!
> > > > > >
> > > > > >
> > > > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > > > >
> > > > > > > Show us your source code.
> > > > > > >
> > > > > > > --
> > > > > > > Ryan Parman
> > > > > > > http://ryanparman.com
> > > > > > > Sent from my iPhone
> > > > > > >
> > > > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > > > >
> > > > > > > > ERROR LOG:
> > > > > > > >
> > > > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member
function
> > > > > > > > get_base() on a non-object in
/home/my-server/public_html/lib/php/
> > > > > > > > simplepie.inc on line 3150
> > > > > > > >
> > > > > > > > Hey everyone,
> > > > > > > >
> > > > > > > > I've tried everything I could possibly think to fix this --
check/
> > > > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > > > handler_image.php, cache folder, etc.) Does anyone have any idea
why
> > > > > > > > this is happening?
> > > > > > > >
> > > > > > > > The live URL in question is:
http://silvasonic.com/multifeeds.php
> > > > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > > > >
> > > > > > > > Thanks a lot in advance!
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > ------------------------------------
> > > > > > > >
> > > > > > > > Yahoo! Groups Links
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4221 From: "silvasonic" <pablo@...>
Date: Sun Aug 9, 2009 11:13 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
silvasonic
Send Email Send Email
 
Yes, I've got that part, but what exactly did you change on your code? Here's
mine:

LIVE URL: http://silvasonic.com/multifeeds.php

PHP SCRIPTS:
multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g

No further modifications... Thanks!


--- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
>
> Hi silvasonic :)
>
> I didn't make changes to the main simplepie.inc file - just to *my* code, some
of which I had copied from the multifeeds.php example in the 1.1.3 demo
directory.  If you can paste your code, or email it to me, I can take a look.
>
> Cheers,
> Chris.
>
> --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> >
> > Hi beachie1976. Thanks for the reply!
> >
> > I'm sure a significant part of the problem is that I'm not a programmer, so
I need to sort of guess my way through many of these things. Having said that...
> >
> > 1.1.3 used to work for me too, no problem, then when 1.2 came out I decided
to upgrade it before going live, and that's when I encountered the problem
described below. I know that the focus has been shifted to SP 2.0 now, but I
didn't want to start my project with an old version of the parser, you know? (I
want to avoid upgrades after I launch it as much as possible -- it needs to be
on autopilot, if at all possible).
> >
> > Could you please copy & paste the exact modifications you've applied to SP
1.2 please?
> >
> > I guess I need to stop being lazy and just learn how to use SimpleXML =)
> >
> > Thanks again!
> >
> >
> >
> > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > >
> > > Sorry for the multiple posts - it was multifeeds.php from the demo
directory that I originally cut and pasted the code from; line 20 and line 81
both assign the $feed variable differently.
> > >
> > > Hope that's of some help.
> > >
> > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > >
> > > > Ah ha!  This has something to do with a piece of code that I originally
cut and pasted from one of the SimplePie demos that was in the 1.1.3 ZIP file.
It was initially assigning:
> > > >
> > > > $feed = new SimplePie();
> > > >
> > > > But later, within a while loop, was assigning:
> > > >
> > > > $feed = $item->get_feed();
> > > >
> > > > When I renamed the latter $feed variable to something else it works
perfectly!  No idea why it works fine with 1.1.3 and not 1.2 though, but there
must be some difference.
> > > >
> > > > Cheers,
> > > > Chris.
> > > >
> > > >
> > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > > >
> > > > > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2
and I now get this error.  If I downgrade to 1.1.3 I have no problem.
> > > > >
> > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > > > >
> > > > > > Any ideas, Ryan? Anyone? Thanks!
> > > > > >
> > > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@>
wrote:
> > > > > > >
> > > > > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > > > > >
> > > > > > > PHP SCRIPTS:
> > > > > > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > > > > handler_image.php:
http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > > > > >
> > > > > > > No further modifications...
> > > > > > >
> > > > > > > Thanks a lot, Ryan!
> > > > > > >
> > > > > > >
> > > > > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > > > > >
> > > > > > > > Show us your source code.
> > > > > > > >
> > > > > > > > --
> > > > > > > > Ryan Parman
> > > > > > > > http://ryanparman.com
> > > > > > > > Sent from my iPhone
> > > > > > > >
> > > > > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > > > > >
> > > > > > > > > ERROR LOG:
> > > > > > > > >
> > > > > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member
function
> > > > > > > > > get_base() on a non-object in
/home/my-server/public_html/lib/php/
> > > > > > > > > simplepie.inc on line 3150
> > > > > > > > >
> > > > > > > > > Hey everyone,
> > > > > > > > >
> > > > > > > > > I've tried everything I could possibly think to fix this --
check/
> > > > > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > > > > handler_image.php, cache folder, etc.) Does anyone have any
idea why
> > > > > > > > > this is happening?
> > > > > > > > >
> > > > > > > > > The live URL in question is:
http://silvasonic.com/multifeeds.php
> > > > > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > > > > >
> > > > > > > > > Thanks a lot in advance!
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > ------------------------------------
> > > > > > > > >
> > > > > > > > > Yahoo! Groups Links
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4222 From: "beachie1976" <c@...>
Date: Sun Aug 9, 2009 11:22 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Sorry about the quick and dirty reply.  Try replace from line 78 to line 104
with this:
<?php
	 // Let's loop through each item in the feed.
	 foreach($feed->get_items() as $item):

	 // Let's give ourselves a reference to the parent $feed object for this
particular item.
	 $feeditem = $item->get_feed();
	 ?>

		 <div class="chunk">
			 <h4 style="background-image:url(<?php echo $feeditem->get_favicon(); ?>);"><a
href="<?php echo $item->get_permalink(); ?>"><?php echo
html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8'); ?></a></h4>

			 <!-- get_content() prefers full content over summaries -->
			 <?php echo $item->get_content(); ?>

			 <?php if ($enclosure = $item->get_enclosure()): ?>
				 <div>
				 <?php echo $enclosure->native_embed(array(
					 // New 'mediaplayer' attribute shows off Flash-based MP3 and FLV playback.
					 'mediaplayer' => '../demo/for_the_demo/mediaplayer.swf'
				 )); ?>
				 </div>
			 <?php endif; ?>

			 <p class="footnote">Source: <a href="<?php echo $feeditem->get_permalink();
?>"><?php echo $feeditem->get_title(); ?></a> | <?php echo $item->get_date('j M
Y | g:i a'); ?></p>
		 </div>

	 <?php endforeach ?>


--- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@...> wrote:
>
> Yes, I've got that part, but what exactly did you change on your code? Here's
mine:
>
> LIVE URL: http://silvasonic.com/multifeeds.php
>
> PHP SCRIPTS:
> multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
>
> No further modifications... Thanks!
>
>
> --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> >
> > Hi silvasonic :)
> >
> > I didn't make changes to the main simplepie.inc file - just to *my* code,
some of which I had copied from the multifeeds.php example in the 1.1.3 demo
directory.  If you can paste your code, or email it to me, I can take a look.
> >
> > Cheers,
> > Chris.
> >
> > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > >
> > > Hi beachie1976. Thanks for the reply!
> > >
> > > I'm sure a significant part of the problem is that I'm not a programmer,
so I need to sort of guess my way through many of these things. Having said
that...
> > >
> > > 1.1.3 used to work for me too, no problem, then when 1.2 came out I
decided to upgrade it before going live, and that's when I encountered the
problem described below. I know that the focus has been shifted to SP 2.0 now,
but I didn't want to start my project with an old version of the parser, you
know? (I want to avoid upgrades after I launch it as much as possible -- it
needs to be on autopilot, if at all possible).
> > >
> > > Could you please copy & paste the exact modifications you've applied to SP
1.2 please?
> > >
> > > I guess I need to stop being lazy and just learn how to use SimpleXML =)
> > >
> > > Thanks again!
> > >
> > >
> > >
> > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > >
> > > > Sorry for the multiple posts - it was multifeeds.php from the demo
directory that I originally cut and pasted the code from; line 20 and line 81
both assign the $feed variable differently.
> > > >
> > > > Hope that's of some help.
> > > >
> > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > > >
> > > > > Ah ha!  This has something to do with a piece of code that I
originally cut and pasted from one of the SimplePie demos that was in the 1.1.3
ZIP file. It was initially assigning:
> > > > >
> > > > > $feed = new SimplePie();
> > > > >
> > > > > But later, within a while loop, was assigning:
> > > > >
> > > > > $feed = $item->get_feed();
> > > > >
> > > > > When I renamed the latter $feed variable to something else it works
perfectly!  No idea why it works fine with 1.1.3 and not 1.2 though, but there
must be some difference.
> > > > >
> > > > > Cheers,
> > > > > Chris.
> > > > >
> > > > >
> > > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > > > >
> > > > > > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to 1.2
and I now get this error.  If I downgrade to 1.1.3 I have no problem.
> > > > > >
> > > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@>
wrote:
> > > > > > >
> > > > > > > Any ideas, Ryan? Anyone? Thanks!
> > > > > > >
> > > > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@>
wrote:
> > > > > > > >
> > > > > > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > > > > > >
> > > > > > > > PHP SCRIPTS:
> > > > > > > > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > > > > > handler_image.php:
http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > > > > > >
> > > > > > > > No further modifications...
> > > > > > > >
> > > > > > > > Thanks a lot, Ryan!
> > > > > > > >
> > > > > > > >
> > > > > > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > > > > > >
> > > > > > > > > Show us your source code.
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Ryan Parman
> > > > > > > > > http://ryanparman.com
> > > > > > > > > Sent from my iPhone
> > > > > > > > >
> > > > > > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > > > > > >
> > > > > > > > > > ERROR LOG:
> > > > > > > > > >
> > > > > > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member
function
> > > > > > > > > > get_base() on a non-object in
/home/my-server/public_html/lib/php/
> > > > > > > > > > simplepie.inc on line 3150
> > > > > > > > > >
> > > > > > > > > > Hey everyone,
> > > > > > > > > >
> > > > > > > > > > I've tried everything I could possibly think to fix this --
check/
> > > > > > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > > > > > handler_image.php, cache folder, etc.) Does anyone have any
idea why
> > > > > > > > > > this is happening?
> > > > > > > > > >
> > > > > > > > > > The live URL in question is:
http://silvasonic.com/multifeeds.php
> > > > > > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > > > > > >
> > > > > > > > > > Thanks a lot in advance!
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ------------------------------------
> > > > > > > > > >
> > > > > > > > > > Yahoo! Groups Links
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4223 From: "beachie1976" <c@...>
Date: Sun Aug 9, 2009 11:28 am
Subject: Re: [SimplePie] PHP Fatal error: Call to a member function get_base() on a non-object
beachie1976
Send Email Send Email
 
Here:
http://pastie.org/577373


--- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
>
> Sorry about the quick and dirty reply.  Try replace from line 78 to line 104
with this:
> <?php
>  // Let's loop through each item in the feed.
>  foreach($feed->get_items() as $item):
>
>  // Let's give ourselves a reference to the parent $feed object for this
particular item.
>  $feeditem = $item->get_feed();
>  ?>
>
> 	 <div class="chunk">
> 		 <h4 style="background-image:url(<?php echo $feeditem->get_favicon();
?>);"><a href="<?php echo $item->get_permalink(); ?>"><?php echo
html_entity_decode($item->get_title(), ENT_QUOTES, 'UTF-8'); ?></a></h4>
>
> 		 <!-- get_content() prefers full content over summaries -->
> 		 <?php echo $item->get_content(); ?>
>
> 		 <?php if ($enclosure = $item->get_enclosure()): ?>
> 			 <div>
> 			 <?php echo $enclosure->native_embed(array(
> 				 // New 'mediaplayer' attribute shows off Flash-based MP3 and FLV
playback.
> 				 'mediaplayer' => '../demo/for_the_demo/mediaplayer.swf'
> 			 )); ?>
> 			 </div>
> 		 <?php endif; ?>
>
> 		 <p class="footnote">Source: <a href="<?php echo $feeditem->get_permalink();
?>"><?php echo $feeditem->get_title(); ?></a> | <?php echo $item->get_date('j M
Y | g:i a'); ?></p>
> 	 </div>
>
>  <?php endforeach ?>
>
>
> --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> >
> > Yes, I've got that part, but what exactly did you change on your code?
Here's mine:
> >
> > LIVE URL: http://silvasonic.com/multifeeds.php
> >
> > PHP SCRIPTS:
> > multifeeds.php: http://pastie.org/private/3cqatesluozrb6afjtnda
> > handler_image.php: http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> >
> > No further modifications... Thanks!
> >
> >
> > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > >
> > > Hi silvasonic :)
> > >
> > > I didn't make changes to the main simplepie.inc file - just to *my* code,
some of which I had copied from the multifeeds.php example in the 1.1.3 demo
directory.  If you can paste your code, or email it to me, I can take a look.
> > >
> > > Cheers,
> > > Chris.
> > >
> > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@> wrote:
> > > >
> > > > Hi beachie1976. Thanks for the reply!
> > > >
> > > > I'm sure a significant part of the problem is that I'm not a programmer,
so I need to sort of guess my way through many of these things. Having said
that...
> > > >
> > > > 1.1.3 used to work for me too, no problem, then when 1.2 came out I
decided to upgrade it before going live, and that's when I encountered the
problem described below. I know that the focus has been shifted to SP 2.0 now,
but I didn't want to start my project with an old version of the parser, you
know? (I want to avoid upgrades after I launch it as much as possible -- it
needs to be on autopilot, if at all possible).
> > > >
> > > > Could you please copy & paste the exact modifications you've applied to
SP 1.2 please?
> > > >
> > > > I guess I need to stop being lazy and just learn how to use SimpleXML =)
> > > >
> > > > Thanks again!
> > > >
> > > >
> > > >
> > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > > >
> > > > > Sorry for the multiple posts - it was multifeeds.php from the demo
directory that I originally cut and pasted the code from; line 20 and line 81
both assign the $feed variable differently.
> > > > >
> > > > > Hope that's of some help.
> > > > >
> > > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...> wrote:
> > > > > >
> > > > > > Ah ha!  This has something to do with a piece of code that I
originally cut and pasted from one of the SimplePie demos that was in the 1.1.3
ZIP file. It was initially assigning:
> > > > > >
> > > > > > $feed = new SimplePie();
> > > > > >
> > > > > > But later, within a while loop, was assigning:
> > > > > >
> > > > > > $feed = $item->get_feed();
> > > > > >
> > > > > > When I renamed the latter $feed variable to something else it works
perfectly!  No idea why it works fine with 1.1.3 and not 1.2 though, but there
must be some difference.
> > > > > >
> > > > > > Cheers,
> > > > > > Chris.
> > > > > >
> > > > > >
> > > > > > --- In simplepie-support@yahoogroups.com, "beachie1976" <c@...>
wrote:
> > > > > > >
> > > > > > > Not sure if it helps, but I upgraded simplepie.inc from 1.1.3 to
1.2 and I now get this error.  If I downgrade to 1.1.3 I have no problem.
> > > > > > >
> > > > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@>
wrote:
> > > > > > > >
> > > > > > > > Any ideas, Ryan? Anyone? Thanks!
> > > > > > > >
> > > > > > > > --- In simplepie-support@yahoogroups.com, "silvasonic" <pablo@>
wrote:
> > > > > > > > >
> > > > > > > > > LIVE URL: http://silvasonic.com/multifeeds.php
> > > > > > > > >
> > > > > > > > > PHP SCRIPTS:
> > > > > > > > > multifeeds.php:
http://pastie.org/private/3cqatesluozrb6afjtnda
> > > > > > > > > handler_image.php:
http://pastie.org/private/zlb44lwfpvqbafctr0cm4g
> > > > > > > > >
> > > > > > > > > No further modifications...
> > > > > > > > >
> > > > > > > > > Thanks a lot, Ryan!
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --- In simplepie-support@yahoogroups.com, Ryan Parman
<simplepie.support@> wrote:
> > > > > > > > > >
> > > > > > > > > > Show us your source code.
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Ryan Parman
> > > > > > > > > > http://ryanparman.com
> > > > > > > > > > Sent from my iPhone
> > > > > > > > > >
> > > > > > > > > > On Aug 5, 2009, at 5:06 PM, "silvasonic" <pablo@> wrote:
> > > > > > > > > >
> > > > > > > > > > > ERROR LOG:
> > > > > > > > > > >
> > > > > > > > > > > [05-Aug-2009 18:51:45] PHP Fatal error:  Call to a member
function
> > > > > > > > > > > get_base() on a non-object in
/home/my-server/public_html/lib/php/
> > > > > > > > > > > simplepie.inc on line 3150
> > > > > > > > > > >
> > > > > > > > > > > Hey everyone,
> > > > > > > > > > >
> > > > > > > > > > > I've tried everything I could possibly think to fix this
-- check/
> > > > > > > > > > > change/re-check all paths (simplepie.inc, multifeeds.php,
> > > > > > > > > > > handler_image.php, cache folder, etc.) Does anyone have
any idea why
> > > > > > > > > > > this is happening?
> > > > > > > > > > >
> > > > > > > > > > > The live URL in question is:
http://silvasonic.com/multifeeds.php
> > > > > > > > > > > and everything else is in http://silvasonic.com/lib/
> > > > > > > > > > >
> > > > > > > > > > > Thanks a lot in advance!
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > ------------------------------------
> > > > > > > > > > >
> > > > > > > > > > > Yahoo! Groups Links
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

#4224 From: "brrutzo" <brrutzo@...>
Date: Sun Aug 9, 2009 2:13 pm
Subject: Simple Pie Yahoo Weather Class
brrutzo
Send Email Send Email
 
Is it possible to extend the Simple Pie Yahoo Weather class to get Weather for a
specific date?  The date would never be more then 7 days in advance of the
current date.

In a nutshell, I am trying to add weather forecasts for a specific football game
from week to week.  The weeks begin on Monday's, and the team can play on either
Thursday, Saturday or Sunday.  Is this even possible with Yahoo Weather API?  If
not, are there any ways around this limitation?

Thank you,
John

Messages 4192 - 4224 of 5877   Oldest  |  < Older  |  Newer >  |  Newest
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help