Пример #1
0
        protected void bt_submit_Click(object sender, EventArgs e)
        {
            umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(int.Parse(Request.QueryString["id"]));

            Member owner = new Member(int.Parse(p.GetProperty("owner").Value));
            Member m     = Member.GetCurrentMember();


            MailMessage mm = new MailMessage();

            mm.Subject = "Umbraco community: Request to contribute to project";

            mm.Body =
                string.Format("The Umbraco Community member '{0}'  would like to contribute to your project '{1}'.  You can add the member to the project from your profile on our.umbraco.org.",
                              m.Text, p.Name);

            mm.Body = mm.Body + string.Format("\n\r\n\rMessage from {0}: \n\r\n\r", m.Text) + tb_message.Text;

            mm.To.Add(owner.Email);
            mm.From = new MailAddress(m.Email);

            SmtpClient c = new SmtpClient();

            c.Send(mm);


            umbraco.presentation.nodeFactory.Node current = umbraco.presentation.nodeFactory.Node.GetCurrent();

            Response.Redirect(umbraco.library.NiceUrl(current.Children[0].Id));
        }
Пример #2
0
        protected void btnCreateTopic_Click(object sender, EventArgs e)
        {
            string subject   = Member.GetCurrentMember().Text + " suggests a meetup";
            string extrabody = "";

            if (Request["event"] != null)
            {
                umbraco.presentation.nodeFactory.Node ev = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));

                subject = "New event in your area: " + ev.Name;

                extrabody = string.Format(
                    "<br/><br/>Check out the event details <a href='{0}'>here</a>",
                    "http://" + HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + ev.NiceUrl);


                NewTopicContainer.Visible = false;
            }
            else
            {
                uForum.Businesslogic.Topic meetupTopic = uForum.Businesslogic.Topic.Create(1184, Member.GetCurrentMember().Text + " suggests a meetup", TextBox1.Text, Member.GetCurrentMember().Id);

                Member current = Member.GetCurrentMember();
                current.getProperty("lastMeetupSuggestDate").Value = DateTime.Now;

                current.getProperty("lastMeetupTopicId").Value = meetupTopic.Id;
                current.Save();

                lnkNewTopic.NavigateUrl = uForum.Library.Xslt.NiceTopicUrl(meetupTopic.Id);
            }

            if (SendMails && Request["event"] != null)
            {
                foreach (string memberId in ViewState["MemberLocatorMemberIds"].ToString().Split(';'))
                {
                    Member member = new Member(int.Parse(memberId));

                    if (member.getProperty("bugMeNot").Value.ToString() == "0" ||
                        member.getProperty("bugMeNot").Value.ToString() == null ||
                        member.getProperty("bugMeNot").Value.ToString() == "")
                    {
                        MailMessage mail = new MailMessage();
                        mail.From    = new MailAddress("*****@*****.**", "Our umbraco");
                        mail.Subject = subject;
                        mail.To.Add(new MailAddress(new Member(int.Parse(memberId)).Email));
                        //mail.To.Add(new MailAddress("*****@*****.**"));
                        mail.Body       = TextBox1.Text.Replace("\n", "<br/>") + extrabody;
                        mail.IsBodyHtml = true;

                        SmtpClient client = new SmtpClient();
                        client.Send(mail);
                    }
                }
            }



            pnlCreateTopic.Visible        = false;
            pnlCreateTopicSuccess.Visible = true;
        }
        protected void bt_submit_Click(object sender, EventArgs e)
        {
            umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(int.Parse(Request.QueryString["id"]));

            Member owner = new Member(int.Parse(p.GetProperty("owner").Value));
            Member m = Member.GetCurrentMember();

            MailMessage mm = new MailMessage();
            mm.Subject = "Umbraco community: Request to contribute to project";

            mm.Body =
                string.Format("The Umbraco Community member '{0}'  would like to contribute to your project '{1}'.  You can add the member to the project from your profile on our.umbraco.org.",
                m.Text, p.Name);

            mm.Body = mm.Body + string.Format("\n\r\n\rMessage from {0}: \n\r\n\r", m.Text) + tb_message.Text;

            mm.To.Add(owner.Email);
            mm.From = new MailAddress(m.Email);

            SmtpClient c = new SmtpClient();
            c.Send(mm);

            umbraco.presentation.nodeFactory.Node current = umbraco.presentation.nodeFactory.Node.GetCurrent();

            Response.Redirect(umbraco.library.NiceUrl(current.Children[0].Id));
        }
