コード例 #1
0
ファイル: Settings.php プロジェクト: sDenizhan/skyfilm
 public function yasaluyarikaydet()
 {
     if (ayar_guncelle('yasal_uyari', ckeditor_html_clear($this->input->post('frmYasalUyari', TRUE)))) {
         $_data['e'] = (object) array('durum' => 'ok', 'type' => 'mesaj', 'mesaj' => 'Yasal Uyarı Güncellendi..! <b><a href="' . base_url("admin/settings") . '">Geri Dön</a></b>');
         $this->render('errorpage', $_data);
     } else {
         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Yasal Uyarı Güncellenemedi..! <b><a href="' . base_url("admin/settings") . '">Geri Dön</a></b>');
         $this->render('errorpage', $_data);
     }
 }
コード例 #2
0
ファイル: Bloglar.php プロジェクト: sDenizhan/skyfilm
 public function yazikaydet()
 {
     $this->form_validation->set_rules('frmYaziBaslik', 'Yazı Başlığı', 'trim|required|xss_clean');
     $this->form_validation->set_rules('frmYaziOzet', 'Yazı Özeti', 'trim|required|xss_clean');
     $this->form_validation->set_rules('frmYaziIcerik', 'Yazı İçeriği', 'trim|required|xss_clean');
     //$this->form_validation->set_rules('frmKategoriler','Yazı Kategorisi','trim|required|xss_clean');
     $this->form_validation->set_rules('frmEtiket', 'Yazı Etiketi', 'trim|required|xss_clean');
     if ($this->form_validation->run() !== FALSE) {
         $baslik = $this->input->post('frmYaziBaslik');
         $ozet = $this->input->post('frmYaziOzet');
         $icerik = ckeditor_html_clear($this->input->post('frmYaziIcerik'));
         $durum = $this->input->post('frmDurum');
         $resimKullan = $this->input->post('frmResimKullan');
         $kategoriler = json_encode($this->input->post('kategori'));
         $etiketler = $this->input->post('frmEtiket');
         //resim kullan aktifse
         if ($resimKullan == 'Evet') {
             //upload ayarları
             $config['allowed_types'] = 'gif|jpeg|jpg|png';
             $config['upload_path'] = BLOG_UPLOAD_PATH;
             //upload sınıfı
             $this->load->library('upload', $config);
             //resim yüklenirse
             if ($this->upload->do_upload('frmYaziResim')) {
                 $upData = $this->upload->data();
                 //resim adresi
                 $image = base_url(BLOG_UPLOAD_PATH . '/' . $upData['file_name']);
                 //resim yüklenmezse hata versin
             } else {
                 $_data['e'] = (object) array('durum' => 'hata', 'type' => 'uploadform', 'mesaj' => '');
                 $this->render('errorpage', $_data);
             }
         }
         //resim kontrolü ...
         $image = !empty($image) ? $image : NULL;
         $insert = $this->db->insert('blogyazilari', array('baslik' => $baslik, 'ozet' => $ozet, 'icerik' => $icerik, 'durum' => $durum, 'kategori_id' => $kategoriler, 'image' => $image, 'tarih' => time(), 'yazar' => uyebilgisi('kullaniciadi'), 'hit' => 0, 'seo_keys' => $etiketler, 'seo_desc' => $ozet, 'seo_title' => $baslik));
         if ($insert) {
             //post ID alınıyor..
             $postID = $this->db->insert_id();
             //etiketler ekleniyor...
             $expEtiket = explode(',', $etiketler);
             foreach ($expEtiket as $etiket) {
                 $this->db->insert('etiketler', array('eklenti_id' => $postID, 'etiket' => $etiket, 'tur' => 'blog'));
             }
             $_data['e'] = (object) array('durum' => 'ok', 'type' => 'normal', 'mesaj' => 'Kayıt Eklendi. <b><a href="' . base_url('admin/bloglar/yaziekle') . '">Geri Dön</a></b>');
             $this->render('errorpage', $_data);
         } else {
             $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Kayıt Eklenemedi. <b><a href="' . base_url('admin/bloglar/yaziekle') . '">Geri Dön</a></b>');
             $this->render('errorpage', $_data);
         }
     } else {
         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'formvalidation', 'mesaj' => '<b><a href="' . base_url('admin/bloglar/yaziekle') . '">Geri Dön</a></b>');
         $this->render('errorpage', $_data);
     }
 }
