예제 #1
0
        protected void lnkbtn_ApproveThread_Click(object sender, EventArgs e)
        {
            int threadId = -1;// GET QUERYSTRING
            if (Request.QueryString["threadid"] != null)
            {
                threadId = Convert.ToInt32(Request.QueryString["threadid"]);

                // Label ForumIDLabel = (Label)e.Item.FindControl("ForumIDLabel");
                // int currentForumID = Convert.ToInt32(ForumIDLabel.Text);

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                int currentForumID = util.GetForumId(threadId);
                Dictionary<int, int> fr = new Dictionary<int, int>(); // Forum correspondence
                fr.Add(18, 32); // Crime

                fr.Add(19, 33); // Drugs and alcohol

                fr.Add(20, 34); // Economy

                fr.Add(13, 3); // Education

                fr.Add(21, 35); // Employment

                fr.Add(6, 1); // Environment

                fr.Add(22, 36); // Health

                fr.Add(23, 37); // Human rights

                fr.Add(24, 38); // Innovation

                fr.Add(53, 52); // Politics

                fr.Add(49, 48); // Other
                int newForumID = fr[currentForumID];
                DotNetNuke.Data.DataProvider dp = DotNetNuke.Data.DataProvider.Instance();
                //int threadID = Convert.ToInt32(e.CommandArgument);

                int moderatorID = 0;
                string notes = "some notes";
                SqlHelper.ExecuteNonQuery(CONNECTION_STRING, "Forum_Thread_Move", threadId, newForumID, moderatorID, notes);
                //SqlHelper.execut
                util.UpdateThreadPhase(threadId, 2);

                String[] urlParams = {"forumid=" + newForumID,
                                   "postid=" + threadId,
                                   "scope=posts"};
               string url = Globals.NavigateURL(62, "", urlParams);
               util.SendEmailToThreadTrackersAboutMovingToPhase2(newForumID, threadId);
               util.TransferThreadSubscriptionsToPhase2(threadId, newForumID);
                //url = url + "#" + postId.ToString();
                Response.Redirect(url);
                //http://localhost/ourspace/OpenDebates/tabid/62/forumid/37/threadid/99/scope/posts/language/en-GB/Default.aspx

            }
        }
예제 #2
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);
        }
        public override void DoWork()
        {
            try
            {
                var scoreCalculator = new ScoreCalculator();
               bool status = scoreCalculator.Calculate();
                var emailQueueTask = new EmailQueueTask();
                bool emailStatus = emailQueueTask.SendPendingEmails();

                CopyLanguageToNationalityOfNewUsers();

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
               //string addTestUsersMessage = util.AddTestUsers(1);
                // Adding Test Users

                // Do some work, like download today's currency...
                //int count = 9999;
                //for (int i = 0; i < count; i++)
                //{
                //    string repeat = "ss";
                //}
                // Notify that scheduled succeeded+

               if (status)
               {
                   ScheduleHistoryItem.AddLogNote("User points updated successfully!");
                   ScheduleHistoryItem.Succeeded = true;
               }
               else
               {
                   ScheduleHistoryItem.AddLogNote("Failed to update user points");
                   ScheduleHistoryItem.Succeeded = false;
               }

            }
            catch (Exception ex)
            {
                // report a failure
                ScheduleHistoryItem.Succeeded = false;

                // log the exception into
                // the scheduler framework
                ScheduleHistoryItem.AddLogNote("EXCEPTION: " + ex.ToString());

                // call the Errored method
                Errored(ref ex);

                // log the exception into the DNN core
                Exceptions.LogException(ex);

            }
        }
예제 #4
0
        protected void Repeater1_ItemDataBound(object sender, System.Web.UI.WebControls.RepeaterItemEventArgs e)
        {
            Image imgUser = (Image) e.Item.FindControl("imgUser");
             Label lblUsername = (Label)   e.Item.FindControl("lblUserName");
             string username = lblUsername.Text;
            DotNetNuke.Entities.Users.UserInfo user =   DotNetNuke.Entities.Users.UserController.GetUserByName(0,username);
            Ourspace_Utilities.View view = new Ourspace_Utilities.View();

            imgUser.ImageUrl = view.GetOurSpaceUserImgUrl(Server, user.UserID);

            Label lblDate = (Label)e.Item.FindControl("lblDate");
              DateTime date =  Convert.ToDateTime(lblDate.Text);
              lblDate.Text = date.ToString("dd MMM. yyyy");

             Label lblDisplayName = (Label)e.Item.FindControl("lblUserDisplayName");
             lblDisplayName.Text = user.DisplayName;
        }