Пример #4
0
public static int CreateComment(int parentId)
{
    HttpRequest post = HttpContext.Current.Request;
    
    string email = post["email"];
    string comment = post["comment"];
    string name = post["author"];
    string website = post["url"];
    
 
    //if all values are there + valid email.. we start to create the comment
    if (!string.IsNullOrEmpty(email) && isValidEmail(email) && !string.IsNullOrEmpty(comment) && !string.IsNullOrEmpty(name))
    {

        Document blogpost = new Document(parentId);

        //if parent is actually a blogpost
        if(blogpost != null && blogpost.ContentType.Alias == "BlogPost"){
           
            umbraco.presentation.nodeFactory.Node blog = new umbraco.presentation.nodeFactory.Node(parentId);
            while (blog.NodeTypeAlias != "Blog")
            {
                blog = blog.Parent;
            }
            int blogid = blog.Id;

            bool isspam = false;

            SpamChecker checker = Config.GetChecker();

            if (checker != null)
            {
                isspam = checker.Check(parentId,
                    post.UserAgent, post.UserHostAddress,
                    name, email, website, comment);
            }

            
            ISqlHelper SqlHelper = DataLayerHelper.CreateSqlHelper(umbraco.GlobalSettings.DbDSN);
            SqlHelper.ExecuteNonQuery(
                @"insert into Comment(mainid,nodeid,name,email,website,comment,spam,created) 
                    values(@mainid,@nodeid,@name,@email,@website,@comment,@spam,@created)",
                 SqlHelper.CreateParameter("@mainid", blogid),
                SqlHelper.CreateParameter("@nodeid", blogpost.Id),
                SqlHelper.CreateParameter("@name", name),
                SqlHelper.CreateParameter("@email", email),
                SqlHelper.CreateParameter("@website", website),
                SqlHelper.CreateParameter("@comment", comment),
                SqlHelper.CreateParameter("@spam", isspam),
                SqlHelper.CreateParameter("@created", DateTime.Now));


            return 1;

        }
    }
    
    //if nothing gets created, we return zero
    return 0;
}
Пример #5
0
        protected void btnCreateTopic_Click(object sender, EventArgs e)
        {
            string subject = Member.GetCurrentMember().Text + " suggests a meetup";
            string extrabody = "";

            if (Request["event"] != null)
            {
                umbraco.presentation.nodeFactory.Node ev = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));

                subject = "New event in your area: " + ev.Name;

                extrabody = string.Format(
                    "<br/><br/>Check out the event details <a href='{0}'>here</a>",
                    "http://" + HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + ev.NiceUrl);

                NewTopicContainer.Visible = false;
            }
            else
            {
                uForum.Businesslogic.Topic meetupTopic = uForum.Businesslogic.Topic.Create(1184, Member.GetCurrentMember().Text + " suggests a meetup", TextBox1.Text, Member.GetCurrentMember().Id);

                Member current = Member.GetCurrentMember();
                current.getProperty("lastMeetupSuggestDate").Value = DateTime.Now;

                current.getProperty("lastMeetupTopicId").Value = meetupTopic.Id;
                current.Save();

                lnkNewTopic.NavigateUrl = uForum.Library.Xslt.NiceTopicUrl(meetupTopic.Id);
            }

            if (SendMails && Request["event"] != null)
            {
                foreach (string memberId in ViewState["MemberLocatorMemberIds"].ToString().Split(';'))
                {
                    Member member = new Member(int.Parse(memberId));

                    if (member.getProperty("bugMeNot").Value.ToString() == "0" ||
                        member.getProperty("bugMeNot").Value.ToString() == null ||
                        member.getProperty("bugMeNot").Value.ToString() == "")
                    {
                        MailMessage mail = new MailMessage();
                        mail.From = new MailAddress("*****@*****.**","Our umbraco");
                        mail.Subject = subject;
                        mail.To.Add(new MailAddress(new Member(int.Parse(memberId)).Email));
                        //mail.To.Add(new MailAddress("*****@*****.**"));
                        mail.Body = TextBox1.Text.Replace("\n","<br/>") + extrabody;
                        mail.IsBodyHtml = true;

                        SmtpClient client = new SmtpClient();
                        client.Send(mail);
                    }
                }
            }

            pnlCreateTopic.Visible = false;
            pnlCreateTopicSuccess.Visible = true;
        }
