<%@ Page Language="C#" AutoEventWireup="true" Codebehind="index.aspx.cs" Inherits="JuSNS.Web.user.share.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/share_1.gif"
                                    align="absmiddle" />
                                <span class="bold shenlan font14 ocolor"><% if (Request.QueryString["f"] == "1"){%>随便看看：分享<%}else{ %><%# sUserName%>分享<%} %></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><a href="../ram/blog.aspx">日志</a></li>
                                 <li><a href="../ram/photo.aspx">相册</a></li>
                                 <li class="current"><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 <%=CurrentCSS %>><a href="../share/?r=0" <%=checkstr %>>好友最新分享</a></li>
                                <li <%=CurrentCSS1 %>><a href="../share"<%=checkstr %>>我的分享</a></li>
                                <li <%=CurrentCSS2 %>><a href="../share/?r=all">大家的分享</a></li>
                                <%} %>
                            </ul>
                        </div>
                    </div>
                    <div class="body_sec_left">
  
                            <div class="recordnumber">
                                共有
                                <asp:Literal runat="server" ID="LtrCount" Text="0"></asp:Literal>
                                个分享。
                            </div>

                        <!--正文开始-->
                        <div class="spline"></div>
                        <form id="Form1" runat="server">
                            <div class="content">
                                <asp:Repeater runat="server" ID="RptData">
                                    <HeaderTemplate>
                                        <ul id="share-list">
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        
                                        <li id="share-138047">
                                       <%if (!isMy)
                                         {%> 
                                            <div class="body-m-left image nl">
                                                <a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>">
                                                    <%# GetUserHeadPic(DataBinder.Eval(Container.DataItem, "UserID"))%>
                                                </a>
                                            </div>
                                            <div class="body-m-right nl"> 
                                             <div class="hdtitle nl s99">
                                            <%}else{ %>
                                            <div class="content s96">
                                             <div class="hdtitle nl s100">
                                            <%} %>
                                                    <span class="nl">
                                                    <%if (isMy)
                                                      {%>你<%} else{%>
                                                    <a href="../../user/<%# JuSNS.Common.Public.URLWrite("","r",""+DataBinder.Eval(Container.DataItem, "UserID")+"")%>"><b><%# GetUserName(DataBinder.Eval(Container.DataItem, "UserID"))%></b></a><%} %>分享了一个<%# GetUserShareSingleType(DataBinder.Eval(Container.DataItem, "ShareType"))%></a>
                                                    <span class="time">
                                                        <%# GetSharePostTime(DataBinder.Eval(Container.DataItem, "PostTime"))%>
                                                    </span>
                                                   </span> 
                                                   <span class="nr">
                                                    <%# GetOperType(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "UserID"))%>
                                                   </span> 
                                                </div>
                                                <div class="content s95 nl">
                                                    
                                                    <div class="content nl">
                                                        <div class="nl">
                                                            <div class="nl"><%# GetSharePicStyle(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "ShareType"), DataBinder.Eval(Container.DataItem, "UserID"), DataBinder.Eval(Container.DataItem, "CaseID"))%></div>
                                                            <div class="nl">
                                                                <%# GetShareDesc(DataBinder.Eval(Container.DataItem, "ID"), DataBinder.Eval(Container.DataItem, "ShareType"), DataBinder.Eval(Container.DataItem, "Description"), DataBinder.Eval(Container.DataItem, "URL"), DataBinder.Eval(Container.DataItem, "CaseID"))%>
                                                                <div class="nl"><strong><a href="../share/links.aspx?Id=<%# GetLinkCaseID(DataBinder.Eval(Container.DataItem, "ID"),DataBinder.Eval(Container.DataItem, "CaseID"),DataBinder.Eval(Container.DataItem, "ShareType"))%>&type=<%# DataBinder.Eval(Container.DataItem, "ShareType")%>&userid=<%# DataBinder.Eval(Container.DataItem, "userid")%>"><%# DataBinder.Eval(Container.DataItem, "Title")%></a></strong></div>
                                                                
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="content">
                                                    <p class="cpstr">
                                                   <%if (!isMy)
                                                     {%> 
                                                        <a href="../share/?r=<%# DataBinder.Eval(Container.DataItem, "UserID")%>">
                                                            <%# GetUserName(DataBinder.Eval(Container.DataItem, "UserID"))%>的所有分享</a><span class="pipe">|</span><%} %><%# GetShareCommentCount(DataBinder.Eval(Container.DataItem, "UserID"), DataBinder.Eval(Container.DataItem, "ID"))%>
                                                        <span class="pipe">|</span><a href="javascript:void(0)" onclick="showCommentForm('<%# DataBinder.Eval(Container.DataItem, "ID")%>');">发表评论</a></p>
                                                </div>
                                                <div class="spline2"></div>
                                                <div id="Content<%# DataBinder.Eval(Container.DataItem, "ID")%>" style="display: none;">
                                                    loading...</div>
                                                <div style="display: none;" id="share_<%# DataBinder.Eval(Container.DataItem, "ID")%>">
                                                    loading....
                                                </div>
                                                <div class="spline2"></div>
                                            </div>
                                        </li>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </ul>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </div>
                            <div class="pagination" runat="server" id="DivPage">
                            </div>
                            <div class="spline">
                            </div>
                        </form>
                    </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">
                        <div class="adscss">

                            <script type="text/javascript" src="../../js/ads/body_top.js"></script>

                        </div>
                        <div class="ctitle">分享网页、音乐：</div>
                            <form action="postshare.aspx" method="get" name="sharelink" id="sharelink">
                                <div class="content">
                                    <input type="hidden" name="action" value="newurl" />
                                   
                                    <div class="pstr">
                                        <div class="item">地址：</div>
                                        <input type="text" class="f-text s90" name="url" id="url" value="http://"  tabindex="1" />
                                    </div>                                    
                                    <div class="pstr">
                                        <div class="item">描述：</div>
                                        <textarea id="txtcontent" name="desc" maxlength="200" rows="5" class="f-text s90"></textarea> 
                                    </div>
                                    <div class="pstr">
                                        <input type="submit" class="f-button" value="分享..." tabindex="2"<%=checkstr %> />
                                    </div>
                                </div>
                            </form>                        
                        <div class="adscss">

                            <script type="text/javascript" src="../../js/ads/body.js"></script>

                        </div>
                    </div>
                    <!--右边导航结束-->
                </div>
                <!--底部-->
                <div class="divbottom">
                    <%=this.GetHtmlFoot()%>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

<script type="text/javascript" language="javascript">
function showCommentForm(gid)
{
    document.getElementById("share_"+gid).style.display="block";
    var Action='Id='+gid+'&InnId=share_'+gid;   var options={ 
                      method:'get', 
                      parameters:Action, 
                      onComplete:function(transport) 
                      { 
                          var returnvalue=transport.responseText; 
                          if (returnvalue.indexOf("??")>-1) 
                              document.getElementById("share_"+gid).innerHTML='error!'; 
                          else 
                              document.getElementById("share_"+gid).innerHTML=returnvalue; 
                      } 
                   }; 
       new  Ajax.Request('showCommentForm.aspx?no-cache='+Math.random(),options);
}
function DelShareID(sid,uid)
{
//   if(window.confirm("确定要删除分享吗?"))
//    { 
        var Action='Id='+sid+'&uid='+uid+'&action=del';   var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport) 
                          { 
                              var returnvalue=transport.responseText; 
                              if (returnvalue.indexOf("??")>-1) 
                              {
                                  //alert("错误！"); 
                               } 
                              else 
                              {
                                  window.location.href="index.aspx?r=<%Response.Write(Request.QueryString["r"]); %>&Page=<%Response.Write(Request.QueryString["Page"]); %>";
                              } 
                          } 
                       }; 
           new  Ajax.Request('index.aspx?no-cache='+Math.random(),options);
//      } 
}

