Ejemplo n.º 1
0
        protected void lstvw_NewestMember_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            HyperLink hprlnkUserProfile = (HyperLink)e.Item.FindControl("hprlnkUserProfile");

            string[] parameters3 = new string[1];

            Label lblUserId = (Label)e.Item.FindControl("lblUserId");

            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            string lang = CultureInfo.CurrentCulture.ToString();
            hprlnkUserProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(lblUserId.Text), lang, isFacebook);
        }
Ejemplo n.º 2
0
        protected void lstvw_DebateProposals_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            try
            {
                Label lbl_ThumbsDown = (Label)e.Item.FindControl("lbl_ThumbsDown");
                Label lbl_ThumbsUp = (Label)e.Item.FindControl("lbl_ThumbsUp");
                Label UserIDLabel = (Label)e.Item.FindControl("UserIDLabel");
                LinkButton lnkbtn_ApproveThread = (LinkButton)e.Item.FindControl("lnkbtn_ApproveThread");
                if (lbl_ThumbsDown != null)
                {
                    if (lbl_ThumbsDown.Text == "")
                    {
                        lbl_ThumbsDown.Text = "0";
                        lbl_ThumbsUp.Text = "0";
                    }
                }
                if (!UserInfo.IsInRole("Administrator") && lnkbtn_ApproveThread != null)
                {
                    lnkbtn_ApproveThread.Visible = false;
                }

                //Label PostIDLabel = (Label)e.Item.FindControl("PostIDLabel");
                Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
                Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
                Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
                Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");
                Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");

                string[] dateArr = CreatedDateLabel.Text.Split(' ');
                if (dateArr.Length > 1)
                {
                    CreatedDateLabel.Text = dateArr[0] + ", " + dateArr[1];
                }
                else
                {
                    CreatedDateLabel.Text = dateArr[0];
                }

                string htmlContent = Server.HtmlDecode(lbl_Body.Text);
                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                List<string> images = util.GetImagesInHTMLString(htmlContent);//.GetImagesInHTMLString(html);
                lbl_Body.Text = util.GetTrimmedBody(Server, 350, htmlContent);

                if (images.Count > 0)
                {

                    ltrlImage.Text = images[0].Replace("style=", "ourspace=");
                }
                else
                {
                    HtmlTableCell imageTd = (HtmlTableCell)e.Item.FindControl("imageTd");
                    HtmlTableCell textTd = (HtmlTableCell)e.Item.FindControl("textTd");
                    imageTd.Visible = false;
                    textTd.ColSpan = 2;
                }

                // .Replace("&amp;amp;lt;br /&amp;amp;gt;", "<br/>");
                // if (BodyLabel.Text.Length > 100)
                // {
                //     BodyLabel.Text = BodyLabel.Text.Substring(0, 99) + "..";
                // }

                HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");
                HyperLink hprlnk_subject = (HyperLink)e.Item.FindControl("hprlnk_subject");
                string language = CultureInfo.CurrentCulture.Name;
                if (ThreadIDLabel != null)
                {

                    if (Request.QueryString["facebook"] != null)
                    {
                        Dictionary<string, int> tabs = new Dictionary<string, int>();
                        tabs.Add("en-GB", 259);
                        tabs.Add("el-GR", 260);
                        tabs.Add("cs-CZ", 261);
                        tabs.Add("de-AT", 262);
                        int joinTab = tabs[language];
                        string[] parameters = new string[3];
                        parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                        hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(joinTab, "", parameters);
                    }
                    else
                    {
                        string[] parameters = new string[2];
                        parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                        hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                    }

                    // string url = "";
                    //string[] parameters = new string[3];

                    //parameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    //url = NavigateURL(TabId, "", parameters);
                    // url = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                    //hprlnk_post.NavigateUrl = url;
                    // Add FB support
                    int resultsPageId = 196;
                    string url2 = "";
                    // if accessed via Facebook App Canvas
                    if (Request.QueryString["facebook"] != null)
                    {
                        resultsPageId = 275;
                        string[] parameters2 = new string[2] { "result=" + ThreadIDLabel.Text, "facebook=1" };
                        url2 = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters2);
                    }
                    else
                    {
                        string[] parameters2 = new string[1] { "result=" + ThreadIDLabel.Text };
                        url2 = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters2);
                    }
                    hprlnk_subject.NavigateUrl = url2;
                    hprlnk_subject.NavigateUrl = url2.Replace("language/en-GB", "language/" + language);
                }

                Label lbl_FavoriteSolution = (Label)e.Item.FindControl("lbl_FavoriteSolution");

                IDataReader reader = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(@" SELECT        Ourspace_Proposal_Solutions.ThreadID, Forum_Posts.UserID, Forum_Posts.Body, Ourspace_Proposal_Solutions.IsFeatured
            FROM            Ourspace_Proposal_Solutions INNER JOIN
                         Forum_Posts ON Ourspace_Proposal_Solutions.PostId = Forum_Posts.PostID
            WHERE        (Ourspace_Proposal_Solutions.ThreadID = " + ThreadIDLabel.Text + @") AND (Ourspace_Proposal_Solutions.IsFeatured = 'true')
            ORDER BY Ourspace_Proposal_Solutions.ThumbsUp DESC");
                if (reader.Read())
                {
                    //util = new Ourspace_Utilities.View();

                    lbl_FavoriteSolution.Text += " " + util.GetTrimmedBody(Server, 95, reader["body"].ToString());
                }
                // Displaying favorite- solution

                HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

                string lang = CultureInfo.CurrentCulture.ToString();
                hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(UserIDLabel.Text), lang, Request.QueryString["facebook"] != null);

            }
            catch (Exception ex)
            {
                string exception = ex.Message;
            }
        }
Ejemplo n.º 3
0
 public string GetUserProfileUrl(string userId)
 {
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     return util.GetUserProfileLink(Convert.ToInt32( userId), CultureInfo.CurrentCulture.Name,false);
 }
Ejemplo n.º 4
0
        protected void NotificationsRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            try
            {
                if (NotificationsRepeater.Items.Count < 1)
                {
                    if (e.Item.ItemType == ListItemType.Footer)
                    {
                        Label lblFooter = (Label)e.Item.FindControl("lblEmptyData");
                        lblFooter.Visible = true;
                    }
                }
                HyperLink hprlnkUserProfile = (HyperLink)e.Item.FindControl("hprlnkUserProfile");

                string[] parameters3 = new string[1];

                Label lblUserId = (Label)e.Item.FindControl("lblUserId");

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                string lang = CultureInfo.CurrentCulture.ToString();
                hprlnkUserProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(lblUserId.Text), lang, isFacebook);
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
Ejemplo n.º 5
0
        private void getImages(String type)
        {
            Image[] topUserImages = { ImageTopUser1, ImageTopUser2, ImageTopUser3,
                                      ImageTopUser4, ImageTopUser5};

            Label[] topUserLabels = { LabelTopUser1, LabelTopUser2, LabelTopUser3,
                                      LabelTopUser4, LabelTopUser5};

            HyperLink[] topUserHyperlinks = { hprlnk_TopUser1, hprlnk_TopUser2, hprlnk_TopUser3,
                                                hprlnk_TopUser4, hprlnk_TopUser5};
            String sql = sqlMap[type];

            String connectionString = ConfigurationManager.ConnectionStrings["SiteSqlServer"].ToString();

            using (var sqlConn = new SqlConnection(connectionString))
            {
                sqlConn.Open();

                using (SqlCommand cmd = new SqlCommand(sql, sqlConn))
                {
                    cmd.CommandType = CommandType.Text;

                    SqlDataReader reader = cmd.ExecuteReader();
                    int i = 0;
                    while (reader.Read())
                    {
                        int userId = reader.GetInt32(0);

                        int points = reader.GetInt32(1);

                        String userName = reader.GetString(2);
                        topUserHyperlinks[i].Text = userName;

                        Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                        string lang = CultureInfo.CurrentCulture.ToString();
                        topUserHyperlinks[i].NavigateUrl = util.GetUserProfileLink(userId, lang, isFacebook);

                        //Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                        //topUserImages[i].ImageUrl = getImageUrl(userId);
                        topUserImages[i].ImageUrl = util.GetOurSpaceUserImgUrl(Server, userId);
                        topUserImages[i].ToolTip = userName;
                        string pointsLbl = Localization.GetString("points", LocalResourceFile);

                        // Retrieves String and Image resources.
                        //string myString = myManager.GetString("StringResource");

                        //ResourceManager rm = new ResourceManager(Type.DefaultBinder);
                        //string pointsLbl = ResourceManager.GetString("points");

                        topUserLabels[i].Text = points.ToString() +
                                        ((points == 1) ? " point" : " "+pointsLbl);
                        i++;

                    }
                    reader.Close();
                }
                sqlConn.Close();
            }
        }
