'; $sehirler=array("Seçiniz","Adana","Adıyaman","Afyon","Ağrı","Amasya","Ankara","Antalya","Artvin","Aydın","Balıkesir","Bilecik","Bingöl","Bitlis","Bolu","Burdur","Bursa","Çanakkale","Çankırı","Çorum","Denizli","Diyarbakır","Edirne","Elazığ","Erzincan","Erzurum","Eskişehir","Gaziantep","Giresun","Gümüşhane","Hakkari","Hatay","Isparta","İçel","İstanbul","İzmir","Kars","Kastamonu","Kayseri","Kırklareli","Kırşehir","Kocaeli","Konya","Kütahya","Malatya","Manisa","K.Maraş","Mardin","Muğla","Muş","Nevşehir","Niğde","Ordu","Rize","Sakarya","Samsun","Siirt","Sinop","Sivas","Tekirdağ","Tokat","Trabzon","Tunceli","Şanlıurfa","Uşak","Van","Yozgat","Zonguldak","Aksaray","Bayburt","Karaman","Kırıkkale","Batman","Şırnak","Bartın","Ardahan","Iğdır","Yalova","Karabük","Kilis","Osmaniye","Düzce"); $kabuledilenuzantilar=array("jpg","jpeg","png","gif"); $kabuledilenuzantilarDepo=array("jpg","JPG","jpeg","png","gif","swf","zip","rar","doc","docx","ppt","pptx","xls","xlsx","pdf","flv","mp4"); $uyeliktipleri=array("-1"=>"Durdurulmuş",0=>"Email adresi doğrulanmamış",1=>"Aktif üye",2=>"Özel üye"); $languages=array('tr'=>'Türkçe','en'=>'English'); $lang="tr"; if($_COOKIE['lang']!="") { $clang=htmlspecialchars(substr($_COOKIE['lang'],0,2),ENT_QUOTES); if(array_key_exists($clang,$languages)) $lang=$clang; } //Ayarları alalım... $sorgu=mysql_query("SELECT * FROM config"); $satir=mysql_num_rows($sorgu); for($i=0;$i < $satir;$i++) { $cnfg_name=mysql_result($sorgu,$i,'cnfg_name'); $cnfg_value=mysql_result($sorgu,$i,'cnfg_value'); if(!isset($config[$cnfg_name])) $config[$cnfg_name]=$cnfg_value; } mysql_free_result($sorgu); //Bazı diğer ayarlar. //$incDir=$config['tema']; if($incDir=="") $incDir="default"; //template ayarı //modülleri alalım $ustmoduller=mysql_query("select id,xml_data,align from ".($lang=="tr"?"module":"module2")." where active='1' order by list asc"); while ($ustmoduloku=mysql_fetch_array($ustmoduller)) $moduller[$ustmoduloku['id']]=array($ustmoduloku['xml_data'],$ustmoduloku['align']); mysql_free_result($ustmoduller); $unvanlar['tr']=array(0=>'Prof. Dr','Doç. Dr.','Dr. Öğr. Üyesi.','Öğr. Gör. Dr.','Öğr. Gör.','Arş. Gör. Dr.', 'Arş. Gör.','Uzman'); $unvanlar['en']=array(0=>'Professor','Associace Professor','Assistant Professor','Instructor (Ph.D.)','Intructor','Research Assist.(Ph.D.)','Research Assist.','Teaching Assist.'); $anabilimdallari['tr']=array('Enerji Ana Bilim Dalı','Mekanik Ana Bilim Dalı','Makina Teorisi ve Dinamiği Ana Bilim Dalı','İmalat ve Konstrüksiyon Ana Bilim Dalı','Termodinamik Ana Bilim Dalı'); $anabilimdallari['en']=array('Energy','Mechanics','Theory and Dynamics of Machinery','Manufacturing and Construction','Thermodynamics'); ?>0) { $start.=" width=$maxen"; //if($uzanti=="swf" and $maxboy==0) $start.=" height=$maxen"; } if($maxboy>0) $start.=" height=$maxboy"; $start.=">"; return $start; } if($maxen<>0 and $width>$maxen) {$height=$height*($maxen/$width);$width=$maxen; } if($maxboy<>0 and $height>$maxboy) {$width=$width*($maxboy/$height);$height=$maxboy; } if ($uzanti=="swf") return ""; else return ""; } function yonlendir($url,$alert='') { if(strlen($alert)>0) echo ""; echo ""; exit(); } function UyeGirisiGerekmekte($mesaj) { global $username; return ''.$mesaj.'

