Exemple #1
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;
    }