Ejemplo n.º 6
0
        protected void lstvw_DebateProposals_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            try
            {
                Label lbl_ThumbsDown = (Label)e.Item.FindControl("lbl_ThumbsDown");
                Label lbl_ThumbsUp = (Label)e.Item.FindControl("lbl_ThumbsUp");
                LinkButton lnkbtn_ApproveThread = (LinkButton)e.Item.FindControl("lnkbtn_ApproveThread");
                LinkButton lnkbtn_RejectThread = (LinkButton)e.Item.FindControl("lnkbtn_RejectThread");

                if (lbl_ThumbsDown != null)
                {
                    if (lbl_ThumbsDown.Text == "")
                    {
                        lbl_ThumbsDown.Text = "0";
                        lbl_ThumbsUp.Text = "0";
                    }
                }
                if (!UserInfo.IsInRole("Administrator") && !UserInfo.IsInRole("Collaborator") && lnkbtn_ApproveThread != null)
                {
                    lnkbtn_ApproveThread.Visible = false;
                    lnkbtn_RejectThread.Visible = false;
                }

                //Label PostIDLabel = (Label)e.Item.FindControl("PostIDLabel");
                Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
                Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
                Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
                Label lbl_FullBody = (Label)e.Item.FindControl("lbl_FullBody");
                Label UserIDLabel = (Label)e.Item.FindControl("UserIDLabel");
                Label lblRejectReasonId = (Label)e.Item.FindControl("lblRejectReasonId");
                  Label lblRejected = (Label)e.Item.FindControl("lblRejected");

                Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");
                Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");

                string[] dateArr = CreatedDateLabel.Text.Split(' ');
                if (dateArr.Length > 1)
                {
                    CreatedDateLabel.Text = dateArr[0] + ", " + dateArr[1];
                }
                else
                {
                    CreatedDateLabel.Text = dateArr[0];
                }

                if (lblRejectReasonId.Text != "-1")
                {
                    lblRejected.Visible = true;
                }

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                if (lbl_Body != null)
                {
                    string htmlContent = Server.HtmlDecode(lbl_Body.Text);

                    List<string> images = util.GetImagesInHTMLString(htmlContent);//.GetImagesInHTMLString(html);
                    lbl_Body.Text = util.GetTrimmedBody(Server, 350, htmlContent);
                    lbl_FullBody.Text = htmlContent;
                    if (images.Count > 0)
                    {

                        ltrlImage.Text = images[0].Replace("style=", "ourspace=");
                    }
                    else
                    {
                        HtmlTableCell imageTd = (HtmlTableCell)e.Item.FindControl("imageTd");
                        HtmlTableCell textTd = (HtmlTableCell)e.Item.FindControl("textTd");
                        imageTd.Visible = false;
                        textTd.ColSpan = 2;
                    }
                }

                // .Replace("&amp;amp;lt;br /&amp;amp;gt;", "<br/>");
                // if (BodyLabel.Text.Length > 100)
                // {
                //     BodyLabel.Text = BodyLabel.Text.Substring(0, 99) + "..";
                // }

                HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");
                HyperLink hprlnk_subject = (HyperLink)e.Item.FindControl("hprlnk_subject");

                if (ThreadIDLabel != null)
                {
                    string url = "";
                    int resultsPageId = 73;

                    if (Request.QueryString["facebook"] != null)
                    {
                        // if accessed via Facebook App Canvas
                        resultsPageId = 271;
                        string[] parameters = new string[4];
                        parameters = new string[4] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                        url = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters);
                    }
                    else
                    {
                        string[] parameters = new string[3];
                        parameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                        url = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters);
                    }
                    hprlnk_post.NavigateUrl = url;
                    if (hprlnk_subject != null)
                        hprlnk_subject.NavigateUrl = url;
                }

                HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

                string lang = CultureInfo.CurrentCulture.ToString();
                if (hprlnk_userProfile != null)
                    hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(UserIDLabel.Text), lang, isFacebook);

            }
            catch (Exception ex)
            {
                string exception = ex.Message;
            }
        }
Ejemplo n.º 7
0
        protected void lstvw_ResultsSnippets_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
            Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");

            Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
            Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");
            Label lbl_UserId = (Label)e.Item.FindControl("lbl_UserId");
            Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");
            HyperLink hprlnk_subject = (HyperLink)e.Item.FindControl("hprlnk_subject");

            HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");

            string[] dateArr = CreatedDateLabel.Text.Split(' ');
            if (dateArr.Length > 1)
            {
                CreatedDateLabel.Text = dateArr[0] + ", " + dateArr[1];
            }
            else
            {
                CreatedDateLabel.Text = dateArr[0];
            }

            string htmlContent = Server.HtmlDecode(lbl_Body.Text);
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            List<string> images = util.GetImagesInHTMLString(htmlContent);//.GetImagesInHTMLString(html);
            lbl_Body.Text = util.GetTrimmedBody(Server,350,htmlContent);

            if (images.Count > 0)
            {

                ltrlImage.Text = images[0].Replace("style=", "ourspace=");
            }
            else
            {
                HtmlTableCell imageTd = (HtmlTableCell)e.Item.FindControl("imageTd");
                HtmlTableCell textTd = (HtmlTableCell)e.Item.FindControl("textTd");
                imageTd.Visible = false;
                textTd.ColSpan = 2;
            }

            string url = "";
            int resultsPageId = 200;

            if (Request.QueryString["facebook"] != null)
            {
                // if accessed via Facebook App Canvas
                resultsPageId = 279;
                string[] parameters2 = new string[3];
                parameters2 = new string[3] { "threadid=" + ThreadIDLabel.Text, "mode=featured","facebook=1" };
                url = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters2);
            }
            else
            {

                string[] parameters2 = new string[2];
                parameters2 = new string[2] { "threadid=" + ThreadIDLabel.Text, "mode=featured" };
                url = DotNetNuke.Common.Globals.NavigateURL(resultsPageId, "", parameters2);
            }

            string language = CultureInfo.CurrentCulture.Name;
            hprlnk_subject.NavigateUrl = url.Replace("language/en-GB", "language/"+language);

             HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

             string lang = CultureInfo.CurrentCulture.ToString();
             hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(lbl_UserId.Text), lang, isFacebook);

             if (isFacebook)
             {
                 Dictionary<string, int> tabs = new Dictionary<string, int>();

                 tabs.Add("en-GB", 259);
                 tabs.Add("el-GR", 260);
                 tabs.Add("cs-CZ", 261);
                 tabs.Add("de-AT", 262);
                 int suggestTab = tabs[language];
                 string[] parameters = new string[3];
                 parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                 hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);

             }
             else
             {
                 Dictionary<string, int> tabs = new Dictionary<string, int>();
                 tabs.Add("en-GB", 62);
                 tabs.Add("el-GR", 93);
                 tabs.Add("cs-CZ", 106);
                 tabs.Add("de-AT", 171);
                 int suggestTab = tabs[language];
                 string[] parameters = new string[2];
                 parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                 hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);
             }
        }