Пример #6
0
        //convert ID to lucene friendly path eg: 1123 -> 1234s1232s1123s
        public static string LucenePath(int nodeId)
        {
            umbraco.presentation.nodeFactory.Node umbNode = new umbraco.presentation.nodeFactory.Node(nodeId);
            string path = "";

            if (umbNode != null)
            {
                path = umbNode.Path.Replace("-1,", "").Replace(",", new Businesslogic.Settings().PathSplit);
            }
            return(path);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int pId = 0;

                if (!string.IsNullOrEmpty(Request.QueryString["id"]) && int.TryParse(Request.QueryString["id"], out pId) && umbraco.library.IsLoggedOn())
                {
                    umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(pId);

                    lt_title.Text = p.Name;

                }
                else
                    projectCollabForm.Visible = false;
            }
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int pId = 0;

                if (!string.IsNullOrEmpty(Request.QueryString["id"]) && int.TryParse(Request.QueryString["id"], out pId) && umbraco.library.IsLoggedOn())
                {
                    umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(pId);

                    lt_title.Text = p.Name;
                }
                else
                {
                    projectCollabForm.Visible = false;
                }
            }
        }
Пример #9
0
        public string RemoveContributor(int projectId, int memberId)
        {
            int _currentMember = Member.GetCurrentMember().Id;

            if (_currentMember > 0)
            {
                umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(projectId);

                if (p.GetProperty("owner").Value == _currentMember.ToString())
                {
                    ProjectContributor pc = new ProjectContributor(projectId, memberId);
                    pc.Delete();
                    return("true");
                }

                return("false");
            }

            return("false");
        }
Пример #10
0
        private Akismet Initialize(int nodeid)
        {
             umbraco.presentation.nodeFactory.Node blog = 
                new umbraco.presentation.nodeFactory.Node(nodeid);

            while (blog.NodeTypeAlias != "Blog")
            {
                blog = blog.Parent;
            }

            if (blog.GetProperty("akismetAPIKey").Value != string.Empty)
            {
                Akismet api = new Joel.Net.Akismet(
                    blog.GetProperty("akismetAPIKey").Value,
                    "http://" + HttpContext.Current.Request.ServerVariables["HTTP_HOST"] + blog.Url,
                    "Blog4Umbraco2");

                if (!api.VerifyKey())
                {
                    umbraco.BusinessLogic.Log.Add(
                        umbraco.BusinessLogic.LogTypes.Error,
                        -1,
                        "Akismet Key could not be verified, please check if you have a valid Akismet API Key");

                    return null;
                }
                else
                {
                    return api;
                }
            }
            else
            {
                return null;
            }
        }
Пример #11
0
        public static string NewTopic(int forumId)
        {
            umbraco.presentation.nodeFactory.Node n = new umbraco.presentation.nodeFactory.Node(forumId);
            int _currentMember =
                HttpContext.Current.User.Identity.IsAuthenticated ? (int)Membership.GetUser().ProviderUserKey : 0;

            if (_currentMember > 0 && n != null && Access.HasAccces(n.Id, _currentMember)) {
                string title = HttpContext.Current.Request["title"];
                string body = HttpContext.Current.Request["body"];

                Businesslogic.Topic t = Businesslogic.Topic.Create(forumId, title, body, _currentMember);

                return Library.Xslt.NiceTopicUrl(t.Id);
            } else {
                return "0";
            }
        }
