<%@ Page Language="C#" AutoEventWireup="true" Codebehind="article.aspx.cs" Inherits="JuSNS.Web.user.blog.article" %>

<!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>
<title id="ptitle" runat="server">博客日志</title>
<script language="javascript" type="text/javascript" src="<%=rooDir %>/js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="<%=rooDir %>/js/public.js"></script>
<link href="<%=rooDir %>/template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css" id="skinpath" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript">
    <!--
    function unlogin()
   {
        alert("需要登录后才能查看！");
   } 
 
    function checkform()
    {
        var s = document.getElementById('TxtComment').value;
        if(s == '')
        {
            document.getElementById('p_err').style.display = '';
            document.getElementById('TxtComment').style.borderColor = 'red';
            return false;
        }
    }
    
    function DeleteBlog(id)
    {
       if(window.confirm('确定删除该日志吗?'))
       {
            var  options={
            method:'post',
            parameters:"Option=DelBlog&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    location.href = '<%=rooDir %>/home/blog/?r=my';
	                }
	            } 
	        }
	        new  Ajax.Request('<%=rooDir %>/home/blog/article.aspx',options);
       }
    }
    
    function DeleteComment(id)
    {
       if(window.confirm('确定删除该日志评论吗?'))
       {
            var  options={
            method:'post',
            parameters:"Option=DelComment&ID="+ id,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
	                    document.getElementById('ol_blogcmtlst').removeChild(document.getElementById('li_'+ id));
	                }
	            } 
	        }
	        new  Ajax.Request('<%=rooDir %>/home/blog/article.aspx',options);
       }
    }
    //-->
    </script>
   </head>
<body>
<!--头部-->
<%=this.GetHtmlShort()%>
<div id="divhead">
    <%=this.GetHtmlHead()%>
</div>