Ejemplo n.º 8
0
        protected void lstvw_ActiveDiscussions_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            Label lbl_ThumbsDown = (Label)e.Item.FindControl("lbl_ThumbsDown");
            Label lbl_ThumbsUp = (Label)e.Item.FindControl("lbl_ThumbsUp");
            LinkButton lnkbtn_ApproveThread = (LinkButton)e.Item.FindControl("lnkbtn_ApproveThread");
            if (lbl_ThumbsDown != null)
            {
                if (lbl_ThumbsDown.Text == "")
                {
                    lbl_ThumbsDown.Text = "0";
                    lbl_ThumbsUp.Text = "0";
                }
            }
            if (!UserInfo.IsInRole("Administrator") && lnkbtn_ApproveThread != null)
            {
                lnkbtn_ApproveThread.Visible = false;
            }

            //Label PostIDLabel = (Label)e.Item.FindControl("PostIDLabel");
            Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
            Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
            Label BodyLabel = (Label)e.Item.FindControl("BodyLabel");
            Label lbl_UserId = (Label)e.Item.FindControl("lbl_UserId");
            Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");

            string[] dateArr = CreatedDateLabel.Text.Split(' ');
            CreatedDateLabel.Text = dateArr[0] + " @ " + dateArr[1];
            BodyLabel.Text = Server.HtmlDecode(BodyLabel.Text);

            // .Replace("&amp;amp;lt;br /&amp;amp;gt;", "<br/>");
            // if (BodyLabel.Text.Length > 100)
            // {
            //     BodyLabel.Text = BodyLabel.Text.Substring(0, 99) + "..";
            // }

            HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");
            HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

                        Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                        string lang = CultureInfo.CurrentCulture.ToString();
                        hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(lbl_UserId.Text), lang, isFacebook);

            if (ThreadIDLabel != null)
            {
                string url = "";
                string[] parameters = new string[3];

                parameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                //url = NavigateURL(TabId, "", parameters);
                url = DotNetNuke.Common.Globals.NavigateURL(73, "", parameters);
                hprlnk_post.NavigateUrl = url;

            }
            if (!UserInfo.IsInRole("Administrator"))
            {
                ListView lstvw_SolutionsInner = (ListView)e.Item.FindControl("lstvw_Solutions");
                Panel pnl_insertTemplate = (Panel)lstvw_SolutionsInner.InsertItem.FindControl("pnl_insertTemplate");
                pnl_insertTemplate.Visible = false;
            }
        }
Ejemplo n.º 9
0
        protected void lstvw_RecentActivities_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            // HyperLink hprlnk_userLink = (HyperLink)e.Item.FindControl("hprlnk_userLink");
            //Label friendshipRequesterLabel = (Label)e.Item.FindControl("friendshipRequesterLabel");
            Label UserIDLabel = (Label)e.Item.FindControl("UserIDLabel");
            Label SubjectLabel = (Label)e.Item.FindControl("SubjectLabel");
            //Label lbl_FriendDisplayName = (Label)e.Item.FindControl("lbl_FriendDisplayName");
            Label lbl_Name = (Label)e.Item.FindControl("lbl_Name");
            //Label lbl_Location = (Label)e.Item.FindControl("lbl_Location");
               // Label lbl_LocationText = (Label)e.Item.FindControl("lbl_LocationText");
            Label BodyLabel = (Label)e.Item.FindControl("BodyLabel");
            if (SubjectLabel.Text.Length > 4 && SubjectLabel.Text.Substring(0, 4) == "Re: ")
            {
                SubjectLabel.Text = SubjectLabel.Text.Substring(4,SubjectLabel.Text.Length -4);
            }

            //SubjectLabel.Text = SubjectLabel.Text.Substring(0,4)
            UserInfo userInfo = new UserInfo();
            System.Web.UI.WebControls.Image img_profileMini = (System.Web.UI.WebControls.Image)e.Item.FindControl("img_profileMini");

            userInfo = UserController.GetUserById(PortalId, Convert.ToInt32(UserIDLabel.Text));
            if (userInfo.FirstName != "")
            {

                lbl_Name.Text = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(userInfo.Profile.FirstName) + " " + System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(userInfo.Profile.LastName); //.Substring(0, 1).ToUpper()
            }
            else
            {
                lbl_Name.Text = userInfo.Username;
            }

            //if (userInfo.Profile.Country == "" || userInfo.Profile.Country == "N/A" || userInfo.Profile.Country == null)
            //{
            //    lbl_LocationText.Visible = false;
            //    lbl_Location.Visible = false;
            //}
            //else
            //{
            //    lbl_Location.Text = userInfo.Profile.Country;
            //}

            //lbl_FriendDisplayName.Text = userInfo.FirstName + " " + userInfo.LastName;
            //hprlnk_userLink.NavigateUrl = userInfo.UserID.ToString();
            //img_profileMini.ToolTip = lbl_FriendDisplayName.Text;

            /* Link to user profile */
            HyperLink hprlnk_UserProfile = (HyperLink)e.Item.FindControl("hprlnk_UserProfile");
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            string lang = CultureInfo.CurrentCulture.ToString();
            hprlnk_UserProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(UserIDLabel.Text), lang, isFacebook);

            /* Link to thread*/
            HyperLink hprlnk_Topic = (HyperLink)e.Item.FindControl("hprlnk_Topic");

            Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
            Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
            string topicUrl = "";
            string[] topicParameters = new string[3];

            topicParameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };
            topicUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", topicParameters);

            if (UserId == -1 &&  Response.Cookies["language"] != null)
            {
               string cookieLang = Response.Cookies["language"].Value;
             topicUrl =  topicUrl.Replace("en-GB", cookieLang);
            }

            hprlnk_Topic.NavigateUrl = topicUrl;

            img_profileMini.ImageUrl = util.GetOurSpaceUserImgUrl(Server, userInfo.UserID);

            //Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");

            //string[] dateArr = CreatedDateLabel.Text.Split(' ');
            //CreatedDateLabel.Text = dateArr[0] + " @ " + dateArr[1];
            BodyLabel.Text = Regex.Replace(HttpUtility.HtmlDecode(BodyLabel.Text), @"<(.|\n)*?>", string.Empty);
            if (BodyLabel.Text.Length > 200)
            {
                BodyLabel.Text = Regex.Replace(HttpUtility.HtmlDecode(BodyLabel.Text), @"<(.|\n)*?>", string.Empty);
                if (BodyLabel.Text.Length > 200)
                {
                    BodyLabel.Text = BodyLabel.Text.Substring(0, 199) + "..";
                }
            }
            //BodyLabel.Text = BodyLabel.Text.Replace("&ndash;", "-");
        }
