コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int page;

            Sitecore.Globalization.Language language;

            if (Sitecore.Globalization.Language.TryParse(Lang, out language))
            {
                Sitecore.Context.SetLanguage(language, false);
            }

            // Ensure friendship
            if (!IsUserLoggedIn &&
                !string.IsNullOrEmpty(ScreenName) &&
                !TelligentService.IsApprovedFriend(CurrentMember.ScreenName, ScreenName))
            {
                return;
            }

            if (int.TryParse(ResultPage, out page))
            {
                int totalFriends;

                var friends = TelligentService.GetFriends(ScreenName, page, Constants.MY_CONNECTIONS_FRIENDS_PER_PAGE, out totalFriends);

                if (friends.Any())
                {
                    rptConnections.DataSource = friends;
                    rptConnections.DataBind();
                }

                phMoreResults.Visible = ((page - 1) * Constants.MY_CONNECTIONS_FRIENDS_PER_PAGE) + friends.Count() < totalFriends;
            }
        }
コード例 #2
0
        private void PopulateContent()
        {
            int totalFriends;

            var friends = TelligentService.GetFriends(ProfileMember.ScreenName, 1, Constants.MY_CONNECTIONS_FRIENDS_PER_PAGE, out totalFriends);

            if (friends.Any())
            {
                rptConnections.DataSource = friends;
                rptConnections.DataBind();
            }

            pnlShowMore.Visible = friends.Count() < totalFriends;
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyAccountItem context = (MyAccountItem)Sitecore.Context.Item;
            var           item    = Sitecore.Context.Database.GetItem(Constants.Pages.MyAccountConnections);

            int totalFriends;

            var friends = TelligentService.GetFriends(this.CurrentMember.ScreenName, 1, Constants.MY_CONNECTIONS_FRIENDS_PER_PAGE, out totalFriends);

            if (friends.Any())
            {
                rptFriends.DataSource = friends;
                rptFriends.DataBind();
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            MyAccountItem context = (MyAccountItem)Sitecore.Context.Item;
            var           item    = Sitecore.Context.Database.GetItem(Constants.Pages.MyAccountConnections);

            hypConnectionsTab.NavigateUrl = Sitecore.Links.LinkManager.GetItemUrl(item);
            hypConnectionsTab.Text        = Model.SeeAllConnectionsText;

            int totalFriends;

            var friends = TelligentService.GetFriends(this.CurrentMember.ScreenName, 1, Constants.MY_ACCOUNT_CONNECTIONS_WIDGET_ENTRIES, out totalFriends);

            ltFriendCount.Text = totalFriends.ToString();

            if (friends.Any())
            {
                rptFriends.DataSource = friends;
                rptFriends.DataBind();
            }
        }
コード例 #5
0
        private void PopulateContent()
        {
            int         totalFriends = 0;
            List <User> friends      = TelligentService.GetFriends(CurrentMember.ScreenName, 1, Constants.WHATS_HAPPENING_MY_FRIENDS_ENTRIES, out totalFriends);

            if (friends.Any())
            {
                rptFriends.DataSource = friends;
                rptFriends.DataBind();
                if (totalFriends <= 4)
                {
                    arrowLeft.Visible = arrowRight.Visible = false;
                }
            }
            if (!friends.Any())
            {
                divFriends.Visible = false;
            }

            hypSeeAll.NavigateUrl = LinkManager.GetItemUrl(Sitecore.Context.Database.GetItem("{840AEEF4-5294-4A0D-8D1C-6839E39FE3FE}"));
        }
コード例 #6
0
        private void LoadFriends()
        {
            int totalFriends = 0;
            var usernames    = TelligentService.GetFriends(CurrentMember.ScreenName, FriendPageIndex, 10, out totalFriends).Select(x => new { Username = x.Username }); //TelligentService.GetUserNames().Select(x=> new {Username=x});

            if (usernames.Count() < totalFriends)
            {
                FriendPageIndex++;
            }

            TotalFriends = totalFriends;

            chklUsernames.DataSource = usernames;
            chklUsernames.DataBind();

            if (!string.IsNullOrEmpty(RecipientScreenName))
            {
                try
                {
                    chklUsernames.SelectedValue = RecipientScreenName;
                }
                catch { }
            }
        }
コード例 #7
0
        protected void Page_Init(object sender, EventArgs e)
        {
            var pageAreas = new WhatsHappeningAreas();

            if (this.CurrentMember != null)
            {
                //should we display Recommended Questions?
                var reccommendedQuestions = SearchHelper.GetRecommendedContent(this.CurrentMember, QandADetailsItem.TemplateId)
                                            .Where(a => a.GetItem() != null);
                if (reccommendedQuestions.Count() > 0)
                {
                    pageAreas.Questions = WhatsHappeningAreas.WhatsHappeningSublayouts.RecommendedQuestions;
                }

                //even bother with community features?
                if (!string.IsNullOrEmpty(this.CurrentMember.ScreenName))
                {
                    //should we display Blogs I Follow?
                    if (TelligentService.UserFollowsBlogs(this.CurrentMember.ScreenName))
                    {
                        pageAreas.Blogs = WhatsHappeningAreas.WhatsHappeningSublayouts.BlogsIFollow;
                    }
                    else
                    {
                        var reccommnededBlogs = SearchHelper.GetRecommendedContent(this.CurrentMember, BlogsPostPageItem.TemplateId)
                                                .Where(a => a.GetItem() != null);
                        if (reccommnededBlogs.Count() > 0)
                        {
                            pageAreas.Blogs = WhatsHappeningAreas.WhatsHappeningSublayouts.RecommendedBlogs;
                        }
                    }

                    //should we display My Friends?
                    int friendCount = 0;
                    var friends     = TelligentService.GetFriends(this.CurrentMember.ScreenName, 1, 1, out friendCount);

                    if (friendCount > 0)
                    {
                        pageAreas.CommunityMembers = WhatsHappeningAreas.WhatsHappeningSublayouts.MyFriends;
                    }

                    //should we display My Groups?
                    var usersGroups = TelligentService.GetUserGroups(this.CurrentMember.ScreenName);
                    if (usersGroups.Count > 0)
                    {
                        pageAreas.Groups = WhatsHappeningAreas.WhatsHappeningSublayouts.MyGroups;
                    }
                }
                else
                {
                    //should we display Recommended Blogs?
                    var reccommnededBlogs = SearchHelper.GetRecommendedContent(this.CurrentMember, BlogsPostPageItem.TemplateId)
                                            .Where(a => a.GetItem() != null);
                    if (reccommnededBlogs.Count() > 0)
                    {
                        pageAreas.Blogs = WhatsHappeningAreas.WhatsHappeningSublayouts.RecommendedBlogs;
                    }

                    //TODO - implement Recommended Groups sublayout
                    //var recommendedGroups = SearchHelper.GetRecommendedContent(this.CurrentMember, GroupItem.TemplateId)
                    //.Where(a => a.GetItem() != null);
                    //if (reccommendedQuestions.Count > 0)
                    //{
                    //    sbGroups.Path = this.RecommendedGroups;
                    //}
                }
            }

            ProcessAreas(pageAreas);
        }