📄 bodygroup.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="GB18030" import="com.blue.web.common.util.*,java.util.*,com.eline.vod.utils.caching.*,com.blue.web.common.model.*,com.eline.vod.utils.*,com.eline.vod.client.*,com.eline.vod.model.*"%>
<%!
String showStars(int count, String element) {
String result = "";
for (int i = 0; i < count; i ++)
result += element;
return result;
}
%>
<%
int groupId = StringUtils.getInt(request.getParameter("group"), 0);
int pageIndex = StringUtils.getInt(request.getParameter("page"), 0);
int sortBy = StringUtils.getInt(request.getParameter("sort"), 1);
String groupCacheKey = "group-id:" + groupId;
Cache cache = Cache.getInstance();
Group group = (Group) cache.get(groupCacheKey);
if (group == null) {
group = Groups.getGroup(groupId);
if (group != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MINUTE, 5);
cache.add(groupCacheKey, group, cal.getTime(), Cache.NoSlidingExpiration);
}
}
// 判断影片数目是否为0
boolean groupNotFound = group == null;
System.out.println("groupNotFound=" + groupNotFound);
String moviesCacheKey = "movies-group:" + groupId + "-8-" + pageIndex;
if (sortBy != -1)
moviesCacheKey += "-sort:" + sortBy;
System.out.println("cacheKey=" + moviesCacheKey);
Page chunk = (Page) cache.get(moviesCacheKey);
if (chunk == null) {
chunk = Groups.getMoviesInGroup(groupId, sortBy, pageIndex * 8, 8, true); if (chunk.getItems().size() > 0) {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MINUTE, 1);
cache.add(moviesCacheKey, chunk, cal.getTime(), Cache.NoSlidingExpiration);
}
}
boolean groupEmpty = chunk.getItems().size() < 1;
String movieURL = SiteUrls2.getInstance().getMovieURL() + "?group=" + groupId + "&item=";
String groupURL = SiteUrls2.getInstance().getMovieGroupURL() + "?group=" + groupId;
%><table cellSpacing="0" cellPadding="1" width="100%" border="0">
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0" class="pager1">
<tr>
<td width="64"><img src="<%= request.getContextPath() %>/images/02/title-right-hot-01.gif"></td>
<td style="PADDING-TOP: 15px; FONT-WEIGHT: bold; COLOR: #ffffff" width="100"
background="<%= request.getContextPath() %>/images/02/title-right-hot-bg.gif"> <%=groupNotFound ? "未知" : group.getName() %></td>
<td width="5"><img src="<%= request.getContextPath() %>/images/02/title-right-hot-02.gif"></td>
<td style="PADDING-TOP: 15px" align="right" background="<%= request.getContextPath() %>/images/02/title-right-hot-bg1.gif">排序: <a href="<%=groupURL + "&sort=1"%>">正常排序</a> <a href="<%=groupURL + "&sort=2"%>">上架时间</a> <a href="<%=groupURL + "&sort=3"%>">点播次数</a> </td>
<td width="20"><img src="<%= request.getContextPath() %>/images/02/title-right-hot-03.gif"></td>
</tr>
</table>
</td>
</tr>
</table>
<%if (groupEmpty) { %>
<table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="#FFAD33" style="BORDER: #F7F1E3 1px solid;">
<tr><td align="center">影片数为空!</td></tr>
</table>
<%} else { %>
<table width="100%" border="0" cellpadding="6" cellspacing="0" bgcolor="#FFAD33" style="BORDER: #F7F1E3 1px solid;">
<%
for (int i = 0; i < chunk.getItems().size(); i ++) {
Movie item = (Movie) chunk.getItems().get(i); if (i % 2 == 0) {%><tr><%} %>
<td align="center" width="50%">
<table class="body4" cellSpacing="0" cellPadding="0" width="97%" border="0">
<tr><td height="10" colspan="2"> </td></tr>
<tr>
<td width="150" height="180" align="center"><a href="<%=movieURL + item.getIndexID() %>"><img alt="点击进入:<%=item.getTitle() %>" src="<%= request.getContextPath() + ImageProcessor.getThumbFileURL(item.getOrigionFile(), 125, 170) %>" width="125" height="170" border="0" /></a></td>
<td align="left" valign="top">片名:<a href="<%=movieURL + item.getIndexID()%>"><%=item.getTitle() %></a>
<br>
导演:<%=item.getDirector() %><br>
编剧:<%=item.getPlaywright() %><br>
主演:<%=item.getActors() %><br>
<!-- 片长: 108分钟
<br>
收费: 普通会员 -->
</td>
</tr>
<tr>
<td height="20" align="left"> 推荐指数:<%=showStars(item.getRecommend(), "<img src=\"" + request.getContextPath() + "/images/zhishu.gif\" width=\"15\" height=\"13\"/>") %></td>
<td height="20" align="left"> <a href="<%=movieURL + item.getIndexID()%>"><img alt="播放" border="0" src="<%= request.getContextPath() %>/images/play.gif" width="62" height="20"></a>
<a href="<%=movieURL + item.getIndexID()%>"><img alt="下载" border="0" src="<%= request.getContextPath() %>/images/download.gif" width="62" height="20"></a></td>
</tr>
</table>
</td>
<%if (i % 2 == 1) { %></tr><%} %>
<%} %>
</table>
<%} %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -