📄 _monthly_hits.rhtml
字号:
<br><% unique_max_total = @month_hits.inject(0) {|m,a| a[1].to_i > m ? a[1].to_i : m }hits_max_total = @month_hits.inject(0) {|m,a| a[2].to_i > m ? a[2].to_i : m }%><table cellpadding=0 cellspacing=0 align=center width=65%><tr valign=bottom><td valign=top align=left width=60 nowrap> <img align="bottom" src="/images/sitealizer/uv.png" height="10" width="4"/> Unique<br> <img align="bottom" src="/images/sitealizer/vh.png" height="10" width="4"/> Hits</td><% @month_hits.each do |month_hits|unique_height = 0hits_height = 0if unique_max_total > 0 unique_height = ((month_hits[1].to_f/unique_max_total)*100).round unique_height = 1 if unique_height < 1 endif hits_max_total > 0 hits_height = ((month_hits[2].to_f/hits_max_total)*100).round hits_height = 1 if hits_height < 1 end%><td> <table> <tr valign=bottom nowrap align=center> <td> <img align="bottom" src="/images/sitealizer/uv.png" height="<%=unique_height%>" width="4"/> <img align="bottom" src="/images/sitealizer/vh.png" height="<%=hits_height%>" width="4"/> </td> </tr> <tr valign=bottom nowrap align=center> <td> <span style="font-size:10px"><%=month_hits[0]%></span> </td> </tr> </table></td><%end%></tr></table><br><br><table align=center width=70% border=1 cellpadding=3><tr align=center nowrap><th align=center>Month</th><th align=center>Hits</th><th align=center>Percentage</th><th align=center>Unique Visits</th></tr><%i=1; @month_hits.each do |month_hits| %><tr nowrap><td align=left><%= month_hits[0] %></td><td align=center><%= month_hits[2] %></td><td align=center><%= sprintf("%000.2f",(month_hits[2].to_f/@year_hits)*100) %>%</td><td align=center><%= month_hits[1] %></td></tr><% i+=1; end %><tr align=center nowrap bgcolor="#DDDDDD"><td align=left><b>Totals:</td><td align=center><b><%=@year_hits%></b></td><td></td> <td align=center><b><%=@year_uniq%></b></td></tr></table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -