Esempio n. 1
0
 public int Counter()
 {
     return(GosterimMethods.Count("galeri", AlbumBilgi.ID.ToString()));
 }
Esempio n. 2
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;
            }
        }
Esempio n. 3
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);
                }
            }
        }
Esempio n. 4
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);
            }
        }