root/trunk/website/forums/index.cfm @ 21

Revision 5, 3.0 kB (checked in by DanWilson, 17 years ago)

Initial Commit Of ModelGlue? Website (upgrade to blogcfc 511)

Line 
1<cfsetting enablecfoutputonly=true>
2<!---
3        Name         : index.cfm
4        Author       : Raymond Camden
5        Created      : June 10, 2004
6        Last Updated : August 4, 2006
7        History      : show msgcount, last msg (rkc 4/6/05)
8                                   Fixed code that gets # of pages (rkc 4/8/05)
9                                   Right colspan if no data (rkc 4/15/05)
10                                   use addToken=false in auto-push (rkc 4/15/05)
11                                   Remove mappings (rkc 8/27/05)
12                                   support sorting, fix pages (rkc 9/15/05)
13                                   show last user (rkc 7/12/06)
14                                   show right title (rkc 8/4/06)
15        Purpose          : Displays conferences
16--->
17
18<!--- get my conferences --->
19<cfset data = application.galleon.conference.getConferences()>
20
21<!--- if just one, auto go to a forums for it --->
22<cfif data.recordCount is 1>
23        <cflocation url="forums.cfm?conferenceid=#data.id#" addToken="false">
24</cfif>
25
26<!--- sort --->
27<cfset data = request.udf.querySort(data,url.sort,url.sortdir)>
28
29<!--- Loads header --->
30<cfmodule template="tags/layout.cfm" templatename="main" title="#application.galleon.settings.title#">
31
32<!--- determine max pages --->
33<cfif data.recordCount and data.recordCount gt application.galleon.settings.perpage>
34        <cfset pages = ceiling(data.recordCount / application.galleon.settings.perpage)>
35<cfelse>
36        <cfset pages = 1>
37</cfif>
38
39<!--- Displays pagination on right side, plus left side buttons for threads --->
40<cfmodule template="tags/pagination.cfm" pages="#pages#" />
41
42<!--- Now display the table. This changes based on what our data is. --->
43<cfoutput>
44<p>
45        <table width="100%" cellpadding="6" class="tableDisplay" cellspacing="1" border="0">
46        <tr class="tableHeader">
47                <td colspan="4" class="tableHeader">Conferences</td>
48        </tr>
49        <tr class="tableSubHeader">
50                <td class="tableSubHeader">#request.udf.headerLink("Name")#</td>
51                <td class="tableSubHeader">#request.udf.headerLink("Description")#</td>
52                <td class="tableSubHeader">#request.udf.headerLink("Messages","messagecount")#</td>
53                <td class="tableSubHeader">#request.udf.headerLink("Last Post","lastpost")#</td>
54        </tr>
55        <cfif data.recordCount>
56                <!--- Have to 'fake out' CF since it doesn't like named params with udfs in a struct --->
57                <cfset cachedUserInfo = request.udf.cachedUserInfo>
58                <cfloop query="data" startrow="#(url.page-1)*application.galleon.settings.perpage+1#" endrow="#(url.page-1)*application.galleon.settings.perpage+application.galleon.settings.perpage#">
59                        <tr class="tableRow#currentRow mod 2#">
60                                <td><a href="forums.cfm?conferenceid=#id#">#name#</a></td>
61                                <td>#description#</td>
62                                <td>#messagecount#</td>
63                                <td><cfif len(useridfk)>
64                                <cfset uinfo = cachedUserInfo(username=useridfk,userid=true)>
65                                <a href="messages.cfm?threadid=#threadidfk###last">#dateFormat(lastpost,"m/d/yy")# #timeFormat(lastpost,"h:mm tt")#</a> by #uinfo.username#
66                                <cfelse>&nbsp;</cfif></td>
67                        </tr>
68                </cfloop>
69        <cfelse>
70                <tr class="tableRow1">
71                        <td colspan="4">Sorry, but there are no conferences available.</td>
72                </tr>
73        </cfif>
74</table>
75</p>
76</cfoutput>
77       
78</cfmodule>
79
80<cfsetting enablecfoutputonly=false>
Note: See TracBrowser for help on using the browser.