void appendPromoter(StringBuilder sb, Promoter p, bool doneOne) { if (doneOne) sb.Append(", "); sb.Append(p.Link()); if (p.SalesUsrK > 0) { sb.Append(" ("); sb.Append(p.SalesUsr.NickName); sb.Append(")"); } sb.Append(" "); sb.Append("<a"); sb.AppendAttribute("href", p.Url("callnow", "true")); sb.AppendAttribute("target", "_blank"); sb.Append(">"); sb.Append(p.PhoneNumber); sb.Append("</a>"); }
protected void Page_Load(object sender, EventArgs e) { List<Usr> onlineUsrs = Usr.GetOnlineUsers().ToList(); if (Usr.Current != null && !onlineUsrs.Exists(u => u.K == Usr.Current.K)) { onlineUsrs.Add(Usr.Current); onlineUsrs.Sort(new UsrNickNameComparer()); } OnlineLabel.Text = onlineUsrs.Count.ToString() + " member" + (onlineUsrs.Count == 1 ? "" : "s") + " online:"; OnlineDataList.Visible = false; StringBuilder sb = new StringBuilder(); bool doneOne = false; foreach (Usr u in onlineUsrs) { bool isBuddy = Usr.Current != null && Usr.Current.IsBuddy(u); if (doneOne) sb.Append(", "); sb.Append("<a"); sb.AppendAttribute("href", u.Url()); u.RolloverAppend(sb); sb.Append(">"); if (isBuddy) sb.Append("<b>"); sb.Append(u.NickName); if (isBuddy) sb.Append("</b>"); sb.Append("</a>"); //if (u.ChattingNow) // u.PresenceIconAppend(sb, "selected-onyellow"); //if (Usr.Current != null && u.K != Usr.Current.K) //{ // Chat.RoomSpec r = new Chat.RoomSpec(u.K, Usr.Current.K); // r.PinHtmlAppend(sb, "selected-onyellow"); //} doneOne = true; } OnlineP.InnerHtml = sb.ToString(); }
public static StringBuilder AddOpenTag(this StringBuilder s, string tag, string cl = null, bool classoptional = false, IEnumerable <WRAttribute> attributes = null, bool terminate = true) { s.Append("<").Append(tag); if (cl != null) { s.Append(SB().AppendAttribute("class", cl).Spaces().Wrap("()").Optional(classoptional)); } if (attributes != null) { foreach (var at in attributes) { s.AppendAttribute(at); } } if (terminate) { s.Append(">"); } return(s); }
public void PresenceIconAppend(StringBuilder sb, string shading) { if (ChattingNow || LoggedInNow) { sb.Append("<img"); sb.AppendAttribute("src", ChattingNow ? "/gfx/chat-chatting.png" : "/gfx/chat-online.png"); sb.AppendAttribute("border", "0"); sb.AppendAttribute("width", ChattingNow ? "13" : "9"); sb.AppendAttribute("height", "11"); sb.AppendAttribute("onmouseover", ChattingNow ? "sttd(4);" : "sttd(3);"); sb.AppendAttribute("onmouseout", "htm();"); sb.AppendAttribute("class", "ChatClientRoomPresence"); sb.Append(" />"); } }
public void RolloverAppend(StringBuilder sb) { sb.Append(" onmouseover=\""); mouseOverTextAppend(sb); sb.Append("\""); sb.AppendAttribute("onmouseout", "htm();"); }
public void LinkAppend(StringBuilder sb, bool newWindow, params string[] par) { sb.Append("<a"); sb.AppendAttribute("href", Url(par)); sb.Append(" "); RolloverAppend(sb); if (newWindow) sb.AppendAttribute("target", "_blank"); sb.Append(">"); sb.Append(NickNameDisplay); sb.Append("</a>"); }
public string GetMoreInfoHtml() { StringBuilder sb = new StringBuilder(); if (RoomType == RoomType.Normal && ObjectType == Model.Entities.ObjectType.None) { sb.Append("<p>This is the general chat room.</p>"); } else if (RoomType == RoomType.PrivateChat) { if (Usr.Current == null || (Usr.Current.K != this.ObjectK && Usr.Current.K != this.SecondObjectK)) sb.Append("<p>This is a private chat room.</p>"); else { Usr otherUsr = new Usr(Usr.Current.K == this.ObjectK ? this.SecondObjectK : this.ObjectK); sb.Append("<p>This is a private chat room between you and "); otherUsr.LinkAppend(sb, false); sb.Append("</p>"); if (otherUsr.HasPic) { sb.Append("<p>"); { sb.Append("<a"); sb.AppendAttribute("href", otherUsr.Url()); sb.Append(">"); { sb.Append("<img"); sb.AppendAttribute("src", Storage.Path(otherUsr.Pic)); sb.AppendAttribute("class", "BorderBlack All"); sb.AppendAttribute("width", "100"); sb.AppendAttribute("height", "100"); sb.Append(otherUsr.RolloverNoPic); sb.Append(">"); } sb.Append("</a>"); } sb.Append("</p>"); } } } else if (RoomType == RoomType.Normal) { sb.Append("<p>"); //sb.Append(string.Format("This is {0} chat room.", this.ObjectType.ToString().PrefixWithAOrAn(false))); string s = ""; switch (ObjectType) { case Model.Entities.ObjectType.Country: { s = "This is a country chat room."; break; } case Model.Entities.ObjectType.Place: { s = "This is a place chat room."; break; } case Model.Entities.ObjectType.Venue: { s = "This is a venue chat room."; break; } case Model.Entities.ObjectType.Event: { s = "This is an event chat room."; break; } case Model.Entities.ObjectType.Article: { s = "This is an article chat room. All chat in this room will be posted as comments in the main article topic."; break; } case Model.Entities.ObjectType.Group: { s = "This is a group chat room."; break; } case Model.Entities.ObjectType.Photo: { s = "This is a photo chat room. All chat in this room will be posted as comments in the main photo topic."; break; } case Model.Entities.ObjectType.Thread: { s = "This is a topic chat room. All chat in this room will be posted as comments in the topic."; break; } default: { s = ""; break; } } sb.Append(s); sb.Append("</p>"); if ((this.ObjectBob is IPic && ((IPic)ObjectBob).HasPic) || ObjectType == Model.Entities.ObjectType.Photo) { sb.Append("<p>"); if (this.ObjectBob is IPage) { sb.Append("<a"); sb.AppendAttribute("href", ((IPage)ObjectBob).Url()); sb.Append(">"); } { sb.Append("<img"); if (ObjectType == Model.Entities.ObjectType.Photo) sb.AppendAttribute("src", Storage.Path(((Photo)ObjectBob).Icon)); else sb.AppendAttribute("src", Storage.Path(((IPic)ObjectBob).Pic)); sb.AppendAttribute("class", "BorderBlack All"); sb.AppendAttribute("width", "100"); sb.AppendAttribute("height", "100"); sb.Append(">"); } if (this.ObjectBob is IPage) { sb.Append("</a>"); } sb.Append("</p>"); } if (ObjectBob is IPage && ObjectBob is IReadableReference) { sb.Append("<p>"); { sb.Append("<a"); sb.AppendAttribute("href", ((IPage)ObjectBob).Url()); sb.Append(">"); sb.Append(((IReadableReference)ObjectBob).ReadableReference); sb.Append("</a>"); } sb.Append("</p>"); } } else { //sb.Append("<p>No info available. This is " + RoomType.ToString().PrefixWithAOrAn(false) + " room.</p>"); sb.Append("<p>"); string s = ""; switch (RoomType) { case RoomType.BuddyAlerts: { s = "This is the buddy alerts room. Alerts from your buddies get posted here."; break; } case RoomType.InboxUpdates: { s = "This is the inbox updates room. New comments in topics you are watching get posted here."; break; } case RoomType.Laughs: { s = "This is the laughs room. You'll get an alert here whenever anyone clicks the laugh button."; break; } case RoomType.NewPhotosAll: { s = "This is a photos room. As new photos and videos get uploaded to the site, they appear in here."; break; } case RoomType.NewPhotosBuddies: { s = "This is a photos room. As your buddies upload photos and videos, they appear in here."; break; } case RoomType.NewPhotosProSpotters: { s = "This is a photos room. As pro spotters upload photos and videos, they appear in here."; break; } case RoomType.NewPhotosSpotters: { s = "This is a photos room. As spotters upload photos and videos, they appear in here."; break; } case RoomType.NewVideosAll: { s = "This is a videos room. As new videos get uploaded to the site, they appear in here."; break; } case RoomType.Orphans: { s = "This is the orphans room. Messages that we can't find rooms for get posted here. It's just for debugging."; break; } case RoomType.PrivateChatRequestsBuddies: { s = "This is a private chat requests room. When one of your buddies tries to private chat with you, an alert is sent here."; break; } case RoomType.PrivateChatRequestsStrangers: { s = "This is a private chat requests room. When someone not on you buddy list are tries to private chat with you, an alert is sent here."; break; } case RoomType.PrivateChatRequests: { s = "This is a private chat requests room. When someone tries to private chat with you, an alert is sent here."; break; } case RoomType.RandomChat: { s = "This is the random chat room. All comments posted in public topics create an alert in here ."; break; } case RoomType.SystemMessages: { s = "This is the system messages room. It's just for testing."; break; } default: { s = ""; break; } } sb.Append(s); sb.Append("</p>"); } //if (!IsReadOnly && !IsDefaultRoom) //{ // Query q = new Query(); // q.TableElement = new Join(Usr.Columns.K, RoomPin.Columns.UsrK); // q.QueryCondition = new And( // new Q(RoomPin.Columns.RoomGuid, this.Guid), // new Q(RoomPin.Columns.Pinned, true)); // q.OrderBy = new OrderBy(Usr.Columns.DateTimeLastPageRequest, OrderBy.OrderDirection.Descending); // q.Columns = Usr.LinkColumns; // UsrSet us = new UsrSet(q); // if (us.Count > 0) // { // sb.Append(string.Format("<p>{0} {1} {2} this room pinned:</p>", us.Count.ToString("#,##0"), us.Count == 1 ? "person" : "people", us.Count == 1 ? "has" : "have")); // sb.Append("<p class=\"CleanLinks\">"); // int count = 0; // foreach (Usr u in us) // { // string shading = u.LoggedInNow ? "selected-onyellow" : "shaded40-onyellow"; // sb.Append(count == 0 ? "" : "<br />"); // sb.Append(u.LoggedInNow ? "" : "<small>"); // u.LinkAppend(sb, false); // sb.Append(u.LoggedInNow ? "" : "</small>"); // u.PresenceIconAppend(sb, shading); // if (Usr.Current != null && u.K != Usr.Current.K) // { // RoomSpec c = new RoomSpec(u.K, Usr.Current.K); // c.PinHtmlAppend(sb, shading); // } // count++; // if (count > 100) // { // break; // } // } // sb.Append("</p>"); // if (count > 100) // sb.Append("<p><small>(only showing 100 people)</small></p>"); // } //} //else if (!IsReadOnly && IsDefaultRoom) //{ // sb.Append("<p>This is a default room - everybody has it pinned.</p>"); //} return sb.ToString(); }