<div id="divbody">
    <div id="body_first">
        <div class="body_menu"> 
        <%=this.GetHtmlLeft()%>
        </div>
    </div>
    <div id="body_sec">
            <div id="body_mid"> 
                <div class="body_frame"> 
                 <!--主题内容中-->    
                    <div class="body_frame_otherinfo">
	                        <div class="title">
                                <div class="l"><img src="<%=rooDir %>/template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/blog.gif" align="absmiddle" /> <span class="shenlan bold font14 ocolor"><%=uName %></span></div>
                                <div class="r"><a href="javascript:window.history.back();" title="返回上一页">返回上一页</a></div>
                                <div class="c"></div>
                            </div>
                            
                            <div class="nav-menu">
                                <ul>
                                 <li id="c1" runat="server"></li>
                                 <li id="c2" runat="server"></li>
                                 <li id="c3"><a href="<%=rooDir %>/home/blog/?r=all">所有日志</a></li>
                                 <li style="display:none;"><a href="<%=rooDir %>/home/blog/?r=about">提到过我的日志</a></li>
                                 <li  class="current"><a href="javascript:void(0);">日志详情</a></li>
                                 </ul>
                            </div>                                 
            
                     </div>                 
                     <div class="body_sec_all">
                            <div class="recordnumber">
                                 <%# unm%>共<asp:Literal runat="server" ID="LtrNum"></asp:Literal>篇日志<span class="pipe">|</span><asp:HyperLink runat="server" ID="HypList"></asp:HyperLink><span class="pipe">|</span><a href="<%=rooDir %>/home/blog">返回好友日志列表</a><span class="pipe">|</span><span class="clititle"><a onclick="return postblog()" href="<%=rooDir %>/home/blog/edit.aspx?a=new" title="写新博客日志"><img src="<%=rooDir %>/template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/editblog.gif" align="absmiddle" /></a></span>
                           </div>  
                             <div class="blog_info">
                                    <h3>
                                        <asp:Literal runat="server" ID="LtrTitle"></asp:Literal>
                                    </h3>
                                    <span class="time"><asp:Literal runat="server" ID="LtrTime"></asp:Literal></span>
                             </div>
                             
                               <div class="blog_content">
                                    <asp:Literal runat="server" ID="LtrContent"></asp:Literal>
                                </div>
                                <div class="blog_share">
                                     
                                    <asp:Literal runat="server" ID="LtrReads"></asp:Literal>
                                    <%if(uid == UserID){ %><span class="pipe">|</span><a href="<%=rooDir %>/home/blog/edit.aspx?r=<%# blid%>">编辑日志</a><span  class="pipe">|</span><a href="javascript:DeleteBlog('<%# blid%>','<%# uid%>');">删除</a><%} %>
                                    <span class="pipe">|</span><asp:Literal runat="server" ID="LtrComments"></asp:Literal><%if(!isSelf){ %><span class="share"><a href="javascript:ShowShareDiv(4,<%# blid%>,'分享日志：<%=gtitle %>','<%=gcontent %>','');" title="分享此日志">分享</a></span><%} %>
                                </div>
                                 <div id="isFootUser" runat="server" visible="false">      
                                    <div class="hdtitle-index">他们来看过...</div>
                                    <div class="blog_foot" runat="server" id="FootID"></div>  
                                </div>
                                <div class="c"></div>
                                <div class="content">
                                    
                                    <asp:Repeater runat="server" ID="RptComment">
                                        <HeaderTemplate>
                                            <ol id="ol_blogcmtlst">
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <li id="li_<%# DataBinder.Eval(Container.DataItem, "ID")%>">
                                                <div class="body-m-left nl image">
                                                        <a href="<%=rooDir %>/user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>"><img src="<%# JuSNS.Common.Public.GetSmallHeadPic(DataBinder.Eval(Container.DataItem, "UserPortrait"),1)%>" style="width:48px;height:48px;" title="<%# DataBinder.Eval(Container.DataItem, "UserName")%>" /></a>
                                                </div>
                                                <div class="body-2m-right nl">
                                                        <div class="hdtitle s99 nl">
                                                            <span class="t1 nl">
                                                                <a href="<%=rooDir %>/user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a> (<%# DataBinder.Eval(Container.DataItem, "UserNetwork")%>)
                                                                 <span class="time"><%# JuSNS.Common.Public.getTimeEXPINSpan((DateTime)DataBinder.Eval(Container.DataItem, "PostTime"))%></span>
                                                             </span>
                                                             <%# ShowDelComm(DataBinder.Eval(Container.DataItem, "UserID"), uid, DataBinder.Eval(Container.DataItem, "ID"))%>
                                                         </div>
                                                         <div class="content" id="divcontent">
                                                            <%# JuSNS.Common.Public.CheckSma(DataBinder.Eval(Container.DataItem, "Content").ToString())%>
                                                        </div>
                                                </div>
                                                <div class="spline"></div>
                                            </li>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            </ol>
                                        </FooterTemplate>
                                    </asp:Repeater>
                              </div>
                              <div class="c"></div>
                              <%if(isblogHead&&this.GetUserID()>0){ %>
                              <div class="c-commentpost">
                                    <a name="comment"></a>
                                    <div class="font14 bold" id="addcomment">
                                        发表评论</div>
                                    <form action="<%=rooDir %>/home/blog/article.aspx?r=<%=Request.QueryString["r"] %>" method="post" class="replyparent">
                                        <p>
                                            <textarea name="TxtComment" id="TxtComment"  class="f-text s97" rows="6" maxlength="300" ></textarea></p>
                                            <span id="p_err" class="red" style="display:none;">此项必须填写</span>
                                        <p class="pstr">
                                            <a href="javascript:void(0);"  id="face" onclick="showface(this.id,'TxtComment',0);"><img src="../../template/images/face/c.gif" title="选择表情"  align="absmiddle" /></a>   
                                            <input type="submit" onclick="return checkform();" class="f-button" value="确定发表" />
                                            <input type="hidden" name="parentid" value="0" /><input type="hidden" name="Comment" value="Submit" /></p>
                                    </form>
                                </div>  
                                 <%}else{ %>
                                <div class="msg-warn">需要登录并上传了头像，才能 <b>回复日志</b>！，现在开始<a href="<%=rooDir %>/home/space/userheadphoto.aspx">上传头像</a>或<a href="<%=rooDir %>/?urls=<%=rooDir %>/blog/b<%=Request.QueryString["r"] %>.aspx">登录</a></div>
                                <%} %>
                                
                                <div class="spline"></div>
                         <div class="ctitle">&bull; <%# unm%>的其他博客日志</div>
                        <div class="ccontent" runat="server" id="IDMoreBlog">

                     </div>
                       
                     </div>                
            </div>
           <!--底部-->
             <div class="divbottom">
              <%=this.GetHtmlFoot()%>
              </div>
         </div>
   </div>
</div>              
</body>
</html>
<script type="text/javascript">
   function postblog()
   {
        var uid='<%=GetUserID() %>';
        if(uid=="0")
        {
        alert("需要登录后才能发表日志！");return false;
        }
        else
        {
            return true;
        }
   }

</script>