| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : forums.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : June 10, 2004 |
|---|
| 6 | Last Updated : August 4, 2006 |
|---|
| 7 | History : Support for UUID (rkc 1/27/05) |
|---|
| 8 | Display lastmsg, msgcount (rkc 4/6/05) |
|---|
| 9 | Fixed code that gets # of pages (rkc 4/8/05) |
|---|
| 10 | Right colspan if no data (rkc 4/15/05) |
|---|
| 11 | Pass mode to pagination tag, used to hide/show subscribe button (rkc 7/29/05) |
|---|
| 12 | Remove mappings (8/27/05) |
|---|
| 13 | Support for sorting (rkc 9/15/05) |
|---|
| 14 | show last user (rkc 7/12/06) |
|---|
| 15 | show title (rkc 8/4/06) |
|---|
| 16 | Purpose : Displays forums for conference |
|---|
| 17 | ---> |
|---|
| 18 | |
|---|
| 19 | <cfif not isDefined("url.conferenceid") or not len(url.conferenceid)> |
|---|
| 20 | <cflocation url="index.cfm" addToken="false"> |
|---|
| 21 | </cfif> |
|---|
| 22 | |
|---|
| 23 | <!--- get parent conference ---> |
|---|
| 24 | <cftry> |
|---|
| 25 | <cfset request.conference = application.galleon.conference.getConference(url.conferenceid)> |
|---|
| 26 | <cfcatch> |
|---|
| 27 | <cflocation url="index.cfm" addToken="false"> |
|---|
| 28 | </cfcatch> |
|---|
| 29 | </cftry> |
|---|
| 30 | |
|---|
| 31 | <!--- get my forums ---> |
|---|
| 32 | <cfset data = application.galleon.forum.getForums(conferenceid=url.conferenceid)> |
|---|
| 33 | |
|---|
| 34 | <!--- sort ---> |
|---|
| 35 | <cfset data = request.udf.querySort(data,url.sort,url.sortdir)> |
|---|
| 36 | |
|---|
| 37 | <!--- Loads header ---> |
|---|
| 38 | <cfmodule template="tags/layout.cfm" templatename="main" title="#application.galleon.settings.title# : #request.conference.name#"> |
|---|
| 39 | |
|---|
| 40 | <!--- determine max pages ---> |
|---|
| 41 | <cfif data.recordCount and data.recordCount gt application.galleon.settings.perpage> |
|---|
| 42 | <cfset pages = ceiling(data.recordCount / application.galleon.settings.perpage)> |
|---|
| 43 | <cfelse> |
|---|
| 44 | <cfset pages = 1> |
|---|
| 45 | </cfif> |
|---|
| 46 | |
|---|
| 47 | <!--- Displays pagination on right side, plus left side buttons for threads ---> |
|---|
| 48 | <cfmodule template="tags/pagination.cfm" pages="#pages#" mode="conference" /> |
|---|
| 49 | |
|---|
| 50 | <!--- Now display the table. This changes based on what our data is. ---> |
|---|
| 51 | <cfoutput> |
|---|
| 52 | <p> |
|---|
| 53 | <table width="100%" cellpadding="6" class="tableDisplay" cellspacing="1" border="0"> |
|---|
| 54 | <tr class="tableHeader"> |
|---|
| 55 | <td colspan="5" class="tableHeader">Conference: #request.conference.name#</td> |
|---|
| 56 | </tr> |
|---|
| 57 | <tr class="tableSubHeader"> |
|---|
| 58 | <td class="tableSubHeader">#request.udf.headerLink("Forum","name")#</td> |
|---|
| 59 | <td class="tableSubHeader">#request.udf.headerLink("Description")#</td> |
|---|
| 60 | <td class="tableSubHeader">#request.udf.headerLink("Messages","messagecount")#</td> |
|---|
| 61 | <td class="tableSubHeader">#request.udf.headerLink("Last Post","lastpost")#</td> |
|---|
| 62 | <td class="tableSubHeader">#request.udf.headerLink("Read Only","readonly")#</td> |
|---|
| 63 | </tr> |
|---|
| 64 | <cfif data.recordCount> |
|---|
| 65 | <cfset cachedUserInfo = request.udf.cachedUserInfo> |
|---|
| 66 | <cfloop query="data" startrow="#(url.page-1)*application.galleon.settings.perpage+1#" endrow="#(url.page-1)*application.galleon.settings.perpage+application.galleon.settings.perpage#"> |
|---|
| 67 | <tr class="tableRow#currentRow mod 2#"> |
|---|
| 68 | <td><a href="threads.cfm?forumid=#id#">#name#</a></td> |
|---|
| 69 | <td>#description#</td> |
|---|
| 70 | <td>#messagecount#</td> |
|---|
| 71 | <td> |
|---|
| 72 | <cfif len(useridfk)> |
|---|
| 73 | <cfset uinfo = cachedUserInfo(username=useridfk,userid=true)> |
|---|
| 74 | <a href="messages.cfm?threadid=#threadidfk###last">#dateFormat(lastpost,"m/d/yy")# #timeFormat(lastpost,"h:mm tt")#</a> by #uinfo.username# |
|---|
| 75 | <cfelse> </cfif> |
|---|
| 76 | </td> |
|---|
| 77 | <td>#yesNoFormat(readonly)#</td> |
|---|
| 78 | </tr> |
|---|
| 79 | </cfloop> |
|---|
| 80 | <cfelse> |
|---|
| 81 | <tr class="tableRow1"> |
|---|
| 82 | <td colspan="5">Sorry, but there are no forums available for this conference.</td> |
|---|
| 83 | </tr> |
|---|
| 84 | </cfif> |
|---|
| 85 | </table> |
|---|
| 86 | </p> |
|---|
| 87 | </cfoutput> |
|---|
| 88 | |
|---|
| 89 | </cfmodule> |
|---|
| 90 | |
|---|
| 91 | <cfsetting enablecfoutputonly=false> |
|---|