示例#1
0
    private static void FillFriends(Member member)
    {
        AjaxChat c = GetChatObject(member.WebMemberID);

        // Clear friend list before refreshing it.
        c.Friends.Clear();

        List <ChatOnline> chatFriendsList = ChatOnline.GetChatFriendsByMemberID(member.MemberID);

        foreach (ChatOnline chatFriend in chatFriendsList)
        {
            AjaxChat chat = GetChatObject(chatFriend.WebMemberID);

            if (chat == null)
            {
                AjaxChatFriend ajaxChatFriend = new AjaxChatFriend();
                ajaxChatFriend.WebMemberID   = chatFriend.WebMemberID;
                ajaxChatFriend.OnlineStatus  = (OnlineStatus)chatFriend.Status;
                ajaxChatFriend.FirstName     = chatFriend.FirstName;
                ajaxChatFriend.LastName      = chatFriend.LastName;
                ajaxChatFriend.NickName      = chatFriend.NickName;
                ajaxChatFriend.Email         = chatFriend.Email;
                ajaxChatFriend.CustomMessage = chatFriend.CustomMessage;
                ajaxChatFriend.AvatorUrl     = ParallelServer.Get(chatFriend.AvatorUrl) + @"user/" + chatFriend.AvatorUrl;

                chat = new AjaxChat(ajaxChatFriend);
            }

            chat       = AddToChatData(chatFriend.WebMemberID, chat);
            chat.Token = Next2Friends.Misc.UniqueID.NewWebID();

            c.Friends.Add(chat.Owner);
        }
    }
示例#2
0
    /// <summary>
    /// Populates the gallery photos
    /// </summary>
    private void GetGalleryLister()
    {
        Photos = Photo.GetPhotoByPhotoCollectionIDWithJoin(DefaultGallery.PhotoCollectionID);

        StringBuilder sbHTML = new StringBuilder();

        for (int i = 0; i < Photos.Length; i++)
        {
            object[] parameters = new object[4];

            parameters[0] = ParallelServer.Get(Photos[i].ThumbnailResourceFile.FullyQualifiedURL) + Photos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1] = i.ToString();
            parameters[2] = Photos[i].WebPhotoID;
            parameters[3] = DefaultGallery.WebPhotoCollectionID;

//            sbHTML.AppendFormat(@"<li>
//                                  <a href='javascript:showPhoto({1});'><img src='{0}' style='height:91px' alt='thumb' /></a>
//                                </li>", parameters);


            sbHTML.AppendFormat(@"<li>
                                    <a href='ViewGallery.aspx?g={3}&p={2}'><img src='{0}' style='height:91px' alt='thumb' /></a>
                                </li>", parameters);
        }

        NumberOfPhotosHTML = Photos.Length.ToString();
        GalleryListerHTML  = sbHTML.ToString();
    }
