Example #1
0
        void CustomizeControl1_UpdateClick(SortedDictionary <string, Control> controls)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.QueryString["mdl"]))
                {
                    using (Kategori m = KategoriMethods.GetKategori(Request.QueryString["mdl"], BAYMYO.UI.Converts.NullToString(((TreeView)controls["Kategoriler"]).SelectedNode.DataPath)))
                    {
                        if (!string.IsNullOrEmpty(m.ID))
                        {
                            if (!string.IsNullOrEmpty(((TextBox)controls["Adi"]).Text))
                            {
                                m.Adi = BAYMYO.UI.Commons.SubStringText(((TextBox)controls["Adi"]).Text, 35);
                            }
                            //m.Menu = byte.Parse(((DropDownList)controls["Menu"]).SelectedValue);
                            //m.Sira = (byte)((DropDownList)controls["Sira"]).SelectedIndex;
                            //m.Dil = ((DropDownList)controls["Dil"]).SelectedValue;
                            if (Core.IsUserAdmin)
                            {
                                m.Aktif = ((CheckBox)controls["Aktif"]).Checked;
                            }
                            else
                            {
                                m.Aktif = false;
                            }
                            //if (!string.IsNullOrEmpty(((TextBox)controls["Renk"]).Text))
                            //    m.Renk = BAYMYO.UI.Commons.SubStringText(((TextBox)controls["Renk"]).Text, 7);
                            if (!string.IsNullOrEmpty(((TextBox)controls["Aciklama"]).Text))
                            {
                                m.Aciklama = BAYMYO.UI.Commons.SubStringText(((TextBox)controls["Aciklama"]).Text, 150);
                            }
                            if (!string.IsNullOrEmpty(((TextBox)controls["Etiket"]).Text))
                            {
                                m.Etiket = BAYMYO.UI.Commons.SubStringText(((TextBox)controls["Etiket"]).Text, 100);
                            }
                            switch (KategoriMethods.Update(m))
                            {
                            case "ADI":
                                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, "Eklemek istediğiniz isimde başka bir kategori bulunmaktadır, lütfen kategori adını kontrol ediniz tekrar deneyiniz!");
                                break;

                            default:
                                Core.CreateCategoryMaps(m.ModulID);
                                jSonData.CreateData(m.ModulID);
                                ((TreeView)controls["Kategoriler"]).DataBind();
                                CustomizeControl1.MessageText = MessageBox.Show(ProccesType.Update, DialogResult.Succes);
                                ((TextBox)controls["Adi"]).Focus();
                                break;
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                CustomizeControl1.MessageText = MessageBox.Show(DialogResult.Error, ex.Message);
            }
        }
Example #2
0
        void trv_SelectedNodeChanged(object sender, EventArgs e)
        {
            Kategori k = KategoriMethods.GetKategori(Request.QueryString["mdl"], (sender as TreeView).SelectedNode.DataPath);

            ((TextBox)this.CustomizeControl1.ControlList["Adi"]).Text = k.Adi;
            //((DropDownList)this.CustomizeControl1.ControlList["Menu"]).SelectedValue = k.Menu.ToString();
            //((DropDownList)this.CustomizeControl1.ControlList["Sira"]).SelectedIndex = k.Sira;
            //((TextBox)this.CustomizeControl1.ControlList["Renk"]).Text = k.Renk;
            ((TextBox)this.CustomizeControl1.ControlList["Aciklama"]).Text  = k.Aciklama;
            ((TextBox)this.CustomizeControl1.ControlList["Etiket"]).Text    = k.Etiket;
            ((CheckBox)this.CustomizeControl1.ControlList["Aktif"]).Checked = k.Aktif;
        }
Example #3
0
        private void View(Album m)
        {
            CommentControl1.IsCommandActive = BAYMYO.UI.Converts.NullToGuidString(Core.CurrentUser.ID).Equals(m.HesapID);
            CommentControl1.Visible         = m.Yorum;
            CommentControl1.ModulID         = "galeri";
            CommentControl1.IcerikID        = m.ID.ToString();
            //Icerik Bilgisi
            if (!BAYMYO.UI.Converts.NullToString(KategoriBilgi.ModulID).Equals("galeri") || !BAYMYO.UI.Converts.NullToString(KategoriBilgi.ID).Equals(m.KategoriID))
            {
                KategoriBilgi = KategoriMethods.GetKategori("galeri", m.KategoriID);
            }
            if (KategoriBilgi.Aktif)
            {
                this.Page.Title += " | " + KategoriBilgi.Adi.ToUpper(); //+ " | " + Settings.Site.Title + " | " + m.Etiket;
            }
            Etiketler = "";
            string etiketQuery = string.Empty;

            foreach (string item in m.Etiket.Split(','))
            {
                Etiketler   += string.Format("<a href=\"{0}{1}\" target=\"_blank\"><strong>{2}</strong></a>, ", Settings.SiteUrl.Replace("http:", ""), Core.CreateLink("galerietiket", "", item), item.Trim());
                etiketQuery += " or i.yoneticionay=1 and i.aktif=1 and i.etiket like <%USTENTIRNAK%>%" + item.Trim() + ",%<%USTENTIRNAK%>";
            }
            if (!BAYMYO.UI.Converts.NullToString(Session["etiketSession"]).Equals(etiketQuery))
            {
                Session["etiketSession"] = etiketQuery;
            }

            using (BAYMYO.UI.Web.DataPagers data = new BAYMYO.UI.Web.DataPagers(rptListe, "galeri", "kayittarihi asc", "albumid=?albumid", 1))
            {
                data.Parameters.Add("albumid", m.ID, BAYMYO.MultiSQLClient.MSqlDbType.BigInt);
                data.PageNumberTargetControl = pageNumberLiteral;
                data.Binding();
                SayfaURL = (data.CurrentPage >= data.LastPage) ? "/galeriler" : "/?go=galerigoster&mdl=galeri&raid=" + m.ID + "&pno=" + data.NextPage + "#titleBox";
                if (data.TotalDataCount < 1)
                {
                    pageNumberLiteral.Visible = true;
                    pageNumberLiteral.Text    = MessageBox.IsNotViews();
                }
                else
                {
                    jobSet.Visible = (data.TotalPageCount > 1);
                }
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    using (Haber m = HaberMethods.GetHaber(BAYMYO.UI.Converts.NullToInt64(Request.QueryString["hid"])))
                    {
                        if (m != null)
                        {
                            #region --- html-meta ---
                            //Core.ClearMetaTags(this.Page);
                            this.Page.Title           = m.Baslik;// +" | " + Settings.Site.Title;
                            this.Page.MetaDescription = m.Ozet;
                            this.Page.MetaKeywords    = m.Etiket;
                            string etiket = m.Etiket;
                            if (string.IsNullOrEmpty(etiket))
                            {
                                etiket = m.Ozet;
                            }
                            string imageUrl = Settings.SiteImageUrl + "haber/" + m.ResimUrl;
                            #endregion
                            if (!m.Aktif)
                            {
                                ltrContent.Text = MessageBox.Show(DialogResult.Warning, "Bu içerik gösterime kapatılmıştır. Bağlantının doğru olduğundan eminseniz lütfen bu durumu yöneticilerimize bildiriniz!");
                                return;
                            }
                            CommentControl1.IsCommandActive = BAYMYO.UI.Converts.NullToGuidString(Core.CurrentUser.ID).Equals(m.HesapID);
                            CommentControl1.Visible         = m.Yorum;
                            CommentControl1.ModulID         = "haber";
                            CommentControl1.IcerikID        = Request.QueryString["hid"];
                            using (Hesap hsp = HesapMethods.GetHesap(m.HesapID))
                            {
                                //Icerik Bilgisi
                                ltrContent.Text = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath + "NewsView.view"));
                                //string ilgiliVideo = "", ilgiliFoto = "", fotogaleri = "", videogaleri = "";
                                //if (m.Video > 0)
                                //{
                                //    videogaleri = string.Format("<div class=\"clear\"></div><a href=\"{0}\"><img style=\"float:left\" itemprop=\"image\" src=\"/images/video-tikla.png\" alt=\"{1} videosunu izlemek için tıklayın.\" title=\"{1} videosunu izlemek için tıklayın.\" /></a>", Core.CreateLink("video", m.Video, "video galeri " + m.Baslik), m.Baslik);
                                //    ilgiliVideo = string.Format("<span class=\"video\"><a href=\"{0}\">{1}</a></span>", Core.CreateLink("video", m.Video, m.Baslik + " video"), "Web<br/>TV");
                                //}
                                //if (m.Galeri > 0)
                                //{
                                //    fotogaleri = string.Format("<div class=\"clear\"></div><a href=\"{0}\"><img style=\"float:left\" itemprop=\"image\" src=\"/images/foto-galeri-tikla.png\" alt=\"{1} foto galeriyi gezinmek için tıklayın.\" title=\"{1} foto galeriyi gezinmek için tıklayın.\" /></a>", Core.CreateLink("galeri", m.Galeri, "foto galeri " + m.Baslik), m.Baslik);
                                //    ilgiliFoto = string.Format("<span class=\"galeri\"><a href=\"{0}\">{1}</a></span>", Core.CreateLink("galeri", m.Galeri, m.Baslik + " fotogaleri"), "Foto<br/>Galeri");
                                //}

                                ltrContent.Text = ltrContent.Text.Replace("%ImagesPath%", Settings.ImagesPath);
                                if (!BAYMYO.UI.Converts.NullToString(KategoriBilgi.ModulID).Equals("haber") || !BAYMYO.UI.Converts.NullToString(KategoriBilgi.ID).Equals(m.KategoriID))
                                {
                                    KategoriBilgi = KategoriMethods.GetKategori("haber", m.KategoriID);
                                    if (KategoriBilgi.Aktif)
                                    {
                                        this.Page.Title += " | " + KategoriBilgi.Adi;
                                    }
                                }
                                if (!string.IsNullOrWhiteSpace(m.Sehir) & !KategoriBilgi.Adi.ToLower().Equals(m.Sehir.ToLower()))
                                {
                                    this.Page.Title += " | " + m.Sehir;
                                }
                                ltrContent.Text = ltrContent.Text.Replace("%Renk%", KategoriBilgi.Renk);
                                ltrContent.Text = ltrContent.Text.Replace("%Kategori%", string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", Core.CreateLink("haberkategori", KategoriBilgi.ID, KategoriBilgi.Adi), KategoriBilgi.Adi));
                                if (!string.IsNullOrEmpty(m.ResimUrl))
                                {
                                    string url = Settings.ImagesPath + "haber/b/" + m.ResimUrl;
                                    if (!System.IO.File.Exists(Server.MapPath(url)))
                                    {
                                        ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", "");
                                    }
                                    else
                                    {
                                        ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", string.Format("<img itemprop=\"image\" src=\"{0}\" alt=\"%Baslik%\" title=\"%Baslik%\" />", url));
                                    }
                                }
                                else
                                {
                                    ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", "");
                                }
                                ltrContent.Text = ltrContent.Text.Replace("%ImageUrl%", imageUrl);
                                ltrContent.Text = ltrContent.Text.Replace("%Baslik%", m.Baslik.Replace('"', '\''));
                                ltrContent.Text = ltrContent.Text.Replace("%Body%", BAYMYO.UI.Web.Pages.ClearHtml(m.Icerik).Replace('"', '\''));
                                ltrContent.Text = ltrContent.Text.Replace("%BaslikDiger%", m.Sehir + " haber son dakika " + KategoriBilgi.Adi.ToLower() + " haberleri.");
                                ltrContent.Text = ltrContent.Text.Replace("%SpotBaslik%", "");
                                ltrContent.Text = ltrContent.Text.Replace("%Ozet%", m.Ozet.Replace('"', '\''));
                                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihiSEO%", m.KayitTarihi.ToString("yyyy-MM-ddTHH:mm:ssZ"));
                                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihi%", m.KayitTarihi.ToString("dd/MM/yyyy ddddd HH:mm"));
                                ltrContent.Text = ltrContent.Text.Replace("%Sehir%", m.Sehir);
                                //int indexOf = -1;
                                //string etiketler = string.Empty, etiketQuery = string.Empty; etiket = string.Empty;
                                //foreach (string item in m.Etiket.Split(','))
                                //{
                                //    etiket = string.Format("<a href=\"{0}{1}\" target=\"_blank\"><strong>{2}</strong></a>", Settings.SiteUrl.Replace("http:", ""), Core.CreateLink("haberetiket", "", item), item.Trim());
                                //    etiketQuery += " or i.yoneticionay=1 and i.aktif=1 and i.etiket like <%USTENTIRNAK%>%" + item.Trim() + ",%<%USTENTIRNAK%>";
                                //    indexOf = m.Icerik.IndexOf(item.Trim());
                                //    if (indexOf >= 0)
                                //    {
                                //        m.Icerik = m.Icerik.Remove(indexOf, item.Trim().Length);
                                //        m.Icerik = m.Icerik.Insert(indexOf, etiket);
                                //    }
                                //    indexOf = -1;
                                //    etiketler += etiket + ", ";
                                //}
                                //if (!BAYMYO.UI.Converts.NullToString(Session["etiketSession"]).Equals(etiketQuery))
                                //    Session["etiketSession"] = etiketQuery;
                                //ltrContent.Text = ltrContent.Text.Replace("%Etiket%", "<p><b>Etiketler&nbsp;//</b>&nbsp;" + etiketler + "</p>");
                                //etiketler = null; etiket = null; indexOf = 0;
                                //Hesap Bilgileri
                                ltrContent.Text = ltrContent.Text.Replace("%Adi%", hsp.Adi);
                                ltrContent.Text = ltrContent.Text.Replace("%Soyadi%", hsp.Soyadi);
                                ltrContent.Text = ltrContent.Text.Replace("%Url%", Settings.VirtualPath + hsp.ProfilObject.Url);
                                ltrContent.Text = ltrContent.Text.Replace("%ProfilAdi%", hsp.ProfilObject.Adi.Replace('"', '\''));
                                //ltrContent.Text = ltrContent.Text.Replace("%Meslek%", KategoriMethods.GetKategori("meslek", hsp.ProfilObject.Meslek).Adi);
                                string modulID = CommentControl1.ModulID,
                                       icerik  = string.Empty;
                                if (m.Uye & !Core.CurrentUser.Tipi.Equals(AccountType.Admin))
                                {
                                    if (Core.IsUserActive)
                                    {
                                        //Core.ViewCounter(modulID, m.ID);
                                        //if (Settings.Site.IsVideoView > 0 & m.Video > 0)
                                        //    using (Video v = VideoMethods.GetVideo(m.Video))
                                        //    {
                                        //        if (Core.IsMobileBrowser())
                                        //            v.Embed = v.Embed.Replace("width=\"728\" height=\"410\"", "width=\"100%\" height=\"250\"");
                                        //        switch (Settings.Site.IsVideoView)
                                        //        {
                                        //            case 1:
                                        //                icerik = string.Format("<div class=\"clear\"></div>{0}<div class=\"clear\" style=\"margin-bottom:5px\"></div>", v.Embed) + m.Icerik;
                                        //                break;
                                        //            case 2:
                                        //                icerik = m.Icerik + string.Format("<div class=\"clear\">&nbsp;</div>{0}<div class=\"clear\">&nbsp;</div>", v.Embed);
                                        //                break;
                                        //            default:
                                        //                icerik = m.Icerik;
                                        //                break;
                                        //        }
                                        //    }
                                        //else
                                        icerik = m.Icerik;
                                        this.ltrContent.Text = this.ltrContent.Text.Replace("%Icerik%", icerik); //+ fotogaleri + videogaleri);
                                    }
                                    else
                                    {
                                        CommentControl1.Visible = false;
                                        this.ltrContent.Text    = this.ltrContent.Text.Replace("%Icerik%", string.Format("..<br/><div class=\"clear\">&nbsp;</div>Devamını okumak ve yapılan yorumları görmek için sizde <a href=\"{0}?l=1&ReturnUrl={1}\"><b>Üye Girişi</b></a> yapınız yada <a href=\"{0}?l=2&type=standart&ReturnUrl={1}\"><b>Ücretsiz Kayıt</b></a> olunuz.", Settings.VirtualPath, Request.RawUrl));
                                    }
                                }
                                else
                                {
                                    //Core.ViewCounter(modulID, m.ID);
                                    //if (Settings.Site.IsVideoView > 0 & m.Video > 0)
                                    //    using (Video v = VideoMethods.GetVideo(m.Video))
                                    //    {
                                    //        if (Core.IsMobileBrowser())
                                    //            v.Embed = v.Embed.Replace("width=\"728\" height=\"410\"", "width=\"100%\" height=\"250\"");
                                    //        switch (Settings.Site.IsVideoView)
                                    //        {
                                    //            case 1:
                                    //                icerik = string.Format("<div class=\"clear\"></div>{0}<div class=\"clear\" style=\"margin-bottom:5px\"></div>", v.Embed) + m.Icerik;
                                    //                break;
                                    //            case 2:
                                    //                icerik = m.Icerik + string.Format("<div class=\"clear\">&nbsp;</div>{0}<div class=\"clear\">&nbsp;</div>", v.Embed);
                                    //                break;
                                    //            default:
                                    //                icerik = m.Icerik;
                                    //                break;
                                    //        }
                                    //    }
                                    //else
                                    icerik = m.Icerik;
                                    this.ltrContent.Text = this.ltrContent.Text.Replace("%Icerik%", icerik);// + fotogaleri + videogaleri);
                                }
                                ////Gösterim Bilgisi
                                //switch (Settings.Site.CounterView)
                                //{
                                //    case CounterViewType.Hidden:
                                //        m.GosterimSayi = false;
                                //        break;
                                //}
                                //this.ltrContent.Text = this.ltrContent.Text.Replace("%Gosterim%", m.GosterimSayi ? string.Format(" - Bu {0} <b class=\"toolTip\" style=\"cursor:pointer;\" title=\"Bu oran {0} tekil izlenme sayısını gösterir.\">{1}</b> kere okundu.", modulID, GosterimMethods.Count(modulID, m.ID)) : "");
                                modulID = icerik = null;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    ltrContent.Text = MessageBox.Show(DialogResult.Error, "Son dakika Türkiye gündemi ve haberleri, intertnet'deki en son gelişmeler'den ilk sizin haberiniz olsun. Bu habere teknik bir arızadan dolayı geçici bir süre için erişim sağlanamayacaktır.<br/>//Sistem Mesajı: " + ex.Message + "!");
                }
            }
            base.OnInit(e);
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                try
                {
                    if (!string.IsNullOrEmpty(Request.QueryString["url"]))
                    {
                        using (Hesap hsp = HesapMethods.GetHesapUrl(Request.QueryString["url"]))
                        {
                            string meslek = KategoriMethods.GetKategori("meslek", hsp.ProfilObject.Meslek).Adi;
                            if (string.IsNullOrEmpty(hsp.ID))
                            {
                                this.ltrContent.Text = MessageBox.Show(DialogResult.Stop, "Şuan erişmeye çalıştığınız sayfa bulunamadı lütfen gitmek istediğiniz adresi kontrol edin ve tekrar deneyiniz!<span class=\"right\"><a href=\"/home\"><b>Anasayfaya geri dön!</b></a>&nbsp;-&nbsp;<a href=\"/contact\"><b>Hatalı sayfa bildirimi!</b></a></span>");
                                ScreenClear();
                                return;
                            }
                            GetUniqueID        = hsp.ID.ToString();
                            this.ltrTitle.Text = hsp.ProfilObject.Adi;
                            this.Page.Title    = meslek + " " + hsp.Adi + ' ' + hsp.Soyadi;
                            BAYMYO.UI.Web.Pages.AddMetaTag(this.Page, hsp.Adi + " " + hsp.Soyadi + " hakkında ", hsp.ProfilObject.Hakkimda);
                            //switch (hsp.Tipi)
                            //{
                            //    case AccountType.Admin:
                            //    case AccountType.Private:
                            //    case AccountType.Doctor:
                            //    case AccountType.Editor:
                            //        if (!string.IsNullOrEmpty(hsp.ProfilObject.Adi))
                            //            this.Page.Title = hsp.ProfilObject.Adi;
                            //        else
                            //            this.Page.Title = meslek + " " + hsp.Adi + ' ' + hsp.Soyadi;
                            //        BAYMYO.UI.Web.Pages.AddMetaTag(this.Page, this.Page.Title + " hakkında ", hsp.ProfilObject.Hakkimda);
                            //        break;
                            //    default:
                            //        this.Page.Title = meslek + " " + hsp.Adi + ' ' + hsp.Soyadi;
                            //        BAYMYO.UI.Web.Pages.AddMetaTag(this.Page, hsp.Adi + " " + hsp.Soyadi + " hakkında ", hsp.ProfilObject.Hakkimda);
                            //        break;
                            //}

                            if (!hsp.Aktif & !Core.CurrentUser.Tipi.Equals(AccountType.Admin))
                            {
                                //CommentControl1.Visible = false;
                                contact1.Visible = false;
                                //lastArticle.Visible = false;
                                ltrContent.Text = MessageBox.Show(DialogResult.Warning, "Şuan erişmek istediğiniz <b>'Sayfa'</b> gösterime kapalı durumdadır nedenleri aşağıda belirtilmiştir. <br/>* Üyelik başvuru inceleme altında olabilir.<br/>* Yada yöneticilerimiz tarafından editör üyeliği durdurulmuş olabilir.");
                                return;
                            }
                            ltrContent.Text = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath + "ProfilView.view"));
                            //Hesap Bilgi
                            ltrContent.Text = ltrContent.Text.Replace("%ImagesPath%", Settings.ImagesPath);
                            ltrContent.Text = ltrContent.Text.Replace("%Adi%", hsp.Adi);
                            ltrContent.Text = ltrContent.Text.Replace("%Soyadi%", hsp.Soyadi);
                            ltrContent.Text = ltrContent.Text.Replace("%KayitTarihi%", hsp.KayitTarihi.ToShortDateString());
                            //Profil Bilgi
                            ltrContent.Text = ltrContent.Text.Replace("%Url%", Settings.VirtualPath + hsp.ProfilObject.Url);
                            ltrContent.Text = ltrContent.Text.Replace("%Meslek%", meslek);
                            ltrContent.Text = ltrContent.Text.Replace("%Egitim%", KategoriMethods.GetKategori("egitim", hsp.ProfilObject.Egitim).Adi);
                            ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", Settings.ImagesPath + ((!string.IsNullOrEmpty(hsp.ProfilObject.ResimUrl)) ? "profil/" + hsp.ProfilObject.ResimUrl : "yok.png"));
                            ltrContent.Text = ltrContent.Text.Replace("%ProfilAdi%", hsp.ProfilObject.Adi);
                            ltrContent.Text = ltrContent.Text.Replace("%Mail%", string.IsNullOrEmpty(hsp.ProfilObject.Mail) ? "***@*****.***" : string.Format("<a href=\"mailto:{0}?subject={1}\">{0}</a>", hsp.ProfilObject.Mail, Settings.Site.Title + " sitesi uzerinden gonderildi!"));
                            ltrContent.Text = ltrContent.Text.Replace("%Web%", string.IsNullOrEmpty(hsp.ProfilObject.Web) ? "http://www.*" : string.Format("<a href=\"http://{0}?ref={1}\" target=\"_blank\">{0}</a>", hsp.ProfilObject.Web, Settings.SiteUrl));
                            ltrContent.Text = ltrContent.Text.Replace("%Telefon%", string.IsNullOrEmpty(hsp.ProfilObject.Telefon) ? "*** *** ** **" : hsp.ProfilObject.Telefon);
                            ltrContent.Text = ltrContent.Text.Replace("%GSM%", string.IsNullOrEmpty(hsp.ProfilObject.GSM) ? "*** *** ** **" : hsp.ProfilObject.GSM);
                            ltrContent.Text = ltrContent.Text.Replace("%Sehir%", string.IsNullOrEmpty(hsp.ProfilObject.Sehir) ? "********" : hsp.ProfilObject.Sehir);
                            ltrContent.Text = ltrContent.Text.Replace("%Cinsiyet%", hsp.Cinsiyet.ToString());
                            //Profildeki Baglantilar
                            ltrContent.Text = ltrContent.Text.Replace("%Iletisim%", Core.CreateLink("iletisim", hsp.ProfilObject.Url, "go"));
                            ltrContent.Text = ltrContent.Text.Replace("%Makaleleri%", Core.CreateLink("makaleyazar", hsp.ProfilObject.Url, hsp.Adi + " " + hsp.Soyadi));
                            ltrContent.Text = ltrContent.Text.Replace("%Mesajlari%", Core.CreateLink("mesajliste", hsp.ID, hsp.Adi + " " + hsp.Soyadi));
                            ltrContent.Text = ltrContent.Text.Replace("%YazarHakkinda%", Core.CreateLink("yazarhakkinda", hsp.ProfilObject.Url, "go"));
                            switch (viewPage)
                            {
                            case ViewType.Profil:
                                #region --- Profil ---
                                this.Page.Title += " - Profil Sayfası";
                                if (!string.IsNullOrEmpty(hsp.ProfilObject.Hakkimda))
                                {
                                    ltrContent.Text = ltrContent.Text.Replace("%DetailBlock%", BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath + "ProfilAboutUs.view")));
                                    ltrContent.Text = ltrContent.Text.Replace("%Hakkimda%", hsp.ProfilObject.Hakkimda);
                                }
                                else
                                {
                                    ltrContent.Text = ltrContent.Text.Replace("%DetailBlock%", "");
                                }
                                Core.ViewCounter("profil", hsp.ID);
                                GetData(hsp.ID);
                                #endregion
                                break;

                            case ViewType.About:
                                this.Page.Title += " - Hakkında";
                                //if (Core.CurrentUser.ProfilObject != null)
                                //    CommentControl1.IsCommandActive = BAYMYO.UI.Converts.NullToString(Core.CurrentUser.ProfilObject.Url).Equals(hsp.ProfilObject.Url);
                                //else
                                //    CommentControl1.IsCommandActive = false;
                                //CommentControl1.ModulID = "yazarhakkinda";
                                //CommentControl1.IcerikID = Request.QueryString["url"];
                                ltrContent.Text = ltrContent.Text.Replace("%DetailBlock%", "");
                                break;

                            case ViewType.Contact:
                                this.Page.Title += " - İletişim Formu";
                                contact1.HesapID = hsp.ID.ToString();
                                ltrContent.Text  = ltrContent.Text.Replace("%DetailBlock%", "");
                                break;
                            }
                            //Gösterim Bilgisi
                            switch (Settings.Site.CounterView)
                            {
                            case CounterViewType.Hidden:
                                ltrContent.Text = ltrContent.Text.Replace("%Gosterim%", "");
                                return;

                            default:
                                ltrContent.Text = ltrContent.Text.Replace("%Gosterim%", "PR:&nbsp;" + GosterimMethods.Count("profil", hsp.ID));
                                break;
                            }
                        }
                    }
                    else
                    {
                        Response.Redirect(Settings.VirtualPath + "?ref=profil", false);
                    }
                }
                catch (Exception ex)
                {
                    Response.Redirect(Settings.VirtualPath + "?ref=profil-error&ex=" + ex.Message, false);
                }
            }
        }
