[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

what is going on with cold fusion

Posted on 2011-04-25
10
Medium Priority
?
257 Views
Last Modified: 2012-06-22
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
Comment
Question by:lisakilgore
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 750 total points
ID: 35460292
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
 
LVL 52

Assisted Solution

by:_agx_
_agx_ earned 375 total points
ID: 35461689
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
 
LVL 39

Assisted Solution

by:gdemaria
gdemaria earned 750 total points
ID: 35461790

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
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
LVL 23

Assisted Solution

by:OP_Zaharin
OP_Zaharin earned 375 total points
ID: 35695226
- 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
 

Author Closing Comment

by:lisakilgore
ID: 35754280
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
 
LVL 39

Expert Comment

by:gdemaria
ID: 35754345
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
 
LVL 52

Expert Comment

by:_agx_
ID: 35755715
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
 
LVL 3

Expert Comment

by:dagaz_de
ID: 35832154
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
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35832178
0
 
LVL 23

Expert Comment

by:OP_Zaharin
ID: 35832186
- ops sorry you mean error on the asker page :)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question