示例#3
0
    private void GetPhotoLister(string WebMemberID, List <PhotoCollection> Galleries)
    {
        StringBuilder sbHTML = new StringBuilder();
        int           DisplayNumberOfGalleries   = 10;
        int           NumberOfGalleries          = Galleries.Count + 1;
        int           NumberOfPhotos             = 0;
        int           NumberOfPopulatedGalleries = 0;

        for (int i = 0; i < Galleries.Count; i++)
        {
            // only show galleries with at least one photo
            if (Galleries[i].Photo.Count > 0)
            {
                object[] parameters = new object[6];

                parameters[0] = ParallelServer.Get(Galleries[i].DefaultThumbnailURL) + "user/" + Galleries[i].DefaultThumbnailURL;
                parameters[1] = Galleries[i].WebPhotoCollectionID;
                parameters[2] = Galleries[i].Name;
                parameters[3] = Galleries[i].Photo.Count;
                parameters[4] = Galleries[i].ShortDescription;
                parameters[5] = ViewingMember.WebMemberID;

                sbHTML.AppendFormat(@"<li style='height:182px'><a href='/gallery/?g={1}&m={5}'><img src='{0}' alt='thumb' /></a>
                                <p class='cat_details'><a href='/gallery/?g={1}&m={5}'><strong>{2}</strong> ({3})</a><br />
                                {4}</p>

                            </li>", parameters);
            }
        }

        for (int i = 0; i < Galleries.Count; i++)
        {
            if (Galleries[i].Photo.Count > 0)
            {
                NumberOfPopulatedGalleries++;
                NumberOfPhotos += Galleries[i].Photo.Count;
            }
        }


        //string RightPagerHTML = "<li class='gallery_prev'><a style='display:" + DisplayPrev + ";' href='javascript:PageGallery(\"" + WebMemberID + "\"," + PrevPage + "," + NumberOfGalleries + ");'  id='aGallPrev'><img src='images/nspots-prev.gif' alt='previous' /></a></li>";
        //string LeftPagerHTML = "<li class='gallery_next'><a style='display:" + DisplayNext + ";' href='javascript:PageGallery(\"" + WebMemberID + "\"," + NextPage + "," + NumberOfGalleries + ");'  id='aGallNext'><img src='images/nspots-next.gif' alt='next' /></a></li>";

        GalleryDetailsHTML = "(" + NumberOfPhotos + " photos in " + NumberOfPopulatedGalleries + " galleries)";

        if (NumberOfPhotos > 0)
        {
            GalleryListerHTML  = sbHTML.ToString();
            ShowCarousel       = true;
            DivCarouselClass   = "carousel";
            GalleryDetailsHTML = "(" + NumberOfPhotos + " photos in " + NumberOfPopulatedGalleries + " galleries)";
        }
        else
        {
            GalleryListerHTML  = "<p>Member currently has no Photos.</p>";
            ShowCarousel       = false;
            DivCarouselClass   = string.Empty;
            GalleryDetailsHTML = string.Empty;
        }
    }
示例#4
0
    public TabContents GenerateLister(List <Video> Videos, string pageURL, string miscParams, int Page, int maxItems, int PageSize)
    {
        StringBuilder sbHTMLList = new StringBuilder();

        if (Videos.Count > 0)
        {
            for (int i = 0; i < Videos.Count; i++)
            {
                if (Videos.Count <= i)
                {
                    break;
                }

                StringBuilder sbHTMLItem = new StringBuilder();

                object[] parameters = new object[14];

                parameters[0]  = ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) + Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
                parameters[1]  = Videos[i].TimeAgo;
                parameters[2]  = Videos[i].VeryShortTitle;
                parameters[3]  = Videos[i].VeryShortDescription;
                parameters[4]  = Videos[i].NumberOfViews;
                parameters[5]  = Videos[i].NumberOfComments;
                parameters[6]  = Videos[i].Member.NickName;
                parameters[7]  = Videos[i].Category;
                parameters[8]  = Videos[i].WebVideoID;
                parameters[9]  = Videos[i].Duration;
                parameters[10] = Videos[i].TotalVoteScore;
                parameters[11] = Videos[i].Member.WebMemberID;
                parameters[12] = RegexPatterns.FormatStringForURL(Videos[i].Title);
                parameters[13] = Videos[i].Title.Replace(@"""", "'");

                string HTMLItem = @"<li style='width:120px;text-align:center;padding:0px 0px 0px 0px'>
							<div class='vid_thumb'> <a href='javascript:displayMiniVideo(""{8}"",""{13}"");'><img src='{0}' width='124' height='91' alt='{13}' /></a></div>
                                <a href='/users/{6}'>{6}</a></p>
						</li>"                        ;

                sbHTMLItem.AppendFormat(HTMLItem, parameters);
                sbHTMLList.Append(sbHTMLItem.ToString());
            }
        }
        else
        {
            //sbHTMLList.AppendFormat("There is no result{0} page {1}",Videos.Count,page);
            sbHTMLList.AppendFormat("Your <strong>video</strong> search with keyword <strong>{0}</strong> did not match any video.", keyword);
        }

        Pager pager = new Pager("/video/", miscParams, page, maxItems);

        pager.PageSize = 20;

        // create the TabContents to return
        TabContents tabContents = new TabContents();

        // tabContents.TabType = TabType;
        tabContents.HTML      = sbHTMLList.ToString();
        tabContents.PagerHTML = pager.ToString();

        return(tabContents);
    }
示例#5
0
    private void GetFriendVideoRss(Member friendMember)
    {
        PrivacyType privacyType = PrivacyType.Public;

        bool IsFriend = Friend.IsFriend(member.MemberID, friendMember.MemberID);

        if (IsFriend)
        {
            privacyType = PrivacyType.Network;
        }

        List <Video> Videos = Video.GetMemberVideosWithJoinOrdered(friendMember.MemberID, privacyType, "Latest");

        for (int i = 0; i < Videos.Count; i++)
        {
            if (i >= 20)
            {
                break;
            }

            DataRow row = dt.NewRow();

            row["Title"]     = Videos[i].Title;
            row["Link"]      = "/video/" + RegexPatterns.FormatStringForURL(Videos[i].Title) + "/" + Videos[i].WebVideoID;
            row["DTCreated"] = Videos[i].DTCreated;

            row["Description"]  = "<a href=\"http://www.next2friends.com/video/" + RegexPatterns.FormatStringForURL(Videos[i].Title) + "/" + Videos[i].WebVideoID + "\"/>";
            row["Description"] += row["Description"] + "<img src=\"" + ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) +
                                  Videos[i].ThumbnailResourceFile.FullyQualifiedURL + "\"/>";

            row["ResourceFileThumb"] = ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) +
                                       Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            dt.Rows.Add(row);
        }
    }
示例#6
0
    public static void Login(Member member)
    {
        AjaxChatFriend owner = new AjaxChatFriend();

        owner.CustomMessage      = member.MemberProfile[0].TagLine;
        owner.Email              = member.Email;
        owner.FirstName          = member.FirstName;
        owner.LastName           = member.LastName;
        owner.NickName           = member.NickName;
        owner.OnlineStatus       = OnlineStatus.Online;
        owner.OnlineStatusString = OnlineStatus.Online.ToString();
        owner.WebMemberID        = member.WebMemberID;
        owner.LastCommDt         = DateTime.Now;

        ResourceFile PhotoRes = new ResourceFile(member.ProfilePhotoResourceFileID);

        owner.AvatorUrl = ParallelServer.Get(PhotoRes.FullyQualifiedURL) + PhotoRes.FullyQualifiedURL;;

        AjaxChat c = new AjaxChat(owner);

        c = AddToChatData(member.WebMemberID, c);
        c.Owner.OnlineStatus = OnlineStatus.Online;
        c.Token = Next2Friends.Misc.UniqueID.NewWebID();


        FillFriends(member);

        GetMessagesFromDB(member);
    }
示例#7
0
    private void GetVideoRss()
    {
        List <Video> Videos = Video.GetTop100Videos(OrderByType.Featured);

        for (int i = 0; i < Videos.Count; i++)
        {
            if (i >= 20)
            {
                break;
            }

            DataRow row = dt.NewRow();

            row["Title"]     = Videos[i].Title;
            row["Link"]      = "/video/" + RegexPatterns.FormatStringForURL(Videos[i].Title) + "/" + Videos[i].WebVideoID;
            row["DTCreated"] = Videos[i].DTCreated;

            row["Description"]  = "<a href=\"http://www.next2friends.com/video/" + RegexPatterns.FormatStringForURL(Videos[i].Title) + "/" + Videos[i].WebVideoID + "\"/>";
            row["Description"] += row["Description"] + "<img src=\"" + ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) +
                                  Videos[i].ThumbnailResourceFile.FullyQualifiedURL + "\"/>";

            row["ResourceFileThumb"] = ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) +
                                       Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            dt.Rows.Add(row);
        }
    }
示例#8
0
    private void GetPhotoJSArray()
    {
        StringBuilder sbHTML         = new StringBuilder();
        StringBuilder sbCommentArray = new StringBuilder();

        string JSStart = @"<script>var photos = new Array();";


        for (int i = 0; i < photos.Count; i++)
        {
            object[] parameters = new object[6];

            parameters[0] = ParallelServer.Get(photos[i].PhotoResourceFile.FullyQualifiedURL) + photos[i].PhotoResourceFile.FullyQualifiedURL;
            parameters[1] = photos[i].WebPhotoID;
            parameters[2] = photos[i].Caption.Replace("'", "&#39;").Replace("\r\n", " ");
            parameters[3] = i.ToString();

            sbHTML.AppendFormat(@"photos[{3}] = new Array('{0}','{1}','{2}');    ", parameters);
        }


        //List<AjaxComment> Comments = PhotoComment.GetPhotoCommentsByGalleryID(DefaultGallery.PhotoCollectionID);

        //string JSArray = PhotoComment.PhotoCommentsToJsArray(Comments);

        string JSEnd = @"</script>";

        JSPhotoArrayHTML = JSStart + sbHTML.ToString() + JSEnd;
    }
示例#9
0
    private string GetSubscriberLister()
    {
        List <SubscriptionItem> Subscribers = SubscriptionMember.GetSubscriptionMembersByMemberID(ViewingMember.MemberID);

        NumberOfMemberSubscribers = Subscribers.Count.ToString();

        StringBuilder sbHTML = new StringBuilder();

        for (int i = 0; i < 4; i++)
        {
            if (Subscribers.Count <= i)
            {
                break;
            }

            object[] parameters = new object[5];

            parameters[0] = Subscribers[i].WebMemberID;
            parameters[1] = Subscribers[i].NickName;
            parameters[2] = ParallelServer.Get(Subscribers[i].PhotoURL) + Subscribers[i].PhotoURL;
            parameters[3] = Subscribers[i].ISOCountry;
            parameters[4] = TimeDistance.TimeAgo(Subscribers[i].LastOnline);



            sbHTML.AppendFormat(@"<li><a href='/users/{1}'><img src='{2}' alt='{1}' width='45' height='45' />
                            <p>
                                <strong>{1}</strong></a><br />
                                Logged in: <span style='notes'>{4}</span><br />
                                Country:<span style='metadata'>{3}</span></p></li>", parameters);
        }

        return(sbHTML.ToString());
    }
示例#10
0
    /// <summary>
    /// Populates the gallery photos
    /// </summary>
    private void GetGalleryLister(int Page)
    {
        int NumberOfPhotos = Photo.GetPhotoCountPhotoCollectionID(DefaultGallery.PhotoCollectionID);

        photos = Photo.GetPhotoByPhotoCollectionIDWithJoinPager(DefaultGallery.PhotoCollectionID, Page, 16);

        StringBuilder sbHTML = new StringBuilder();

        for (int i = 0; i < photos.Count; i++)
        {
            object[] parameters = new object[2];

            parameters[0] = ParallelServer.Get(photos[i].ThumbnailResourceFile.FullyQualifiedURL) + photos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1] = i.ToString();

            sbHTML.AppendFormat(@"<li>
                                    <a href='javascript:showPhoto({1});'><img src='{0}' alt='thumb' /></a>
                                </li>", parameters);
        }

        Pager pager = new Pager("/gallery/", "g=" + URLPhotoCollectionID + "&m=" + ViewingMember.WebMemberID, Page, NumberOfPhotos);

        pager.PageSize = 16;
        PagerHTML      = pager.ToString();

        NumberOfPhotosHTML = NumberOfPhotos.ToString();
        pageCount          = (int)Math.Ceiling((double)NumberOfPhotos / pager.PageSize);
        photoLength        = photos.Count;
        GalleryListerHTML  = sbHTML.ToString();
    }
示例#11
0
    public static string GetMiniPhotoGalleryeHTML(string WebPhotoGallery)
    {
        PhotoCollection collection = PhotoCollection.GetPhotoCollectionByWebPhotoCollectionID(WebPhotoGallery);
        List <Photo>    photos     = Photo.GetPhotoByPhotoCollectionIDWithJoinPager(collection.PhotoCollectionID, 1, 9);

        string MiniHTML = string.Empty;

        if (photos != null)
        {
            StringBuilder sbHTML = new StringBuilder();

            for (int i = 0; i < 9; i++)
            {
                if (i >= photos.Count)
                {
                    break;
                }

                object[] parameters = new object[2];

                parameters[0] = ParallelServer.Get(photos[i].ThumbnailResourceFile.FullyQualifiedURL) + photos[i].ThumbnailResourceFile.FullyQualifiedURL;
                parameters[1] = i.ToString();

                sbHTML.AppendFormat(@"<li>
                                    <a href=''><img src='{0}' alt='thumb' /></a>
                                </li>", parameters);
            }


            MiniHTML = "<ul class='profile_gallery clearfix'>" + sbHTML.ToString() + "</ul>";
        }

        return(MiniHTML);
    }
示例#12
0
    public string GenerateFeaturedMemberSidebar()
    {
        string CacheKey = "FeaturedMemberHomePage";

        List <Member> FeaturedMembers = (List <Member>)System.Web.HttpContext.Current.Cache[CacheKey];

        //if (System.Web.HttpContext.Current.Cache.Get(CacheKey) == null)
        //{
        FeaturedMembers = new List <Member>();
        FeaturedMembers.Add(Member.GetMembersByMemberIDWithFullJoin(5));     // Sqeaks
        FeaturedMembers.Add(Member.GetMembersByMemberIDWithFullJoin(136));   // Dazzala
        System.Web.HttpContext.Current.Cache.Insert(CacheKey, FeaturedMembers, null, DateTime.Now.AddMinutes(60), System.Web.Caching.Cache.NoSlidingExpiration);
        //}



        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 2; i++)
        {
            if (FeaturedMembers.Count <= i)
            {
                break;
            }

            StringBuilder sbHTML = new StringBuilder();

            object[] parameters = new object[11];

            parameters[0] = ParallelServer.Get() + FeaturedMembers[i].DefaultPhoto.FullyQualifiedURL;
            parameters[1] = TimeDistance.TimeAgo(FeaturedMembers[i].LastOnline);
            parameters[2] = FeaturedMembers[i].WebMemberID;
            parameters[3] = FeaturedMembers[i].MemberProfile[0].NumberOfViews;
            parameters[4] = FeaturedMembers[i].NickName;



            sbHTML.AppendFormat(@"<li>
						<div class='vid_thumb'><a href='view.aspx?m={2}'><img width='124' height='91' src='{0}' alt='thumb' /></a></div>

						<div class='vid_info'>
							<a href='view.aspx?m={2}'><strong>{4}</strong></a>
							<p class='metadata'>
								Views: {3} <br/>Last Online: <a href='view.aspx?m={2}'>{1}</a>

							</p>
						</div>
					</li>"                    , parameters);

            sbHTMLList.Append(sbHTML.ToString());
        }

        //<h3><a href='view.aspx?v={2}'>{9}</a></h3>
        return(sbHTMLList.ToString());
    }
示例#13
0
    public string GenerateFeatureSidebar(List <Video> Videos)
    {
        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 2; i++)
        {
            if (Videos.Count <= i)
            {
                break;
            }

            StringBuilder sbHTML = new StringBuilder();

            object[] parameters = new object[12];

            parameters[0]  = ParallelServer.Get() + Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1]  = TimeDistance.TimeAgo(Videos[i].DTCreated);
            parameters[2]  = Videos[i].WebVideoID;
            parameters[3]  = Videos[i].NumberOfViews;
            parameters[4]  = Videos[i].NumberOfComments;
            parameters[5]  = Videos[i].TotalVoteScore;
            parameters[6]  = Videos[i].NumberOfComments;
            parameters[7]  = Videos[i].Member.NickName;
            parameters[8]  = Videos[i].Member.WebMemberID;
            parameters[9]  = Videos[i].Title;
            parameters[10] = Videos[i].Description;


            sbHTML.AppendFormat(@"<li>
						<div class='vid_thumb'><a href='view.aspx?v={2}'><img width='124' height='91' src='{0}' alt='thumb' /></a></div>

						<div class='vid_info'>
							<a href='view.aspx?v={2}'><strong>{9}</strong></a>
							<p class='metadata'>
								2 days ago<br />
								by: <a href='view.aspx?m={8}'>{7}</a><br />
								Views: {3} Comments: <a href='view.aspx?v={2}'>{4}</a>

							</p>
						</div>
					</li>"                    , parameters);

            sbHTMLList.Append(sbHTML.ToString());
        }

        //<h3><a href='view.aspx?v={2}'>{9}</a></h3>
        return(sbHTMLList.ToString());
    }
示例#14
0
    public string GenerateFeatureSidebar(List <Photo> Photos)
    {
        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 2; i++)
        {
            if (Photos.Count <= i)
            {
                break;
            }

            StringBuilder sbHTML = new StringBuilder();

            object[] parameters = new object[15];

            parameters[0]  = ParallelServer.Get(Photos[i].ThumbnailResourceFile.FullyQualifiedURL) + Photos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1]  = TimeDistance.TimeAgo(Photos[i].CreatedDT);
            parameters[2]  = Photos[i].WebPhotoID;
            parameters[3]  = Photos[i].NumberOfViews;
            parameters[4]  = Photos[i].NumberOfComments;
            parameters[5]  = Photos[i].TotalVoteScore;
            parameters[6]  = Photos[i].NumberOfComments;
            parameters[7]  = Photos[i].Member.NickName;
            parameters[8]  = Photos[i].Member.WebMemberID;
            parameters[9]  = Photos[i].PhotoCollectionName;
            parameters[10] = Photos[i].PhotoCollectionDescription;
            parameters[11] = Photos[i].WebPhotoCollectionID;

            sbHTML.AppendFormat(@"<li>
								<a href='/users/{7}'><img src='{0}' alt='thumb' /></a><br />
								<h3><a href='/gallery/?g={11}&m={8}'>{9}</a></h3>

								<p class='metadata'>by: <a href='/users/{7}'>{7}</a><br />
									Views: {3} Comments: <a href='/gallery/?g={11}&m={8}'>{6}</a><br />
								</p>						
							</li>"                            , parameters);



            sbHTMLList.Append(sbHTML.ToString());
        }

        return(sbHTMLList.ToString());
    }
示例#15
0
    /// <summary>
    /// Creates a lister with members friends
    /// </summary>
    public void GenerateProfileVisitorLister(Member LoggedInMember)
    {
        List <ContentView> ProfileViews = ContentView.GetMemberProfileViews(LoggedInMember.MemberID);

        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 10; i++)
        {
            if (ProfileViews.Count <= i)
            {
                break;
            }

            // add the member to the js array
            AddJSMemberArray(ProfileViews[i].WebMemberID, ProfileViews[i].FirstName + " " + ProfileViews[i].LastName);

            StringBuilder sbHTMLItem = new StringBuilder();

            object[] parameters = new object[6];

            parameters[0] = ProfileViews[i].NickName;
            parameters[1] = ParallelServer.Get("/user/" + ProfileViews[i].PhotoURL) + "/user/" + ProfileViews[i].PhotoURL;
            parameters[2] = ProfileViews[i].FirstName;
            parameters[3] = ProfileViews[i].LastName;
            parameters[4] = TimeDistance.TimeAgo(ProfileViews[i].DTCreated);
            parameters[5] = ProfileViews[i].WebMemberID;


            string HTMLItem = @"<li><a onclick='dmp(""{5}"");return false;'>
                            <img src='{1}' alt='member' width='45' height='45' /></a>
                            <p><span style='notes'><a onclick='dmp(""{5}"");return false;'>{2} {3}</a></span></p>   
                            <p><span style='notes'>{4}</a></span></p>                              
                        </li>";

            sbHTMLItem.AppendFormat(HTMLItem, parameters);
            sbHTMLList.Append(sbHTMLItem.ToString());
        }

        ViewLister = sbHTMLList.ToString();

        ViewCount = ProfileViews.Count;
    }
示例#16
0
    /// <summary>
    /// Creates a lister with members friends
    /// </summary>
    public void GenerateFriendLister()
    {
        List <Member> Friends = Member.GetAllFriendsByMemberIDForPageLister(ViewingMember.MemberID);

        NumberOfFriends = Friends.Count;

        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 10; i++)
        {
            if (Friends.Count <= i)
            {
                break;
            }

            StringBuilder sbHTMLItem = new StringBuilder();

            object[] parameters = new object[5];

            parameters[0] = Friends[i].WebMemberID;
            parameters[1] = ParallelServer.Get(Friends[i].DefaultPhoto.FullyQualifiedURL) + Friends[i].DefaultPhoto.FullyQualifiedURL;
            parameters[2] = Friends[i].NickName;
            parameters[3] = Friends[i].ISOCountry;
            parameters[4] = TimeDistance.TimeAgo(Friends[i].LastOnline);

            string HTMLItem = @"<li><a href='/users/{2}'>
                            <img src='{1}' alt='{2}' width='45' height='45' /></a>
                            <p>
                                <a href='/users/{2}'><strong>{2}</strong></a><br />
                                Active: <span style='notes'>{4}</span><br />
                                Country: <span style='metadata'>{3}</span></p>
                        </li>";

            //<p class='notes'>You and Lawrence made friend {}. <br />

            sbHTMLItem.AppendFormat(HTMLItem, parameters);
            sbHTMLList.Append(sbHTMLItem.ToString());
        }

        FriendLister = sbHTMLList.ToString();
    }
示例#17
0
    private void GetLiveRss(int memberID)
    {
        List <Video> Videos = Video.GetMemberVideosWithJoinOrdered(memberID, PrivacyType.Public, "Latest");

        for (int i = 0; i < Videos.Count; i++)
        {
            if (i > 20)
            {
                break;
            }

            DataRow row = dt.NewRow();
            row["Title"]             = Videos[i].Title;
            row["Link"]              = "http://www.next2friends.com";
            row["DTCreated"]         = Videos[i].DTCreated;
            row["Duration"]          = Videos[i].Duration;
            row["Description"]       = "";// Page.Server.HtmlEncode(Videos[i].Description);
            row["ResourceFileThumb"] = ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) +
                                       Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            row["ResourceLink"] = "/video/" + RegexPatterns.FormatStringForURL(Videos[i].Title) + "/" + Videos[i].WebVideoID;
            dt.Rows.Add(row);
        }
    }
示例#18
0
    /// <summary>
    /// Populates the Gallery Dropdown
    /// </summary>
    private void GetGalleryDrop()
    {
        List <PhotoCollection> Galleries = PhotoCollection.GetAllPhotoCollectionByMemberID(ViewingMember.MemberID);

        StringBuilder sbHTML            = new StringBuilder();
        int           NumberOfGalleries = 0;
        int           NumberOfPhotos    = 0;

        for (int i = 0; i < Galleries.Count; i++)
        {
            // only show galleries with at least one photo
            if (Galleries[i].Photo.Count > 0)
            {
                NumberOfGalleries++;

                object[] parameters = new object[6];

                parameters[0] = ParallelServer.Get(Galleries[i].DefaultThumbnailURL) + "user/" + Galleries[i].DefaultThumbnailURL;
                parameters[1] = Galleries[i].WebPhotoCollectionID;
                parameters[2] = Galleries[i].Name;
                parameters[3] = Galleries[i].Photo.Count;
                parameters[4] = Galleries[i].Description;
                parameters[5] = ViewingMember.WebMemberID;

                sbHTML.AppendFormat(@"<li>
								<a href='/gallery/?g={1}&m={5}' class='clearfix'><span class='drop_thumb'><img src='{0}' alt='thumb' width='50' height='35' /></span>
								<span class='drop_details'><strong>{2}</strong><br />
								 {4}</span></a>

							</li>"                            , parameters);

                NumberOfPhotos += Galleries[i].Photo.Count;
            }
        }

        GalleryDropHTML = sbHTML.ToString();
    }
示例#19
0
    private void ExtractURLParams()
    {
        ViewingMember = ExtractPageParams.GetMember(this.Page, this.Context);

        // if no member name was givent then it is likely to be a video page
        if (ViewingMember == null)
        {
            // get the video and extact the member
            DefaultVideo  = ExtractPageParams.GetVideo(this.Page, this.Context);
            ViewingMember = new Member(DefaultVideo.MemberID);
        }

        NumberOfComments          = AjaxComment.GetNumberOfCommentByObjectID(ViewingMember.MemberID, (int)CommentType.Wall);
        NumberOfMemberSubscribers = SubscriptionMember.GetSubscriberCountByMemberID(ViewingMember.MemberID).ToString();
        ViewingMemberProfile      = ViewingMember.MemberProfile[0];

        try
        {
            NumberOfVideos  = ViewingMemberProfile.NumberOfVideos;
            NumberOfPhotos  = ViewingMemberProfile.NumberOfPhotos;
            NumberOfFriends = FriendRequest.GetNumberOfFriends(ViewingMember.MemberID);
        }
        catch { }

        try
        {
            ResourceFile PhotoRes = new ResourceFile(ViewingMember.ProfilePhotoResourceFileID);
            PhotoURL      = ParallelServer.Get(PhotoRes.FullyQualifiedURL) + PhotoRes.FullyQualifiedURL;
            LargePhotoURL = ParallelServer.Get("/pmed/" + PhotoRes.FileName) + @"user/" + ViewingMember.NickName + "/pmed/" + PhotoRes.FileName;
        }
        catch { }

        ViewingMemberProfile = ViewingMember.MemberProfile[0];

        ViewingMemberProfile.NumberOfViews++;
    }
示例#20
0
    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>";
    }
示例#21
0
    /// <summary>
    /// Concatonates the videos into HTML for the lister control
    /// </summary>
    private TabContents GetVideoLister(string WebMemberID, int Page, bool WrapInP)
    {
        PrivacyType privacyType = PrivacyType.Public;

        if (member != null)
        {
            if (
                ViewingMember.MemberID == member.MemberID ||
                Friend.IsFriend(member.MemberID, ViewingMember.MemberID))
            {
                privacyType = PrivacyType.Network;
            }
        }

        List <Next2Friends.Data.Video> videos = Next2Friends.Data.Video.GetTopVideosByMemberIDWithJoin(ViewingMember.MemberID, privacyType);

        NumberOfVideos = videos.Count;
        int DisplayNumberOfVideos = 12;
        int StartIndex            = Page * DisplayNumberOfVideos;
        int EndIndex = StartIndex + DisplayNumberOfVideos;

        StringBuilder sbHTML = new StringBuilder();

        for (int i = StartIndex; i < EndIndex; i++)
        {
            if (videos.Count <= i)
            {
                break;
            }

            object[] parameters = new object[11];

            parameters[0] = ParallelServer.Get(videos[i].ThumbnailResourceFile.FullyQualifiedURL) + videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1] = videos[i].Duration.ToString();
            parameters[2] = videos[i].VeryShortTitle;
            parameters[3] = TimeDistance.TimeAgo(videos[i].DTCreated);
            parameters[4] = videos[i].VeryShortDescription;
            parameters[5] = videos[i].NumberOfViews;
            parameters[6] = videos[i].WebVideoID;
            parameters[7] = videos[i].NumberOfComments;
            parameters[8] = videos[i].Title;
            parameters[9] = RegexPatterns.FormatStringForURL(videos[i].Title);



//            sbHTML.AppendFormat(@"<li>
//								<div class='vid_thumb'> <a href='/video/{9}/{6}'><img src='{0}' width='124' height='91' alt='{8}' /></a></div>
//								<div class='vid_info'>
//									<h3><a href='/video/{9}/{6}'>{2}</a></h3>
//									<p class='timestamp'>{3}</p>
//									<p>{4}</p>
//									<p class='metadata'>Views: {5} Comments: {7}</p>
//								</div>
//							</li>", parameters);

            sbHTML.AppendFormat(@"<li style='width:145px;clear: none;margin-left:3px'>
								<div class='vid_thumb'> <a href='javascript:displayMiniVideo(""{6}"",""{8}"");'><img src='{0}' width='124' height='91' alt='{8}' /></a></div>
							</li>"                            , parameters);
        }

        TabContents tabContents = new TabContents();

        int PreviousPage = Page - 1;
        int NextPage     = Page + 1;

        tabContents.PagerHTML  = (WrapInP) ? "<p class='view_all' id='pPager'>" : string.Empty;
        tabContents.PagerHTML += (Page > 0) ? @"<p class='view_all'><a href='javascript:ajaxGetListerContent(""" + WebMemberID + @""",1," + PreviousPage + @");' class='previous'>Previous</a>" : string.Empty;
        tabContents.PagerHTML += (videos.Count > (NextPage * DisplayNumberOfVideos)) ? @"<a href='javascript:ajaxGetListerContent(""" + WebMemberID + @""",1," + NextPage + @");' class='next'>Next</a></p>" : string.Empty;
        tabContents.PagerHTML += (WrapInP) ? "</p>" : string.Empty;
        tabContents.HTML       = (NumberOfVideos > 0) ? "<ul class='profile_vid_list' id='ulContentLister'>" + sbHTML.ToString() + "</ul>" : "<p>Member currently has no Videos.</p>";

        // tabContents.HTML = sbHTML.ToString();

        return(tabContents);
    }
示例#22
0
    public TabContents GenerateLister(List <Photo> Photos, int TabType, int Page)
    {
        StringBuilder sbHTMLList = new StringBuilder();
        int           PageSize   = 54;
        int           StartAt    = (Page * PageSize) - PageSize;

        for (int i = StartAt; i < StartAt + PageSize; i++)
        {
            if (Photos.Count <= i)
            {
                break;
            }

            StringBuilder sbHTML = new StringBuilder();

            object[] parameters = new object[15];

            parameters[0]  = ParallelServer.Get(Photos[i].ThumbnailResourceFile.FullyQualifiedURL) + Photos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1]  = TimeDistance.TimeAgo(Photos[i].CreatedDT);
            parameters[2]  = Photos[i].WebPhotoID;
            parameters[3]  = Photos[i].NumberOfViews;
            parameters[4]  = Photos[i].NumberOfComments;
            parameters[5]  = Photos[i].TotalVoteScore;
            parameters[6]  = Photos[i].NumberOfComments;
            parameters[7]  = Photos[i].Member.NickName;
            parameters[8]  = Photos[i].Member.WebMemberID;
            parameters[9]  = Photos[i].Title;
            parameters[10] = Photos[i].Caption;
            parameters[11] = Photos[i].WebPhotoCollectionID;


            sbHTML.AppendFormat(@"<li style='width:131px;text-align:center;padding:0 0 0px'>
							<div class='vid_thumb' style='text-align:center;width:131px;overflow:hidden;'> 
                            <a href='/gallery/?g={11}&m={8}'><img src='{0}' height='91' alt='thumb' /></a></div>
						    <a href='/users/{7}'>{7}</a>
						</li>"                        , parameters);


//            sbHTML.AppendFormat(@"<li style='width:115px;text-align:center;padding:0 0 0px'>
//							<div class='vid_thumb' style='text-align:center;width:131px;overflow:hidden;'>
//                            <a href='/gallery/?g={11}&m={8}'><img src='{0}' height='91' alt='thumb' /></a></div>
//						    <a href='/users/{7}'>{7}</a>
//						</li>", parameters);

//            sbHTML.AppendFormat(@"<li>
//							<div class='vid_thumb' style='text-align:center;width:131px;overflow:hidden;'> <a href='view.aspx?p={2}'><img src='{0}' height='91' alt='thumb' /></a></div>
//							<div class='vid_info'>
//
//                                <h3><a href='view.aspx?p={2}'>{9}</a></h3>
//								<p class='timestamp'>{1}</p>
//								<div class='vote vote_condensed'><span class='vote_count'>{5}</span></div>
//								<p class='metadata'>Views: {3}<br />
//								Comments: <a href='#'>{4}</a><br />
//								by: <a href='view.aspx?m={8}'>{7}</a></p>
//
//							</div>
//						</li>", parameters);


            sbHTMLList.Append(sbHTML.ToString());
        }


        //StringBuilder sbPager = new StringBuilder();

        //object[] PagerParameters = new object[4];
        //PagerParameters[0] = TabType;
        //PagerParameters[1] = Page - 1;
        //PagerParameters[2] = Page + 1;
        //PagerParameters[3] = TabType;

        //if (Page != 1)
        //    sbPager.AppendFormat("<a  href='?t={3}&p={1}' class='previous'>Previous</a>", PagerParameters);

        //if (Photos.Count >= (Page * PageSize))
        //    sbPager.AppendFormat("<a  href='?t={3}&p={2}' class='next'>Next</a>", PagerParameters);

        //// create the TabContents to return
        //TabContents tabContents = new TabContents();

        //tabContents.TabType = TabType;
        //tabContents.HTML = sbHTMLList.ToString();
        //tabContents.PagerHTML = sbPager.ToString();

        Pager pager = new Pager("/photos/", string.Empty, Page, 5000);

        pager.PageSize = PageSize;

        // create the TabContents to return
        TabContents tabContents = new TabContents();

        // tabContents.TabType = TabType;
        tabContents.HTML      = sbHTMLList.ToString();
        tabContents.PagerHTML = pager.ToString();

        return(tabContents);
    }
示例#23
0
    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);
    }
示例#24
0
    /// <summary>
    /// generates the gallery HTML
    /// </summary>
    private TabContents GetPhotoLister(string WebMemberID, List <PhotoCollection> Galleries, int Page)
    {
        StringBuilder sbHTML = new StringBuilder();
        int           DisplayNumberOfGalleries   = 10;
        int           NumberOfGalleries          = Galleries.Count + 1;
        int           NumberOfPhotos             = 0;
        int           NumberOfPopulatedGalleries = 0;
        int           StartIndex = Page * DisplayNumberOfGalleries;
        int           EndIndex   = StartIndex + DisplayNumberOfGalleries;

        if (Galleries.Count < 4)
        {
            HideCarousel = true;
        }

        for (int i = StartIndex; i < EndIndex; i++)
        {
            if (Galleries.Count <= i)
            {
                break;
            }

            // only show galleries with at least one photo
            if (Galleries[i].Photo.Count > 0)
            {
                object[] parameters = new object[6];

                parameters[0] = ParallelServer.Get(Galleries[i].DefaultThumbnailURL) + "user/" + Galleries[i].DefaultThumbnailURL;
                parameters[1] = Galleries[i].WebPhotoCollectionID;
                parameters[2] = Galleries[i].Name;
                parameters[3] = Galleries[i].Photo.Count;
                parameters[4] = Galleries[i].ShortDescription;
                parameters[5] = ViewingMember.WebMemberID;


                sbHTML.AppendFormat(@"<li style='height:182px'><a href='/gallery/?g={1}&m={5}'><img src='{0}' alt='thumb' /></a>
                                <p class='cat_details'><a href='/gallery/?g={1}&m={5}'><strong>{2}</strong> ({3})</a><br />
                                {4}</p>

                            </li>", parameters);
            }
        }



        for (int i = 0; i < Galleries.Count; i++)
        {
            if (Galleries[i].Photo.Count > 0)
            {
                NumberOfPopulatedGalleries++;
                NumberOfPhotos += Galleries[i].Photo.Count;
            }
        }

        if (NumberOfPopulatedGalleries <= 3)
        {
            ShowGalleryArrows = false;
        }


        TabContents tabContents = new TabContents();


        // previous button
        string DisplayPrev = (Page > 1) ? "block" : "none";

        int PrevPage = Page - 1;

        tabContents.PagerHTML = "<li class='gallery_prev'><a style='display:" + DisplayPrev + ";' href='javascript:PageGallery(\"" + WebMemberID + "\"," + PrevPage + "," + NumberOfGalleries + ");'  id='aGallPrev'><img src='images/nspots-prev.gif' alt='previous' /></a></li>";
        RightPagerHTML        = tabContents.PagerHTML;

        string DisplayNext = (DisplayNumberOfGalleries < NumberOfGalleries) ? "block" : "none";

        // Next Button
        int NextPage = Page + 1;

        LeftPagerHTML         = "<li class='gallery_next'><a style='display:" + DisplayNext + ";' href='javascript:PageGallery(\"" + WebMemberID + "\"," + NextPage + "," + NumberOfGalleries + ");'  id='aGallNext'><img src='images/nspots-next.gif' alt='next' /></a></li>";
        tabContents.PagerHTML = LeftPagerHTML;

        //GalleryDetailsHTML = "(" + NumberOfPhotos + " photos in " + NumberOfPopulatedGalleries + " galleries)";
        //GalleryListerHTML = sbHTML.ToString();

        if (NumberOfPhotos > 0)
        {
            GalleryListerHTML  = sbHTML.ToString();
            ShowCarousel       = true;
            DivCarouselClass   = "carousel";
            GalleryDetailsHTML = "(" + NumberOfPhotos + " photos in " + NumberOfPopulatedGalleries + " galleries)";
        }
        else
        {
            GalleryListerHTML  = "<p>Member currently has no Photos.</p>";
            ShowCarousel       = false;
            DivCarouselClass   = string.Empty;
            GalleryDetailsHTML = string.Empty;
        }

        tabContents.HTML = GalleryListerHTML;

        return(tabContents);
    }
示例#25
0
    private void GetVideoLister(string WebMemberID, bool WrapInP)
    {
        PrivacyType privacyType = PrivacyType.Public;

        if (member != null)
        {
            if (
                ViewingMember.MemberID == member.MemberID ||
                Friend.IsFriend(member.MemberID, ViewingMember.MemberID))
            {
                privacyType = PrivacyType.Network;
            }
        }

        string OrderByClause = "";

        switch (CurrentTab)
        {
        case MemberOrderVideo.Latest:
            OrderByClause = "Latest";
            break;

        case MemberOrderVideo.NumberOfViews:
            OrderByClause = "NumberOfViews";
            break;

        case MemberOrderVideo.NumberOfComments:
            OrderByClause = "NumberOfComments";
            break;

        case MemberOrderVideo.TotalVoteScore:
            OrderByClause = "TotalVoteScore";
            break;
        }

        List <Next2Friends.Data.Video> Videos = Next2Friends.Data.Video.GetMemberVideosWithJoinOrdered(ViewingMember.MemberID, privacyType, OrderByClause);

        NumberOfVideos = Videos.Count;
        int DisplayNumberOfVideos = 28;
        int StartIndex            = PageTo * DisplayNumberOfVideos - DisplayNumberOfVideos;
        int EndIndex = StartIndex + DisplayNumberOfVideos;

        StringBuilder sbHTML = new StringBuilder();

        for (int i = StartIndex; i < EndIndex; i++)
        {
            if (Videos.Count <= i)
            {
                break;
            }

            object[] parameters = new object[14];

            parameters[0]  = ParallelServer.Get(Videos[i].ThumbnailResourceFile.FullyQualifiedURL) + Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1]  = Videos[i].TimeAgo;
            parameters[2]  = Videos[i].VeryShortTitle;
            parameters[3]  = Videos[i].VeryShortDescription;
            parameters[4]  = Videos[i].NumberOfViews;
            parameters[5]  = Videos[i].NumberOfComments;
            parameters[6]  = Videos[i].Member.NickName;
            parameters[7]  = Videos[i].Category;
            parameters[8]  = Videos[i].WebVideoID;
            parameters[9]  = Videos[i].Duration;
            parameters[10] = Videos[i].TotalVoteScore;
            parameters[11] = Videos[i].Member.WebMemberID;
            parameters[12] = RegexPatterns.FormatStringForURL(Videos[i].Title);
            parameters[13] = Videos[i].Title;

//            sbHTML.AppendFormat(@"<li>
//							<div class='vid_thumb'> <a href='/video/{12}/{8}'><img src='{0}' width='124' height='91' alt='{13}' /></a></div>
//
//							<div class='vid_info'>
//
//								<p class='metadata'><a href='/video/{12}/{8}'>{2}</a></p>
//								<p class='timestamp'>{1}</p>
//								<div class='vote vote_condensed'><span class='vote_count'>{10}</span></div>
//								<p class='metadata'>Views: {4}<br />
//								Comments: <a href='#'>{5}</a><br />
//                                </p>
//							</div>
//						</li>", parameters);

            sbHTML.AppendFormat(@"<li style='width:140px;clear: none;margin-left:3px'>
								<div class='vid_thumb'> <a href='javascript:displayMiniVideo(""{8}"",""{13}"");'><img src='{0}' width='124' height='91' alt='{8}' /></a></div>
							</li>"                            , parameters);

//            object[] parameters = new object[10];

//            parameters[0] = ParallelServer.Get(videos[i].ThumbnailResourceFile.FullyQualifiedURL) + videos[i].ThumbnailResourceFile.FullyQualifiedURL;
//            parameters[1] = videos[i].Duration.ToString();
//            parameters[2] = videos[i].VeryShortTitle;
//            parameters[3] = TimeDistance.TimeAgo(videos[i].DTCreated);
//            parameters[4] = videos[i].VeryShortDescription;
//            parameters[5] = videos[i].NumberOfViews;
//            parameters[6] = videos[i].WebVideoID;
//            parameters[7] = videos[i].NumberOfComments;
//            parameters[8] = videos[i].Title;
//            parameters[9] = RegexPatterns.FormatStringForURL(videos[i].Title);

//            sbHTML.AppendFormat(@"<li>
//								<div class='vid_thumb'> <a href='/video/{9}/{6}'><img src='{0}' width='124' height='91' alt='{8}' /></a></div>
//								<div class='vid_info'>
//									<h3><a href='/video/{9}/{6}'>{2}</a></h3>
//									<p class='timestamp'>{3}</p>
//									<p>{4}</p>
//									<p class='metadata'>Views: {5} Comments: {7}</p>
//								</div>
//							</li>", parameters);
        }


        DefaultHTMLLister = (NumberOfVideos > 0) ? "<ul class='profile_vid_list2' style='padding: 15px 0pt 20px 14px;' id='ulContentLister'>" + sbHTML.ToString() + "</ul>" : "<p>Member currently has no Videos.</p>";

        string MiscPagerParams = string.Empty;

        if (CurrentTab != MemberOrderVideo.Latest)
        {
            MiscPagerParams = "&to=" + ((int)CurrentTab).ToString();
        }

        Pager pager = new Pager("/users/" + ViewingMember.NickName + "/videos/", MiscPagerParams, PageTo, NumberOfVideos);

        pager.PageSize = 20;

        DefaultHTMLPager = pager.ToString();
    }
示例#26
0
    private void SetVariables()
    {
        string strWebMemberID     = Request.Params["m"];
        string strWebVideoID      = Request.Params["v"];
        string strPhotoID         = Request.Params["p"];
        string strLiveBroadcastID = Request.Params["l"];

        if (strWebMemberID != null)
        {
            ViewingMember = Member.GetMembersViaWebMemberIDWithFullJoin(strWebMemberID);
            //ProfileDefaultPageType = DefaultPageType.Member;
            //ViewingMemberProfile = ViewingMember.MemberProfile[0];
            //DefaultNumberOfViews = (++ViewingMemberProfile.NumberOfViews).ToString();
            //ViewingMemberProfile.Save();
            //PermaLink = WebRoot + "view.aspx?m=" + strWebMemberID;
            MemberSubscribers = GetSubscriberLister();

            GenerateFriendLister();
        }
        else if (strWebVideoID != null)
        {
            DefaultVideo  = Video.GetVideoByWebVideoIDWithJoin(strWebVideoID);
            ViewingMember = new Member(DefaultVideo.MemberID);
            //ViewingMemberProfile = ViewingMember.MemberProfile[0];
            //ProfileDefaultPageType = DefaultPageType.Video;
            //DefaultVideoURL = DefaultVideo.VideoResourceFile.FullyQualifiedURL;
            //DefaultMediaID = strWebVideoID;
            //DefaultVoteCount = DefaultVideo.TotalVoteScore.ToString();
            //VideoURL = DefaultVideo.VideoResourceFile.FullyQualifiedURL;
            //DefaultNumberOfViews = (++DefaultVideo.NumberOfViews).ToString();
            //DefaultVideo.Save();
            //PermaLink = WebRoot + "view.aspx?v=" + strWebVideoID;
            //EmbedLink = @"<object width=""480"" height=""400""><param name=""movie"" value=""http://www.next2friends.com/flvplayer.swf""></param><param name=""wmode"" value=""transparent""></param><embed src=""http://www.next2friends.com/flvplayer.swf?file=" + VideoURL + @""" type=""application/x-shockwave-flash"" wmode=""transparent"" width=""480"" height=""400""></embed></object>";

            //MainTitle = DefaultVideo.Title;
            //MainSubTitle = DefaultVideo.Description;

            if (IsLoggedIn)
            {
                //ReportAbuseLink = "ReportAbuse.aspx?r=" + strWebVideoID;
            }
            else
            {
                //ReportAbuseLink = @"signup.aspx?u=ReportAbuse.aspx?r=" + strWebVideoID + "&url=" + Request.Url.AbsoluteUri;
            }
        }
        else if (strPhotoID != null)
        {
            DefaultPhoto = Photo.GetPhotoByWebPhotoIDWithJoin(strPhotoID);

            //DefaultNumberOfViews = (++DefaultPhoto.NumberOfViews).ToString();
            //DefaultPhoto.Save();

            ViewingMember = new Member(DefaultPhoto.MemberID);
            //ViewingMemberProfile = ViewingMember.MemberProfile[0];
            //ProfileDefaultPageType = DefaultPageType.Photo;
            //DefaultPhotoURL = ParallelServer.Get(DefaultPhoto.PhotoResourceFile.FullyQualifiedURL) + DefaultPhoto.PhotoResourceFile.FullyQualifiedURL;
            //DefaultMediaID = strPhotoID;
            //DefaultVoteCount = DefaultPhoto.TotalVoteScore.ToString();
            //PermaLink = WebRoot + "view.aspx?p=" + strPhotoID;

            MainTitle = DefaultPhoto.Caption;

            //MainSubTitle = "From Gallery " + DefaultPhoto.;

            if (IsLoggedIn)
            {
                //ReportAbuseLink = "ReportAbuse.aspx?r=" + strPhotoID;
            }
            else
            {
                //ReportAbuseLink = @"signup.aspx?u=ReportAbuse.aspx?r=" + strPhotoID + "&url=" + Request.Url.AbsoluteUri;
            }
        }
        else if (strLiveBroadcastID != null)
        {
            VideoURL = strLiveBroadcastID;
            LiveBroadcast live = LiveBroadcast.GetLiveBroadcastByWebLiveBroadcastID(strLiveBroadcastID);

            ViewingMember = new Member(live.MemberID);
            //ViewingMemberProfile = ViewingMember.MemberProfile[0];
            //ProfileDefaultPageType = DefaultPageType.LiveBroadcast;
            //PermaLink = ASP.global_asax.WebRoot + "view.aspx?v="+strWebVideoID;
        }
        else
        {
            throw new Exception("No WebID");
            //ViewingMember = new Member(1);
            //ProfileDefaultPageType = DefaultPageType.Member;
            //PermaLink = ASP.global_asax.WebRoot + "view.aspx?v="+strWebVideoID;
        }

        NumberOfComments     = AjaxComment.GetNumberOfMemberCommentByMemberID(ViewingMember.MemberID);
        ViewingMemberProfile = ViewingMember.MemberProfile[0];

        try
        {
            NumberOfVideos  = ViewingMemberProfile.NumberOfVideos;
            NumberOfPhotos  = ViewingMemberProfile.NumberOfPhotos;
            NumberOfFriends = FriendRequest.GetNumberOfFriends(ViewingMember.MemberID);
        }
        catch { }



        try
        {
            ResourceFile PhotoRes = new ResourceFile(ViewingMember.ProfilePhotoResourceFileID);
            PhotoURL      = ParallelServer.Get(PhotoRes.FullyQualifiedURL) + PhotoRes.FullyQualifiedURL;
            LargePhotoURL = ParallelServer.Get("/pmed/" + PhotoRes.FileName) + @"user/" + ViewingMember.NickName + "/pmed/" + PhotoRes.FileName;
        }
        catch { }

        ViewingMemberProfile = ViewingMember.MemberProfile[0];

        ViewingMemberProfile.NumberOfViews++;
    }
示例#27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(typeof(ViewGalleryPB));

        member = (Member)Session["Member"];

        if (member != null)
        {
            IsLoggedIn = true;
        }

        // set the default forwarding if the member is not logged in
        LoginUrl          = @"signup.aspx?u=" + Request.Url.AbsoluteUri;
        SubscribeLink     = LoginUrl;
        SendMessageLink   = LoginUrl;
        BlockMemberLink   = LoginUrl;
        AddToFriendsLink  = LoginUrl;
        AddFavouritesLink = LoginUrl;

        // load the members photo
        string strGalleryPhoto = Request.Params["g"];
        string strPhoto        = Request.Params["p"];

        if (strGalleryPhoto != null)
        {
            ViewingMember        = Member.GetMemberByPhotoCollectionID(strGalleryPhoto);
            ViewingMemberProfile = ViewingMember.MemberProfile[0];
            DefaultNumberOfViews = (++ViewingMemberProfile.NumberOfViews).ToString();
            ViewingMemberProfile = ViewingMember.MemberProfile[0];
            DefaultGallery       = PhotoCollection.GetPhotoCollectionByWebPhotoCollectionID(strGalleryPhoto);
            GalleryNameHTML      = DefaultGallery.Name;

            GetGalleryDrop();
            GetPhotoJSArray();
            DisplayGallery = "block";
        }
        else
        {
            // the member failed to load from the URL param.. throw a friendly
        }

        if (strPhoto != null)
        {
            DefaultPhoto        = Photo.GetPhotoByWebPhotoIDWithJoin(strPhoto);
            DefaultPhotoURL     = ParallelServer.Get(DefaultPhoto.PhotoResourceFile.FullyQualifiedURL) + DefaultPhoto.PhotoResourceFile.FullyQualifiedURL;
            DefaultPhotoCaption = DefaultPhoto.Caption;
            DefaultWebPhotoID   = DefaultPhoto.WebPhotoID;
            DisplayPhoto        = "block";
            DisplayCurrentIndex = "block";
            DisplayComments     = "block";
            SetPagerButtons();
        }
        else
        {
            GetGalleryLister();
        }

        if (member != null)
        {
            if (ViewingMember.MemberID == member.MemberID)
            {
                IsMyPage = true;
            }
        }

        try
        {
            NumberOfVideos  = ViewingMemberProfile.NumberOfVideos;
            NumberOfPhotos  = ViewingMemberProfile.NumberOfPhotos;
            NumberOfFriends = FriendRequest.GetNumberOfFriends(ViewingMember.MemberID);
        }
        catch { }
    }
示例#28
0
    /// <summary>
    /// Concatonates the videos into HTML for the lister control
    /// </summary>
    private TabContents GetVideoLister(string WebMemberID, int Page)
    {
        PrivacyType privacyType = PrivacyType.Public;

        if (member != null)
        {
            if (
                ViewingMember.MemberID == member.MemberID ||
                Friend.IsFriend(member.MemberID, ViewingMember.MemberID))
            {
                privacyType = PrivacyType.Network;
            }
        }

        List <Next2Friends.Data.Video> videos = Next2Friends.Data.Video.GetTopVideosByMemberIDWithJoin(ViewingMember.MemberID, privacyType);

        NumberOfVideos = videos.Count;
        int DisplayNumberOfVideos = 6;
        int StartIndex            = Page * DisplayNumberOfVideos;
        int EndIndex = StartIndex + DisplayNumberOfVideos;

        StringBuilder sbHTML = new StringBuilder();

        for (int i = StartIndex; i < EndIndex; i++)
        {
            if (videos.Count <= i)
            {
                break;
            }

            object[] parameters = new object[8];

            parameters[0] = ParallelServer.Get(videos[i].ThumbnailResourceFile.FullyQualifiedURL) + videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1] = videos[i].Duration.ToString();
            parameters[2] = videos[i].VeryShortTitle;
            parameters[3] = TimeDistance.TimeAgo(videos[i].DTCreated);
            parameters[4] = videos[i].VeryShortDescription;
            parameters[5] = videos[i].NumberOfViews;
            parameters[6] = videos[i].WebVideoID;
            parameters[7] = videos[i].NumberOfComments;

            sbHTML.AppendFormat(@"<li>
								<div class='vid_thumb'> <a href='view?v={6}'><img src='{0}' width='124' height='91' alt='thumb' /></a></div>
								<div class='vid_info'>
									<h3><a href='view?v={6}'>{2}</a></h3>
									<p class='timestamp'>{3}</p>
									<p>{4}</p>
									<p class='metadata'>Views: {5} Comments: {7}</p>
								</div>
							</li>"                            , parameters);
        }

        TabContents tabContents = new TabContents();

        int PreviousPage = Page - 1;
        int NextPage     = Page + 1;

        tabContents.PagerHTML  = (Page > 0) ? @"<p class='view_all'><a href='javascript:ajaxGetListerContent(""" + WebMemberID + @""",1," + PreviousPage + @");' class='previous'>Previous</a>" : string.Empty;
        tabContents.PagerHTML += (videos.Count > (NextPage * DisplayNumberOfVideos)) ? @"<a href='javascript:ajaxGetListerContent(""" + WebMemberID + @""",1," + NextPage + @");' class='next'>Next</a></p>" : string.Empty;

        tabContents.HTML = sbHTML.ToString();

        return(tabContents);
    }
示例#29
0
    public string GetTopVideos(OrderByType TabType)
    {
        string CacheKey = "TopVideo" + TabType;

        Videos = (List <Video>)System.Web.HttpContext.Current.Cache[CacheKey];

        if (System.Web.HttpContext.Current.Cache.Get(CacheKey) == null)
        {
            Videos = Video.GetTop100Videos((OrderByType)TabType);
            System.Web.HttpContext.Current.Cache.Insert(CacheKey, Videos, null, DateTime.Now.AddSeconds(30.00), System.Web.Caching.Cache.NoSlidingExpiration);
        }

        StringBuilder sbHTMLList = new StringBuilder();

        for (int i = 0; i < 7; i++)
        {
            if (Videos.Count <= i)
            {
                break;
            }
            StringBuilder sbHTMLItem = new StringBuilder();

            object[] parameters = new object[15];

            parameters[0]  = ParallelServer.Get() + Videos[i].ThumbnailResourceFile.FullyQualifiedURL;
            parameters[1]  = Videos[i].TimeAgo;
            parameters[2]  = Videos[i].Title;
            parameters[3]  = Videos[i].Description;
            parameters[4]  = Videos[i].NumberOfViews;
            parameters[5]  = Videos[i].NumberOfComments;
            parameters[6]  = Videos[i].Member.NickName;
            parameters[7]  = Videos[i].Category;
            parameters[8]  = Videos[i].WebVideoID;
            parameters[9]  = Videos[i].TotalVoteScore;
            parameters[10] = Videos[i].Member.WebMemberID;
            parameters[11] = Videos[i].FormattedTags();
            parameters[12] = NCache.GetCategoryName(Videos[i].Category);
            parameters[13] = Videos[i].Category;
            parameters[14] = RegexPatterns.FormatStringForURL(Videos[i].Title);

            string HTMLItem = @"<li><div class='vid_thumb'>
                                    <a href='/video/{14}/{8}/'><img src='{0}' alt='{2}' width='124' height='91' />

                                {1}
                                </div>
                                <div class='vid_info'>
                                    <h3>
                                        <a href='/video/{14}/{8}'>
                                            {2}</a></h3>
                                    <div class='vote vote_condensed'><span class='vote_count'>{9}</span></div>
                                        {3}</p>
                                    <p class='metadata'>
                                        Views: {4} Comments: {5}<br />
                                        Category: <a href='video.aspx?cat={13}'>{12}</a><br />
                                        Tags: {11}<br />
                                        From: <a href='/users/{6}'>{6}</a></p>
                                </div>
                            </li>";


            sbHTMLItem.AppendFormat(HTMLItem, parameters);
            sbHTMLList.Append(sbHTMLItem.ToString());
        }

        return(sbHTMLList.ToString());
    }