Example #6
0
        private void View(Makale m)
        {
            using (Hesap hsp = HesapMethods.GetHesap(m.HesapID))
            {
                this.Page.Title = m.Baslik + " - " + hsp.Adi + " " + hsp.Soyadi;
                #region --- html-meta ---
                string imageUrl = Settings.SiteImageUrl + "profil/" + hsp.ProfilObject.ResimUrl, meslek = KategoriMethods.GetKategori("meslek", hsp.ProfilObject.Meslek).Adi;
                #endregion
                CommentControl1.IsCommandActive = BAYMYO.UI.Converts.NullToGuidString(Core.CurrentUser.ID).Equals(m.HesapID);
                CommentControl1.Visible         = m.Yorum;
                CommentControl1.ModulID         = "makale";
                CommentControl1.IcerikID        = Request.QueryString["mklid"];
                ltrContent.Text = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath + "ArticleView.view"));
                //Icerik Bilgisi
                ltrContent.Text = ltrContent.Text.Replace("%ImagesPath%", Settings.ImagesPath);
                if (!BAYMYO.UI.Converts.NullToString(KategoriBilgi.ModulID).Equals("makale") || !BAYMYO.UI.Converts.NullToString(KategoriBilgi.ID).Equals(m.KategoriID))
                {
                    KategoriBilgi = KategoriMethods.GetKategori("makale", m.KategoriID);
                }
                if (KategoriBilgi.Aktif)
                {
                    this.Page.Title += " | " + KategoriBilgi.Adi.ToUpper();// +" - " + m.Etiket;
                }
                ltrContent.Text = ltrContent.Text.Replace("%Renk%", KategoriBilgi.Renk);
                ltrContent.Text = ltrContent.Text.Replace("%Kategori%", string.Format("<a href=\"{0}\" target=\"_blank\">{1}</a>", Core.CreateLink("makalekategori", KategoriBilgi.ID, KategoriBilgi.Adi), KategoriBilgi.Adi));
                ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", "<div class=\"profil-img\"><a href=\"%Url%\" target=\"_blank\"><img class=\"image left\" src=" + Settings.ImagesPath + "profil/" + hsp.ProfilObject.ResimUrl + " alt=\"%Adi% %Soyadi%\" /></a>" + string.Format("<span class=\"links\"><a class='toolTip' title='Yazarın profilini görüntülemek için buraya tıklayın.' href=\"/{0}\" target=\"_blank\"><b>{4} {1} {2}</b></a>&nbsp;<br/><span style='font-size:12px;color:#454545;margin-bottom: 8px;display:block;'>{3}</span>", hsp.ProfilObject.Url, hsp.Adi, hsp.Soyadi, hsp.ProfilObject.Mail, meslek) + "</span></div>");
                ltrContent.Text = ltrContent.Text.Replace("%SpotBaslik%", ((!string.IsNullOrEmpty(m.ResimUrl)) ? string.Format("<figure class=\"photo\"><img itemprop=\"image\" src=\"{0}\" alt=\"%Adi% %Soyadi%\" title=\"%Adi% %Soyadi%\" /><meta itemprop=\"interactionCount\" content=\"UserComments:{1}\" /><meta itemprop=\"thumbnailUrl\" content=\"{0}\" /></figure>", Settings.SiteImageUrl + "makale/" + m.ResimUrl, YorumMethods.Count(m.ID.ToString())) : ""));
                ltrContent.Text = ltrContent.Text.Replace("%Baslik%", m.Baslik.Replace('"', '\''));
                ltrContent.Text = ltrContent.Text.Replace("%Body%", BAYMYO.UI.Web.Pages.ClearHtml(m.Icerik).Replace('"', '\''));
                ltrContent.Text = ltrContent.Text.Replace("%BaslikDiger%", hsp.ProfilObject.Adi + " " + KategoriBilgi.Adi.ToLower() + " kategorisindeki makaleleri ve röportajları.");
                ltrContent.Text = ltrContent.Text.Replace("%Ozet%", m.Ozet.Replace('"', '\''));
                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihiSEO%", m.KayitTarihi.ToString("yyyy-MM-ddTHH:mm:ssZ"));
                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihi%", m.KayitTarihi.ToString("dd MMMMM yyyy ddddd - HH:mm:ss"));
                ltrContent.Text = ltrContent.Text.Replace("%ImageUrl%", imageUrl);

                string etiketler = string.Empty;
                foreach (string item in m.Etiket.Split(','))
                {
                    etiketler += string.Format("<a href=\"{0}{1}\" target=\"_blank\"><strong>{2}</strong></a>, ", Settings.SiteUrl.Replace("http:", ""), Core.CreateLink("makaleetiket", "", item), item.Trim());
                }
                ltrContent.Text = ltrContent.Text.Replace("%Etiket%", "<p><b>Etiketler&nbsp;//</b>&nbsp;" + etiketler + "</p>");
                //Hesap ve Profil Bilgileri
                ltrContent.Text = ltrContent.Text.Replace("%Adi%", hsp.Adi);
                ltrContent.Text = ltrContent.Text.Replace("%Soyadi%", hsp.Soyadi);
                ltrContent.Text = ltrContent.Text.Replace("%Url%", Settings.VirtualPath + hsp.ProfilObject.Url);
                ltrContent.Text = ltrContent.Text.Replace("%ProfilAdi%", hsp.ProfilObject.Adi);
                ltrContent.Text = ltrContent.Text.Replace("%Meslek%", meslek);
                m.Icerik       += string.Format("<div class=\"clear\"></div><a class='toolTip' title='Yazarın tüm yazılarını görüntülemek için buraya tıklayın.' class href=\"{0}\"><u><b>Diğer tüm yazıları için buraya tıklayın!</b></u></a><br/>", Core.CreateLink("makaleyazar", hsp.ProfilObject.Url, hsp.Adi + " " + hsp.Soyadi));
                string modulID = CommentControl1.ModulID;
                if (m.Uye)
                {
                    if (Core.IsUserActive)
                    {
                        Core.ViewCounter(modulID, m.ID);
                        ltrContent.Text = ltrContent.Text.Replace("%Icerik%", m.Icerik);
                    }
                    else
                    {
                        CommentControl1.Visible = false;
                        ltrContent.Text         = ltrContent.Text.Replace("%Icerik%", string.Format("..<br/><br/><br/>Devamını okumak ve yapılan yorumları görmek için sizde <a href=\"{0}?l=1&ReturnUrl={1}\"><b>Üye Girişi</b></a> yapınız yada <a href=\"{0}?l=2&type=standart&ReturnUrl={1}\"><b>Ücretsiz Kayıt</b></a> olunuz.", Settings.VirtualPath, Request.RawUrl));
                    }
                }
                else
                {
                    Core.ViewCounter(modulID, m.ID);
                    ltrContent.Text = ltrContent.Text.Replace("%Icerik%", m.Icerik);
                }
                //Gösterim Bilgisi
                switch (Settings.Site.CounterView)
                {
                case CounterViewType.Hidden:
                    m.GosterimSayi = false;
                    break;
                }
                ltrContent.Text = ltrContent.Text.Replace("%Gosterim%", m.GosterimSayi ? string.Format(" - Bu {0} <b class=\"toolTip\" style=\"cursor:pointer;\" title=\"Bu oran {0} tekil izlenme sayısını gösterir.\">{1}</b> kere okundu.", modulID, GosterimMethods.Count(modulID, m.ID)) : "");
                modulID         = null;
            }
        }
