public static string GetMiniProgileHTML(string WebMemberID, Member member) { Member MiniProfileMember = Member.GetMembersViaWebMemberIDWithFullJoin(WebMemberID); string MiniProfileHTML = string.Empty; int MutualFriendCount = Friend.GetMutualFriendCount(MiniProfileMember, member); try { if (MiniProfileMember != null) { StringBuilder sbHTML = new StringBuilder(); string[] Parameters = new string[7]; Parameters[0] = MiniProfileMember.NickName; ResourceFile PhotoRes = new ResourceFile(MiniProfileMember.ProfilePhotoResourceFileID); Parameters[1] = "http://www.next2friends.com/" + PhotoRes.FullyQualifiedURL; Parameters[2] = MiniProfileMember.FirstName + " " + MiniProfileMember.LastName; Parameters[3] = UserStatus.IsUserOnline(MiniProfileMember.WebMemberID) ? "<img class=\"online-offline\" src=\"/images/online.gif\" alt=\"Online\" /> Online now" : "<img class=\"online-offline\" src=\"/images/offline.gif\" alt=\"Offline\" /> Offline"; Parameters[4] = MiniProfileMember.AgeYears.ToString(); Parameters[5] = MiniProfileMember.WebMemberID; Parameters[6] = MutualFriendCount.ToString(); sbHTML.AppendFormat(@"<div class='popupActions'> <ul class='friend_actions' style='width:150px'> <li><a class='send_message' onmouseover='return true;' href='javascript:openMsg();'>Send Message</a></li> <li><a class='forward' onmouseover='return true;' href='/Inbox.aspx?f={5}'>Forward to a friend</a></li> <li><a class='forward' onmouseover='return true;' href='/users/{0}'>View full profile</a></li> </ul> </div> <div class='popupProfileContent'> <p class='profile_pic'> <img id='imgProfile' alt='Comosicus profile pic' src='{1}'/> </p> <dl> <dt>Name:</dt><dd><strong>{2}</strong></dd> <dt>Age:</dt><dd><strong>{4}</strong></dd> <dt>Friends:</dt><dd>{6} mutual friends</dd> </dl> <div class='clear'/> <div id='divMsg' style='display:none'> <p>Send message to {2}:</p> <p><textarea rows='3' style='width: 100%;'/></textarea></p> <p style='text-align:right;'><input type='button' class='form_btn2' value='cancel' onclick='closeMsg();'/><input type='button' class='form_btn2' value='send'/></p> </div> </div>" , Parameters); MiniProfileHTML = sbHTML.ToString(); } } catch (Exception ex) { throw ex; } return(MiniProfileHTML); }
public TabContents GenerateProximityLister(List <Member> Members, int TabType, int Page, bool IsFriend, MemberOrderBy OrderBy) { Members = SortMembers(Members, OrderBy); StringBuilder sbHTMLList = new StringBuilder(); int PageSize = 10; int StartAt = (Page * PageSize) - PageSize; for (int i = StartAt; i < StartAt + PageSize; i++) { if (Members.Count <= i) { break; } StringBuilder sbHTMLItem = new StringBuilder(); object[] parameters = new object[14]; parameters[0] = Members[i].WebMemberID; parameters[1] = ParallelServer.Get() + Members[i].DefaultPhoto.FullyQualifiedURL; parameters[2] = Members[i].NickName; parameters[3] = Members[i].FirstName; parameters[4] = Members[i].LastName; parameters[5] = Members[i].ISOCountry; parameters[6] = (Gender)Members[i].Gender; parameters[7] = TimeDistance.GetAgeYears(Members[i].DOB); parameters[8] = Members[i].CreatedDT.ToString("dd MMMM yyyy"); parameters[9] = UserStatus.IsUserOnline(Members[i].WebMemberID) ? "<img class=\"online-offline\" src=\"/images/online.gif\" alt=\"Online\" /> Online now" : "<img class=\"online-offline\" src=\"/images/offline.gif\" alt=\"Offline\" /> Offline"; //parameters[10] = (true) ? @"<a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""">'<img src='images/unfriend.gif' /></a>" : string.Empty; //parameters[10] = (IsFriend) ? @"<p><a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""")' class='unfriend' >Unfriend</a></p>" : string.Empty; parameters[10] = @"<p><a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""")' class='unfriend'>UnFriend</a>"; parameters[11] = @"/Inbox.aspx?s=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[12] = @"/Inbox.aspx?f=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[13] = Members[i].DefaultPhoto.CreatedDT.ToString("dd MMMM yyyy hh:mm tt"); string HTMLItem = @"<div class='friend_list clearfix' id='divFriend{0}'> <div class='profile_pic'> <a href='/users/{2}'><img src='{1}' alt='pic' /></a> </div> <div class='friend_data'> <p class='friend_name'><a href='/users/{2}'>{3} {4}</a></p> <div class='col1'> <strong>Location:</strong> {5}<br /> <strong>Gender:</strong> {6}<br /> <strong>Age:</strong> {7}</div> <div class='col2'><strong>Nickname:</strong> <a href='/users/{2}'>{2}</a><br /> <strong>Joined:</strong> {8}<br /> <strong>Active:</strong> {9} </div> <p class='notes'></p> </div> <ul class='friend_actions'> <li><a href='{11}' onmouseover='return true;' class='send_message'>Send Message</a></li> <li><a href='{12}' onmouseover='return true;' class='forward'>Forward to a friend</a></li> </ul></div>" ; //<li><a href='javascript:parent.openChatWindowEx(""{0}"");' onmouseover='return true;' class='send_instant'>Send Instant Message</a></li> //<p class='notes'>You and Lawrence made friend {}. <br /> // <p class='notes'> //Tagged: {10} // </p> sbHTMLItem.AppendFormat(HTMLItem, parameters); sbHTMLList.Append(sbHTMLItem.ToString()); } //<li><a href='#' onmouseover='return true;' class='send_instant'>Send Instant Message</a></li> Pager pager = new Pager("/friends/", "to=" + TabType, Page, Members.Count); pager.PageSize = 10; DefaultHTMLPager = pager.ToString(); //// create the TabContents to return TabContents tabContents = new TabContents(); //tabContents.TabType = TabType; tabContents.HTML = sbHTMLList.ToString(); //tabContents.PagerHTML = sbPager.ToString(); return(tabContents); }
public void GenerateLister(List <Member> Members, int TabType, int Page, bool IsFriend) { StringBuilder sbHTMLList = new StringBuilder(); int PageSize = 10; int StartAt = (Page * PageSize) - PageSize; for (int i = StartAt; i < StartAt + PageSize; i++) { if (Members.Count <= i) { break; } StringBuilder sbHTMLItem = new StringBuilder(); object[] parameters = new object[14]; parameters[0] = Members[i].WebMemberID; parameters[1] = ParallelServer.Get() + Members[i].DefaultPhoto.FullyQualifiedURL; parameters[2] = Members[i].NickName; parameters[3] = Members[i].FirstName; parameters[4] = Members[i].LastName; parameters[5] = Members[i].ISOCountry; parameters[6] = (Gender)Members[i].Gender; parameters[7] = TimeDistance.GetAgeYears(Members[i].DOB); parameters[8] = Members[i].CreatedDT.ToString("dd MMMM yyyy"); parameters[9] = UserStatus.IsUserOnline(Members[i].WebMemberID) ? "<img class=\"online-offline\" src=\"/images/online.gif\" alt=\"Online\" /> Online now" : "<img class=\"online-offline\" src=\"/images/offline.gif\" alt=\"Offline\" /> Offline"; //parameters[10] = (true) ? @"<a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""">'<img src='images/unfriend.gif' /></a>" : string.Empty; //parameters[10] = (IsFriend) ? @"<p><a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""")' class='unfriend' >Unfriend</a></p>" : string.Empty; parameters[10] = @"javascript:unfriendMember(""" + Members[i].WebMemberID + @""")"; parameters[11] = @"/Inbox.aspx?s=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[12] = @"/Inbox.aspx?f=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); string HTMLItem = @"<div class='friend_list clearfix' style='background:transparent;' id='divFriend{0}'> <div class='profile_pic'> <a href='/users/{2}'><img src='{1}' alt='{3}' /></a> </div> <div class='friend_data'> <p class='friend_name'><a href='/users/{2}'>{3} {4}</a></p> <div class='col1'> <strong>Location:</strong> {5}<br /> <strong>Gender:</strong> {6}<br /> <strong>Age:</strong> {7}<br /> {9}</div> <div class='col2'><strong>Nickname:</strong> <a href='/users/{2}'>{2}</a><br /> <strong>Joined:</strong> {8} </div> <p class='notes'> </p> </div> <ul class='friend_actions'> <li><a href='{11}' onmouseover='return true;' class='send_message'>Send Message</a></li> <li><a href='{12}' onmouseover='return true;' class='forward'>Forward to a friend</a></li> "; if (member != null) { if (member.MemberID == ViewingMember.MemberID) { HTMLItem += @"<li><a href='{10}' onmouseover='return true;' class='block'>Unfriend</a></li>"; } } HTMLItem += @"</ul></div>"; //<li><a href='javascript:parent.openChatWindowEx(""{0}"");' onmouseover='return true;' class='send_instant'>Send Instant Message</a></li> //<p class='notes'>You and Lawrence made friend {}. <br /> sbHTMLItem.AppendFormat(HTMLItem, parameters); sbHTMLList.Append(sbHTMLItem.ToString()); } //<li><a href='#' onmouseover='return true;' class='send_instant'>Send Instant Message</a></li> Pager pager = new Pager("/users/" + ViewingMember.NickName + "/friends/", "", Page, Members.Count); pager.PageSize = 10; DefaultHTMLPager = (Members.Count > 0) ? "<span>" + pager.ToString() + "</span>" : string.Empty; DefaultHTMLLister = (Members.Count > 0) ? sbHTMLList.ToString() : "<p>Member currently has no Friends.</p>"; }
public TabContents GenerateSearchLister(List <Member> Members, string pageURL, string miscParams, int Page) { //MemberOrderBy OrderBY = SetCurrentTab(); //Members = SortMembers(Members, OrderBy); StringBuilder sbHTMLList = new StringBuilder(); int PageSize = 20; int StartAt = (Page * PageSize) - PageSize; bool isFriend = false; for (int i = StartAt; i < StartAt + PageSize; i++) { if (Members.Count <= i) { break; } StringBuilder sbHTMLItem = new StringBuilder(); object[] parameters = new object[23]; parameters[0] = Members[i].WebMemberID; parameters[1] = Next2Friends.Data.ParallelServer.Get() + Members[i].DefaultPhoto.FullyQualifiedURL; parameters[2] = Members[i].NickName; parameters[3] = Members[i].FirstName; parameters[4] = Members[i].LastName; parameters[5] = (Members[i].ISOCountry != "Unspecified") ? Members[i].ISOCountry : string.Empty; //+city if (Members[i].AccountType == (int)AccountType.Personal) { //parameters[6] = (Gender)Members[i].Gender; //parameters[7] = TimeDistance.GetAgeYears(Members[i].DOB); //<strong>Gender:</strong> {6}<br /> //<strong>Age:</strong> {7}<br /> parameters[6] = string.Format("<strong>Gender:</strong> {0}<br />", (Gender)Members[i].Gender); // if he user signed up from the web service then the year will be 1900 if (Members[i].DOB.Year == 1900) { parameters[7] = "<strong>Age:</strong> unspecified<br />"; } else { parameters[7] = string.Format("<strong>Age:</strong> {0}<br />", TimeDistance.GetAgeYears(Members[i].DOB)); } } else if (Members[i].AccountType == (int)AccountType.Business) { parameters[6] = ""; parameters[7] = ""; } parameters[8] = Members[i].CreatedDT.ToString("dd MMMM yyyy"); parameters[9] = UserStatus.IsUserOnline(Members[i].WebMemberID) ? "<img class=\"online-offline\" src=\"/images/online.gif\" alt=\"Online\" /> Online now" : "<img class=\"online-offline\" src=\"/images/offline.gif\" alt=\"Offline\" /> Offline"; // parameters[10] = (IsFriend) ? @"<a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""")'<img src='images/unfriend.gif' /></a>" : string.Empty; //parameters[10] = (IsFriend) ? @"<p class='notes'><a href='#' class='addto_friends'>Add to Friends</a>" : "<a href='#' class='addto_friends added'>Already a Friend</a></p> "; parameters[10] = "";//@"<p><a href='javascript:unfriendMember(""" + Members[i].WebMemberID + @""")' class='unfriend'>UnFriend</a></p>"; parameters[11] = @"Inbox.aspx?s=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[12] = @"Inbox.aspx?f=" + Members[i].WebMemberID + @"&r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[19] = Members[i].NickName; parameters[20] = Members[i].ISOCode; parameters[21] = Members[i].ISOCountry; if (Members[i].MemberProfile[0].RelationshipStatus != -1 && Members[i].MemberProfile[0].RelationshipStatus != 0) { parameters[22] = "<strong>Status: </strong>" + GetRelationShipStatus(Members[i].MemberProfile[0].RelationshipStatus) + "<br />"; } else { parameters[22] = ""; } if (Members[i].MemberProfile[0].NumberOfPhotos > 0) { parameters[13] = "<strong>Photos :</strong><a href= \"/users/" + Members[i].NickName + "/photos\">" + Members[i].MemberProfile[0].NumberOfPhotos + "</a><br />"; } else { parameters[13] = ""; } if (Members[i].MemberProfile[0].NumberOfVideos > 0) { parameters[14] = "<strong>Videos :</strong><a href= \"/users/" + Members[i].NickName + "/videos\">" + Members[i].MemberProfile[0].NumberOfVideos + "</a><br />"; } else { parameters[14] = ""; } if (Members[i].MemberProfile[0].NumberOfViews > 0) { parameters[15] = "<strong>Views :</strong><a href= \"/users/" + Members[i].NickName + "\">" + Members[i].MemberProfile[0].NumberOfViews + "</a><br />"; } else { parameters[15] = ""; } try { isFriend = Friend.IsFriend(member.MemberID, Members[i].MemberID); } catch { } if (isFriend) { parameters[16] = (member != null) ? "<a href='javascript:void(0);' class='add_to_friends'>Already a Friend</a><span id='spanAddToFriends" + Members[i].WebMemberID + "'><img src='/images/check.gif' /></span>" : string.Empty; } else { parameters[16] = (member != null) ? "<a href='javascript:addTofriends(\"" + Members[i].WebMemberID + "\");' class='add_to_friends'>Send Friend Request</a><span id='spanAddToFriends" + Members[i].WebMemberID + "'></span>" : string.Empty; } parameters[17] = (member != null) ? "inbox.aspx?s=" + Members[i].WebMemberID : "signup.aspx?r=" + Server.UrlEncode(Request.Url.PathAndQuery); parameters[18] = (member != null) ? "inbox.aspx?f=" + Members[i].WebMemberID : "signup.aspx?r=" + Server.UrlEncode(Request.Url.PathAndQuery); string HTMLItem = @"<div class='communitylist clearfix'> <div class='profile_pic'> <a href='/users/{2}'><img src='{1}' alt='{3} {4}' /></a> </div> <div class='friend_data'> <p class='friend_name'><img src='/images/flags/{20}.gif' title='{21}' alt='{21}'> <a href='/users/{2}'>{3} {4}</a> </p> <p> <strong>Nickname:</strong> {19}<br /> {6}{7} {22} {13}{14}{15} {9}<br /> <br /> {16} </p> </div> </div>" ; // <p class='notes'>{3} is not your friend yet. <br /> // <strong>Joined:</strong> {8}<br /> //<li><a href='javascript:parent.openChatWindowEx(""{0}"");' onmouseover='return true;' class='send_instant'>Send Instant Message</a></li> //<p class='notes'>You and Lawrence made friend {}. <br /> //<li><a href='#' class='block'>Block this user</a></li> //<strong>profile views :</strong> {15} sbHTMLItem.AppendFormat(HTMLItem, parameters); sbHTMLList.Append(sbHTMLItem.ToString()); } StringBuilder sbPager = new StringBuilder(); object[] PagerParameters = new object[2]; PagerParameters[0] = Page - 1; PagerParameters[1] = Page + 1; int PreviousPage = Page - 1; int NextPage = Page + 1; if (Page != 1) { sbPager.AppendFormat("<a href='?p={0}' class='previous'>Previous</a>", PagerParameters); } if (Members.Count >= (Page * PageSize)) { sbPager.AppendFormat("<a href='?p={1}' class='next'>Next</a>", PagerParameters); } // DefaultHTMLPager = sbPager.ToString(); Pager pager = new Pager("/community/", miscParams, Page, Members.Count); pager.PageSize = PageSize; DefaultHTMLPager = pager.ToString(); // create the TabContents to return TabContents tabContents = new TabContents(); tabContents.HTML = sbHTMLList.ToString(); // tabContents.PagerHTML = sbPager.ToString(); pager.PageSize = PageSize; tabContents.PagerHTML = pager.ToString(); return(tabContents); }