Files
2026-07-01 16:44:17 +03:00

281 lines
7.1 KiB
PHP

<?php
function category(){
return DB::where('kat_ustid',0)->kategoriler()->result();
}
function content_category(){return DB::where('lang',LANG,'and')->where('parentId',0)->content_category()->result();}
function contentListAdmin($lang = 'tr'){
return DB::orderBy('id','desc')
->where('content_type','content','and')
->where('lang',$lang)
->get('content')
->result();
}
/* Functions Content */
function pageList($lang = 'tr'){
return DB::orderBy('title','asc')
->where('content_type','page','and')
->where('lang', $lang)
->get('content')->result();
}
function pageEdit($id){
return DB::where('id',$id)->get('content')->row();
}
function duyuru(){
return DB::where('status','1')->duyuruRow();
}
function duyuruRow($id){
return DB::Where('id',$id)->duyuruRow();
}
function etiketler(){
$par = DB::select('icerik_tag')->get('content')->result();
$a = '';$b='';
foreach ($par as $key ) {
$a .= $key->icerik_tag.',';
}
$new = explode(',',$a);
return array_unique($new);
}
/* End Functions Content */
function telegram1($messaggio) {
//echo "Mesaj Gönderiliyor.. -1001464176086\n";
$url = "https://api.telegram.org/bot889222363:AAF-kRBifC2lt9Yvv6mUqEuu1h0f7vIYhhA/sendMessage?forum_topic_created_name=-testkonu";
$url = $url . "&text=" . urlencode($messaggio);
$ch = curl_init();
$optArray = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true
);
curl_setopt_array($ch, $optArray);
$result = curl_exec($ch);
curl_close($ch);
}
function telegram($messaggio) {
echo "Mesaj Gönderiliyor.. -1001464176086\n";
$url = "https://api.telegram.org/bot889222363:AAF-kRBifC2lt9Yvv6mUqEuu1h0f7vIYhhA/sendMessage?chat_id=-1001464176086";
$url = $url . "&text=" . urlencode($messaggio);
$ch = curl_init();
$optArray = array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true
);
curl_setopt_array($ch, $optArray);
$result = curl_exec($ch);
curl_close($ch);
}
function translate($data){echo ML::select($data);}
function lang($langFile, $langParam){
return Lang::select($langFile, $langParam);
}
function loginControl($deg='Panel'){
if(!Session::select('login')){
redirect('home/login');
}
}
function reCaptcha($response){
$fileds = [
'secret' => "6Lc2qXwUAAAAAGfGK29-85EpV72saCoGwDUvwJv2",
'response' => $response
];
$ch = curl_init('https://www.google.com/recaptcha/api/siteverify');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($fileds),
CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($ch);
curl_close($ch);
return json_decode($result,true);
}
function member_role($id){
return DB::select('authority')->where('id',$id)->get('authority')->value();
}
function authority_list(){
return DB::get('authority')->result();
}
function category_name($id){
return DB::select('adi')->where('id',$id)->get('kategoriler')->value();
}
function galeryCategory(){
return DB::get('galeryCategory')->result();
}
function languageList(){
return DB::orderBy('sirala','asc')->language()->result();
}
function langList(){
return DB::orderBy('sirala','asc')->language()->result();
}
function langRow($id){
return DB::where('id',$id)->language()->row();
}
/* MENU FUNCTIONS */
function menuList($menuCatId=''){
return DB::where('menuCatId',$menuCatId)->menuResult();
}
function menuListAdmin($subMenuId ='0'){
return DB::where('subMenuId',$subMenuId)->menuResult();
}
function menuCatList(){
return DB::menucat()->result();
}
function menuCatName($id){
return DB::where('id',$id)->menucat()->value('name');
}
function menu($data){
$catid = DB::where('name', $data)->menucat()->value('id');
return DB::where('menuCatId', $catid, 'and')->where('lang', LANG)->menu()->result();
}
function menu1($menuCatId){
return DB::where('menuCatId', $menuCatId,'and')->where('lang',LANG)->menu()->result();
}
function menuRow($id){
return DB::where('id',$id)->menu()->row();
}
/* END MENU FUNCTIONS */
function userRow($id){
return DB::where('user_id',$id)->get('user')->row();
}
function activeUserCount(){
return DB::where('status','1')->get('user')->totalRows();
}
function disableMemberCount(){
return DB::where('status','2')->get('user')->totalRows();
}
function pendingMemberCount(){
return DB::where('status','0')->get('user')->totalRows();
}
function username($id){
return DB::select('username')->where('user_id',$id)->get('user')->value();
}
function userId($username){
return DB::select('user_id')->whereLike('username',$username)->get('user')->value();
}
function userStatus($id){
return DB::select('status')->where('user_id',$id)->get('user')->value();
}
function userList(){
return DB::orderBy('username','asc')->where('status',1)->get('user')->limit('10')->result();
}
function contentStatus($id){
return DB::select('status')->where('value',$id, 'and')->where('lang',LANG)->contentStatus()->value();
}
/* functions Meagges*/
function messsageCount($userid){
return DB::where('userId',$userid,'and')->where('status','0')->messages()->totalRows('TRUE');
}
function messageList($userid){
return DB::where('userId',$userid)->messages()->result();
}
function messageListAdmin(){
return DB::where('admin','1')->messages()->result();
}
function messageRow($id){
return DB::where('id',$id)->messages()->row();
}
function messageStatus($status){
if ($status == 1) {
echo '<i class="fa-solid fa-envelope-circle-check" title="'.lang('message','read').'"></i>';
}else{
echo '<i class="fa-solid fa-envelope" title="'.lang('message','unread').'"></i>';
}
}
/* End Functions Meagges*/
function curl($url, $post = NULL)
{
$http_header = array(
"Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4,id;q=0.2,ru;q=0.2,ar;q=0.2,fa;q=0.2",
"Cache-Control:max-age=0",
"Upgrade-Insecure-Requests:1",
);
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_FOLLOWLOCATION => TRUE,
CURLOPT_ENCODING => "",
CURLOPT_SSL_VERIFYPEER => FALSE,
CURLOPT_SSL_VERIFYHOST => FALSE,
CURLOPT_MAXREDIRS => 3,
CURLOPT_HTTPHEADER => $http_header,
));
if (isset($post)) {
curl_setopt_array($ch, array(
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $post,
CURLOPT_HTTPHEADER => array_merge($http_header, array(
"Expect: ",
)),
));
}
$content = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$http_url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);
curl_close($ch);
return (object)array(
"http_code" => $http_code,
"http_url" => $http_url,
"content" => $content,
);
}