Eposta adresiniz
Şifreniz
Yeni üyelik için tıklayınız.
'; } function makeinput($width,$name,$value,$type,$title="",$readonly="") { global $incDir; return "
"; } function makebutton($name,$value) { return ""; } function sayfala($query,$template,$hersayfayakayit='10',$sayfa='0') { $yedek=$template; $satirsayisi=mysql_num_rows(mysql_query($query)); $sayfasayisi=ceil($satirsayisi/$hersayfayakayit); if($sayfasayisi>1) { for ($i=0;$i<$sayfasayisi;$i++) { $template=str_replace("{sayfa}",$i,$template); if($i==$sayfa) $template=str_replace("{gorunen}","[".($i+1)."]",$template); else $template=str_replace("{gorunen}",$i+1,$template); $return.=$template; $template=$yedek; } return "
Sayfalar:  ".$return; } } function ctgryDelete($uid,$table="ctgry") { $bilgi=unserialize(teksatir("select other from $table where id=$uid",true)); if(is_array($bilgi) and in_array("sabit",$bilgi)) return false; mysql_query("delete from $table where id='$uid'"); mysql_query("update images set ctgry_id='0' where ctgry_id='ic$uid'"); $sorgu = mysql_query("select id from $table where uid='$uid'"); while(list($id)=mysql_fetch_array($sorgu))ctgryDelete($id); } function ctgrySelectBox($uid='-1',$select='',$prfix = '',$prfix2 = '|_____',$tablo="ctgry") { global $config,$lang; $str=''; $sorgu = mysql_query("select name,id from $tablo where uid='$uid' and lang='$lang' order by name"); $satir = mysql_num_rows($sorgu); $i=1; while(list($name,$id)=mysql_fetch_array($sorgu)) { $str .= (preg_match( "/:".$id."-/i", $select)) ? '' : ''; if($i<$satir)$yprfix = '|  '; else $yprfix = ' '; $str .= ctgrySelectBox($id,$select,$prfix.$yprfix.'  ','|___',$tablo); $i++; } return $str; } function ctgrySelectBox2($uid='-1',$select='',$prfix = '',$prfix2 = '|___') { global $config; $str=''; $sorgu = mysql_query("select name,id from ctgry where uid='$uid' order by list"); $satir = mysql_num_rows($sorgu); $i=1; while(list($name,$id)=mysql_fetch_array($sorgu)) { if($id==$select) $str .= ''.$prfix.$prfix2." ".$name.'
'; else $str .= ''.$prfix.$prfix2." ".$name.'
'; if($i<$satir)$yprfix = ""; else $yprfix = ""; $str .= ctgrySelectBox2($id,$select,$prfix.$yprfix."",""); $i++; } return $str; } function getCtgryTree($tid,$tpl='{name} » ',$tpl2='{name}',$str="",$table="ctgry") { global $db; $sorgu=mysql_query("select uid,name from $table where id='$tid'"); $satir=mysql_num_rows($sorgu); if($satir==1) { $uid=mysql_result($sorgu,0,'uid'); $name=mysql_result($sorgu,0,'name'); if(isNull($str))$str = str_replace('{name}',$name,$tpl2); else { $t = str_replace('{tid}',$tid,$tpl); $t = str_replace('{name}',$name,$t); $str = $t.$str; } $str = getCtgryTree($uid,$tpl,$tpl2,$str); } mysql_free_result($sorgu); return $str; } function logTut($user,$url='',$post='') { if(!is_dir('logs')) mkdir('logs','0755'); if($post=="Array\n(\n)\n") $post=""; $post=str_replace("\n"," ",$post); $userIP=$_SERVER['REMOTE_ADDR']; $dosya=date("d-m-Y")."-log.txt"; $an=date("d-m-Y H:i"); if(!file_exists("logs/".$dosya)) touch("logs/".$dosya); $fp = fopen("logs/".$dosya, 'a'); fwrite($fp,"$an \t$userIP \t $user \t $url \t$post\r\n"); fclose($fp); mysql_query("INSERT INTO linkler VALUES(null,'$an','$user','$url','$post','$userIP')"); } function md666($gelen) { $gelen=md5($gelen); $ilk8=substr($gelen,0,8); $son8=substr($gelen,23,8); return md5(substr($gelen,7,16).$son8.$ilk8); } function ModuleCoz($data,$margin=false,$include=false,$key='') { global $son3gun,$lang; global $son5gun; global $son7gun; global $intTime; global $config; global $caching; global $userIP,$userid,$username,$isLogin,$incDir; if($include==true) { if(file_exists("aw/$incDir/modules/{$data}.php")) include("aw/$incDir/modules/{$data}.php"); else if(file_exists("aw/default/modules/{$data}.php")) include("aw/default/modules/{$data}.php"); else echo "Modül dosyası kayıp.
"; } else { if($margin) $marginText=" style='margin-bottom:10px;' "; $data=parseXML($data); $dataType=(string)$data->type; $htmlcode=utf_to_iso(stripslashes((string)$data->html)); if($dataType=="htmlkod") $veri=$htmlcode; else if($dataType=="bnr") { $filename="img/".(string)$data->src; $link=(string)$data->link; $target=(string)$data->target=='1'?"":"target=_blank"; $uzanti=uzanti_al($filename); list($en,$boy)=getimagesize($filename); if($uzanti=="swf") { $veri= ""; } else { $veri=""; } } else if($dataType=="resimlikategori") { $type=(string)$data->resim; $kategori=(string)$data->kategori; $haberID=(string)$data->haberID; if(!$caching) include("resimli.php"); else if(file_exists("html/resimli_${key}.php")) include("html/resimli_${key}.php"); else { ob_start(); include("resimli.php"); $content=ob_get_contents(); ob_end_clean(); touch("html/resimli_${key}.php"); file_put_contents("html/resimli_${key}.php",$content); echo $content; } } echo "$veri\n"; } } function hatali_giris() { echo "Hatalı giriş"; exit(); } function utf_to_iso($data) { return iconv("utf-8","iso-8859-9",$data); } function haberURL2($id,$sbjct) { return strToLink($sbjct)."_haber$id.html"; } function buyuk_harf($metin) { $kucuk=array('ç','ı','ğ','ö','ü','ş','ğ','i'); $buyuk=array('Ç','I','Ğ','Ö','Ü','Ş','Ğ','İ'); $metin=str_replace($kucuk,$buyuk,$metin); $metin=strtoupper($metin); return $metin; } function TrZaman($zaman) { if(!is_numeric($zaman)) return ""; global $lang; if($lang!="tr") return date("d F Y l H:i",$zaman); $gunler=array('Mon'=>'Pazartesi','Tue'=>'Salı','Wed'=>'Çarşamba','Thu'=>'Perşembe','Fri'=>'Cuma','Sat'=>'Cumartesi','Sun'=>'Pazar'); $aylar=array('Ocak','Şubat','Mart','Nisan','Mayıs','Haziran','Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'); $gun=date("d",$zaman); $ay=$aylar[date("n",$zaman)-1]; $yil=date("Y",$zaman); $haftagunu=$gunler[date("D",$zaman)]; $saat=date("H",$zaman); $dakika=date("i",$zaman); return "$gun $ay $yil $haftagunu $saat:$dakika"; } function GetMeta($title) { global $siteAdresi; global $doctype; global $config,$incDir; $rand=1; $title.=" | $config[title]"; if(file_exists('favicon.ico')) $favicon=' '; echo $doctype.' '.$title.' '.$favicon.' '; } function selectSec($aranan,$mevcut) { if($aranan==$mevcut) return "selected"; } function TEXT($gelen) { $gelen=trim($gelen); $gelen=htmlspecialchars($gelen,ENT_QUOTES); $gelen=eregi_replace("SELECT","SELECT",$gelen); $gelen=eregi_replace("INSERT","INSERT",$gelen); $gelen=eregi_replace("UPDATE","UPDATE",$gelen); $gelen=eregi_replace("DELETE","DELETE",$gelen); $gelen=eregi_replace("UNION","UNION",$gelen); $gelen=eregi_replace("union","UNION",$gelen); return $gelen; } function TEXT_admin($gelen) { $gelen=trim($gelen); $gelen=eregi_replace("SELECT","SELECT",$gelen); $gelen=eregi_replace("INSERT","INSERT",$gelen); $gelen=eregi_replace("UPDATE","UPDATE",$gelen); $gelen=eregi_replace("DELETE","DELETE",$gelen); $gelen=eregi_replace("UNION","UNION",$gelen); $gelen=eregi_replace("union","UNION",$gelen); return addslashes($gelen); } function cek($nereden) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_URL,"$nereden"); curl_setopt($ch, CURLOPT_NOBODY,0); curl_setopt($ch, CURLOPT_TIMEOUT,2); $sonuc = curl_exec ($ch); curl_close ($ch); return $sonuc; } function coksatir($query,$template="",$returnArray=false) { global $baglanti; $yedek=$template; $sorgu=mysql_query($query); if($returnArray==true) { while ($oku=mysql_fetch_array($sorgu)) { foreach ($oku as $key=>$value) { $dataItem[$key]=$value; } $dataArray[]=$dataItem; } return $dataArray; } while ($oku=mysql_fetch_array($sorgu,1)) { foreach ($oku as $key=>$value) { $template=str_replace('{'.$key.'}',$value,$template); $template=str_replace('['.$key.']',strToLink($value),$template); $template=str_replace('{B'.$key.'}',buyuk_harf($value),$template); $template=str_replace('{clr_text'.$key.'}',clr_text($value),$template); $template=str_replace('{TR'.$key.'}',TrZaman($value),$template); } $sonuc.=$template; $template=$yedek; } mysql_free_result($sorgu); return stripslashes($sonuc); } function teksatir($query,$ilkalan=false) { //echo $query; $sorgu=mysql_query($query) or dir(mysql_error()); $deger=mysql_fetch_array($sorgu); $kayitsayisi=mysql_num_rows($sorgu); mysql_free_result($sorgu); if($kayitsayisi>0) { return $ilkalan?$deger[0]:$deger; } else return false; } function kisalt($metin,$max,$sonra='') { $metin=stripslashes($metin); if(strlen($metin)>$max) return substr($metin,0,$max).$sonra; else return $metin; } function golge($metin,$padding=0) { $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.="\n"; $veri.=""; $veri.="
$metin
"; return $veri; } function mail_gonder($to,$subject,$text,$replyto="makinabb@selcuk.edu.tr") { if($_SERVER['HTTP_HOST']=="localhost") return false; global $config; global $lang; global $siteTitle; global $siteAdresi; include_once('aw/class.phpmailer.php'); $mail=new PHPMailer(); $mail->IsSMTP(); $linkSite="$siteAdresi"; $text.="