예제 #5
0
        protected void lnkbtnSubmitReply_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserId > -1)
                {
                    string test = ctlAttachment.lstAttachmentIDs;

                    string text = txtEditor.Text;

                    string title = "";
                    Random random = new Random();
                    //Session["ATTACHMENTS_SESSION"] =

                    int postId = -1;
                    GetThreadTitle(out title, out postId);

                    int newPostId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Post_Add", postId, -1, UserId, "::1", title, txtEditor.Text, false, DateTime.Now, false, PortalId, -1, false, 0, false);
                    // http://localhost/ourspace/OpenDebates/tabid/62/forumid/1/postid/25/scope/posts/language/en-GB/Default.aspx#25
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    int threadId = util.GetThreadId(newPostId);
                    int forumId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Id_From_Thread_Id", threadId);

                    var added = SqlHelper.ExecuteScalar(CONNECTION_STRING, "Forum_Forum_PostAdded", forumId, threadId, newPostId, UserId, "approve");

                    int attachmentsSession = (int)Session["ATTACHMENTS_SESSION"];
                    AssignAttachmentsToPost(attachmentsSession, newPostId);

                    util.SubscribeUserToThread(threadId, forumId, UserId);

                    //Forum.PostConnector postConnector = new Forum.PostConnector();

                   //List<Entities.Content.Taxonomy.Term> terms = new List<Entities.Content.Taxonomy.Term>();
                    //postConnector.SubmitExternalPost(TabId, 381, 0, UserId, title, txtEditor.Text, forumId, threadId, ctlAttachment.lstAttachmentIDs,  "Ourspace_Texteditor:reply",threadId,terms);
                  // ctlAttachment.

                    //Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    util.SendEmailToThreadTrackers(threadId, newPostId, CultureInfo.CurrentCulture.ToString());
                    Session["showPostSuccess"] = true;

                    if (Request.QueryString["threadId"] != null)
                    {
                        threadId = int.Parse(Request.QueryString["threadId"]);

                        string[] parameters = new string[3] { "postId=" + newPostId, "forumId=" + forumId, "scope=posts" };
                        string url = DotNetNuke.Common.Globals.NavigateURL(TabId, "", parameters);

                        //Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId,true);
                        Response.Redirect(url);
                    }
                    else if (Request.QueryString["postId"] != null)
                    {
                        //Response.Redirect(Request.Url.ToString().Replace("postid=" + postId, "postId=" + newPostId) + "#" + newPostId,true);
                        string[] parameters = new string[3] { "postId=" + newPostId, "forumId=" + forumId, "scope=posts" };
                        string url = DotNetNuke.Common.Globals.NavigateURL(TabId, "", parameters);

                        //Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId,true);
                        Response.Redirect(url);
                    }
                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
예제 #6
0
 protected void lnkBtn_SubmitRejection_Click(object sender, EventArgs e)
 {
     int threadId = Convert.ToInt32(Request.QueryString["threadid"].ToString());
     //rdbtnlst_RejectionReasons.DataTextField =
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     util.RejectThread(Convert.ToInt32(rdbtnlst_RejectionReasons.SelectedValue),
         txtRejectionComment.Text,
         threadId);
     util.SendEmailToThreadTrackersAboutTopicRejection(threadId);
     Response.Redirect(Request.Url.ToString());
 }
예제 #7
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;
            }
        }
예제 #8
0
 public string GetUserProfileUrl(string userId)
 {
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     return util.GetUserProfileLink(Convert.ToInt32( userId), CultureInfo.CurrentCulture.Name,false);
 }
예제 #9
0
        public string GetUserImgUrl(string userId)
        {
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();

            return util.GetOurSpaceUserImgUrl(Server, Convert.ToInt32( userId));
        }
예제 #10
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();
            }
        }
