=1)
{
$kes = strpos($oku, '=');
if(trim(substr($oku,0,$kes))=="baslik")
eval("$".trim(substr($oku,0,$kes)) . "[]=\"" . trim(substr($oku, $kes+1)) . "\";");
elseif(trim(substr($oku,0,$kes))=="dosya")
eval("$".trim(substr($oku,0,$kes)) . "[]=\"" . trim(substr($oku, $kes+1)) . "\";");
else
eval("$".trim(substr($oku,0,$kes)) . "=\"" . trim(substr($oku, $kes+1)) . "\";");
}
}
if(empty($isim)) $isim = "Personel Web Sitesi";
/*
* $isim : Recep Kocur
* $fotograf : images/recep.jpg
* $anasayfa : anasayfa.html
* $baslik[] : Ana Sayfa, Eğitim, ...
* $dosya[] : anasayfa.html, egitim.html, ...
*/
//////////////////////////////////////////////////////
// Ara dizin bulunuyor Örn : /tr/ ///////////////////
$uri_onek = "http://" . $_SERVER['HTTP_HOST'];
$ara_dizin = preg_replace("/(.*\/)(.*)/","\\1",$_SERVER['PHP_SELF']);
$dizinler = preg_replace("/https?:\/\/[^\/]+(.*\/).*/i","$1", $uri_onek.$ara_dizin.$_SERVER['QUERY_STRING']);
$bos = preg_split('/\//', strrev($ara_dizin), 3);
$ara_dilsiz = strrev($bos[2]);
//////////////////////////////////////////////////////
// Mevcut Sayfa //////////////////////////////////////
$iceri_adi = $_SERVER['QUERY_STRING'];
//////////////////////////////////////////////////////
// Değerinin boş ise Ana Sayfa'ya yönlendirilir... ///
if (empty($iceri_adi))
{
if(is_file($anasayfa)) {
header("location: ./?" . $anasayfa);
}
else { // bulamazsa 404
$sayfa = "
\n 404\n404
\nSayfa bulunamadı.
\n\n";
}
}
//////////////////////////////////////////////////////
// Boş değilse dosya oku /////////////////////////////
else
{
if(is_file($iceri_adi)) {
$sayfa = file_get_contents($uri_onek . $ara_dizin . $iceri_adi);
}
else { // bulamazsa 404
$sayfa = "\n 404\n404
\nSayfa bulunamadı.
\n\n";
}
}
//////////////////////////////////////////////////////
// Sayfanın İngilizce sürümü varsa bu sürüm adresi sayfa _eng değişkenine atar
if (is_file("../eng/" . $iceri_adi)) {
$sayfa_eng = $uri_onek.$ara_dilsiz.'/eng/'."?".$iceri_adi;
} else {
$sayfa_eng = "";
}
// Sayfanın Türkçe sürümü varsa bu sürüm adresini sayfa _tr değişkenine atar
if (is_file("../tr/" . $_SERVER['QUERY_STRING'])) {
$sayfa_tr = $uri_onek.$ara_dilsiz.'/tr/'."?".$iceri_adi;
} else {
$sayfa_tr = "";
}
//////////////////////////////////////////////////////
// HEAD için /////////////////////////////////////////
preg_match("/]*>(.*)<\/head[^>]*/is", $sayfa, $bul);
$iceri_head = $bul[1];
/* Yarı görece için */
$iceri_head = preg_replace("/(href=|src=|url=?[\(])([\"']?)(?!http)(?!@@)(?![#\/])([^\"'\(\):]+)([\"'\) ]+)/","$1$2".$dizinler."$3$4", $iceri_head);
//////////////////////////////////////////////////////
// BODY için /////////////////////////////////////////
preg_match("/]*>(.*)<\/body[^>]*/is", $sayfa, $bul);
$iceri_body = $bul[1];
/* Yarı görece için */
$iceri_body = preg_replace("/(href=|src=|url=?[\(])([\"']?)(?!http)(?!@@)(?![#\/])([^\"'\(\):]+)([\"'\) ]+)/","$1$2".$dizinler."$3$4", $iceri_body);
//////////////////////////////////////////////////////
// Menüler için /////////////////////////////////////////
for($i=0; $i" . $baslik[$i] . " ";
}
/* Kapalı */
else {
$iceri_menu.= "" . $baslik[$i] . " ";
}
}
//////////////////////////////////////////////////////
// Fotoğraf için /////////////////////////////////////
if(is_file($fotograf) || strstr($fotograf, "http")) {
$iceri_foto = "";
}
else $iceri_foto = "";
//////////////////////////////////////////////////////
// Kullanıcı Adı /////////////////////////////////////
preg_match("/[^\/~]+/", $_SERVER['PHP_SELF'], $matches);
$kullanici = $matches[0];
//////////////////////////////////////////////////////
// XML Fonksiyonu ////////////////////////////////////
function xml2array($text)
{
$text = preg_replace("/\]\]>/", "", preg_replace("/]*>(.*?)<\/\\1>/s';
preg_match_all($reg_exp, $text, $match); $say = 0;
foreach ($match[1] as $key=>$val)
{
if ( preg_match($reg_exp, $match[2][$key]) ) {
$array[$val][$say] = xml2array($match[2][$key]); $say++;
}
else {
$array[$val] = $match[2][$key];
}
}
return $array;
}
//////////////////////////////////////////////////////
// XML Bilgilerini Çek ///////////////////////////////
if(strstr($iceri_body, "@@")) {
//$kullanici = "muftuler";
$url = "http://www.sabanciuniv.edu/rehber/rv2_people_xml.php?UserID=" . $kullanici . "&dil=tr";
$icerik = xml2array(file_get_contents($url));
$coursesurl = "http://www.sabanciuniv.edu/rehber/instructor_courses_xml.php?instructor_username=" . $kullanici;
$coursesarr = xml2array(file_get_contents($coursesurl));
// özgeçmiş bilgisi array'e atılıyor
$courses = "Sunulan Dersler
";
$cv = "Özgeçmiş
";
if ($icerik["KAYIT"][0]["EGITIM"] != "") $cv .= "Eğitim
" . nl2br($icerik["KAYIT"][0]["EGITIM"]) . "";
if ($icerik["KAYIT"][0]["KURUMLAR"] != "") $cv .= "Çalıştığı Kurumlar
" . nl2br($icerik["KAYIT"][0]["KURUMLAR"]) . "";
if ($icerik["KAYIT"][0]["ODULLER"] != "") $cv .= "Ödüller
" . nl2br($icerik["KAYIT"][0]["ODULLER"]) . "";
if ($icerik["KAYIT"][0]["UYELIKLER"] != "") $cv .= "Üyelikler
" . nl2br($icerik["KAYIT"][0]["UYELIKLER"]) . "";
if ($icerik["KAYIT"][0]["ARASTIRMA"] != "") $cv .= "Araştırma
" . nl2br($icerik["KAYIT"][0]["ARASTIRMA"]) . "";
if ($icerik["KAYIT"][0]["YAYINLAR"] != "") $cv .= "Yayınlar
" . nl2br($icerik["KAYIT"][0]["YAYINLAR"]) . "";
if ($icerik["KAYIT"][0]["YONOZGECMIS"] != "") $cv .= "Yönetici Özgeçmişi
" . nl2br($icerik["KAYIT"][0]["YONOZGECMIS"]) . "";
// dersler array'e atılıyor
$courses .= "";
for ($iii=0; $iii < count($coursesarr["courses"][0]["course"]); $iii++)
{
// Döngü içinde ===> Bu bölümde derslerin web sitesinin olup olmadığı kontrol ediliyor
$web = "";
if (is_file("/home/$kullanici/public_html/courses/" . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".html")) {
$web = "http://people.sabanciuniv.edu/~" . $kullanici . "/courses/" . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".html";
}
else if (is_file("/home/$kullanici/public_html/courses/" . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".htm")) {
$web = "http://people.sabanciuniv.edu/~" . $kullanici . "/courses/" . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtolower(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".htm";
}
else if (is_file("/home/$kullanici/public_html/courses/" . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".html")) {
$web = "http://people.sabanciuniv.edu/~" . $kullanici . "/courses/" . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".html";
}
else if (is_file("/home/$kullanici/public_html/courses/" . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".htm")) {
$web = "http://people.sabanciuniv.edu/~" . $kullanici . "/courses/" . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_subject"])) . strtoupper(trim($coursesarr["courses"][0]["course"][$iii]["course_number"])) . ".htm";
}
$courses .= "";
$courses .= "" . $coursesarr["courses"][0]["course"][$iii]["course_subject"] . "";
$courses .= " " . $coursesarr["courses"][0]["course"][$iii]["course_number"] . "";
$courses .= " - " . $coursesarr["courses"][0]["course"][$iii]["course_title"];
$web = trim($coursesarr["courses"][0]["course"][$iii]["course_webaddress"]);
if ($web!="") {
$courses .= " ";
}
$courses .= " |
";
}
$courses .= "
";
// Etiketler verilerle değiştiriliyor
$iceri_body = preg_replace("/@@ISIM@@/",$icerik["KAYIT"][0]["ISIM"], $iceri_body);
$iceri_body = preg_replace("/@@EPOSTA@@/",$icerik["KAYIT"][0]["EPOSTA"],$iceri_body);
$iceri_body = preg_replace("/@@ISBASTARIH@@/",$icerik["KAYIT"][0]["ISBASTARIH"],$iceri_body);
$iceri_body = preg_replace("/@@DOGTARIH@@/",$icerik["KAYIT"][0]["DOGTARIH"],$iceri_body);
$iceri_body = preg_replace("/@@BIRIM@@/",$icerik["KAYIT"][0]["BIRIM"],$iceri_body);
$iceri_body = preg_replace("/@@WEB@@/",$icerik["KAYIT"][0]["WEB"],$iceri_body);
$iceri_body = preg_replace("/@@BINA@@/",$icerik["KAYIT"][0]["BINA"],$iceri_body);
$iceri_body = preg_replace("/@@ODA@@/",$icerik["KAYIT"][0]["ODA"],$iceri_body);
$iceri_body = preg_replace("/@@SICIL@@/",$icerik["KAYIT"][0]["SICIL"],$iceri_body);
$iceri_body = preg_replace("/@@GOREVTURU@@/",$icerik["KAYIT"][0]["GOREVTURU"],$iceri_body);
$iceri_body = preg_replace("/@@GOREVLERI@@/",$icerik["KAYIT"][0]["GOREVLERI"],$iceri_body);
$iceri_body = preg_replace("/@@EGITIM@@/",nl2br($icerik["KAYIT"][0]["EGITIM"]),$iceri_body);
$iceri_body = preg_replace("/@@KURUMLAR@@/",nl2br($icerik["KAYIT"][0]["KURUMLAR"]),$iceri_body);
$iceri_body = preg_replace("/@@ODULLER@@/",nl2br($icerik["KAYIT"][0]["ODULLER"]),$iceri_body);
$iceri_body = preg_replace("/@@UYELIKLER@@/",nl2br($icerik["KAYIT"][0]["UYELIKLER"]),$iceri_body);
$iceri_body = preg_replace("/@@ARASTIRMA@@/",nl2br($icerik["KAYIT"][0]["ARASTIRMA"]),$iceri_body);
$iceri_body = preg_replace("/@@YAYINLAR@@/",nl2br($icerik["KAYIT"][0]["YAYINLAR"]),$iceri_body);
$iceri_body = preg_replace("/@@YONOZGECMIS@@/",nl2br($icerik["KAYIT"][0]["YONOZGECMIS"]),$iceri_body);
$iceri_body = preg_replace("/@@TELEFON@@/",$icerik["KAYIT"][0]["TELEFON"],$iceri_body);
$iceri_body = preg_replace("/@@DISGOREVTANIM@@/",$icerik["KAYIT"][0]["DISGOREVTANIM"],$iceri_body);
$iceri_body = preg_replace("/@@ICGOREVTANIM@@/",$icerik["KAYIT"][0]["ICGOREVTANIM"],$iceri_body);
$iceri_body = preg_replace("/@@RESIM@@/",$icerik["KAYIT"][0]["RESIM"],$iceri_body);
$iceri_body = preg_replace("/@@RESIM2@@/","",$iceri_body);
$iceri_body = preg_replace("/@@CV@@/",$cv,$iceri_body);
$iceri_body = preg_replace("/@@DERSLER@@/",$courses,$iceri_body);
/*$iceri_body = preg_replace("/&/","&",$iceri_body);
$iceri_body = preg_replace("/ /"," ",$iceri_body);
$iceri_body = preg_replace("/&#/","",$iceri_body);*/
}
//////////////////////////////////////////////////////
include("kalip/kalip.php");
?>