Bu mail ".$linkSite." sitesinden gelmiştir."; $text.="
This mail recieved from ".$linkSite."
"; //$mail->SMTPSecure="ssl"; $mail->SMTPAuth=true; $mail->Host="ssl://smtp.gmail.com:465"; //$mail->Port=465; $mail->Username="selcukmakina2012@gmail.com"; $mail->Password="makina448"; $mail->From="selcukmakina2012@gmail.com"; $mail->FromName=$config["titletr"]; $mail->CharSet="iso-8859-9"; $mail->AddAddress($to); // $mail->AddAddress("selcukmakina2012@gmail.com"); $mail->AddReplyTo($replyto,$replyto); $mail->Subject=$subject; $mail->IsHTML(true); $mail->Body=nl2br($text); //$mail->Body=$mail->EncodeString(nl2br($text),"base64"); if($mail->Send()) return true; else { echo $mail->ErrorInfo; } } function mail_gonder2($kime,$konu,$metin,$gonderen='0') { global $config; if($gonderen=='0') $gonderen=$config['email']; date_default_timezone_set(date_default_timezone_get()); include_once('aw/class.phpmailer.php'); $mail = new PHPMailer(); $metin=nl2br($metin); $body = $metin; $body.="

Bu mail ".$_SERVER['HTTP_HOST']." sitesinden gelmiştir."; $mail->IsSMTP(); $mail->Host = "193.255.248.114"; $mail->From = $gonderen; $mail->FromName = $config['title']; $mail->CharSet='iso-8859-9'; $mail->AltBody = "..."; // optional, comment out and test $mail->Subject = $konu; $mail->MsgHTML($body); $mail->AddAddress($kime,"Kullanıcı"); //$mail->AddAttachment("img/".$config['logo']); //$mail->AddAttachment("../img/".$config['logo']); if($mail->Send()){echo"sent";} else echo $ErrorInfo."
".$mail->ErrorInfo; } function htmlSil() { global $caching; if($caching) { $gelenler=func_get_args(); foreach ($gelenler as $file) { if(file_exists("html/${file}.php")) unlink("html/${file}.php"); if(file_exists("../html/${file}.php")) unlink("../html/${file}.php"); } } } function htmlSilTumu($icersin="") { global $caching; if($caching) { $files=opendir('../html'); while ($file=readdir($files)) { //echo $file."
"; if($icersin!="") { if(eregi($icersin,$file)) unlink("../html/$file"); } else if(strlen($file)>2) unlink("../html/$file"); } } } function make_clickable($text) { $ret = eregi_replace( "([[:alnum:]]+)://([^[:space:])>]*)([[:alnum:]#?/&=])", "\\1://\\2\\3", $text); $ret = eregi_replace( "(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "\\1", $ret); return $ret; } function uzanti_al($dosya) { $dizi=explode(".",$dosya); $son=count($dizi)-1; $uzanti=$dizi[$son]; return $uzanti; } //eskiler function img_box($sname,$svalue) { global $db; $img_name = @mysql_result(mysql_query("select * from images where id='".$svalue."'"),0,'name'); $html = '
Temizle
'; echo $html; } function opf($openpage)//include komutu için dosya yolu ve uzantisi belirler { global $config; $page=$config['inc_dir'].$openpage.$config['file_exten']; if(!file_exists($page))$page=$config['inc_dir']."404".$config['file_exten']; return $page; } function rand_sid($k)//rasgele karakter dizisi üretir { $confirm_chars = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9','a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'); $max_chars = count($confirm_chars) - 1; $code = ''; for ($i = 0; $i < $k; $i++)$code .= $confirm_chars[mt_rand(0, $max_chars)]; return $code; } function clr_username($value) { global $searchf,$replacef; $value=preg_replace($searchf, $replacef,$value); $value=trim($value); return $value; } function clr_text($value) { global $searchf,$replacef; $value=preg_replace($searchf, $replacef,$value); $value=trim($value); return $value; } function grt_sid($table_name,$where) { global $db; do { $value=md5(rand_sid(20)); $sql="SELECT * FROM ".$table_name." WHERE ".$where."='$value'"; $sorgu=mysql_query($sql,$db); } while (mysql_num_rows($sorgu)!=0); return $value; } function grt_sid_x_bit($table_name,$where,$x) { global $db; do { $value=rand_sid($x); $sql="SELECT * FROM ".$table_name." WHERE ".$where."='$value'"; $sorgu=mysql_query($sql,$db); } while (mysql_num_rows($sorgu)!=0); return $value; } function go_url($url) { ?> ';break;} } return $img; } function strtomyupper($value) { $srch_reg = array ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','ı','ö','ü','ş','ğ','ç'); $srch_reg2 = array ('A','B','C','D','E','F','G','H','İ','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','I','Ö','Ü','Ş','Ğ','Ç'); return str_replace($srch_reg, $srch_reg2,$value); } function get_time($x,$t="") { $time = (isNull($t)) ? time() : $t; $ayin_gunleri = array(31,28,31,30,31,30,31,31,30,31,30,31); $saat=strftime ("%H",$time); $gun=strftime("%d",$time); $ay=strftime ("%m",$time); $yil=strftime ("%Y",$time); if((($yil%4) == 0 && ($yil%100) !=0) || ($yil%400) == 0)$ayin_gunleri[1] = 29; if($x<$gun)$gun=$gun - $x; else { if($ay==1){$ay=12;$yil--;} else $ay--; $gun=$ayin_gunleri[$ay-1] + $gun - $x; } return mktime ($saat,0,0, $ay, $gun, $yil); } function printFile($path) { global $config; list($width, $height, $type) = @getimagesize($path); $path=$config['aw_path'].$path; echo' '; } function parseXML($response_string) { $pos=strpos($response_string, 'encoding'); if($pos===false)$response_string="\n".$response_string; $xml = new SimpleXMLElement($response_string); if (is_a($xml, 'SimpleXMLElement'))return $xml; } function parseXML2($response_string) { $xml = new SimpleXMLElement($response_string); if (is_a($xml, 'SimpleXMLElement'))return $xml; } function getUrl($link) { $html=''; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $link); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_REFERER, $link); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, "60"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"); $html = curl_exec($ch); curl_close($ch); return $html; } function isNull($value) { $value=preg_replace('/\s\s+/', ' ',$value); if($value == NULL || $value == "" || $value == '' || $value == ' ' || $value == 'null' || $value == 'NULL')return true; else return false; } function strToLink($value) { $value=trim($value); $srch_reg = array ('ı','ö','ü','ş','ğ','ç','İ','Ö','Ü','Ş','Ğ','Ç',' '); $srch_reg2 = array ('i','o','u','s','g','c','I','O','U','S','G','C','_'); $value = str_replace($srch_reg, $srch_reg2,$value); $value=eregi_replace("[^a-zA-Z0-9_-]", "",$value); return $value; } function resizeIMG($img,$maxWidth=0,$maxHeight=0) { list($width, $height, $type) = @getimagesize($img); if($maxWidth>0) { if($width > $maxWidth) { $yuzde = ($width - $maxWidth)/$width; $height = intval($height - $height*$yuzde); $width=$maxWidth; } } if($maxHeight>0) { if($height > $maxHeight) { $yuzde = ($height - $maxHeight)/$height; $width=intval($width - $width*$yuzde); $height=$maxHeight; } } $n = array('width'=>$width,'height'=>$height,'type'=>$type); return $n; } function resizeText($text,$len=110,$ex='') { $rText=''; $t = explode(" ",$text); for($i=0;$i]*?>.*?@si', // Strip out javascript '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags '@([\r\n])[\s]+@', // Strip out white space '@&(quot|#34);@i', // Replace HTML entities '@&(amp|#38);@i', '@&(lt|#60);@i', '@&(gt|#62);@i', '@&(nbsp|#160);@i', '@&(iexcl|#161);@i', '@&(cent|#162);@i', '@&(pound|#163);@i', '@&(copy|#169);@i', '@&#(\d+);@e', '/\s\s+/'); // evaluate as php $replacef = array ('','','','','','','','','','','','','',' '); function timepicker($intTime="") { if($intTime=="") $intTime=time(); $data.='
/ /   :
'; return $data; } ?>