function postComment(gid)
{
   var gcontent = document.getElementById("showContent"+gid);
   if(gcontent.value==""){return false;}
   var Action='action=Post&ContentDesc='+escape(gcontent.value)+'&Id='+gid;   var options={ 
                      method:'get', 
                      parameters:Action, 
                      onComplete:function(transport) 
                      { 
                          var returnvalue=transport.responseText; 
                          if (returnvalue.indexOf("??")>-1) 
                          {
                              document.getElementById("Content"+gid).innerHTML='error!'; 
                             document.getElementById("share_"+gid).style.display="none";
                          }
                          else 
                          {
                             document.getElementById("Content"+gid).style.display="block";
                             document.getElementById("Content"+gid).innerHTML=returnvalue; 
                             gcontent.value='';
                          }
                      } 
                   }; 
       new  Ajax.Request('showCommentForm.aspx?no-cache='+Math.random(),options);
}
function closeComment(gid)
{
   document.getElementById("share_"+gid).style.display="none";
}

function showCommentContent(gid)
{
   var ContentRq=document.getElementById("Content"+gid);
   if(ContentRq.style.display=="none")
   {
       var Action='sh=1&Id='+gid;   var options={ 
                          method:'get', 
                          parameters:Action, 
                          onComplete:function(transport) 
                          { 
                              var returnvalue=transport.responseText; 
                              if (returnvalue.indexOf("??")>-1) 
                              {
                                 ContentRq.style.display="block";
                                 ContentRq.innerHTML='error!'; 
                              }
                              else 
                              {
                                 ContentRq.style.display="block";
                                 ContentRq.innerHTML=returnvalue; 
                              }
                          } 
                       }; 
           new  Ajax.Request('showCommentForm.aspx?no-cache='+Math.random(),options);
      }
      else
      {
            ContentRq.style.display="none";
      } 
}

function DelShareCommtent(gid,uid)
{ 
   if(window.confirm("确定要删除评论吗?"))
    { 
           var ContentRq=document.getElementById("Content"+uid);
           var Action='action=Del&Id='+gid;   var options={ 
                              method:'get', 
                              parameters:Action, 
                              onComplete:function(transport) 
                              { 
                                  var returnvalue=transport.responseText; 
                                  if (returnvalue.indexOf("??")>-1) 
                                  {
                                      alert("error!!");
                                  }
                                  else 
                                  {
                                     
                                  }
                              } 
                           }; 
               new  Ajax.Request('showCommentForm.aspx?no-cache='+Math.random(),options);
                ContentRq.style.display="none";
                showCommentContent(uid); 
      } 
}
</script>

