• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

what is going on with cold fusion

i just put the link into web pages of colf fusion, do not know how to code (yet).
can you figure out why this page is getting a cold fusion error ? and how I can fix it?
scroll down to see error.
http://www.sustainablecampus.cornell.edu/newsevents/newsevents.cfm
<!---These lines should be in the page that is going to call the reader
<cfset rss_url = 'http://www.cuinfo.cornell.edu/Calendar/feeds/feed__xmlSustain.rss'>
<cfinclude template="rss_reader.cfm">
--->

<!---Delete this line once the lines above have been included on the calling page--->
<cfset rss_url = 'http://www.cuinfo.cornell.edu/Calendar/feeds/feed__xmlSustain.rss'>

<cfhttp url="#rss_url#" method="get" resolveurl="no">

<cfset events = XMLParse(cfhttp.FileContent)>

<cfoutput>

	<!---Remove if using your own title.
	<h3><a href="#events.rss.channel.link.XMLText#">#events.rss.channel.title.XMLText#</a></h3>--->
	
	<!---Change this to customize the number of events to show in the read--->
	
	
	<cfset show = 9>
	
	<!---This outputs the feed if there are items in the feed--->
	
	<cfif #ArrayLen(events.rss.channel.item)# gt 0>		
		<cfloop index="i" from="1" to="#show#">			
			<p>#dateformat(events.rss.channel.item[i].startdate.XMLText, "mmm dd, yyyy")# 
			<cfif find("All Day", events.rss.channel.item[i].starttime.XMLText)>All Day<cfelse>at  #timeformat(events.rss.channel.item[i].starttime.XMLText, "h:mm tt")#</cfif> - 
			#events.rss.channel.item[i].title.XMLText#..
            <a href="#events.rss.channel.item[i].guid.XMLText#">more</a></p>
		</cfloop>
	<cfelse>
		<b>No events at this time</b>
	</cfif>
</cfoutput>
 <p><a href="http://cornell.edu/events/" title="link to events" target="_blank">More events(type in keyword "sustainability")</a></p>

<!---Uncomment this line to see all available fields
<cfdump var="#events#">--->

Open in new window

0
lisakilgore
Asked:
lisakilgore
  • 3
  • 3
  • 2
  • +2
4 Solutions
 
gdemariaCommented:
Is this resolved?  I don't see an error..

If there is still a problem can you post the error and the line that it's referrencing..
0
 
_agx_Commented:
I don't see an error either.  

> <cfhttp url="#rss_url#" method="get" resolveurl="no">

I noticed you're not checking for errors. By default cfhttp doesn't throw an error if there are problems. Always check the status code first to verify the call was successful. Otherwise, you'll end up with a very cryptic error when you try and parse the feed w/XMLParse.

<cfhttp url="#rss_url#" method="get" resolveurl="no">
<cfif cfhttp.statusCode eq "200 OK">
      <!--- request was successful .  go ahead and do rest output code ... --->
      <cfset events = XMLParse(cfhttp.FileContent)>
      ... rest of code 

<cfelse>
        oops. it failed for some reason. do error handling here 
</cfif>

Open in new window

0
 
gdemariaCommented:

Sorry Lisa for the tangent..


agx, ideas on this question, i'm going in circles?

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_26973485.html?cid=1572#a35461407
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
OP_ZaharinCommented:
- i also didn't see any error on the pages, except that clicking the "more" link doesn't shows specific event page, which i presume it should do that.
- currently, both 'more' links on that page go to the main event page http://events.cornell.edu/ instead. look into the "#events.rss.channel.item(i).guid.XMLText#" if its referring to the right/existing value.

0
 
lisakilgoreAuthor Commented:
thank you all....
sorry i didn't respond to anyone, someone at work helped me
Try changing :
<cfif #ArrayLen(events.rss.channel.item)# gt 0>

To this:
<cfif isdefined(“events.rss.channel.item”) >
0
 
gdemariaCommented:
Your code will throw an error if the number of items on the RSS is less than your "show" value.   Perhaps that will never happen, but just an FYI...
0
 
_agx_Commented:
sorry i didn't respond to anyone

That would've made it easier for us to help you ;-)  If you feel you solved the problem yourself, you can select your comment as the answer, instead of just picking a random comment just to close the question.
0
 
dagaz_deCommented:
I see this error

The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Could not find the included template rss_reader.cfm.

 
The error occurred in E:\Webs\www.sustainablecampus.cornell.edu\newsevents\newsevents.cfm: line 210
0
 
OP_ZaharinCommented:
0
 
OP_ZaharinCommented:
- ops sorry you mean error on the asker page :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now