コード例 #3
0
ファイル: Sss.php プロジェクト: sDenizhan/skyfilm
 public function soruduzeltkaydet()
 {
     $_soruID = $this->uri->segment(4);
     if (!is_numeric($_soruID) || empty($_soruID)) {
         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Düzeltilecek Kayıt ID Bilgisine Ulaşılamadı. <b><a href="' . base_url("admin/sss") . '"> Geri Dön </a></b>');
         $this->render('errorpage', $_data);
     } else {
         $_soru = $this->db->get_where('siksorulansorular', array('id' => $_soruID));
         if ($_soru->num_rows() > 0) {
             $this->form_validation->set_rules('frmSoru', 'Soru', 'trim|required|xss_clean');
             $this->form_validation->set_rules('frmSoruAciklamasi', 'Soru Açıklaması', 'trim|required|xss_clean');
             $this->form_validation->set_rules('frmSoruEtiketleri', 'Soru Etiketleri', 'trim|required|xss_clean');
             if ($this->form_validation->run() == FALSE) {
                 $_data['e'] = (object) array('durum' => 'hata', 'type' => 'formvalidation', 'mesaj' => 'Kayıt Eklenemedi. <b><a href="' . base_url("admin/sss") . '"> Geri Dön </a></b>');
                 $this->render('errorpage', $_data);
             } else {
                 $soru = $this->input->post('frmSoru', TRUE);
                 $aciklama = ckeditor_html_clear($this->input->post('frmSoruAciklamasi', TRUE));
                 $soruEtiketleri = $this->input->post('frmSoruEtiketleri', TRUE);
                 $tarih = time();
                 $update = $this->db->update('siksorulansorular', array('soru' => $soru, 'aciklama' => $aciklama, 'tarih' => $tarih), array('id' => $_soruID));
                 if ($update) {
                     $delete = $this->db->delete('etiketler', array('eklenti_id' => $_soruID, 'tur' => 'sss'));
                     $exp = explode(',', $soruEtiketleri);
                     foreach ($exp as $etiket) {
                         $this->db->insert('etiketler', array('eklenti_id' => $_soruID, 'tur' => 'sss', 'etiket' => $etiket));
                     }
                     $_data['e'] = (object) array('durum' => 'ok', 'type' => 'normal', 'mesaj' => 'Soru Düzeltild..! <b><a href="' . base_url("admin/sss") . '"> Geri Dön </a></b>');
                     $this->render('errorpage', $_data);
                 } else {
                     $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Soru Düzeltilemedi..! <b><a href="' . base_url("admin/sss") . '"> Geri Dön </a></b>');
                     $this->render('errorpage', $_data);
                 }
             }
         } else {
             $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Kayıt Bulunamadı. <b><a href="' . base_url("AdminSSS") . '"> Geri Dön </a></b>');
             $this->render('errorpage', $_data);
         }
     }
 }
