PDA

View Full Version : Fatal error: Call to a member function on a non-object in


Tim_Myth
10-27-2005, 12:06 PM
So I'm playing with the pagination and RSS feed stuff, and come across this error:

Fatal error: Call to a member function on a non-object in /htdocs/after5webdesign/directory/rss.php on line 86

I set the pagination at 5 links (my directory isn't very full yet), and browsed to the second page of links in teh Consumer Electronics section. I then clicked the XML button and got the error. I'm pretty sure that it is the &p=xx option that is throwing it off since it only fails when that option is present. I do not know if the error is present when URL rewriting is on because I can't get that portion to work on my host.

What I'm testing is whether the rss feed only displays the feed for that page or if it displays all the links in that category. E.g, if a category has 500 links, does the feed display all 500 or is it paginated as well?

Tim_Myth
10-27-2005, 12:24 PM
In rss.php, it appears that $links is being assigned the number of links displayed on the "Top xxxxx" page.
Content visible to registered users only.
I did not change the top number though...hmmm...brb
Nope, that didn't work.

BUT! I did discover the problem is probably not with rss.php at all, but rather it is likely with my top_bar.tpl. More specifically with this bit of code:

Content visible to registered users only.
The url it's trying to go to is http://www.after5webdesign.com/directory/rss.php?p=2

Tim_Myth
10-27-2005, 04:49 PM
Interestingly if you change the logic to {elseif !$p} instead of {elseif $p}, it works for multiple pages, but doesn ot work with single paged categories.

Content visible to registered users only.

David
10-27-2005, 05:06 PM
It looks like you figured out much of the issue. Sorry we weren't more helpful, but it's great that you posted what you did for others who may need help in the future. 8)

Tim_Myth
10-27-2005, 05:49 PM
Thanks David. I must say that I love this script. I'm strapped for cash at the moment (4 kids, mortgage, and Christmas looming), but once I get several sites up and running, you'll be the first to know. $$ :wink:

I'd do better if I knew what $p was. Then maybe I can post a patch for it. I'd also do better if i knew php. :D

Can you answer a quick question for me? does the RSS feed only display the links on that page, or does it display all the links in the category? For example, if I have my directory set to display 20 links per page, and I have 500 links in my Weddings category, will the RSS feed for the weddings category only display the links from the specific page it is taken from, or will it feed me all 500 links?

David
10-27-2005, 05:50 PM
I pretty sure it displays all links in the category