Ejemplo n.º 10
0
        protected void lstvw_DebateProposals_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            try
            {
                Label lblProposalPosition = (Label)e.Item.FindControl("lblProposalPosition");

                if (lblProposalPosition != null)
                {
                    int position = proposalPosition++;
                    //lblProposalPosition.Text = position.ToString();
                    lblProposalPosition.CssClass = "proposalPosition" + position;
                }
                LinkButton lnkbtn_disagree = (LinkButton)e.Item.FindControl("lnkbtn_disagree");
                LinkButton lnkbtn_agree = (LinkButton)e.Item.FindControl("lnkbtn_agree");
                if (lnkbtn_agree != null && lnkbtn_disagree != null)
                {
                    if (UserId < 0)
                    {
                        lnkbtn_disagree.CssClass += " please-log-in";
                        lnkbtn_disagree.Attributes.Add("onclick", "return false;");
                        lnkbtn_agree.CssClass += " please-log-in";
                        lnkbtn_agree.Attributes.Add("onclick", "return false;");

                    }
                    if (UserHasVotedProposal(int.Parse(lnkbtn_disagree.CommandArgument), UserId))
                    {
                        lnkbtn_disagree.CssClass += " already-voted";
                        lnkbtn_disagree.Attributes.Add("onclick", "return false;");
                        lnkbtn_agree.CssClass += " already-voted";
                        lnkbtn_agree.Attributes.Add("onclick", "return false;");
                    }
                }

                Label lbl_ThumbsDown = (Label)e.Item.FindControl("lbl_ThumbsDown");
                Label lbl_ThumbsUp = (Label)e.Item.FindControl("lbl_ThumbsUp");
                LinkButton lnkbtn_ApproveThread = (LinkButton)e.Item.FindControl("lnkbtn_ApproveThread");
                if (lbl_ThumbsDown != null)
                {
                    if (lbl_ThumbsDown.Text == "")
                    {
                        lbl_ThumbsDown.Text = "0";
                        lbl_ThumbsUp.Text = "0";
                    }
                }
                if (!UserInfo.IsInRole("Administrator") && lnkbtn_ApproveThread != null && !UserInfo.IsInRole("Collaborator"))
                {
                    lnkbtn_ApproveThread.Visible = false;
                }

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                //Label PostIDLabel = (Label)e.Item.FindControl("PostIDLabel");
                Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
                Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
                Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
                Label lbl_BodyWhole = (Label)e.Item.FindControl("lbl_BodyWhole");
                Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");
                // Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");
                Label UserIDLabel = (Label)e.Item.FindControl("UserIDLabel");
                Image userImage = (Image)e.Item.FindControl("userImage");

                string[] dateArr = CreatedDateLabel.Text.Split(' ');
                if (dateArr.Length > 1)
                {
                    CreatedDateLabel.Text = dateArr[0] + ", " + dateArr[1];
                }
                else
                {
                    CreatedDateLabel.Text = dateArr[0];
                }
                if (lbl_Body != null)
                {
                    string htmlContent = Server.HtmlDecode(lbl_Body.Text);

                    List<string> images = util.GetImagesInHTMLString(htmlContent);//.GetImagesInHTMLString(html);
                    lbl_Body.Text = util.GetTrimmedBody(Server, 350, htmlContent);
                }
                else if (lbl_BodyWhole != null)
                {
                    //lbl_BodyWhole.Text = Server.HtmlDecode(lbl_Body.Text);
                    lbl_BodyWhole.Text = util.GetTrimmedBody(Server, 5000, Server.HtmlDecode(lbl_BodyWhole.Text));
                }

                HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

                string lang = CultureInfo.CurrentCulture.ToString();
                hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(UserIDLabel.Text), lang, isFacebook);

                Panel pnlAdminControls = (Panel)e.Item.FindControl("pnlAdminControls");
                if (pnlAdminControls != null)
                {

                    if (!(UserInfo.IsInRole("Collaborator") && currentPhaseId == 2))
                    {

                        pnlAdminControls.Visible = false;

                    }
                }

                HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");
                HyperLink hprlnk_subject = (HyperLink)e.Item.FindControl("hprlnk_subject");
                if (hprlnk_subject != null && hprlnk_post != null)
                {
                    if (ThreadIDLabel != null)
                    {
                        string url = "";
                        string[] parameters = new string[3];

                        parameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                        //url = NavigateURL(TabId, "", parameters);
                        url = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                        url = url.Replace("language/en-GB", "language/"+ CultureInfo.CurrentCulture.ToString());
                        hprlnk_post.NavigateUrl = url;
                        hprlnk_subject.NavigateUrl = url;
                        //currentForumId = Int32.Parse(ForumIDLabel.Text);
                       // Session["currentForumId"] = currentForumId;
                    }
                }

                if (ForumIDLabel != null)
                {
                    currentForumId = Int32.Parse(ForumIDLabel.Text);
                    Session["currentForumId"] = currentForumId;
                }
               // Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");

                userImage.ImageUrl = util.GetOurSpaceUserImgUrl(Server, int.Parse(UserIDLabel.Text));

                if (currentPhaseId == 3 && Request.QueryString["mode"] != null)
                {
                    Panel pnlPhase2Voting = (Panel)e.Item.FindControl("pnlPhase2Voting");
                    pnlPhase2Voting.Visible = false;
                    Panel pnlPhase3Voting = (Panel)e.Item.FindControl("pnlPhase3Voting");
                    pnlPhase3Voting.Visible = true;
                }
                else
                {
                    Panel pnlPhase2Voting = (Panel)e.Item.FindControl("pnlPhase2Voting");
                    pnlPhase2Voting.Visible = true;
                    Panel pnlPhase3Voting = (Panel)e.Item.FindControl("pnlPhase3Voting");
                    pnlPhase3Voting.Visible = false;
                }

            }
            catch (Exception ex)
            {
                string exception = ex.Message;
            }
        }
Ejemplo n.º 11
0
        protected void lstvw_reportedPosts_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            int forumId = Convert.ToInt32( ((Label) e.Item.FindControl("ForumIDLabel")).Text);
            int postId = Convert.ToInt32(((Label)e.Item.FindControl("PostIDLabel")).Text);
             int userId = Convert.ToInt32(((Label)e.Item.FindControl("UserIDLabel")).Text);

            Label BodyLabel = (Label)e.Item.FindControl("BodyLabel");
              Label ReasonLabel = (Label)e.Item.FindControl("ReasonLabel");

            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            ((HyperLink)e.Item.FindControl("hprlnk_GoToPost")).NavigateUrl = util.GetPostUrl(forumId, postId);
            ((HyperLink)e.Item.FindControl("hprlnk_GoToProfile")).NavigateUrl = util.GetUserProfileLink(userId,CultureInfo.CurrentCulture.ToString(),false);

            BodyLabel.Text = util.GetTrimmedBody(Server, 300, BodyLabel.Text);

            ReasonLabel.Text = util.GetTrimmedBody(Server, 300, ReasonLabel.Text);
        }
Ejemplo n.º 12
0
        protected void lstvw_OverviewItems_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            // Localize previous/next buttons

            try{
            Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
            Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
            Label CreatedDateLabel = (Label)e.Item.FindControl("CreatedDateLabel");

            Label lblRejectReasonId = (Label)e.Item.FindControl("lblRejectReasonId");
            Label lblRejected = (Label)e.Item.FindControl("lblRejected");
            Label lblRejectedDash = (Label)e.Item.FindControl("lblRejectedDash");

            Label lblUserId = (Label)e.Item.FindControl("lblUserId");

            Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");
            HyperLink hprlnk_subject = (HyperLink)e.Item.FindControl("hprlnk_subject");

            HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

            if (lblRejectReasonId.Text != "-1")
            {
                lblRejected.Visible = true;
                lblRejectedDash.Visible = true;
            }
            string[] dateArr = CreatedDateLabel.Text.Split(' ');
            if (dateArr.Length > 1)
            {
                CreatedDateLabel.Text = dateArr[0] + ", " + dateArr[1];
            }
            else
            {
                CreatedDateLabel.Text = dateArr[0];
            }

            string[] parameters2 = new string[2];
            parameters2 = new string[2] { "threadid=" + ThreadIDLabel.Text, "mode=featured" };
            string url = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters2);
            hprlnk_subject.NavigateUrl = url;

            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            string lang = CultureInfo.CurrentCulture.ToString();
            hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(lblUserId.Text), lang, isFacebook);

            HtmlGenericControl phase1 = (HtmlGenericControl)e.Item.FindControl("phase1");
            HtmlGenericControl phase2 = (HtmlGenericControl)e.Item.FindControl("phase2");
            HtmlGenericControl phase3 = (HtmlGenericControl)e.Item.FindControl("phase3");
            HtmlGenericControl phase4 = (HtmlGenericControl)e.Item.FindControl("phase4");
            HtmlGenericControl[] phases = { phase1, phase2, phase3, phase4 };
            Label lblPhaseId = (Label)e.Item.FindControl("lblPhaseId");
            int currentPhase = int.Parse(lblPhaseId.Text);
            int i = 0;
            int j = 0;
            for (i = 0; i < currentPhase - 1; i++)
            {
                phases[i].Attributes["class"] = "phase-progress-icon phase-progress-complete phase-progress-" + (i + 1);

            }

            phases[i].Attributes["class"] = "phase-progress-icon phase-progress-active phase-progress-" + (i + 1);

            if (i == 3)
                phases[i].Attributes["class"] = "phase-progress-icon phase-progress-complete phase-progress-" + (i + 1);

            i++;
            for (j = i; j < 4; j++)
            {
                phases[j].Attributes["class"] = "phase-progress-icon phase-progress-inactive phase-progress-" + (i + 1);
            }

            // Make phase label links redirect user to phase according to phase.
            HyperLink hprlnk_Phase1 = (HyperLink)e.Item.FindControl("hprlnk_Phase1");
            HyperLink hprlnk_Phase2 = (HyperLink)e.Item.FindControl("hprlnk_Phase2");
            HyperLink hprlnk_Phase3 = (HyperLink)e.Item.FindControl("hprlnk_Phase3");
            HyperLink hprlnk_Phase4 = (HyperLink)e.Item.FindControl("hprlnk_Phase4");

            // Associating the Facebook tabs to each language

            // Suggest
            Dictionary<string, int> suggestTabs = new Dictionary<string, int>();
            suggestTabs.Add("en-GB", 271);
            suggestTabs.Add("el-GR", 272);
            suggestTabs.Add("cs-CZ", 273);
            suggestTabs.Add("de-AT", 274);

            // Join
            Dictionary<string, int> joinTabs = new Dictionary<string, int>();
            joinTabs.Add("en-GB", 259);
            joinTabs.Add("el-GR", 259);
            joinTabs.Add("cs-CZ", 259);
            joinTabs.Add("de-AT", 259);

            // Vote
            Dictionary<string, int> voteTabs = new Dictionary<string, int>();
            voteTabs.Add("en-GB", 279);
            voteTabs.Add("el-GR", 280);
            voteTabs.Add("cs-CZ", 281);
            voteTabs.Add("de-AT", 282);

            // Results

            // Subject link redirects user according to topic phase
            string language = CultureInfo.CurrentCulture.Name;
            if (currentPhase == 1)
            {
                if (isFacebook)
                {
                    int suggestTab = suggestTabs[language];
                    string[] parameters = new string[3];
                    //parameters1 = new string[2] { "user="******"facebook=1" };
                    parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);

                    // Phase links
                    hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);
                    hprlnk_Phase2.CssClass = "phase-unavailable";
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                    hprlnk_Phase4.CssClass = "phase-unavailable";
                }
                else
                {
                    string[] parameters = new string[2];
                    parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(73, "", parameters);
                    hprlnk_subject.NavigateUrl = hprlnk_subject.NavigateUrl.Replace("en-GB", language);

                    // Phase links
                    hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(73, "", parameters);
                    hprlnk_Phase1.NavigateUrl = hprlnk_Phase1.NavigateUrl.Replace("en-GB", language);
                    hprlnk_Phase2.CssClass = "phase-unavailable";
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                    hprlnk_Phase4.CssClass = "phase-unavailable";
                }

            }
            else if (currentPhase == 2)
            {
                if (isFacebook)
                {

                    int joinTab = joinTabs[language];
                    string[] parameters = new string[3];
                    parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(joinTab, "", parameters);

                    // Phase links
                    // Phase 2
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(joinTab, "", parameters);

                    // Phase 1
                    hprlnk_Phase1.CssClass = "phase-unavailable";
                    //int suggestTab = suggestTabs[language];
                    //parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                   // hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);
                    // Phase 3
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                    // Phase 4
                    hprlnk_Phase4.CssClass = "phase-unavailable";

                }
                else
                {
                    string[] parameters = new string[2];
                    parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                    hprlnk_subject.NavigateUrl = hprlnk_subject.NavigateUrl.Replace("en-GB", language);

                    // Phase links

                    // Phase 2
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                    hprlnk_Phase2.NavigateUrl = hprlnk_Phase2.NavigateUrl.Replace("en-GB", language);
                    // Phase 1
                   // int suggestTab = suggestTabs[language];
                   // string[] phase1Parameters = new string[2];
                   // phase1Parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    //hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(73, "", phase1Parameters);
                    hprlnk_Phase1.CssClass = "phase-unavailable";

                    // Phase 3
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                    // Phase 4
                    hprlnk_Phase4.CssClass = "phase-unavailable";

                }

            }
            else if (currentPhase == 3)
            {
                if (isFacebook)
                {
                    int voteTab = voteTabs[language];
                    string[] parameters = new string[3];
                    parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "mode=featured", "facebook=1" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);

                    // Phase links

                    // Phase 3
                    hprlnk_Phase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);
                    // Phase 1
                    //int suggestTab = suggestTabs[language];
                    //parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                    //hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);
                    hprlnk_Phase1.CssClass = "phase-unavailable";
                    // Phase 2
                    int joinTab = joinTabs[language];
                    parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(joinTab, "", parameters);
                    // Phase 4
                    hprlnk_Phase4.CssClass = "phase-unavailable";

                }
                else
                {
                    string[] parameters = new string[2];
                    parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "mode=featured" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    hprlnk_subject.NavigateUrl = hprlnk_subject.NavigateUrl.Replace("en-GB", language);

                    // Phase links

                    // Phase 3
                    hprlnk_Phase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    hprlnk_Phase3.NavigateUrl = hprlnk_Phase3.NavigateUrl.Replace("en-GB", language);
                    // Phase 1
                   // string[] phase1Parameters = new string[2];
                    //phase1Parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    //hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(73, "", phase1Parameters);
                    hprlnk_Phase1.CssClass = "phase-unavailable";

                    // Phase 2
                    string[] phase2Parameters = new string[2];
                    phase2Parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", phase2Parameters);
                    hprlnk_Phase2.NavigateUrl = hprlnk_Phase2.NavigateUrl.Replace("en-GB", language);
                    // Phase 4
                    hprlnk_Phase4.CssClass = "phase-unavailable";

                }
            }
            else if (currentPhase == 4)
            {
                if (isFacebook)
                {
                    int voteTab = voteTabs[language];
                    string[] parameters = new string[2];
                    parameters = new string[2] { "result=" + ThreadIDLabel.Text, "facebook=1" };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);

                    // Phase links

                    // Phase 4
                    hprlnk_Phase4.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", parameters);

                    // Phase 1
                    //int suggestTab = suggestTabs[language];
                    //parameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "scope=posts", "facebook=1" };
                    //hprlnk_Phase1.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(suggestTab, "", parameters);
                    hprlnk_Phase1.CssClass = "phase-unavailable";

                    // Phase 2
                    int joinTab = joinTabs[language];
                    parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(joinTab, "", parameters);

                    // Phase 3
                    //string[] voteParameters = new string[3];
                    //voteParameters = new string[3] { "threadid=" + ThreadIDLabel.Text, "mode=featured", "facebook=1" };
                    //hprlnk_Phase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(voteTab, "", voteParameters);
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                }
                else
                {
                    string[] parameters = new string[1];
                    parameters = new string[1] { "result=" + ThreadIDLabel.Text };
                    hprlnk_subject.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(196, "", parameters);
                    hprlnk_subject.NavigateUrl = hprlnk_subject.NavigateUrl.Replace("en-GB", language);

                    hprlnk_Phase1.CssClass = "phase-unavailable";
                    // Phase links

                    // Phase 4
                    hprlnk_Phase4.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(196, "", parameters);
                    hprlnk_Phase4.NavigateUrl = hprlnk_Phase4.NavigateUrl.Replace("en-GB", language);
                    // Phase 2
                    string[] phase2Parameters = new string[2];
                    phase2Parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_Phase2.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", phase2Parameters);
                    hprlnk_Phase2.NavigateUrl = hprlnk_Phase2.NavigateUrl.Replace("en-GB", language);

                    // Phase 3
                    //string[] phase3Parameters = new string[2];
                    //phase3Parameters = new string[2] { "threadid=" + ThreadIDLabel.Text, "mode=featured" };
                    //hprlnk_Phase3.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", phase3Parameters);
                    hprlnk_Phase3.CssClass = "phase-unavailable";
                }

            }

            }catch(Exception ex)
            {
                string message = ex.Message;
                }
        }
Ejemplo n.º 13
0
        protected void lstvw_Solutions_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Label lbl_currentRow = (Label)e.Item.FindControl("lbl_currentRow");
            lbl_currentRow.Text = currentRow + ".";
            currentRow++;

            Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            lbl_Body.Text = util.GetTrimmedBody(Server, 500, lbl_Body.Text);

            Label UserIDLabel = (Label)e.Item.FindControl("UserIDLabel");
            HyperLink hprlnk_userProfile = (HyperLink)e.Item.FindControl("hprlnk_userProfile");

            string lang = CultureInfo.CurrentCulture.ToString();
            hprlnk_userProfile.NavigateUrl = util.GetUserProfileLink(int.Parse(UserIDLabel.Text), lang, Request.QueryString["facebook"] != null);

            string test = "";
        }