Ejemplo n.º 1
0
			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();
			}