<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><c:out value="${blog.title}"/> - 留言</title>
<meta name="generator" content="BlogMethods Basic 1.0.0" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" href="<c:url value="/themes/${blog.options.theme_dir_name.value}/resources/styles/style.css"/>" type="text/css" media="screen, projection" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<c:url value="/feeds/"/>" />
<link rel="shortcut icon" href="<c:url value="/favicon.ico"/>" type="image/x-icon" />
<script src="<c:url value="/js/blog.js"/>" type="text/javascript" language="JavaScript"></script>
</head>
<body>

<div id="container">

<c:import url="/include.do">
	<c:param name="path" value="/include_header.jsp" />
</c:import>

<c:import url="/blog.do?method=nav"/>

<hr class="low" />

<!-- content ................................. -->
<div id="content">
<c:forEach var="message" items="${pageResult.results}">
	<div class="entry" id="message_<c:out value="${message.id}"/>">
	<p><c:out value="${message.content}" escapeXml="false" /></p>
	<p class="info">
	<em	class="date"><fmt:formatDate value="${message.time}" pattern="${blog.dateFormat} ${blog.timeFormat}"/></em>
	<c:choose>
	<c:when test="${message.url!=''}">
	<a href="<c:out value="${message.url}"/>" class="authorlink" rel='external nofollow'><c:out value="${message.author}"/></a>
	</c:when>
	<c:otherwise>
	<em class="author"><c:out value="${message.author}"/></em>
	</c:otherwise>
	</c:choose>
	</p>
	</div>
</c:forEach>

	<p class="pagebar">
	<c:if test="${pageResult.pageIndex!=1}"><A HREF="<c:url value="/message.do?method=index&p=${pageResult.prevIndex}"/>">上一页</A></c:if>
	<c:set var="begin" value="1"/>
	<c:if test="${(pageResult.pageIndex-6)>0}"><c:set var="begin" value="${pageResult.pageIndex-6}"/></c:if>
	<c:set var="end" value="${pageResult.pagesAmount}"/>
	<c:if test="${pageResult.pagesAmount==0}"><c:set var="end" value="1"/></c:if>
	<c:if test="${(pageResult.pagesAmount-pageResult.pageIndex)>5}"><c:set var="end" value="${pageResult.pageIndex+4}"/></c:if>
	<c:forEach var="i" begin="${begin}" end="${end}">
	<c:choose>
	<c:when test="${i==pageResult.pageIndex}"><em><c:out value="${i}"/></em></c:when>
	<c:otherwise><a href="<c:url value="/message.do?method=index&p=${i}"/>"><c:out value="${i}"/></a></c:otherwise>
	</c:choose>
	</c:forEach>
	<c:if test="${(pageResult.pagesAmount-pageResult.pageIndex)>0}"><A HREF="<c:url value="/message.do?method=index&p=${pageResult.nextIndex}"/>">下一页</A></c:if>
	<span>(共<b><c:out value="${pageResult.allResultsAmount}"/></b>个留言)</span></p>

	<hr class="low" />

	<h2>给我留言</h2>
	<script src="<c:url value="/js/blog.js"/>" type="text/javascript" language="JavaScript"></script>
	<script src="<c:url value="/js/tiny_mce/tiny_mce.js"/>" type="text/javascript" language="JavaScript"></script>
	<script type="text/javascript" language="JavaScript"><!--
	tinyMCE.init(
			{mode : "exact",
			elements : "messagecontent",
			width : "338",
			height: "200",
			editor_css : "<c:url value="/js/tiny_mce/themes/advanced/css/editor_ui2.css"/>",
			language: "zh_cn_utf8",
			theme : "advanced",
			theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,link,unlink",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_resizing : false,
			browsers : "msie,gecko,opera",
			dialog_type : "modal",
			theme_advanced_resize_horizontal : true,
			entity_encoding : "raw",
			relative_urls : false,
			remove_script_host : false,
			force_p_newlines : true,
			force_br_newlines : false,
			convert_newlines_to_brs : false,
			remove_linebreaks : true,
			auto_reset_designmode : true }
		);
	//--> </script>
	<form id="messageform" name="messageform" method=POST action="<c:url value="/message.do?method=newMessage"/>" onsubmit="return validateMessageForm();">
		<p><label for="author">姓名:</label><input type="text" name="author" tabindex="1" maxlength=50> <em>需要</em></p>
		<p><label for="email">Email:</label><input type="text" name="email" tabindex="2" maxlength=75> <em>需要, 隐藏</em></p>
		<p><label for="url">链接:</label><input type="text" name="url" tabindex="3" maxlength=100></p>
		<p><label for="messagecontent">留言内容:<br/><em>(500字以内)</em></label><textarea id="messagecontent" name="content" cols="45" rows="15" tabindex="4"></textarea></p>
		<p><label>&nbsp;</label><input type="submit" name="submit" value="提交" class="button" tabindex="5"></p>
	</form>
</div> <!-- /content -->

<hr class="low" />

<!-- subcontent ................................. -->
<div id="subcontent">
	<c:import url="/pages.do?method=pages" /> 
	<c:import url="/articles.do?method=tags" /> 
	<c:import url="/articles.do?method=recentArticles" /> 
	<c:import url="/articles.do?method=recentComments" /> 
	<c:import url="/articles.do?method=recentTrackbacks" /> 
	<c:import url="/articles.do?method=archives" /> 
	<c:import url="/links.do" />
	<c:import url="/message.do?method=recentMessages"/>
	<c:import url="/include.do"><c:param name="path" value="/include_feeds.jsp" /></c:import>
</div>
<!-- /subcontent -->

<hr class="low" />

<c:import url="/include.do">
	<c:param name="path" value="/include_footer.jsp" />
</c:import>
</div>
<!-- /container -->
</body>

</html>
