<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="JuSNS.Web.home.blog.index" %>
<!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="../../js/ajax.js"></script>
<script language="javascript" type="text/javascript" src="../../js/public.js"></script>
<link href="../../template/<% Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/css/base.css" id="skinpath" type="text/css" rel="stylesheet" />
</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="../../template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/blog.gif" align="absmiddle" /> <span class="shenlan bold font14 ocolor"><% if (Request.QueryString["f"] == "1"){%>随便看看：博客日志<%}else{ %>博客日志<%} %></span></div>
                                <div class="r"><a href="javascript:window.history.back();" title="返回上一页">返回上一页</a></div>
                                <div class="c"></div>
                            </div>
            		       
                            <div class="nav-menu">
                                <ul>
                            <%if (Request.QueryString["f"] == "1")
                              {%>
                                 <li><a href="../ram/net.aspx">随便看看</a></li>
                                 <li><a href="../ram">同城</a></li>
                                 <li><a href="../network?s=ram&f=0">同地区</a></li>
                                 <li><a href="../ram/day.aspx">日记</a></li>
                                 <li class="current"><a href="../ram/blog.aspx">日志</a></li>
                                 <li><a href="../ram/photo.aspx">相册</a></li>
                                 <li><a href="../ram/share.aspx">分享</a></li>
                                 <li><a href="../ram/group.aspx">群组</a></li>
                                 <li><a href="../ram/vodie.aspx">电影</a></li>
                                 <li><a href="../ask/?r=all&f=1">问答</a></li>
                           <%}
                             else
                             { %>  
                                
                                 <li id="c1" runat="server" class="current"></li>
                                 <li id="c2" runat="server"><a href="../blog/?r=my">我的日志</a></li>
                                 <li id="c3" runat="server"><a href="../blog/?r=all">所有日志</a></li>
                                 <li id="c4" runat="server" style="display:none;"><a href="../blog/?r=about">提到过我的日志</a></li>
                                 <%} %>
                                 </ul>
                            </div>        
                     </div>
       
                    <div class="body_sec_left">
                     <div class="recordnumber">      
                                <div class="nl"><span id="keyvalue" runat="server"></span> 共<asp:Literal runat="server" ID="LtrNum"></asp:Literal>篇博客日志&nbsp;&nbsp;&nbsp;<a href="edit.aspx?a=new" onclick="return postblog()" title="写新博客日志"><img src="/template/<%Response.Write(JuSNS.Config.UiConfig.SkinStyle); %>/images/site/editblog.gif" align="absmiddle" /></a></div>
                     </div>
                    <!--正文开始-->
                    <div class="c spline"></div>
                    <div class="content nl s100">
                        <asp:Repeater runat="server" ID="RptData">
                                <HeaderTemplate>
                                    <ul id="bloglist">
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <li id="li_<%# DataBinder.Eval(Container.DataItem, "ID")%>">
                                    <%if(!isMy){ %>
                                         <div class="body-m-left image nl">
                                              <a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>"><img src="<%# GetHeadImage((int)DataBinder.Eval(Container.DataItem, "UserID"), 1)%>" style="width: 48px;height: 48px;" />
                                             <div class="center c"><%# DataBinder.Eval(Container.DataItem, "UserName")%></div> </a>
                                         </div>
                                        <div class="body-m-right nl">
                                            <div class="hdtitle s100 nl">                                       
                                       <%}else{ %> 
                                       <div class="pstr s96" style="padding-right:8px;">
                                            <div class="hdtitle" style="height:22px;">
                                       <%} %>
                                                 <span class="nl"><a href="../../blog/b<%# DataBinder.Eval(Container.DataItem, "ID")%>.aspx"><%if(isMy){ %>&bull; <%} %><span class="bold" title="<%# JuSNS.Web.BlogUi.GetTitle(DataBinder.Eval(Container.DataItem, "Title")) %>"><%# JuSNS.Common.Input.GetSubString(JuSNS.Web.BlogUi.GetTitle(DataBinder.Eval(Container.DataItem, "Title")),42)%></span></a> <span class="time"><%# JuSNS.Web.BlogUi.GetTitle(DataBinder.Eval(Container.DataItem, "postTime"))%></span></span><span class="nr"><%if(!isMy){ %><span class="share"><a href="javascript:ShowShareDiv(4,<%# DataBinder.Eval(Container.DataItem, "ID")%>,'<%# DataBinder.Eval(Container.DataItem, "Title").ToString().Replace("\"","")%>','','','<%# DataBinder.Eval(Container.DataItem, "UserID")%>');" title="分享此日志">分享</a></span><%}else{ %><span class="delete"><a href="javascript:void(0);" onclick="Confirm(this,'确定删除博客日记吗？','删除博客日记',function(){DeleteBlogs('<%# DataBinder.Eval(Container.DataItem, "ID")%>')});">删除</a></span><%} %></span>
                                            </div>     
                                            <div class="pstr"><%# JuSNS.Common.Input.GetSubString(JuSNS.Common.Input.LostHTML("" + DataBinder.Eval(Container.DataItem, "Content").ToString() + ""),400)%></div>
                                            <%if(!isMy){ %>
                                            <div class="pstr">
                                                <span class="nl"><a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%></a>(<%# DataBinder.Eval(Container.DataItem, "Name")%>) <span class="pike">|</span><a href="../blog/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>"><%# DataBinder.Eval(Container.DataItem, "UserName")%>的所有日志</a></span>
                                            </div>
                                            <%} %> 
                                            
                                            <span class="nr"><%if (isMy){ %><a href="edit.aspx?r=<%# DataBinder.Eval(Container.DataItem, "ID")%>">编辑</a> &nbsp; <%} %><a href="<%=rooDir %>/blog/b<%# DataBinder.Eval(Container.DataItem, "ID")%>.aspx#addcomment">评论(<%#  JuSNS.Web.BlogUi.GetComments(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "Comments"))%>)</a> &nbsp; <a href="<%=rooDir %>/blog/b<%# DataBinder.Eval(Container.DataItem, "ID")%>.aspx">详细内容</a></span>       
                                        </div>
                                       <div class="spline"></div> 
                                    </li>
                                    
                                </ItemTemplate>
                                <FooterTemplate>
                                    </ul></FooterTemplate>
                            </asp:Repeater>
                        <!--分页开始-->
                        <div class="pagination" runat="server" id="DivPage" style="float: left; width: 100%;"></div>
                        <div class="spline"></div> 
                   </div>                    
                     <!--正文结束-->
                    </div>
                       <!--中间分隔-->
                        <div class="line_mid">
                          <div class="line_01"></div>
                          <div class="line_02" id="midline"></div>
                          <div class="line_03"></div>
                        </div>
                        <!--中间分隔结束-->
                    <div class="body_sec_right">
                        <p class="adscss">
                            <script type="text/javascript" src="../../js/ads/body_top.js"></script>
                        </p>       
                           
                        <div class="cpstr">
                            <div class="ctitle">查找日志</div>
                            <div class="cpstr">
                                    <form action="" method="post" id="searchForm" name="searchForm" class="cpstr">
                                        <input name="skey" id="skey" type="text" value="<%Response.Write(Request.QueryString["key"]); %>" class="f-text s90" />
                                         <p class="pstr">
                                         <input type="button" name="toSearchButton" id="toSearchButton" onclick="search();" value="查找日志..." class="f-button" /> 
                                         </p> 
                                    </form>
                            </div> 
                        </div>            
                        <script type="text/javascript">
                            function search()
                           {
                                var key=document.getElementById("skey").value;
                                if(key.length<3)
                                {
                                    alert('关键字不能少于3个!');return;
                                }
                                self.location="../blog/?r=all&key="+escape(key);
                           } 
                        </script>            
                         <div class="line s90"></div>             
                        <div class="ctitle">最近我去看过...</div>
                        <div class="ccontent" runat="server" id="myFoot"></div>
                        <div class="c"></div>
                        <p class="adscss">
                            <script type="text/javascript" src="../../js/ads/body.js"></script>
                        </p>
                    </div>
                     <div class="c"></div>
           </div>
           <!--底部-->
             <div class="divbottom">
              <%=this.GetHtmlFoot()%>
              </div>
         </div>
   </div>
</div>

</body>
</html>
<script language="javascript" type="text/javascript">
    function unlogin()
   {
        alert("需要登录后才能查看！");
   } 
   
   function postblog()
   {
        var uid='<%=GetUserID() %>';
        if(uid=="0")
        {
        alert("需要登录后才能发表日志！");return false;
        }
        else
        {
            return true;
        }
   }

    function DeleteBlogs(bid)
   {
//       if(window.confirm('确定删除该日志吗?'))
//       {
            var  options={
            method:'post',
            parameters:"Option=DelBlog&ID="+ bid,
            onComplete:
            function(transport)
	            {
	                var retv =transport.responseText;
	                if(retv == '1')
	                {
                        closeConfirm();
                        document.getElementById('bloglist').removeChild(document.getElementById('li_'+ bid));
                      // location.href = '../blog/?r=my';
	                }
	            } 
	        }
	        new  Ajax.Request('article.aspx',options);
//       }
}  
</script>