Пример #12
0
        public static string RemoveContributor(int projectId, int memberId)
        {
            int _currentMember = umbraco.presentation.umbracobase.library.library.CurrentMemberId();

            if (_currentMember > 0)
            {
                umbraco.presentation.nodeFactory.Node p = new umbraco.presentation.nodeFactory.Node(projectId);

                if (p.GetProperty("owner").Value == _currentMember.ToString())
                {

                    ProjectContributor pc = new ProjectContributor(projectId, memberId);
                    pc.Delete();
                    return "true";
                }
                else
                {
                    return "false";
                }

            }

            return "false";
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            umbraco.library.RegisterJavaScriptFile("tinyMce", "/scripts/tiny_mce/tiny_mce_src.js");
            umbraco.library.RegisterJavaScriptFile("googlemaps", "http://maps.google.com/maps?file=api&v=2&key=" + Utility.GetGoogleMapsKey());



            if (!IsPostBack)
            {
                if (Member.GetCurrentMember() == null)
                {
                    pnlLoggedIn.Visible    = false;
                    pnlNotLoggedIn.Visible = true;
                }
                else
                {
                    if (Member.GetCurrentMember().Groups.ContainsKey(4686))
                    {
                        //throw new Exception("ok");
                        pnlCreateTopic.Visible  = true;
                        SliderExtender1.Maximum = 10000;
                    }



                    txtRadius.Text = "200";
                    double radius = 200;

                    if (Request["radius"] != null && Request["radius"] != string.Empty)
                    {
                        if (double.Parse(Request["radius"], Utility.GetNumberFormatInfo()) <= SliderExtender1.Maximum)
                        {
                            radius = double.Parse(Request["radius"], Utility.GetNumberFormatInfo());
                        }
                    }

                    string location = Member.GetCurrentMember().getProperty("location").Value.ToString();

                    if (Request["s"] != null && Request["s"] != string.Empty)
                    {
                        location = Request["s"];
                    }

                    if (Request["event"] != null)
                    {
                        umbraco.presentation.nodeFactory.Node ev = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));

                        location = ev.Name;


                        LocationContainer.Visible = false;

                        lblNotify.Text = "Announce the event";
                        lblSearch.Text = "Change Radius";
                        lblOK.Text     = "Ok, event announced";

                        TextBox1.Text = ev.GetProperty("description").Value;
                    }
                    litResults.Text = string.Format("Looking for members within {0} KM of {1} <img src=\"/css/img/ajax-loadercircle.gif\" alt=\"loading\" />", radius.ToString(), location);

                    //show organize meetup if member is in the admin membergroup

                    //MemberGroup admin = MemberGroup.GetByName("admin");
                    //foreach (MemberGroup group in Member.GetCurrentMember().Groups)
                    //{
                    //    //throw new Exception(group.Text);

                    //}


                    //check if member has allready suggested meetup

                    //if (Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value != null
                    //    && Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value.ToString() != string.Empty
                    //    )
                    //{
                    //    DateTime lastDate = Convert.ToDateTime(Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value);

                    //    if (lastDate >= DateTime.Now.AddDays(-14))
                    //    {
                    //        pnlRecentMeetup.Visible = true;
                    //        pnlCreateTopic.Visible = false;

                    //        lnkRecentTopic.NavigateUrl =
                    //            uForum.Library.Xslt.NiceTopicUrl(int.Parse(Member.GetCurrentMember().getProperty("lastMeetupTopicId").Value.ToString()));
                    //    }
                    //}
                }
            }
        }
