Umarım konuyu yanlış yere açmamışımdır. Üye olmak gerçekten zor burda ;) her neyse arkadaşlar ben etiker url lerinde hata alıyorum türkçe karakter sorunu Xyz sitesi olduğu için link koymayı doğru bulmadım.
Örnk.
Öğrenci
etiket/ogrenci/ olması gerekirken bende şu şekilde çıkıyor.
etiket/renci/ türkçe karakterlerin hiç birini değiştirmiyor.
Umarım açıklayıcı olmuşumdur.
include 'fonksiyon.php';
include 'inc-admin/inc-login.php';
function un_escape($string)
{
$string = preg_replace("/%u0130/", "İ", $string);
$string = preg_replace("/ı/", "ı", $string);
$string = preg_replace("/ğ/", "ğ", $string);
$string = preg_replace("/Ğ/", "Ğ", $string);
$string = preg_replace("/ş/", "ş", $string);
$string = preg_replace("/Ş/", "Ş", $string);
$string = preg_replace("/%FC/", "ü", $string);
$string = preg_replace("/%DC/", "ü", $string);
$string = preg_replace("/%F6/", "ö", $string);
$string = preg_replace("/%D6/", "Ö", $string);
$string = preg_replace("/%E7/", "ç", $string);
$string = preg_replace("/%C7/", "Ç", $string);
return $string;
}
if($_POST["adi"]!="")
{
$video = un_escape($_POST["adi"]);
$aciklama = un_escape($_POST["aciklama"]);
$tag = un_escape($_POST["etiket"]);
$flv = un_escape($_POST["flvlink"]);
$resim = un_escape($_POST["buyukresim"]);
$kat = un_escape($_POST["kategori"]);
$sure = un_escape($_POST["sure"]);
$embed = un_escape($_POST["embed"]);
$seo=cevir($video);
$kontrol=mysql_query("select * from madvideo where seo='$seo'");
if(mysql_num_rows($kontrol)==0)
{
$sql2 = mysql_query("insert into madvideo (kat,seo,baslik,vid,resim,sure,tag,aciklama,tarih,embed) values ('$kat','$seo','$video','$flv','$resim','$sure','$tag','$aciklama',now(),'$embed') ");
$id=mysql_insert_id();
resim_indir($resim,$id."_1");
$yeniresim="thumb/".$id."_1.jpg";
mysql_query("UPDATE madvideo SET resim='$yeniresim' WHERE id='$id'");
echo ''.$video.' EKLENDI';
} else { echo 'Bu isimde video daha önce eklenmis'; }
}
?>
fonksiyon ise;
include 'baglan.php';
function acilma_suresi (){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
$saymaya_basla = acilma_suresi();
function ayaral($b) {
$ayar = mysql_query("SELECT * FROM ayarlar where ayar='$b'");
$ayarya = mysql_fetch_array($ayar);
return $ayarya['goster'];
}
function reklamla($c) {
$ayar = mysql_query("SELECT * FROM reklam where ayar='$c'");
$ayaral = mysql_fetch_array($ayar);
return $ayaral['goster']; }
function slash($item1, $clean=false){
//If you have problems withs slashes, play with slash($data, 2)
if ($clean == 1){
return stripslashes($item1);
}elseif ($clean == 2){
return str_replace("\\", "\\\\", $item1);
}else{
return addslashes(str_replace("\\", "\\\\", $item1));
}
}
function cache($id, $seconds="", $data=""){
global $server, $db_user, $db_pass, $database;
mysql_connect($server, $db_user, $db_pass);
mysql_select_db($database);
$utime = time();
$exptime = $utime + $seconds;
mysql_query("DELETE FROM cache WHERE id = '$id' && timestamp <= UNIX_TIMESTAMP()") or die(mysql_error());
$result = mysql_query("SELECT * FROM cache WHERE id = '$id'") or die(mysql_error());
if (mysql_num_rows($result)){
$db = mysql_fetch_row($result);
$db[1] = slash($db[1], 1);
$stored = unserialize($db[1]);
if (is_array($stored)){
foreach ($stored as $key => $store){
$stored[$key] = slash($stored[$key], 2);
}
}else{
$stored = slash($stored, 2);
}
return $stored;
}else{
$data = serialize($data);
$data = slash($data);
$id = addslashes($id);
if ($data) mysql_query("INSERT INTO cache (id, stored, timestamp) VALUES ('$id', '$data', '$exptime')") or die(mysql_error());
return FALSE;
}
}
//ayarlar alınıyor
if(ayaral("Google-Gelenler")=="1") {
$cek=$_SERVER['HTTP_REFERER'];
$refer=parse_url($cek);
$serverr=$refer['host'];
if (eregi ("google.", $serverr)) {
parse_str($refer["query"]);
$gelen = iconv("UTF-8","ISO-8859-9",$q);
$gelen=rawurldecode($gelen);
$gelen=mysql_real_Escape_string($gelen);
if (((strlen($gelen) < 3)) || (!empty($gelen))) {
$ekle=cevir($gelen);
$sql2 = mysql_query("insert into tag (baslik,tr,tarih) values ('$gelen','$ekle',now()) ");
} }}
//tr karekter çevriliyor
function cevir($kroyumben) {
$tr = array('ş','Ş','ı','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç');
$eng = array('s','S','i','I','g','G','u','U','o','O','C','c');
$kroyumben = str_replace($tr,$eng,$kroyumben);
$kroyumben = eregi_replace('[^0-9A-Za-z]',"-",$kroyumben);
$kroyumben = str_replace('--','-',$kroyumben);
return $kroyumben; }
function buyult($metin) {
$metin = strtr($metin, "ığüşiöç", "IĞÜŞİÖÇ");
return strtoupper($metin);
}
function randchar($length = 8, $range = "anc", $case = 'm')
{
$str = null;
if (gettype($length) != "integer")
$length = 8;
// determine character range
switch (TRUE) {
case ("abc" == $range || "alpha" == $range || "alphabetic" == $range): // alphabetic
$minval = 2; $maxval = 3;
break;
case ("dmc" == $range || "color" == $range): // color: decimal
case ("hxc" == $range || "hexcolor" == $range): // color: hexadecimal
$minval = 5; $maxval = 5;
if ($length > 24) $length = 24;
$depth = $length;
$length = 6;
break;
case ("dmg" == $range || "gray" == $range): // gray: decimal
case ("hxg" == $range || "hexgray" == $range): // gray: hexadecimal
$minval = 5; $maxval = 5;
if ($length > 24) $length = 24;
$depth = $length;
$length = 2;
break;
case ("hxd" == $range || "hex" == $range || "hexadecimal" == $range): // hexadecimal
$minval = 5; $maxval = 5;
break;
case ("nmc" == $range || "num" == $range || "numeric" == $range): // numeric
$minval = 1; $maxval = 1;
break;
case ("anc" == $range || "alnum" == $range || "alphanumeric" == $range): // alphanumeric
default : // alphanumeric
$minval = 1; $maxval = 4;
break;
}
// build string
for ($i = 0;$i < $length;$i++) {
switch (@rand($minval, $maxval)) {
case 1: $str .= chr(rand(48, 57)); // 0-9
break;
case 2: $str .= chr(rand(97, 122)); // a-z
break;
case 3: $str .= chr(rand(65, 90)); // A-Z
break;
case 4: $str .= chr(rand(48, 57)); // 0-9
break;
case 5: $str .= dechex(rand(0,15)); // 0-15
break;
}
}
// procedure for color values
switch (TRUE) {
case ("dmc" == $range || "color" == $range):
case ("dmg" == $range || "gray" == $range):
case ("hxc" == $range || "hexcolor" == $range):
case ("hxg" == $range || "hexgray" == $range):
$clrs = chunk_split($str,2,' '); // space delimit color value pairs
$clrs = explode(' ',trim($clrs)); // load color value pairs into array
$bpclr = floor($depth/3); // set number of bits per color value
$step = (256/pow(2,$bpclr)); // calculate step value for quantizing
foreach ($clrs as $key => $clr) {
$clrs[$key] = hexdec($clr); // convert to decimal for manipulation
$clr = round($clrs[$key] / $step); // calculate quantizing (Q) factor
$clr = $clr * $step; // multiply color value by Q factor
$clr = $clr - floor($clr/256); // adjust to maintain bounds 0-256
$clrs[$key] = $clr; // replace original color value pair
}
// triple gray value
switch (TRUE) {
case ("dmg" == $range || "gray" == $range):
case ("hxg" == $range || "hexgray" == $range):
$clrs = array_pad($clrs,3,$clrs[0]);
break;
}
// comma delimit decimal color values
switch (TRUE) {
case ("dmc" == $range || "color" == $range): // r,g,b
case ("dmg" == $range || "gray" == $range): // r,g,b
$str = implode(",", $clrs);
break;
case ("hxc" == $range || "hexcolor" == $range): // rrggbb
case ("hxg" == $range || "hexgray" == $range): // rrggbb
$str = (
sprintf("%02x",$clrs[0])
.sprintf("%02x",$clrs[1])
.sprintf("%02x",$clrs[2])
);
break;
}
break;
}
// set character case
switch (TRUE) {
case ('l' == $case || "lower" == $case): // lower case
$str = strtolower($str);
break;
case ('u' == $case || "upper" == $case): // upper case
$str = strtoupper($str);
break;
}
return $str;
}
function turkceyap($c)
{
$ceviri= urlencode($c);
$verici = file_get_contents("http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=".$ceviri."&langpair=en%7Ctr");
$asdasd=json_decode($verici);
$gelen=$asdasd->responseData->translatedText;
return iconv('UTF-8','ISO-8859-9',$gelen);
}
function kickle($a,$b,$c,$d) {
hadile($a,$b,$c,$d); }
function videolink($a,$b,$c,$d) {
kickle($a,$b,$c,$d); }
$istatik = cache("istatistikler");
if ($istatik){
$ist = $istatik;
}else{
$ist .= "Kategoriler:".$strSQL=mysql_num_rows(mysql_query("SELECT * FROM kat WHERE id"))."
";
$ist .= "Videolar: ".$strSQL=mysql_num_rows(mysql_query("SELECT * FROM madvideo WHERE id"))."
";
$ist .= "Yorumlar: ".$strSQL=mysql_num_rows(mysql_query("SELECT * FROM yorum WHERE id"))."
";
$ist .= "Etiketler: ".$strSQL=mysql_num_rows(mysql_query("SELECT * FROM tag WHERE id"))."
";
$jkl = mysql_fetch_array(mysql_query("Select sum(izlenme) as siktir from madvideo"));
$ist .= "Toplam İzlenme: ".$strSQL=$jkl['siktir']." ";
$istatik = cache("istatistikler", 6000, $ist);
}
function pingle($a,$b,$c) {
$request = xmlrpc_encode_request("weblogUpdates.ping", array($a, $b) );
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($request) . "\r\n";
$header[] = $request;
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $c);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
curl_setopt( $ch, CURLOPT_TIMEOUT, 3);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' );
$result = curl_exec( $ch ); # run!
curl_close($ch);
}
function resim_indir($link,$name=null)
{
$link_info = pathinfo($link);
$uzanti = strtolower($link_info['extension']);
$file = ($name) ? $name.'.jpg' : $link_info['basename'];
$curl = curl_init($link);
$fopen = fopen("thumb/".$file,'w');
curl_setopt($curl, CURLOPT_HEADER,0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_0);
curl_setopt($curl, CURLOPT_FILE, $fopen);
curl_exec($curl);
curl_close($curl);
fclose($fopen);
}
function get_data($url)
{
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_HEADER,true);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>