예제 #11
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                Session["debateProposalsOwnLang"] = CultureInfo.CurrentCulture.Name;
               // Page.ClientScript.RegisterClientScriptInclude("module.js", this.TemplateSourceDirectory + "/js/module.js");

                if (Session["debateProposalsOwnLang"] == null)
                {
                    Session["debateProposalsOwnLang"] = CultureInfo.CurrentCulture.Name;
                }
                if (Request.QueryString["facebook"] != null)
                {
                    isFacebook = true;
                }
                if (!IsPostBack)
                {
                    int allProposalsTabId = 73;
                    if (isFacebook)
                    {

                        if (CultureInfo.CurrentCulture.Name == "en-GB")
                        {
                            allProposalsTabId = 271;
                        }
                        else if (CultureInfo.CurrentCulture.Name == "el-GR")
                        {
                            allProposalsTabId = 272;
                        }
                        else if (CultureInfo.CurrentCulture.Name == "cs-CZ")
                        {
                            allProposalsTabId = 273;
                        }
                        else if (CultureInfo.CurrentCulture.Name == "de-AT")
                        {
                            allProposalsTabId = 274;
                        }
                        string[] parameters = new string[5] { "forumid=" + 6, "ctl=" + "PostEdit", "action=new", "mid=415", "facebook=1" };
                        string url = DotNetNuke.Common.Globals.NavigateURL(allProposalsTabId, "", parameters);
                        hprlnk_ProposeTopic.NavigateUrl = url;
                    }
                    else
                    {
                        string[] parameters = new string[4] { "forumid=" + 6, "ctl=" + "PostEdit", "action=new", "mid=415"};
                        string url = DotNetNuke.Common.Globals.NavigateURL(allProposalsTabId, "", parameters);

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

                        hprlnk_ProposeTopic.NavigateUrl = url.Replace("language/en-GB", "language/" + CultureInfo.CurrentCulture.Name);// 88
                        hprlnk_ProposeTopic.NavigateUrl = util.ReplaceQueryString(hprlnk_ProposeTopic.NavigateUrl, "language", CultureInfo.CurrentCulture.Name);
                    }

                    //GetTotalProposals();
                }
                //Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "script2", ("/OurSpace/js/ui.selectmenu.js"));
                if (Request.QueryString["mode"] != null)
                {
                    pnlThankYou.Visible = true;

                        Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                        int threadId =  util.GetUserLastPostId(UserId);
                        string[] parameters = new string[2] { "threadid=" + threadId, "scope=posts" };

                        string url = DotNetNuke.Common.Globals.NavigateURL(73, "", parameters);
                        if (hprlnkThankyou != null)
                        {
                            hprlnkThankyou.Visible = true;
                            hprlnkThankyou.NavigateUrl = url;
                        }

                }
                if (UserInfo.IsInRole("Administrator"))
                {
                    pnl_admin.Visible = true;
                }

                if (!IsPostBack)
                {
                    GetTotalProposals(LanguageType.Own);
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #12
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;
            }
        }
예제 #13
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {

                // On the Join Discussion page the module is not always visible
                if ((((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"] == null) || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threads") || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threadsearch")) && !UserInfo.IsInRole("Administrator"))
                {

                    //el-GR 93
                    // cs- 106
                    // de-AT 171
                    ContainerControl.Visible = false;
                }
                if (Request.QueryString["threadId"] != null)
                {
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();
                    sqldtsrc_submittedProposals.DataBind();
                    Repeater1.DataBind();
                    //if (util.GetPhaseId(int.Parse(hdnfld_ThreadId.Value)) == 2)
                    //{
                      //  Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "submittedProposals", (this.TemplateSourceDirectory + "/js/submittedProposals.js"));
                    //}
                    string[] parameters = new string[1] { "threadId=" + hdnfld_ThreadId.Value };
                    string url = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    url = url.Replace("en-GB", CultureInfo.CurrentCulture.ToString());
                    hprlnk_ViewAllSubmittedProposals.NavigateUrl = url;
                }
                else if(Request.QueryString["postId"] != null)
                {
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    hdnfld_ThreadId.Value = util.GetThreadId(int.Parse(Request.QueryString["postId"].ToString())).ToString();
                    sqldtsrc_submittedProposals.DataBind();
                    Repeater1.DataBind();
                   // if (util.GetPhaseId(int.Parse(hdnfld_ThreadId.Value)) == 2)
                    //{
                     //   Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "submittedProposals", (this.TemplateSourceDirectory + "/js/submittedProposals.js"));
                   // }
                    string[] parameters = new string[1] { "threadId=" + hdnfld_ThreadId.Value };
                    string url = DotNetNuke.Common.Globals.NavigateURL(200, "", parameters);
                    url = url.Replace("en-GB", CultureInfo.CurrentCulture.ToString());
                    hprlnk_ViewAllSubmittedProposals.NavigateUrl = url;
                }
                SetTitle(DotNetNuke.Services.Localization.Localization.GetString("Title.Text",LocalResourceFile));

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #14
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                hdnfld_UserID.Value = UserId.ToString();

                string url = "";
            //string[] parameters = new string[3];
            //parameters = new string[1] { "user="******"");
               // hprlnkLogin.NavigateUrl = url;
                ScriptManager objScriptManager = ScriptManager.GetCurrent(this.Page);
                ScriptReference objScriptReference;

                objScriptReference = new ScriptReference(@"~/DesktopModules/Ourspace_Friends/js/friends.js");
                objScriptManager.Scripts.Add(objScriptReference);

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
               bool isFacebookUser = util.IsFacebookUser(UserId);
               if (isFacebookUser)
               {
                   pnlNonFbInfo.Visible = false;
                   pnlFbFriends.Visible = true;
                   pnlSearchFacebookFriends.Visible = true;
               }
               else
               {
                   pnlSearchFacebookFriends.Visible = false;
                   pnlNonFbInfo.Visible = true;
                   pnlFbFriends.Visible = false;
               }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #15
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);
             }
        }
예제 #16
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;
            }
        }