コード例 #4
0
ファイル: Duyurular.php プロジェクト: sDenizhan/skyfilm
 function duyuruduzeltkaydet()
 {
     $_newsID = $this->uri->segment(4);
     if (!is_numeric($_newsID) || empty($_newsID)) {
         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Duyuru ID Bilgisine Ulaşılamadı. <b><a href="' . base_url("admin/duyurular") . '"> Geri Dön </a></b>');
         $this->render('errorpage', $_data);
     } else {
         $haber = $this->db->get_where('duyurular', array('id' => $_newsID));
         if ($haber->num_rows() > 0) {
             $this->form_validation->set_rules('frmHaberBaslik', 'Haber Başlığı', 'trim|required|xss_clean');
             $this->form_validation->set_rules('frmHaberIcerik', 'Haber İçeriği', 'trim|required|xss_clean');
             $this->form_validation->set_rules('frmEtiket', 'Etiket', 'trim|required|xss_clean');
             $this->form_validation->set_message('required', '%s alanını girmek zorundasınız.');
             if ($this->form_validation->run() == FALSE) {
                 $this->load->view('admin/ajax_formvalidation_error');
             } else {
                 $_haberBaslik = $this->input->post('frmHaberBaslik');
                 $_haberIcerik = ckeditor_html_clear($this->input->post('frmHaberIcerik'));
                 $_haberTuru = $this->input->post('frmTur');
                 $_resimKullan = $this->input->post('frmResimKullan');
                 $_haberEtiket = $this->input->post('frmEtiket');
                 //eğer resim kullan aktif değilse ise normal kayıt
                 if ($_resimKullan != 'Evet') {
                     $_q = $this->db->update('duyurular', array("baslik" => $_haberBaslik, "icerik" => $_haberIcerik, "yazan" => uyebilgisi('kullaniciadi'), "tarih" => time(), "tur" => $_haberTuru), array('id' => $_newsID));
                     if ($_q) {
                         $this->db->delete('etiketler', array('eklenti_id' => $_newsID, 'tur' => 'haber'));
                         foreach (explode(',', $_haberEtiket) as $etiket) {
                             $this->db->insert('etiketler', array('eklenti_id' => $_newsID, 'tur' => 'haber', 'etiket' => $etiket));
                         }
                         $_data['e'] = (object) array('durum' => 'ok', 'type' => 'normal', 'mesaj' => 'Duyuru Düzeltildi. <b><a href="' . base_url("admin/duyurular") . '"> Geri Dön </a></b>');
                         $this->render('errorpage', $_data);
                     } else {
                         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Duyuru Düzeltilemedi. <b><a href="' . $this->agent->referrer() . '"> Geri Dön </a></b>');
                         $this->render('errorpage', $_data);
                     }
                     //aktif ise resim yükleme ve normal kayit
                 } else {
                     $_uploadConfig['upload_path'] = HABER_UPLOAD_PATH;
                     $_uploadConfig['allowed_types'] = 'gif|png|jpg|jpeg';
                     $_uploadConfig['overwrite'] = FALSE;
                     $_uploadConfig['max_size'] = '1024000';
                     $this->load->library('upload', $_uploadConfig);
                     if (!$this->upload->do_upload('frmHaberResim')) {
                         $_data['e'] = (object) array('durum' => 'hata', 'type' => 'uploadform', 'mesaj' => '');
                         $this->render('errorpage', $_data);
                     } else {
                         //haber resmi değiştiği için önceki kayıt fiziksel olarak silinmeli...
                         $get = $this->db->get_where('duyurular', array('id' => $_newsID));
                         if ($get->num_rows() > 0) {
                             //dosya adresi kırpılıyor...
                             //http://keyfisinema.net/others/upload/haber/image.jpg şelinden
                             //others/upload/haber/image.jpg şekline dönüşüyor..
                             $image = substr($get->row()->resim, (int) strlen(base_url()));
                             //resim silinyor...
                             @unlink('./' . $image);
                         }
                         $_upload_data = $this->upload->data();
                         $_q = $this->db->update('duyurular', array("baslik" => $_haberBaslik, "icerik" => ckeditor_html_clear($_haberIcerik), "yazan" => uyebilgisi('kullaniciadi'), "tarih" => time(), "tur" => $_haberTuru, "resim" => base_url('others/upload/haber/' . $_upload_data['orig_name'] . '')), array('id' => $_newsID));
                         if ($_q) {
                             $this->db->delete('etiketler', array('eklenti_id' => $_newsID, 'tur' => 'haber'));
                             foreach (explode(',', $_haberEtiket) as $etiket) {
                                 $this->db->insert('etiketler', array('eklenti_id' => $_newsID, 'tur' => 'haber', 'etiket' => $etiket));
                             }
                             $_data['e'] = (object) array('durum' => 'ok', 'type' => 'normal', 'mesaj' => 'Duyuru Eklendi. <b><a href="' . base_url("admin/duyurular") . '"> Geri Dön </a></b>');
                             $this->render('errorpage', $_data);
                         } else {
                             $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Duyuru Düzeltilemedi. <b><a href="' . $this->agent->referrer() . '"> Geri Dön </a></b>');
                             $this->render('errorpage', $_data);
                         }
                     }
                 }
             }
         } else {
             $_data['e'] = (object) array('durum' => 'hata', 'type' => 'normal', 'mesaj' => 'Duyuru Bulunamadı. <b><a href="' . $this->agent->referrer() . '"> Geri Dön </a></b>');
             $this->render('errorpage', $_data);
         }
     }
 }