root/trunk/website/blog/includes/relatedpostsjs.cfm

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

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

Line 
1<cfset relatedCats                      = application.blog.getRelatedEntriesSelects() />
2<cfif URL.id IS NOT "0">
3        <cfset getRelatedEntries        = application.blog.getRelatedBlogEntries(URL.id) />
4</cfif>
5
6<cfset catList = "" />
7<cfoutput query="relatedCats" group="categoryName">
8        <cfset catList = listAppend(catList, categoryName) />
9</cfoutput>
10
11var categoryArray       = new Array(<cfoutput>#listQualify(catList, '"')#</cfoutput>);
12var rememberCats        = new Array();  // global array to hold selected options for related entries (categories)
13var rememberEntries = new Array();      // global array to hold selected options for related entries (entries)
14
15var originalEntries = new Array();  // global array to hold the -original- selected options for related entries (entries)
16
17<cfif URL.id IS NOT "0">
18        <cfoutput>
19                <cfloop query="getRelatedEntries">
20                        rememberCats[rememberCats.length] = "#categoryName#";
21                        rememberEntries[rememberEntries.length] = "#ID#";
22                               
23                        originalEntries[originalEntries.length] = "#ID#";
24                </cfloop>
25        </cfoutput>
26</cfif>
27
28<cfset outercount = 0 />
29<cfoutput query="relatedCats" group="categoryName">
30        categoryArray["#categoryName#"] = new Array();
31        <cfset arrayCounter = 0 />
32        <cfoutput>
33                <!--- added conditional to prevent current entry from displaying in entries list : 12 january 2005 : cjg --->
34                <cfif relatedCats.ID IS NOT URL.ID>
35                        categoryArray["#categoryName#"][#arrayCounter#]                 = new Array();
36                        categoryArray["#categoryName#"][#arrayCounter#].ID              = "#ID#";
37                        categoryArray["#categoryName#"][#arrayCounter#].posted  = "#dateFormat(posted, 'mm/dd/yyyy')#";
38                        categoryArray["#categoryName#"][#arrayCounter#].title   = "#jsStringFormat(title)#";
39                       
40                        <cfset arrayCounter = arrayCounter + 1 />
41                </cfif>
42        </cfoutput>
43</cfoutput>
Note: See TracBrowser for help on using the browser.