Пример #14
0
        private void loadMap()
        {
            try
            {
                //check if event
                if (Request["event"] != null)
                {
                    umbraco.presentation.nodeFactory.Node e = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));


                    ShowResult(e.Name, new Location(
                                   Convert.ToDouble(e.GetProperty("latitude").Value, Utility.GetNumberFormatInfo()),
                                   Convert.ToDouble(e.GetProperty("longitude").Value, Utility.GetNumberFormatInfo())));
                }

                else
                {
                    //address supplied
                    if (Request["s"] != null && Request["s"] != string.Empty)
                    {
                        litMultipleResults.Text = MultipleResultsCaption;

                        litResults.Text     = string.Empty;
                        pnlMultiple.Visible = false;

                        IGeoCoder geoCoder  = new GoogleGeoCoder(Utility.GetGoogleMapsKey());
                        Address[] addresses = geoCoder.GeoCode(Request["s"]);
                        if (addresses.Length == 0)//no results
                        {
                            pnlCreateTopic.Visible = false;

                            litResults.Text = umbraco.macro.GetXsltTransformResult(umbraco.content.Instance.XmlContent, umbraco.macro.getXslt(ResultsXslt));

                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "test",
                                                                umbraco.macro.GetXsltTransformResult(umbraco.content.Instance.XmlContent, umbraco.macro.getXslt("MemberLocatorScript.xslt")), true);
                        }
                        else
                        {
                            if (addresses.Length > 1)//multiple results, need to choose first
                            {
                                //show the first result
                                ShowResult(addresses[0].ToString(), new Location(addresses[0].Coordinates.Latitude, addresses[0].Coordinates.Longitude));

                                //rblLocations.Items.Clear();
                                //foreach (Address address in addresses)
                                //{
                                //    rblLocations.Items.Add(new ListItem(address.ToString(), address.Coordinates.Latitude.ToString(Utility.GetNumberFormatInfo()) + "," + address.Coordinates.Longitude.ToString(Utility.GetNumberFormatInfo())));
                                //}
                                //pnlMultiple.Visible = true;
                            }
                            else// single result, ok show results
                            {
                                ShowResult(addresses[0].ToString(), new Location(addresses[0].Coordinates.Latitude, addresses[0].Coordinates.Longitude));
                            }
                        }
                    }
                    else //node address, use member location
                    {
                        //use member location
                        Member   current        = Member.GetCurrentMember();
                        Location memberLocation = new Location(
                            double.Parse(current.getProperty("latitude").Value.ToString(), Utility.GetNumberFormatInfo()),
                            double.Parse(current.getProperty("longitude").Value.ToString(), Utility.GetNumberFormatInfo())
                            );

                        ShowResult(current.getProperty("location").Value.ToString(), memberLocation);
                    }
                }
            }
            catch (Exception ex) {
                if (Request["debug"] == null)
                {
                    litResults.Text = "Error displaying locator results";
                }
                else
                {
                    litResults.Text = ex.Message + "</br>" + ex.StackTrace;
                }
            }

            // }
        }
Пример #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            umbraco.library.RegisterJavaScriptFile("tinyMce", "/scripts/tiny_mce/tiny_mce_src.js");
            umbraco.library.RegisterJavaScriptFile("googlemaps", "http://maps.google.com/maps?file=api&v=2&key=" + Utility.GetGoogleMapsKey());

            if (!IsPostBack)
            {
                if (Member.GetCurrentMember() == null)
                {
                    pnlLoggedIn.Visible = false;
                    pnlNotLoggedIn.Visible = true;
                }
                else
                {

                    if (Member.GetCurrentMember().Groups.ContainsKey(4686))
                    {
                        //throw new Exception("ok");
                        pnlCreateTopic.Visible = true;
                        SliderExtender1.Maximum = 10000;
                    }

                    txtRadius.Text = "200";
                    double radius = 200;

                    if (Request["radius"] != null && Request["radius"] != string.Empty)
                    {
                        if (double.Parse(Request["radius"], Utility.GetNumberFormatInfo()) <= SliderExtender1.Maximum)
                        {
                            radius = double.Parse(Request["radius"], Utility.GetNumberFormatInfo());
                        }

                    }

                    string location = Member.GetCurrentMember().getProperty("location").Value.ToString();

                    if (Request["s"] != null && Request["s"] != string.Empty)
                    {
                        location = Request["s"];
                    }

                    if (Request["event"] != null)
                    {
                        umbraco.presentation.nodeFactory.Node ev = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));

                        location = ev.Name;

                        LocationContainer.Visible = false;

                        lblNotify.Text = "Announce the event";
                        lblSearch.Text = "Change Radius";
                        lblOK.Text = "Ok, event announced";

                        TextBox1.Text = ev.GetProperty("description").Value;

                    }
                    litResults.Text = string.Format("Looking for members within {0} KM of {1} <img src=\"/css/img/ajax-loadercircle.gif\" alt=\"loading\" />", radius.ToString(), location);

                    //show organize meetup if member is in the admin membergroup

                    //MemberGroup admin = MemberGroup.GetByName("admin");
                    //foreach (MemberGroup group in Member.GetCurrentMember().Groups)
                    //{
                    //    //throw new Exception(group.Text);

                    //}

                    //check if member has allready suggested meetup

                    //if (Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value != null
                    //    && Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value.ToString() != string.Empty
                    //    )
                    //{
                    //    DateTime lastDate = Convert.ToDateTime(Member.GetCurrentMember().getProperty("lastMeetupSuggestDate").Value);

                    //    if (lastDate >= DateTime.Now.AddDays(-14))
                    //    {
                    //        pnlRecentMeetup.Visible = true;
                    //        pnlCreateTopic.Visible = false;

                    //        lnkRecentTopic.NavigateUrl =
                    //            uForum.Library.Xslt.NiceTopicUrl(int.Parse(Member.GetCurrentMember().getProperty("lastMeetupTopicId").Value.ToString()));
                    //    }
                    //}
                }
            }
        }