예제 #17
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {

                if (Request.QueryString["facebook"] != null)
                {
                    isFacebook = true;
                }

                ScriptManager objScriptManager = ScriptManager.GetCurrent(this.Page);
                ScriptReference objScriptReference;

                objScriptReference = new ScriptReference(@"~/DesktopModules/Ourspace_Dashboard/js/textboxLimiter.js");
                objScriptManager.Scripts.Add(objScriptReference);

                objScriptReference = new ScriptReference(@"~/DesktopModules/Ourspace_Dashboard/js/jquery-ui-1.8.16.custom.min.js");
                objScriptManager.Scripts.Add(objScriptReference);
                // objScriptReference = new ScriptReference(@"~/DesktopModules/Ourspace_Dashboard/js/dashboard.js");
                //objScriptManager.Scripts.Add(objScriptReference);

                Page.ClientScript.RegisterClientScriptInclude("dashboard.js", this.TemplateSourceDirectory + "/js/dashboard.js");

                Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                if (!IsPostBack)
                {
                    hdnfldCurrentUser.Value = UserId.ToString();
                    if (Request.QueryString["user"] != null)
                    {
                        hdnfldCurrentUser.Value = Request.QueryString["user"];
                    }

                    LoadNotifications();
                    int points = util.GetUserPoints(int.Parse(hdnfldCurrentUser.Value));

                    //lblSideLevel.Text = util.GetLevel(points).ToString();

                    int userLevel = util.GetLevel(Convert.ToInt32(points));
                   lblSideLevel.Text = userLevel.ToString() + " (<span><i>" + util.GetLevelName(userLevel, LocalResourceFile.Replace("Ourspace_Dashboard", "Ourspace_Utilities")) + "</i></span>)";

                    lblSidePoints.Text = points.ToString();
                    lblPoints.Text = points.ToString();
                    lblSidePoints.Text = lblPoints.Text;
                    int pointsToNextLevel = util.GetPointsToNextLevel(points);
                    if (pointsToNextLevel == -1)
                        lblPointsToNextLevel.Text = "-";
                    else
                        lblPointsToNextLevel.Text = pointsToNextLevel.ToString();

                    lblReferrals.Text = util.GetUserReferralCount(UserId) + "";

                }
                if (Request.QueryString["user"] != null && int.Parse(Request.QueryString["user"]) != UserId)
                {
                    lnkBtnEditProfile.Visible = false;
                }

                imgProfilePic.ImageUrl = util.GetHighResUserImgUrl(Server, int.Parse(hdnfldCurrentUser.Value));

                UserInfo userInfo = UserController.GetUserById(0, int.Parse(hdnfldCurrentUser.Value));
                lblUserFullName.Text = userInfo.FirstName + " " + userInfo.LastName;

                lblMemberSinceDate.Text = String.Format("{0:MMMM d, yyyy}", userInfo.Membership.CreatedDate);
                //UserInfo userInfo = UserInfo;
                // Loading user info
                lbl_FirstNameValue.Text = userInfo.Profile.FirstName;
                lbl_LastNameValue.Text = userInfo.Profile.LastName;
                string dob = userInfo.Profile.GetPropertyValue("DOB");
                if (userInfo.Profile.ProfileProperties.GetByName("DOB") != null)
                {

                    // lbl_AgeValue.Text  = String.Format("{0:MMMM d, yyyy}", DateTime.Parse(userInfo.Profile.ProfileProperties.GetByName("DOB").PropertyValue));
                    txt_DOB.Text = DateTime.Parse(userInfo.Profile.ProfileProperties.GetByName("DOB").PropertyValue).ToString("dd-MM-yyyy");
                    hdnfld_DOB.Value = DateTime.Parse(userInfo.Profile.ProfileProperties.GetByName("DOB").PropertyValue).ToString("dd-MM-yyyy");

                }
                lbl_CityValue.Text = userInfo.Profile.GetPropertyValue("City"); ;
                lbl_CountryValue.Text = userInfo.Profile.Country;

                if (Session["FacebookUserId"] != null && Session["FacebookUserId"].ToString() == "0" /*&& Request.QueryString["user"] != null*/)
                {
                    lnkbtn_ChangePhoto.Visible = true;
                    lnkbtn_ChangePassword.Visible = true;
                }

                // txt_DOB.Visible = true;

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #18
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                // On the Join Discussion page the module is not always visible
                if ((((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"] == null) || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threads") || ((TabId == 62 || TabId == 93 || TabId == 106 || TabId == 171) && Request.QueryString["scope"].ToString() == "threadsearch")) && !UserInfo.IsInRole("Administrator"))
                {
                    ContainerControl.Visible = false;
                }
                if (Request.QueryString["threadId"] != null)
                {
                    hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();
                    sqldtsrc_ThreadInfo.DataBind();
                    rptr_ThreadInfo.DataBind();
                }
                else
                {
                    //hdnfld_ThreadId.Value = Convert.ToInt32(Request.QueryString["threadId"].ToString()).ToString();

                    int postId = Convert.ToInt32(Request.QueryString["postid"]);
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();

                    hdnfld_ThreadId.Value = util.GetThreadId(postId).ToString();

                    sqldtsrc_ThreadInfo.DataBind();
                    rptr_ThreadInfo.DataBind();

                }
                SetTitle(DotNetNuke.Services.Localization.Localization.GetString("TopicDebateStatus.Text", LocalResourceFile));

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #19
0
 public string GetUserLevelAndName(string points)
 {
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     int userLevel = util.GetLevel(Convert.ToInt32(points));
     return userLevel.ToString() + " <span><i>" + util.GetLevelName(userLevel, LocalResourceFile.Replace("Ourspace_PeopleSearch", "Ourspace_Utilities")) + "</i></span>";
 }
예제 #20
0
 protected string FormatDate(object date)
 {
     //{
     //    if (this.Session["Locale"] != null)
     //    {
     //        if (this.Session["Locale"].ToString().Equals("USA"))
     //        {
     //            return Convert.ToDateTime(date).ToString("MM/dd/yyyy");
     //        }
     //        else
     //        {
     //            return Convert.ToDateTime(date).ToString("dd/MM/yyyy");
     //        }
     //    }
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     string timeAgo = util.GetTimeAgo(Convert.ToDateTime(date));
     if (timeAgo.Length > 1)
     {
         return  Localization.GetString(timeAgo.Split('#')[1], LocalResourceFile).Replace("{0}",timeAgo.Split('#')[0]);
     }
     else
     {
        return timeAgo;
     }
 }
예제 #21
0
 protected void lnkbtn_ContestProgress_Click(object sender, EventArgs e)
 {
     lstvw_ContestantHallOfFame.DataSource = sqldtsrc_ContestantHallOfFame;
     Ourspace_Utilities.View util = new Ourspace_Utilities.View();
     Session["PeopleSearch_UserNationality"] = util.GetUserNationality(UserId);
     lstvw_ContestantHallOfFame.DataBind();
     grid_allPeople.Visible = false;
     lstvw_ContestantHallOfFame.Visible = true;
     lnkbtn_ContestProgress.CssClass = "tab-active";
     lnkbtn_HallOfFame.CssClass = "tab-inactive";
 }
예제 #22
0
        protected void lnkbtn_EditProfile_Click(object sender, EventArgs e)
        {
            // string navurl = DotNetNuke.Common.Globals.NavigateURL(tabid, "", query);
            //HttpContext.Current.Response.Redirect(navurl);
            lnkbtn_UpdateProfile.Visible = true;
            lnkbtn_EditProfile.Visible = false;
            lnkbtn_editProfileSettings.Visible = false;

            lnkbtn_ChangePassword.Visible = false;

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

            if (!util.IsFacebookUser(UserId))
            {
                txt_FirstName.Visible = true;
                txt_LastName.Visible = true;

                txt_FirstName.Text = lbl_FirstNameValue.Text;
                txt_LastName.Text = lbl_LastNameValue.Text;

                lbl_FirstNameValue.Visible = false;
                lbl_LastNameValue.Visible = false;

                lnkbtn_ChangePhoto.Visible = true;
            }

            //pnlEditDate.Visible = true;

            txt_City.Visible = true;
            txt_City.Text = lbl_CityValue.Text;
            lbl_CityValue.Visible = false;
            ddlCountries.Visible = true;
            lbl_CountryValue.Visible = false;

            txt_DOB.Visible = true;

            // txt_DOB.Text = lbl_AgeValue.Text;

            ListController lc = new ListController();

            ListEntryInfoCollection leic = lc.GetListEntryInfoCollection("Country", "", "");
            ddlCountries.DataTextField = "Text";
            ddlCountries.DataValueField = "Value";
            ddlCountries.DataSource = leic;
            ddlCountries.DataBind();

            int selectedIndex = 0;
            int i = 0;
            foreach (ListItem item in ddlCountries.Items)
            {

                if (item.Text == lbl_CountryValue.Text)
                {
                    selectedIndex = i;
                }
                i++;
            }
            ddlCountries.SelectedIndex = selectedIndex;
            lnkbtn_cancel.Visible = true;
            // lnkbtn_ChangePhoto.Visible = false;
            //ddlCountries.Items.Insert(0, new ListItem("Select Country", "-1"));
        }
예제 #23
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (UserId > -1)
                {

                    if (!IsPostBack)
                    {
                       // Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "miniprofile", (this.TemplateSourceDirectory + "/js/miniprofile.js?v=5"));
                        Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                        lblName.Text = UserInfo.FirstName;
                        int points = util.GetUserPoints(UserInfo.UserID);
                        lblPointsNo.Text = points.ToString();
                        int level1 = util.GetLevel(0);
                        int level2 = util.GetLevel(50);
                        int level3= util.GetLevel(100);
                        int level4 = util.GetLevel(101);
                        int level5 = util.GetLevel(222);
                        int level6 = util.GetLevel(580);

                        util.GetLevel(points).ToString();
                        util.GetLevel(points).ToString();

                        util.GetLevel(points).ToString();

                        img_Profile.ImageUrl = GetImageUrl(UserId);
                        img_Profile.ImageUrl = util.GetOurSpaceUserImgUrl(Server, UserId);
                        lblLevelNo.Text = util.GetLevel(points).ToString();
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #24
0
        protected void lnkbtn_UpdateProfile_Click(object sender, EventArgs e)
        {
            // UserInfo.Profile.InitialiseProfile(PortalSettings.PortalId);

            //DateTime newDob = DateTime.Parse(hdnfld_DOB.Value);
            //string result = newDob.ToString();
            // UserInfo.Profile.SetProfileProperty("DOB", newDob.ToString());

            UserInfo.Profile.SetProfileProperty("City", txt_City.Text);
            UserInfo.Profile.SetProfileProperty("Country", ddlCountries.SelectedItem.Text);
            //UserInfo.Profile.SetProfileProperty("Website", txt_Website.Text);
            // UserInfo.Profile.SetProfileProperty("Biography", txt_AboutMe.Text);
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            bool testing = util.IsFacebookUser(UserId);

            if (!util.IsFacebookUser(UserId))
            {
                UserInfo.Profile.SetProfileProperty("FirstName", txt_FirstName.Text);
                UserInfo.Profile.SetProfileProperty("LastName", txt_LastName.Text);
            }
            //  DotNetNuke.Security.Profile;
            DotNetNuke.Entities.Users.UserController.UpdateUser(0, UserInfo);

            // DotNetNuke.Entities.Profile.ProfileController.

            DotNetNuke.Entities.Profile.ProfileController.UpdateUserProfile(UserInfo);
            var test = UserInfo.Profile.ProfileProperties;

            lbl_FirstNameValue.Text = UserInfo.Profile.FirstName;
            lbl_LastNameValue.Text = UserInfo.Profile.LastName;
            string dob = UserInfo.Profile.GetPropertyValue("DOB");
            if (UserInfo.Profile.ProfileProperties.GetByName("DOB") != null)
            {
                // lbl_AgeValue.Text = String.Format("{0:MMMM d, yyyy}", DateTime.Parse(UserInfo.Profile.ProfileProperties.GetByName("DOB").PropertyValue));
            }
            lbl_CityValue.Text = UserInfo.Profile.GetPropertyValue("City");
            lbl_CountryValue.Text = UserInfo.Profile.Country;

            lbl_CityValue.Visible = true;
            txt_City.Visible = false;

            lbl_CountryValue.Visible = true;
            ddlCountries.Visible = false;

            lbl_FirstNameValue.Visible = true;
            txt_FirstName.Visible = false;

            lbl_LastNameValue.Visible = true;
            txt_LastName.Visible = false;

            // lbl_AgeValue.Visible = true;

            //pnlEditDate.Visible = false;

            lnkbtn_cancel.Visible = false;
            lnkbtn_UpdateProfile.Visible = false;
            lnkbtn_EditProfile.Visible = true;

            Response.Redirect(Request.Url.ToString());
        }
예제 #25
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                if (CultureInfo.CurrentCulture.Name != "en-GB")
                    rdbtnlst_RejectionReasons.DataTextField = "description-" + CultureInfo.CurrentCulture.Name;
                if (!UserInfo.IsInRole("Administrator") && !UserInfo.IsInRole("Collaborator"))
                {

                        lnkbtn_ApproveThread.Visible = false;
                        lnkbtn_RejectThread.Visible = false;

                }
                if (Request.QueryString["threadid"] != null)
                {
                   int threadId = Convert.ToInt32(Request.QueryString["threadid"]);
                    Ourspace_Utilities.View util = new Ourspace_Utilities.View();
                    if (util.GetPhaseId(threadId) > 1)
                    {
                        lblPhase1Instructions.Visible = false;
                        lblPhase2Instructions.Visible = true;

                        hprlnk_GoToCurrentThreadPhase.NavigateUrl = util.GetTopicCurrentPhaseUrl(Request.QueryString["facebook"] != null, threadId, CultureInfo.CurrentCulture.Name);
                        hprlnk_GoToCurrentThreadPhase.Visible = true;

                        // We also hide the Collaborator buttons for moving topic to phase 2
                        lnkbtn_ApproveThread.Visible = false;
                        lnkbtn_RejectThread.Visible = false;

                    }
                    else
                    {
                        lblPhase1Instructions.Visible = true;
                        lblPhase2Instructions.Visible = false;
                        hprlnk_GoToCurrentThreadPhase.Visible = false;
                    }
                }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #26
0
        protected void lstvwRecentActitity_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            Label TypeLabel = (Label)e.Item.FindControl("TypeLabel");
            Label PostIdLabel = (Label)e.Item.FindControl("PostIdLabel");
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            if (TypeLabel.Text == "Reply")
            {
                TypeLabel.Text = Localization.GetString("Replied.Text", LocalResourceFile);
               // TypeLabel.Text = "replying to";
                Label ThreadNameLabel = (Label)e.Item.FindControl("ThreadNameLabel");
                ThreadNameLabel.Text = util.GetThreadName(int.Parse(PostIdLabel.Text));
                ThreadNameLabel.Visible = true;
            }
            else if (TypeLabel.Text == "Thumbs up" || TypeLabel.Text == "Thumbs down")
            {
                if(TypeLabel.Text == "Thumbs up")
                    TypeLabel.Text = Localization.GetString("Thumbsup.Text", LocalResourceFile);
                else
                    TypeLabel.Text = Localization.GetString("Thumbsdown.Text", LocalResourceFile);
               // TypeLabel.Text = "rating";
                Label ThreadNameLabel = (Label)e.Item.FindControl("ThreadNameLabel");
                ThreadNameLabel.Text = util.GetThreadName(int.Parse(PostIdLabel.Text));
                ThreadNameLabel.Visible = true;
            }

            //TypeLabel.Text = util.GetThreadName(int.Parse(PostIdLabel.Text));
        }
예제 #27
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// Page_Load runs when the control is loaded
        /// </summary>
        /// -----------------------------------------------------------------------------
        private void Page_Load(object sender, System.EventArgs e)
        {
            try
            {

                // Replace with Paul or Annas userId so Paul can show Anna without affecting other users.
                if (UserId == 45 || UserId == 75)
                {
                    if(Request.QueryString["googleConversion"] != null)
                    {
                        pnlGoogleConversion.Visible = true;
                    }

                    Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "pageGuide", (this.TemplateSourceDirectory + "/js/pageguide.min.js?v=1"));

                }
                if (UserId > -1)
                {   Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "microprofile", (this.TemplateSourceDirectory + "/js/microprofile.js?v=2"));

                }
                if (!IsPostBack)
                {
                    ltrl_UserId.Text = UserId.ToString();

                    if (UserId > -1)
                    {

                        SetLikeButtonCode();
                        referPanel.Visible = true;
                        int profilePageTabId = 71;
                        HideReferralPanels();
                        string promoPageUrl = "www.joinourspace.eu/pr/tabid/307/language/en-GB/refx/" + UserId + "/Default.aspx";
                        if (CultureInfo.CurrentCulture.Name == "el-GR")
                        {
                            promoPageUrl = "www.joinourspace.eu/pr/tabid/308/language/el-GR/refx/" + UserId + "/Default.aspx";

                            pnlReferralElGr.Visible = true;
                            profilePageTabId = 91;
                        }
                        else if (CultureInfo.CurrentCulture.Name == "cs-CZ")
                        {
                            profilePageTabId = 104;
                            pnlReferralCsCz.Visible = true;
                            promoPageUrl = "www.joinourspace.eu/pr/tabid/309/language/cs-CZ/refx/" + UserId + "/Default.aspx";

                        }
                        else if (CultureInfo.CurrentCulture.Name == "de-AT")
                        {
                            profilePageTabId = 174;
                            pnlReferralDeAt.Visible = true;
                            promoPageUrl = "www.joinourspace.eu/pr/tabid/310/language/de-AT/refx/" + UserId + "/Default.aspx";

                        }
                        else
                        {
                            pnlReferralEnGb.Visible = true;
                        }

                        hprlnk_toProfile.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(profilePageTabId);

                        lbl_personalSharingUrl.Text = promoPageUrl;
                        lbl_personalSharingUrlElGr.Text = promoPageUrl;
                        lbl_personalSharingUrlCsCz.Text = promoPageUrl;
                        lbl_personalSharingUrlDeAt.Text = promoPageUrl;
                        lblName.Text = UserInfo.FirstName;
                        lbl_FacebookId.Text = AuthenticateUser().ToString();

                        // This is the only place that FacebookuserId can be defined
                        Session["FacebookUserId"] = lbl_FacebookId.Text;

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

                        img_Profile.ImageUrl = util.GetOurSpaceUserImgUrl(Server, UserId);

                    }
                    else
                    {
                        hprlnk_toProfile.Visible = false;
                        img_Profile.Visible = false;

                        //ContainerControl.Visible = false;

                    }

                    lblLanguage.Text = CultureInfo.CurrentUICulture.Name;

                }
                else
                {
                    pnlGoogleConversion.Visible = false;
                }

                try
                {
                    string currentCookieCulture = "no cookie found";
                    string currentCulture = CultureInfo.CurrentCulture.Name;
                    if (Request.Cookies["language"] != null)
                    {
                        currentCookieCulture = Request.Cookies["language"].Value;
                    }

                    if (Request.QueryString["facebook"] != null)
                    {
                        hprlnk_toProfile.Visible = false;
                        img_Profile.Visible = false;
                    }

                    string test = UserInfo.Profile.GetPropertyValue("PreferredLocale");

                    lblCulture.Text = currentCulture;
                    lblCookie.Text = currentCookieCulture;
                    lblLangSetting.Text = test;
                }
                catch (Exception ex) { string exception = ex.Message; }

            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
예제 #28
0
        protected void lstvw_Replies_ItemDataBound(object sender, System.Web.UI.WebControls.ListViewItemEventArgs e)
        {
            Ourspace_Utilities.View util = new Ourspace_Utilities.View();
            Label PostIDLabel = (Label)e.Item.FindControl("PostIDLabel");

            Label SubjectLabel = (Label)e.Item.FindControl("SubjectLabel");
            Label lblDate = (Label)e.Item.FindControl("lblDate");
            //DateTime postDate = DateTime.Parse( FormatDate(postDate));
            // lblDate.Text = util.GetDaysAgo(postDate);
            SubjectLabel.Text = util.GetThreadName(int.Parse(PostIDLabel.Text));
        }
예제 #29
0
        protected void lnkbtnSubmitProposal_Click(object sender, EventArgs e)
        {
            try
            {
                if (UserId > -1)
                {
                    int postId = -1;
                    string title = "";
                    GetThreadTitle(out title, out postId);
                    title = txtProposalTitle.Text;
                    string body = txtProposalDescription.Text;

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

                    int newPostId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Post_Add", postId, -1, UserId, "::1", title, body, false, DateTime.Now, false, PortalId, -1, false, 0, true);
                    int threadId = util.GetThreadId(newPostId);
                    int forumId = (int)SqlHelper.ExecuteScalar(CONNECTION_STRING, "Ourspace_Forum_Id_From_Thread_Id", threadId);

                    var added = SqlHelper.ExecuteScalar(CONNECTION_STRING, "Forum_Forum_PostAdded", forumId, threadId, newPostId, UserId, "approve");

                    //RegisterSolutionProposal(thre;

                    // Sending emails to Thread Trackers (Subscribers)

                    util.SendEmailToThreadTrackers(threadId, newPostId, CultureInfo.CurrentCulture.ToString());
                    //SendEmailToThreadTrackers(threadId, newPostId);
                    //lblShowProposalSubmitted.Text = "yes";
                    Session["showProposeSuccess"] = true;
                    if (Request.QueryString["threadId"] != null)
                    {
                        threadId = int.Parse(Request.QueryString["threadId"]);
                        RegisterSolutionProposal(threadId, newPostId);

                        Response.Redirect(Request.Url.ToString().Replace("threadid=" + threadId, "postId=" + newPostId) + "#" + newPostId);
                    }
                    else if (Request.QueryString["postId"] != null)
                    {
                        RegisterSolutionProposal(threadId, newPostId);
                        Response.Redirect(Request.Url.ToString().Replace("postid=" + postId, "postId=" + newPostId) + "#" + newPostId);
                    }
                }

                if (CultureInfo.CurrentCulture.Name == "en-GB")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(216, "");

                }
                else if (CultureInfo.CurrentCulture.Name == "el-GR")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(217, "");

                }
                else if (CultureInfo.CurrentCulture.Name == "cs-CZ")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(218, "");
                }
                else if (CultureInfo.CurrentCulture.Name == "de-AT")
                {

                    hprlnkTermsAndCons.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(219, "");

                }
            }
            catch (Exception ex)
            {
                string error = ex.Message;
            }
        }
예제 #30
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);
 }