-
Notifications
You must be signed in to change notification settings - Fork 0
/
topviewed.cfm
57 lines (57 loc) · 3.07 KB
/
topviewed.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<cfset variables.newrow = False>
<cfset yt = createObject("component", "#request.cfcpath#.youtube")>
<cfset tick = GetTickCount()>
<cfif isDefined('url.time')>
<cfset topviewed = #yt.getMostViewedVideos("#url.time#",1,50)#>
<cfelse>
<cfset topviewed = #yt.getMostViewedVideos("",1,50)#>
<cfset tock = GetTickCount()>
</cfif>
<table align="center" width="100%">
<cfoutput>
<cfset _searchtime = (tock - tick)/1000>
<tr><td colspan="4"><div style="float:left;">Fetching data took <b class="errString">#_searchtime#</b> (locally) seconds</div><div style="float:right;"> <a href="videos.cfm?action=topviewed&time=today" title="Show Todays's Top viewed videos">Today</a> | <a href="videos.cfm?action=topviewed&time=this_week" title="Show this week's top viewed videos">This week</a> | <a href="videos.cfm?action=topviewed&time=this_month" title="Show this month's top viewed videos">This Month</a> | <a href="videos.cfm?action=topviewed&time=all_time" title="Ahow all time Top viewed Videos">All Time</a></div></td></tr>
</cfoutput>
<cfif topviewed.recordcount>
<cfinclude template="paging.cfm">
<br />
<div align="center">
<cfoutput>
Displaying <b>#pagination.getStartRow()#</b> to <b>#pagination.getMaxRows()#</b> of <b>#topviewed.total#</b> Records.
</cfoutput>
</div>
<cfoutput>#pagination.getRenderedHTML()#</cfoutput>
<cfoutput query="topviewed" startrow="#pagination.getStartRow()#" maxrows="#pagination.getMaxRows()#">
<td height="30" valign="middle"><div class="leftcontentDIV" align="center"> <strong><a href="videos.cfm?action=show&ID=#ID#"> <img src="#thumbnail_url#" width="#thumbnail_width#" height="#thumbnail_height#" title="#title#" border="0"/></a><br>
<cfinclude template="timing.cfm">
<br>
<div align="center">#Left(title,10)#...<br>
<cfif averagerating GT 0>
#repeatstring('<img src="images/star.png" width="16" height="16" title="#averagerating#" alt="Avg Rating: ' & averagerating &'">', int(averagerating))#
<cfif int(#averagerating#) LT 5>
#repeatstring('<img src="images/star-blank.png" width="16" height="16" title="#averagerating#" alt="Avg Rating: ' & averagerating &'">', 5-int(averagerating))#
</cfif>
<cfelse>
#repeatstring('<img src="images/star-blank.png" width="16" height="16" alt="not rated yet" title="not rated yet">', 5)#
</cfif>
<br>
<cfif #viewcount# IS "">0<cfelse>#viewcount#</cfif> views<br>
<a href="videos.cfm?action=author&code=#author#" title="All Videos by #author#">#author#</a></div>
</strong> </div>
</td>
<cfif topviewed.currentRow MOD 4 EQ 0>
</tr>
<cfset variables.newrow = true>
<cfelse>
<cfset variables.newrow = false>
</cfif>
</cfoutput>
<cfelse>
<tr>
<td colspan="4" align="center"><img src="images/smilo.gif" alt="No Top Viewed videos Found" border="0" /><br />
<br />
No Top viewed videos Found! </td>
</tr>
</cfif>
<tr>
</table>