Пример #16
0
 //convert ID to lucene friendly path eg: 1123 -> 1234s1232s1123s
 public static string LucenePath(int nodeId)
 {
     umbraco.presentation.nodeFactory.Node umbNode = new umbraco.presentation.nodeFactory.Node(nodeId);
     string path = "";
     if (umbNode != null) {
         path = umbNode.Path.Replace("-1,", "").Replace(",", new Businesslogic.Settings().PathSplit);
     }
     return path;
 }
Пример #17
0
 public UmbracoModelBase GetModel(umbraco.presentation.nodeFactory.Node node)
 {
     return(GetModel(node.Id));
 }
Пример #18
0
 public T GetModel <T>(umbraco.presentation.nodeFactory.Node node) where T : UmbracoModelBase
 {
     return(GetModel <T>(node.Id));
 }
Пример #19
0
        private void loadMap()
        {
            try
            {

                //check if event
                if (Request["event"] != null)
                {
                    umbraco.presentation.nodeFactory.Node e = new umbraco.presentation.nodeFactory.Node(Convert.ToInt32(Request["event"]));

                    ShowResult(e.Name, new Location(
                        Convert.ToDouble(e.GetProperty("latitude").Value, Utility.GetNumberFormatInfo()),
                         Convert.ToDouble(e.GetProperty("longitude").Value, Utility.GetNumberFormatInfo())));
                }

                else
                {
                    //address supplied
                    if (Request["s"] != null && Request["s"] != string.Empty)
                    {
                        litMultipleResults.Text = MultipleResultsCaption;

                        litResults.Text = string.Empty;
                        pnlMultiple.Visible = false;

                        IGeoCoder geoCoder = new GoogleGeoCoder(Utility.GetGoogleMapsKey());
                        Address[] addresses = geoCoder.GeoCode(Request["s"]);
                        if (addresses.Length == 0)//no results
                        {
                            pnlCreateTopic.Visible = false;

                            litResults.Text = umbraco.macro.GetXsltTransformResult(umbraco.content.Instance.XmlContent, umbraco.macro.getXslt(ResultsXslt));

                            ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "test",
               umbraco.macro.GetXsltTransformResult(umbraco.content.Instance.XmlContent, umbraco.macro.getXslt("MemberLocatorScript.xslt")), true);
                        }
                        else
                        {
                            if (addresses.Length > 1)//multiple results, need to choose first
                            {
                                //show the first result
                                ShowResult(addresses[0].ToString(), new Location(addresses[0].Coordinates.Latitude, addresses[0].Coordinates.Longitude));

                                //rblLocations.Items.Clear();
                                //foreach (Address address in addresses)
                                //{
                                //    rblLocations.Items.Add(new ListItem(address.ToString(), address.Coordinates.Latitude.ToString(Utility.GetNumberFormatInfo()) + "," + address.Coordinates.Longitude.ToString(Utility.GetNumberFormatInfo())));
                                //}
                                //pnlMultiple.Visible = true;
                            }
                            else// single result, ok show results
                            {
                                ShowResult(addresses[0].ToString(), new Location(addresses[0].Coordinates.Latitude, addresses[0].Coordinates.Longitude));
                            }
                        }
                    }
                    else //node address, use member location
                    {
                        //use member location
                        Member current = Member.GetCurrentMember();
                        Location memberLocation = new Location(
                            double.Parse(current.getProperty("latitude").Value.ToString(), Utility.GetNumberFormatInfo()),
                            double.Parse(current.getProperty("longitude").Value.ToString(), Utility.GetNumberFormatInfo())
                            );

                        ShowResult(current.getProperty("location").Value.ToString(), memberLocation);
                    }
                }
            }
            catch(Exception ex) {

                if (Request["debug"] == null)
                {
                    litResults.Text = "Error displaying locator results";
                }
                else
                {
                    litResults.Text = ex.Message + "</br>" + ex.StackTrace;
                }
            }

            // }
        }