new pisilinux web sites
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Created By : Erkan IŞIK
|
||||
* Created Date: 2018-01-26
|
||||
* Update Date : 2018-01-26
|
||||
*/
|
||||
class Blog_model extends Model{
|
||||
|
||||
function content_list(){
|
||||
return DB::where('icerik_tur','icerik','and')->where('icerik_durum','1')->orderBy('icerik_id','desc')->get('content')->result();
|
||||
}
|
||||
|
||||
function label_list($data){
|
||||
return DB::like('icerik_tag',$data)->get('content')->result();
|
||||
}
|
||||
|
||||
function content($id){
|
||||
$content = DB::where('id',$id)->get('content')->row();
|
||||
$say = $content->hits + 1;
|
||||
DB::where('id',$id)->update(
|
||||
'content',[
|
||||
'hits' => $say,
|
||||
]);
|
||||
|
||||
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
class Bugs_model extends Model{
|
||||
|
||||
function new($post){
|
||||
DB::insert('bugs', [
|
||||
'userid' => USERID,
|
||||
'title' => $post['title'],
|
||||
'titleSeo' => seo($post['title']),
|
||||
'tasktype' => $post['tasktype'],
|
||||
'status' => 1,
|
||||
'system' => $post['system'],
|
||||
'details' => $post['details'],
|
||||
]);
|
||||
|
||||
if (!DB::error()) {
|
||||
$message = "Bugs bölümüne ".username(USERID)." ".$post['title']." mesajı bıraktı kontrol edin..";
|
||||
telegram($message);
|
||||
redirect('bugs/search');
|
||||
}
|
||||
}
|
||||
|
||||
function insert($post){
|
||||
//bugRow($post['post_id'])->title
|
||||
|
||||
DB::insert('bugs', [
|
||||
'userid' => USERID,
|
||||
'title' => bugsRow($post['post_id'])->title,
|
||||
'titleSeo' => seo(bugsRow($post['post_id'])->title),
|
||||
'tasktype' => bugsRow($post['post_id'])->tasktype,
|
||||
'status' => '1',
|
||||
'details' => $post['bugs_post'],
|
||||
'contentId' => $post['post_id'],
|
||||
]);
|
||||
|
||||
if (!DB::error()) {
|
||||
|
||||
$link = 'bugs/detail/'.$post['post_id'].'/'.seo(bugsRow($post['post_id'])->title);
|
||||
|
||||
$message = "Bugs bölümüne ".username(USERID)." https://pisilinux.org/".$link." mesajına cevap yazdı kontrol edin...";
|
||||
|
||||
telegram($message);
|
||||
|
||||
redirect($link);
|
||||
}
|
||||
}
|
||||
|
||||
function edit($post){
|
||||
|
||||
DB::where('id', $post['id'])->update('bugs', [
|
||||
'title' => $post['title'],
|
||||
'titleSeo' => seo($post['title']),
|
||||
'tasktype' => $post['tasktype'],
|
||||
'details' => $post['details'],
|
||||
|
||||
]);
|
||||
$contentId = bugsRow($post['id'])->contentId;
|
||||
|
||||
if (!DB::error()) {
|
||||
|
||||
|
||||
if (bugsRow($post['id'])->contentId != '0') {
|
||||
$link = 'bugs/detail/'.$contentId.'/'.seo($post['title']);
|
||||
}else{
|
||||
$link = 'bugs/detail/'.$post['id'].'/'.seo($post['title']);
|
||||
}
|
||||
$message = "Bugs bölümüne ".username(USERID)." ".$post['title']." mesajına cavap yazdı.
|
||||
Link ".URL::base($link);
|
||||
telegram($message);
|
||||
|
||||
redirect($link);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
|
||||
class Forum_model extends Model{
|
||||
|
||||
function kategori($par = '0'){
|
||||
return DB::where('kat_ustid',$par)->get('forum_kat')->result();
|
||||
}
|
||||
|
||||
// soru/cevap gösterimdeki konu gönderimi
|
||||
function konu_kaydet($post){
|
||||
$userid = Session::select('userid');
|
||||
$title = trim(linkcleaner($post['title']));
|
||||
|
||||
if($userid > 0){
|
||||
DB::insert('forum',[
|
||||
'category_id' => $post['category_id'],
|
||||
'title' => $title,
|
||||
'title_seo' => seo($title),
|
||||
'content' => $post['content'],
|
||||
'user_id' => $userid,
|
||||
'content_id' => '0',
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
$konu_id = DB::insertID();
|
||||
$url = 'forum/konulist/'.$konu_id;
|
||||
$konu_url = 'forum/subject/'.isset($konu_id).'-'.seo($post['title']);
|
||||
$message = "Mesajın geldiği yer: Forum\nGönderen: ".yazar(Session::select('userid'))."\nBaşlık: ".$post['title']."\nMesaj: ".decode1($post['content'])."\nLink: https://pisilinux.org/forum/subject/".DB::insertID()."-".seo($post['title']);
|
||||
telegram($message);
|
||||
redirect('forum');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// forum gösterimdeki konu gönderimi
|
||||
function konu_kaydet1($post){
|
||||
$title = linkcleaner($post['title']);
|
||||
DB::insert('forum',[
|
||||
'category_id' => $post['category_id'],
|
||||
'title' => $title,
|
||||
'title_seo' => seo($title),
|
||||
'content' => $post['content'],
|
||||
'user_id' => Session::select('userid'),
|
||||
'content_id' => '0',
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
$konu_id = DB::insertID();
|
||||
$url = 'forum/konulist/'.$konu_id;
|
||||
$konu_url = 'forum/subject/'.isset($konu_id).'-'.seo($post['title']);
|
||||
$message = "Mesajın geldiği yer: Forum\nGönderen: ".yazar(Session::select('userid'))."\nBaşlık: ".$post['title']."\nMesaj: ".$post['content']."\nLink: https://pisilinux.org/forum/subject/".DB::insertID()."-".seo($post['title']);
|
||||
$link = "forum/subject/".DB::insertID()."-".seo($post['title'])."'>".$post['title'];
|
||||
telegram($message);
|
||||
//redirect($link);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function forumkonu($post){
|
||||
//$title_seo = explode('.',$post);
|
||||
return DB::where('id',$post)->get('forum')->row();
|
||||
}
|
||||
|
||||
function cevap($post){
|
||||
$fd = DB::where('id', $post['konu_id'])->get('forum')->row();
|
||||
$userid = $fd->user_id;
|
||||
|
||||
DB::insert('forum',[
|
||||
'category_id' => $fd->category_id,
|
||||
'title' => $fd->title,
|
||||
'title_seo' => $fd->title_seo,
|
||||
'content' => $post['konu_cevap'],
|
||||
'user_id' => Session::select('userid'),
|
||||
'content_id' => $post['konu_id'],
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
|
||||
$konu_id = $post['konu_id'];
|
||||
$konu_url = 'forum/subject/'.$konu_id.'-'.seo(forum_title($konu_id));
|
||||
//$link = "forum/subject/".DB::insertID()."-".seo($post['title'])."'>".$post['title'];
|
||||
$message = "Mesajın geldiği yer: Forum\nGönderen: ".yazar(Session::select('userid'))."\nBaşlık: ".forum_title($konu_id)."\nLink:" .URL::base($konu_url) ;
|
||||
telegram($message);
|
||||
|
||||
|
||||
$notice = 'Yazdığınıza cevap verildi linki aşağıda.</br><a href="/forum/subject/'.$post['konu_id'].'-'.$post['title_seo'].'.html">'.$fd->title.'</a>';
|
||||
$notice1 = 'Forumdaki yazdığınıza konuya cevap verildi. <a href="'.URL::base().'forum/subject/'.$post['konu_id'].'-'.$post['title_seo'].'.html">'.URL::base().'forum/subject/'.$post['konu_id'].'-'.$post['title_seo'].'.html</a>';
|
||||
|
||||
Email::from('info@pisilinux.org', 'Pisi Linux Forum','info@pisilinux.org' )
|
||||
->receiver(userRow($userid)->mail)
|
||||
->subject('Pisi Linux Forum [ '.$fd->title.' ]')
|
||||
->message($notice1)
|
||||
->send();
|
||||
|
||||
DB::insert('messages',[
|
||||
'title' => 'Forumdan mesaj var ['.$fd->title.' ]',
|
||||
'userId' => $fd->user_id,
|
||||
'message' => $notice,
|
||||
|
||||
]);
|
||||
|
||||
|
||||
//redirect('forum/subject/'.$post['konu_id'].'-'.$post['title_seo'].'.html');
|
||||
}else{
|
||||
output(DB::error());
|
||||
}
|
||||
}
|
||||
|
||||
function edit($data){
|
||||
return DB::where('id',$data)->get('forum')->row();
|
||||
}
|
||||
|
||||
function update($post){
|
||||
DB::where('id',$post['content_id'])->update('forum',[
|
||||
'title' => $post['konubaslik'],
|
||||
'title_seo' => seo($post['konubaslik']),
|
||||
'content' => $post['konuicerik'],
|
||||
'user_id' => Session::select('userid'),
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
//redirect(baseUrl('forum/konu/'.$post['konuid'].'-'.seo($post['konubaslik'])));
|
||||
}
|
||||
}
|
||||
|
||||
function cat_update($post){
|
||||
DB::where('id',$post['id'])->update('forum_kat',[
|
||||
'adi' => $post['adi'],
|
||||
'adi_seo' => seo($post['adi']),
|
||||
'aciklama' => $post['aciklama'],
|
||||
'kat_ustid' => $post['kat_ustid']
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
redirect('forum/category_list');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>403 Erişim Engellendi</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<p>Dizin Erişimi Engellendi!</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
|
||||
class Main_model extends Model{
|
||||
|
||||
function iletisim_mail($post){
|
||||
|
||||
$mesaj = '
|
||||
Mesajı Gönderen: '.$post['name'].'<br>
|
||||
Mail Adresi: '.$post['email'].'<br>
|
||||
Mesaj: '.$post['message'];
|
||||
|
||||
|
||||
Email::sender('musteri_hizmetleri@kartalelektronik.com', 'Pisilinux')
|
||||
->receiver('info@kartalelektronik.com')
|
||||
->subject('İletişim Formundan Mesaj var')
|
||||
->message($mesaj)
|
||||
->send();
|
||||
|
||||
if (!Email::error()) {
|
||||
jalert('İletişime geçtiğiniz için teşekkürler, en kısa zamanda dönüş yapılacaktır.');
|
||||
|
||||
}else{
|
||||
echo Email::error();
|
||||
}
|
||||
|
||||
|
||||
redirect(baseUrl());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
|
||||
class Questionanswer_model extends Model{
|
||||
|
||||
function kategori($par = '0'){return DB::where('kat_ustid',$par)->get('forum_kat')->result();}
|
||||
|
||||
|
||||
function newsubject($post){
|
||||
$title = linkcleaner($post['title']);
|
||||
DB::insert('forum',[
|
||||
'category_id' => $post['category_id'],
|
||||
'title' => $title,
|
||||
'title_seo' => seo($title),
|
||||
'content' => $post['content'],
|
||||
'user_id' => Session::select('userid'),
|
||||
'content_id' => '0',
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
$konu_id = DB::insertID();
|
||||
$url = 'forum/konulist/'.$konu_id;
|
||||
$konu_url = 'forum/konu/'.isset($konu_id).'-'.seo($post['title']);
|
||||
$message = "Mesajın geldiği yer: Forum\nGönderen: ".yazar(Session::select('userid'))."\nBaşlık: ".$post['title']."\nMesaj: ".decode1($post['content'])."\nLink: https://pisilinux.org/forum/konu/".DB::insertID()."-".seo($post['title'])."'>".$post['title'];
|
||||
|
||||
telegram($message);
|
||||
redirect('forum');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function newsubject1($post){
|
||||
$title = linkcleaner($post['title']);
|
||||
DB::insert('forum',[
|
||||
'category_id' => $post['category_id'],
|
||||
'title' => $title,
|
||||
'title_seo' => seo($title),
|
||||
'content' => $post['content'],
|
||||
'user_id' => Session::select('userid'),
|
||||
'content_id' => '0',
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
$subject_id = DB::insertID();
|
||||
$url = 'question_answer/konulist/'.$subject_id;
|
||||
$subject_url = 'question_answer/subject/'.isset($subject_id).'-'.seo($post['title']);
|
||||
$message = "Mesajın geldiği yer: Forum\nGönderen: ".yazar(Session::select('userid'))."\nBaşlık: ".$post['title']."\nMesaj: ".decode1($post['content'])."\nLink: <a href='https://pisilinux.org/question_answer/".DB::insertID()."-".seo($post['title'])."'>".$post['title']."</a>";
|
||||
|
||||
//telegram($message);
|
||||
redirect($subject_url);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function forumkonu($post){
|
||||
$title_seo = explode('.',$post);
|
||||
return DB::where('id',$post)->get('forum')->row();
|
||||
}
|
||||
|
||||
function cevap($post){
|
||||
$fd = DB::where('id', $post['konu_id'])->get('forum')->row();
|
||||
|
||||
// $baslik = DB::select('title_seo')->where('title_seo',$post['konu_id'])->get('forum')->value();
|
||||
|
||||
DB::insert('forum',[
|
||||
'category_id' => $fd->category_id,
|
||||
'title' => $fd->title,
|
||||
'title_seo' => $fd->title_seo,
|
||||
'content' => $post['konu_cevap'],
|
||||
'user_id' => Session::select('userid'),
|
||||
'content_id' => $post['konu_id'],
|
||||
'view' => '0',
|
||||
'message' => '0'
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
|
||||
//redirect(baseUrl('forum/konu/'.$post['konu_id'].'-'.$post['title_seo'].'.html'));
|
||||
}else{
|
||||
output(DB::error());
|
||||
}
|
||||
}
|
||||
|
||||
function edit($data){
|
||||
return DB::where('id',$data)->get('forum')->row();
|
||||
}
|
||||
|
||||
|
||||
function update($post){
|
||||
|
||||
DB::where('id',$post['id'])->update('forum',[
|
||||
'title' => $post['title'],
|
||||
'title_seo' => seo($post['title']),
|
||||
'content' => $post['content'],
|
||||
|
||||
]);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
redirect($post['link']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
class Sss_model extends Model{
|
||||
|
||||
function listele(){
|
||||
return DB::get('sss')->result();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
/**
|
||||
* Created By : Erkan IŞIK
|
||||
* Created Date: 2017-09-27
|
||||
* Update Date : 2018-11-24
|
||||
*/
|
||||
class User_model extends Model{
|
||||
|
||||
function logincheck($data){
|
||||
$url = isset($_GET['return_url']) ? $_GET['return_url'] : null;
|
||||
|
||||
$user = DB::where('mail',$data['email'], 'and')
|
||||
->where('status','1')
|
||||
->get('user')
|
||||
->row();
|
||||
|
||||
if (!$user) {
|
||||
redirect(URL::base().'member');
|
||||
return;
|
||||
}
|
||||
|
||||
$valid = false;
|
||||
if (password_verify($data['pass'], $user->password)) {
|
||||
$valid = true;
|
||||
} elseif (md5($data['pass']) === $user->password) {
|
||||
$valid = true;
|
||||
$newHash = password_hash($data['pass'], PASSWORD_DEFAULT);
|
||||
DB::where('user_id', $user->user_id)->update('user',['password' => $newHash]);
|
||||
}
|
||||
|
||||
if ($valid) {
|
||||
DB::where('user_id', $user->user_id)->update('user',['login_date' => $data['currentDate']]);
|
||||
Session::insert('login','true');
|
||||
Session::insert('userid',$user->user_id);
|
||||
Session::insert('username',$user->username);
|
||||
Session::insert('avatar',$user->avatar);
|
||||
Session::insert('yetki',$user->authority);
|
||||
Cookie::time(60 * 60 * 24)->insert('username',$user->username);
|
||||
|
||||
if(isset($data['remember']) == '1'){
|
||||
Cookie::time(60 * 60 * 24)->insert('userlogin','true');
|
||||
Cookie::time(60 * 60 * 24)->insert('userid',$user->user_id);
|
||||
}
|
||||
|
||||
if ($url) {
|
||||
redirect(URL::base($url));
|
||||
}else{
|
||||
redirect(URL::base());
|
||||
}
|
||||
}else{redirect(URL::base().'member');}
|
||||
}
|
||||
|
||||
function emailcontrol($post){
|
||||
$mailCheck = DB::select('mail')->where('mail', $post['email1'])->userResult();
|
||||
if ($mailCheck) {
|
||||
echo '1';
|
||||
}
|
||||
}
|
||||
|
||||
function yeniuye($post){
|
||||
$password = password_hash($post['password'], PASSWORD_DEFAULT);
|
||||
$rnd = md5(date('Ymd His'));
|
||||
$username = mb_convert_case($post['username'], MB_CASE_TITLE, "UTF-8").' '.mb_convert_case($post['surname'], MB_CASE_TITLE, "UTF-8");
|
||||
|
||||
$new_user = DB::insert('user',[
|
||||
'username' => $username,
|
||||
'mail' => $post['email'],
|
||||
'password' => $password,
|
||||
'avatar' => '',
|
||||
'status' => '0',
|
||||
'authority' => '2',
|
||||
'aktivizasyon' => $rnd,
|
||||
'egitim' => $post['egitim'],
|
||||
'meslek' => $post['meslek'],
|
||||
'beceri' => $post['beceri'],
|
||||
'nickname' => ''
|
||||
]);
|
||||
|
||||
if ($new_user){
|
||||
echo '1';
|
||||
|
||||
$mesaj = emailActivationTemplate($username, $rnd);
|
||||
|
||||
Email::from('info@pisilinux.org', 'Pisi Linux','info@pisilinux.org')
|
||||
->receiver($post['email'])
|
||||
->subject('Üyelik onayı')
|
||||
->message($mesaj)
|
||||
->send();
|
||||
}
|
||||
}
|
||||
|
||||
function sifremiunuttum_model($post){
|
||||
$user = DB::where('mail',$post['email'])->get('user')->row();
|
||||
if (!$user) {
|
||||
echo "<script>
|
||||
swal({
|
||||
title: 'Hata!',
|
||||
text: 'Böyle Bir mail adresi kayıtlı değil...',
|
||||
icon: 'error',
|
||||
button: 'Tamam'
|
||||
}).then(function() {
|
||||
window.location.href = '/member/sifremiunuttum';
|
||||
});
|
||||
</script>";
|
||||
return;
|
||||
}
|
||||
|
||||
$rnd = md5(date('Ymd His'));
|
||||
DB::where('mail',$post['email'])->update('user',['aktivizasyon' => $rnd,'status' => '0']);
|
||||
|
||||
if (DB::affectedRows()) {
|
||||
$mesaj = emailPasswordResetTemplate($rnd);
|
||||
|
||||
if (DB::affectedRows()){
|
||||
Email::from('info@pisilinux.org', 'Pisi Linux','info@pisilinux.org')
|
||||
->receiver($post['email'])
|
||||
->subject('Yeni Şifre belirleme')
|
||||
->message($mesaj)
|
||||
->send();
|
||||
|
||||
echo "<script>
|
||||
swal({
|
||||
title: 'Başarılı!',
|
||||
text: 'Kurtarma maili Gönderildi. Yeni Şifre Belirleyebilmeniz için lütfen mail adresinizi kontrol edin...',
|
||||
icon: 'success',
|
||||
button: 'Tamam'
|
||||
}).then(function() {
|
||||
window.location.href = '/';
|
||||
});
|
||||
</script>";
|
||||
}
|
||||
}
|
||||
}//sifremiunuttum_model
|
||||
|
||||
function yenisifre($post){
|
||||
$password = password_hash($post['password'], PASSWORD_DEFAULT);
|
||||
DB::where('aktivizasyon',$post['act'])->update('user',['aktivizasyon' => '']);
|
||||
DB::where('user_id',$post['id'])->update('user',['password' => $password,'status' => '1']);
|
||||
jalert('Şifreniz Başarıyla Güncellendi. Üye giriş sayfasına yönlendiriliyorsunuz...');
|
||||
git('uye');
|
||||
}//yenisifre
|
||||
}//class sonu
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Created By : Erkan IŞIK
|
||||
* Created Date: 2018-11-05
|
||||
* Update Date : 2018-11-05
|
||||
*/
|
||||
|
||||
class Wiki_model extends Model{
|
||||
|
||||
function catlist(){
|
||||
return DB::where('kat_ustid',30)->get('wiki_kat')->result();
|
||||
}
|
||||
|
||||
function wikikat($kat_id){
|
||||
$id = explode('-', $kat_id);
|
||||
return DB::orderBy('id','desc')->where('katid',$id['0'],'and')->where('durum','1')->get('wiki')->result();
|
||||
}
|
||||
|
||||
function content($id){
|
||||
$p = explode('-', $id);
|
||||
$content = DB::where('id',$p[0])->get('wiki')->row();
|
||||
$say = $content->hits + 1;
|
||||
DB::where('id',$id)->update(
|
||||
'wiki',[
|
||||
'hits' => $say,
|
||||
]);
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user