RSS help

14 posts by 3 authors in: Forums > CMS Builder
Last Post: December 15, 2011   (RSS)

Hello all,
I want to add a RSS feed to a site I am working on.
I used the http://www.interactivetools.com/docs/cmsbuilder/rss_feeds.html as a template. It validated and looked like it would work. Yet when I run some test posts they do not show up in the feed. I am pulling records from 3 different areas of input. That is where I think the wheels fall off my code. I attached the php file if anyone would like to give it a look and point me in the right direction.

Thank you
Chris
Attachments:

rss-xml_003.php 3K

Re: [towtimes] RSS help

By Jason - December 14, 2011

Hi Chris,

If you are receiving no errors on the page, then you are probably just not returning any records in $truckRecords.

A couple of things I noticed:

- You do a query to get location records, but they are not used anywhere else in the script.

- You are retrieving a single accounts record based on a number in the URL string. If there is nothing in the string, it will use record number 1. Since your other 2 queries are based on this accounts record, if no number is being passed in the URL, that could explain the problem.

Try using debugSql on your queries to see what their actually executing to see if there are any clues there.

Let us know what you find.

Thanks,
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] RSS help

Thanks for the tips I did get rid of that locations records code.I also removed the single record string. I want to show the 5 most current listings at a time. One issue I see is the <?php foreach ($trucksRecords as $record): ?> I need to pull from trucks and the account field. How do I add both fields to that statement. I attached the new revised code.
Attachments:

rss-xml_004.php 3K

Re: [gkornbluth] RSS help

Thank you for the help I did have to many closing tags. Now when I cleaned up my code to match your example I get this error message. <?xml version="1.0" encoding="UTF-8"?>Couldn't start session! 'session_start(): Cannot send session cache limiter - headers already sent (output started at /home/towingeq/public_html/rss.xml.php:1)'!
you can look at my file in action at http://towingequipmentsearch.com/rss.xml.php
I attached the new code. Sorry to be a pain coding is just not my strong point.
Attachments:

rss-xml_005.php 3K

Re: [towtimes] RSS help

Hi Towtimes,

I'm not a great coder either.

You might try:

session_write_close ();
after your

require_once("./includes/functions.inc.php");
[session_write_close ();


And I think you might be missing a . in the include path

"../includes/functions.inc.php");

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] RSS help

Thank you for the tips. I added the session_close (); part and nothing bad happened.
I tired the extra . and that did not go over to well. I still have the same error message as I did before. I will keep trying different code until it works.

Re: [towtimes] RSS help

does it give an error without the extra include?
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] RSS help

I have been playing around with the code and now I get a new error message. That might be progress haha.
getRecords(trucks) errors<br/>

I think now I have the RSS formatting correct but not the code to pull from the database.
I attached the new file.

Thank you

Re: [towtimes] RSS help

no file attached...
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php