Example #7
0
        private void View(Video m)
        {
            using (Hesap hsp = HesapMethods.GetHesap(m.HesapID))
            {
                if (Core.IsMobileBrowser())
                {
                    m.Embed = m.Embed.Replace("width=\"728\" height=\"410\"", "width=\"100%\" height=\"250\"");
                }

                CommentControl1.IsCommandActive = BAYMYO.UI.Converts.NullToGuidString(Core.CurrentUser.ID).Equals(m.HesapID);
                CommentControl1.Visible         = m.Yorum;
                CommentControl1.ModulID         = "video";
                CommentControl1.IcerikID        = Request.QueryString["vid"];
                ltrContent.Text = BAYMYO.UI.FileIO.ReadText(Server.MapPath(Settings.ViewPath + "VideoView.view"));
                //Icerik Bilgisi
                if (!BAYMYO.UI.Converts.NullToString(KategoriBilgi.ModulID).Equals("video") || !BAYMYO.UI.Converts.NullToString(KategoriBilgi.ID).Equals(m.KategoriID))
                {
                    KategoriBilgi = KategoriMethods.GetKategori("video", m.KategoriID);
                }
                if (KategoriBilgi.Aktif)
                {
                    this.Page.Title += " | " + KategoriBilgi.Adi.ToUpper();
                    ltrContent.Text  = ltrContent.Text.Replace("%Renk%", KategoriBilgi.Renk);
                }
                string imageUrl = Settings.SiteImageUrl + "video/" + m.ResimUrl; //, embedUrl = "";
                                                                                 //System.Text.RegularExpressions.Match m2 = System.Text.RegularExpressions.Regex.Match(m.Embed, @"src=\""(.*?)\""", System.Text.RegularExpressions.RegexOptions.Singleline);
                                                                                 //if (m2.Success)
                                                                                 //    embedUrl = m2.Groups[1].Value;
                                                                                 //else
                                                                                 //    embedUrl = "";
                                                                                 //ltrContent.Text = ltrContent.Text.Replace("%EmbedUrl%", embedUrl);
                ltrContent.Text = ltrContent.Text.Replace("%ImageUrl%", imageUrl);
                ltrContent.Text = ltrContent.Text.Replace("%Kategori%", string.Format("<a id=\"ctgALink\" href=\"{0}\" target=\"_blank\" alt=\"{2}\">{1}</a>", Core.CreateLink("videokategori", KategoriBilgi.ID, KategoriBilgi.Adi), KategoriBilgi.Adi, KategoriBilgi.ID));
                //ltrContent.Text = ltrContent.Text.Replace("%ResimUrl%", ((!string.IsNullOrEmpty(m.ResimUrl)) ? "<img class=\"image left\" src=" + Settings.ImagesPath + "video/" + m.ResimUrl + " alt=\"%Baslik%\" />" : ""));
                ltrContent.Text = ltrContent.Text.Replace("%Baslik%", m.Baslik.Replace('"', '\''));
                ltrContent.Text = ltrContent.Text.Replace("%Ozet%", KategoriBilgi.Adi + " konusuna bağlı en son videoları izleyin.");
                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihiSEO%", m.KayitTarihi.ToString("yyyy-MM-ddTHH:mm:ssZ"));
                ltrContent.Text = ltrContent.Text.Replace("%KayitTarihi%", m.KayitTarihi.ToString("dd/MM/yyyy ddddd HH:mm"));
                string etiketler = string.Empty, etiketQuery = string.Empty, siteUrl = Settings.SiteUrl.Replace("http:", "");
                foreach (string item in m.Etiket.Split(','))
                {
                    etiketler   += string.Format("<a href=\"{0}{1}\" target=\"_blank\"><strong>{2}</strong></a>, ", Settings.SiteUrl.Replace("http:", ""), Core.CreateLink("videoetiket", "", item), item.Trim());
                    etiketQuery += " or i.yoneticionay=1 and i.aktif=1 and i.etiket like <%USTENTIRNAK%>%" + item.Trim() + ",%<%USTENTIRNAK%>";
                }
                if (!BAYMYO.UI.Converts.NullToString(Session["etiketSession"]).Equals(etiketQuery))
                {
                    Session["etiketSession"] = etiketQuery;
                }
                ltrContent.Text = ltrContent.Text.Replace("%Etiket%", "<b>Etiketler;</b> " + etiketler);
                //Hesap Bilgileri
                switch (hsp.Tipi)
                {
                case AccountType.Admin:
                    ltrContent.Text = ltrContent.Text.Replace("%Ekleyen%", "");
                    break;

                default:
                    ltrContent.Text = ltrContent.Text.Replace("%Ekleyen%", "<b class=\"left\">Ekleyen;&nbsp;</b><a href=\"%Url%\" target=\"_blank\"><b class=\"left\">%Adi% %Soyadi%</b><img class=\"toolTip left\" style=\"margin-left: 3px;\" src=\"%ImagesPath%icons/10/expand.png\" title=\"%Adi% %Soyadi% sayfasına git.\" alt=\"Yazarın sayfasına git.\" border=\"0\" /><div class=\"clear\"></div></a>");
                    ltrContent.Text = ltrContent.Text.Replace("%Adi%", hsp.Adi);
                    ltrContent.Text = ltrContent.Text.Replace("%Soyadi%", hsp.Soyadi);
                    break;
                }
                ltrContent.Text = ltrContent.Text.Replace("%Url%", Settings.VirtualPath + hsp.ProfilObject.Url);
                ltrContent.Text = ltrContent.Text.Replace("%ProfilAdi%", hsp.ProfilObject.Adi);
                ltrContent.Text = ltrContent.Text.Replace("%ImagesPath%", Settings.ImagesPath);
                //ltrContent.Text = ltrContent.Text.Replace("%Meslek%", KategoriMethods.GetKategori("meslek", hsp.ProfilObject.Meslek).Adi);

                string modulID = CommentControl1.ModulID;
                if (m.Uye)
                {
                    if (Core.IsUserActive)
                    {
                        Core.ViewCounter(modulID, m.ID);
                        ltrContent.Text = ltrContent.Text.Replace("%Icerik%", m.Embed.Trim());
                    }
                    else
                    {
                        CommentControl1.Visible = false;
                        ltrContent.Text         = ltrContent.Text.Replace("%Icerik%", string.Format("..<br/><br/><br/>Devamını okumak ve yapılan yorumları görmek için sizde <a href=\"{0}?l=1&ReturnUrl={1}\"><b>Üye Girişi</b></a> yapınız yada <a href=\"{0}?l=2&type=standart&ReturnUrl={1}\"><b>Ücretsiz Kayıt</b></a> olunuz.", Settings.VirtualPath, Request.RawUrl));
                    }
                }
                else
                {
                    Core.ViewCounter(modulID, m.ID);
                    ltrContent.Text = ltrContent.Text.Replace("%Icerik%", m.Embed.Trim());
                }
                //Gösterim Bilgisi
                switch (Settings.Site.CounterView)
                {
                case CounterViewType.Hidden:
                    m.GosterimSayi  = false;
                    ltrContent.Text = ltrContent.Text.Replace("%GosterimSayi%", "");
                    ltrContent.Text = ltrContent.Text.Replace("%Gosterim%", "");
                    break;

                default:
                    int viewCount = GosterimMethods.Count(modulID, m.ID);
                    ltrContent.Text = ltrContent.Text.Replace("%GosterimSayi%", viewCount.ToString());
                    ltrContent.Text = ltrContent.Text.Replace("%Gosterim%", m.GosterimSayi ? string.Format("<small>Gösterim: </small>{0}", viewCount) : "");
                    break;
                }
                modulID = null;
                GetOtherData(m);
            }
        }