Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--- I created a function to generate the html that I output, it's called buildSessionOutput --->
- <cffunction name="buildSessionOutput" output="true" returntype="string">
- <cfargument name="scheduleID" type="numeric" required="true">
- <cfargument name="userID" type="numeric" required="true">
- <cfargument name="title" type="string" required="true">
- <cfargument name="teaser" type="string" required="true">
- <cfargument name="startDateTime" type="string" required="true">
- <cfargument name="endDateTime" type="string" required="true">
- <cfargument name="locationName" type="string" required="true">
- <cfargument name="location" type="string" required="true">
- <cfargument name="trackDesc" type="string" required="true">
- <cfargument name="trackName" type="string" required="true">
- <cfargument name="followed" type="string" required="true">
- <cfset var outputText = ""/>
- <cfsavecontent variable="outputText">
- <div class="session">
- <a
- href="/session/#arguments.scheduleID#"
- class="session-link"
- data-log-activity="true"
- data-log-activity-action="viewed"
- data-log-activity-action-type="session"
- data-log-activity-url="/session/#arguments.scheduleID#/"
- data-log-activity-userid="#arguments.userID#"
- data-log-activity-ip="#cgi.remote_addr#"
- data-log-activity-action_on_id="#arguments.scheduleID#"
- data-log-activity-message="source:agenda"
- >
- <div class="session-details">
- <h3 class="session-name">#arguments.title#</h3>
- <cfif len(arguments.teaser)>
- <p>#arguments.teaser#</p>
- </cfif>
- <cfif hideTime EQ 0>
- <div class="detail-item">
- <span webicon="fa:clock-o"></span>#TimeFormat(arguments.startdatetime,'h:mm tt')#
- <cfif len(endDateTime)>- #TimeFormat(arguments.enddatetime,'h:mm tt')#</cfif>
- </div>
- </cfif>
- <cfif len(locationName)>
- <div class="detail-item">
- <span webicon="fa:map-marker"></span> #arguments.locationName#
- </div>
- <cfelseif len(location)>
- <div class="detail-item">
- <span webicon="fa:map-marker"></span> #arguments.location#
- </div>
- </cfif>
- <cfif layoutSetting.getHideTrackOnAgendaDisplay() NEQ 1>
- <div class="detail-item">
- <span class="badge" style="background-color: #color#"><cfif arguments.trackDesc NEQ 0>Track #arguments.trackDesc# : </cfif>#arguments.trackName#</span>
- </div>
- </cfif>
- </div>
- </a>
- <span class="favorite-star save-follow <cfif len(arguments.followed)>active</cfif>" webicon="fa:star-o" data-followtype="session" data-followid="#arguments.scheduleID#"></span>
- </div> <!--- /.session --->
- </cfsavecontent>
- <cfreturn outputText/>
- </cffunction>
- <!--- then when I'm looping through the sessions to display, i call that function with the data ---->
- #buildSessionOutput(scheduleID,session.user.getUserID(),title,teaser,startDateTime,endDateTime,locationName,location,trackDesc,trackName,followed)#
- <!--- this is the part where I check for part 1 in the session title, if found, loop from 2-4 to check for parts 2 - 4--->
- <!--- the checkNextPart query will be an endpoint for you to call and i can return the session data back ---->
- <cfif findNoCase('part 1', title)>
- <cfloop from="2" to="4" index="i">
- <cfquery name="checkNextPart">
- EXECUTE [dbo].[agendaGetNextPart]
- @userID = <cfqueryparam cfsqltype="cf_sql_integer" value="#session.user.getUserID()#"/>,
- @partText = <cfqueryparam cfsqltype="cf_sql_varchar" value="Part #i#%"/>,
- @trackID = <cfqueryparam cfsqltype="cf_sql_integer" value="#trackID#"/>,
- @startDateTime = <cfqueryparam cfsqltype="cf_sql_varchar" value="#dateTimeFormat(startDateTime,'short')#"/>
- </cfquery>
- <cfif checkNextPart.recordCount>
- #buildSessionOutput(checkNextPart.scheduleID,session.user.getUserID(),checkNextPart.title,checkNextPart.teaser,checkNextPart.startDateTime,checkNextPart.endDateTime,checkNextPart.locationName,checkNextPart.location,checkNextPart.trackDesc,checkNextPart.trackName,checkNextPart.followed)#
- </cfif>
- </cfloop>
- </cfif>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement