Пример #1
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;
            }
        }
Пример #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");
                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;
            }
        }
Пример #3
0
 protected void lstvw_Solutions_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     Label lblBody = (Label)e.Item.FindControl("lblBody");
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     lblBody.Text = util.GetTrimmedBody(Server, 60, lblBody.Text);
 }
Пример #4
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);
             }
        }
Пример #5
0
        protected void lstvw_TopTopics_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            Label lbl_Body = (Label)e.Item.FindControl("lbl_Body");
            Literal ltrlImage = (Literal)e.Item.FindControl("ltrlImage");

            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, 200, 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;
                HtmlTableCell title_td = (HtmlTableCell)e.Item.FindControl("title_td");
                title_td.ColSpan = 2;
            }
            string resfile = LocalResourceFile;
            string forumresfile = LocalResourceFile.Replace("View","") + "../../Forum/App_LocalResources/SharedResources";
            string category = Localization.GetString("Environment",forumresfile);

            Label ThreadIDLabel = (Label)e.Item.FindControl("ThreadIDLabel");
            Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
            Label PhaseIDLabel = (Label)e.Item.FindControl("PhaseIDLabel");
            HyperLink hprlnk_post = (HyperLink)e.Item.FindControl("hprlnk_post");
            if (ThreadIDLabel != null)
            {

               // parameters = new string[3] { "forumid=" + ForumIDLabel.Text, "threadid=" + ThreadIDLabel.Text, "scope=posts" };

               // url = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters);
                //hprlnk_post.NavigateUrl = url;

                int currentPhase = Int32.Parse(PhaseIDLabel.Text);

                if (currentPhase == 1)
                {
                    string[] parameters2 = new string[2];
                    parameters2 = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(73, "", parameters2);
                }
                else if (currentPhase == 2)
                {
                    string[] parameters3 = new string[2];
                    parameters3 = new string[2] { "threadid=" + ThreadIDLabel.Text, "scope=posts" };
                    hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(62, "", parameters3);
                }
                else if (currentPhase == 3)
                {
                    string[] parameters4 = new string[2];
                    parameters4 = new string[2] { "threadid=" + ThreadIDLabel.Text, "mode=featured" };
                    hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters4);

                }
                else if (currentPhase == 4)
                {
                    string[] parameters5 = new string[1];
                    parameters5 = new string[1] { "result=" + ThreadIDLabel.Text };
                    hprlnk_post.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(196, "", parameters5);

                }
                if (UserId == -1 && Response.Cookies["language"] != null)
                {
                    string cookieLang = Response.Cookies["language"].Value;
                    hprlnk_post.NavigateUrl = hprlnk_post.NavigateUrl.Replace("en-GB", cookieLang);
                }
            }
        }
Пример #6
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;
            }
        }
Пример #7
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);
        }
Пример #8
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 = "";
        }