📄 bodymovie.jsp
字号:
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030" import="com.blue.web.common.util.*,java.util.*,com.blue.web.common.model.*,com.eline.vod.utils.caching.*,com.eline.vod.utils.*,com.eline.vod.client.*,com.eline.vod.model.*"%>
<%!
String getGroupsString(ArrayList groups) {
String result = "";
for (int i = 0; i < groups.size(); i ++) {
Group group = (Group) groups.get(i);
result += group.getName() + "/";
}
return result;
}
String showStars(int count, String element) {
String result = "";
for (int i = 0; i < count; i ++)
result += element;
return result;
}
public static String getChineseDateString(Date date) {
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy年MM月dd日");
try {
return sdf.format(date);
} catch (Exception e) {
return null;
}
}
%>
<%
int groupId = StringUtils.getInt(request.getParameter("group"), 0);
int movieId = StringUtils.getInt(request.getParameter("item"), 0);
System.out.println("bodyMovies.jsp.groupId=" + groupId);
String cacheKey = "movies-item:" + movieId;
Cache cache = Cache.getInstance();
Movie item = (Movie) cache.get(cacheKey);
if (item == null) {
Movies movies = new Movies();
item = movies.getMovie(movieId);
if (item != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
cal.add(Calendar.MINUTE, 5);
cache.add(cacheKey, item, cal.getTime(), Cache.NoSlidingExpiration);
}
}
// 判断影片数目是否为0
boolean notFound = item == null;
ArrayList movieGroups = new ArrayList();
Page chapters = null;
if (!notFound) {
movieGroups = Groups.getGroupsForMovie(movieId, true);
MovieChapterCondition cond1 = new MovieChapterCondition();
cond1.setMovieId(movieId);
cond1.setApprovedOnly(false);
MovieChapters helper = new MovieChapters();
chapters = helper.searchMovieChapter(cond1, 0, 999);
System.out.println("movieId=" + movieId);
System.out.println("chapters=" + chapters.getTotalRecords());
}
System.out.println("item=" + item);
%>
<!-- bodyMovie.jsp -->
<% if (notFound){ %>
<table width="100%" height="50" border="0" cellpadding="1" cellspacing="0">
<tr><td align="center">影片没有找到</td></tr>
</table>
<%} else { %>
<script type="text/javascript"><!--function doPlayMovie(movieId, index) {
var url = "<%=SiteUrls2.getInstance().getProperty(SiteUrls2.URL_WND_MOVIEPLAYER)%>?item=" + movieId + "&index=" + index;
window.open(url, "_mediaplayer" , "width=650,height=350,status=no,toolbar=no,menubar=no,location=no,fullscreen=no");
}
function doDownloadMovie(chapterId) {
window.alert("抱歉,此功能尚未开放!");
}//--></script>
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center" bgcolor="#CCCCCC">
<table class="body5" width="99%" border="0" cellpadding="6" cellspacing="0" bgcolor="#333333">
<tr>
<td width="336" height="180" rowspan="3" align="center">
<table cellSpacing="1" cellPadding="4" width="10%" bgColor="#e0dcdb" border="0">
<tr>
<td bgColor="#ffffff"><img src="<%= request.getContextPath() + ImageProcessor.getPostImageFileURL(item.getOrigionFile(), 250, 320) %>" width="250" height="320" /></td>
</tr>
</table>
</td>
<td width="285" height="260" align="left" valign="top" style="LINE-HEIGHT: 16px"><br />
<font size="3"><%=item.getTitle() %> / <%=item.getOriginName() %></font><br />
<br>
导演: <%=item.getDirector() %><br>
编剧: <%=item.getPlaywright() %><br/>
主演: <%=item.getActors() %><br>
年份: <%=item.getPublishDate() %><br>
类型: <%=getGroupsString(movieGroups) %><br>
更新: <%=getChineseDateString(item.getDateLastUpdate()) %><br/>
推荐: <%=showStars(item.getRecommend(), "<img src=\"" + request.getContextPath() + "/images/zhishu.gif\" width=\"15\" height=\"13\"/>") %><br>
<!-- 级别: 指导级 ( 血腥 ) <br> -->
<!-- 片长: 108 分钟 <br> -->
<!-- 色彩: 彩色 <br> -->
<!-- 地区: 韩国</td> -->
</tr>
<tr>
<td height="50" align="left" valign="middle">
<%if (chapters != null && chapters.getItems().size() > 0) {
%>
<a href="javascript:doPlayMovie(<%=movieId%>, 0);"><img border="0" src="<%= request.getContextPath() %>/images/play.gif" width="62" height="20"></a>
<a href="javascript:doDownloadMovie(0);"><img border="0" src="<%= request.getContextPath() %>/images/download.gif" width="62" height="20"></a>
<%} %>
</td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<%if (chapters != null && chapters.getItems().size() > 0) {%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65"><img src="<%= request.getContextPath() %>/images/03/title-right-intro-01.gif"
width="65" height="50"></td>
<td style="PADDING-TOP: 10px; FONT-WEIGHT: bold; COLOR: #ffffff"
width="85" background="<%= request.getContextPath() %>/images/03/title-right-intro-bg.gif">集数</td>
<td width="5"><img width="5" height="50"
src="<%= request.getContextPath() %>/images/03/title-right-intro-02.gif"></td>
<td background="<%= request.getContextPath() %>/images/03/title-right-intro-bg1.gif"> </td>
<td width="45"><img src="<%= request.getContextPath() %>/images/03/title-right-intro-03.gif"
width="45" height="50"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" bgcolor="#FFA833" style="PADDING: 5px; ">
<table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFCC33" style="BORDER: #ffffff 1px dashed;">
<tr>
<td align="left">
<table border="0" cellpadding="0" cellspacing="0" >
<%for (int i = 0; i < chapters.getItems().size(); i ++) {
MovieChapter chapter = (MovieChapter) chapters.getItems().get(i);
if ((i % 3) == 0) {%>
<tr>
<%} %>
<td width="200">
<img src="<%= request.getContextPath() %>/images/03/arrow.gif" align="absmiddle">
<span style="line-height:20px"><%=chapter.getTitle() %></span>
<a href="javascript:doPlayMovie(<%=movieId%>, <%=i %>);"><img border="0" src="<%= request.getContextPath() %>/images/play.gif" width="62" height="20" align="absmiddle"></a>
</td>
<%if ((i % 3) == 2 || (i == (chapters.getItems().size() -1 ))) { %>
</tr>
<%} %>
<%} %>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br/>
<%}%>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="65"><img src="<%= request.getContextPath() %>/images/03/title-right-intro-01.gif"
width="65" height="50"></td>
<td style="PADDING-TOP: 10px; FONT-WEIGHT: bold; COLOR: #ffffff"
width="85" background="<%= request.getContextPath() %>/images/03/title-right-intro-bg.gif">剧情介绍</td>
<td width="5"><img width="5" height="50"
src="<%= request.getContextPath() %>/images/03/title-right-intro-02.gif"></td>
<td background="<%= request.getContextPath() %>/images/03/title-right-intro-bg1.gif"> </td>
<td width="45"><img src="<%= request.getContextPath() %>/images/03/title-right-intro-03.gif"
width="45" height="50"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" bgcolor="#FFA833" style="PADDING: 5px; ">
<table width="100%" border="0" cellpadding="4" cellspacing="0" bgcolor="#FFCC33" style="BORDER: #ffffff 1px dashed;">
<tr>
<td align="left">
<%=item.getIntro().replaceAll("\\n", "<br/>") %>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%}%>
<br/>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -