ayar.inc.php


<?php
  /* $db_host = "localhost";
  $db_kullanici = "*********";  
  $db_sifre = "*******";           
  $db_adi = "*******";      

  @$baglanti = mysql_connect($db_host,$db_kullanici,$db_sifre) or die ("Veri Taban&yacute;na Ba&eth;lan&yacute;lam&yacute;yor..");
  @ mysql_select_db($db_adi,$baglanti) or die("Veritaban&yacute; Bulunamad&yacute;..");
	mysql_query("SET NAMES 'latin5'");
	mysql_query("SET CHARACTER SET latin5");
   mysql_free_result($baglanti); */
   require_once("config.inc.php");
   db_baglanti();
 
$sorgu = mysql_query("Select * from ayarlar where id='1'");
$veri = mysql_fetch_array($veri);

//Gerekli Bilgiler..
$siteadi = $veri['siteadi'];
$siteadresi = $veri['site'];
$slogan =  $veri['Makale, Makaleler, Bilgi Bankasi']; // Site Slogani..
$site_mail =  $veri['mail']; //Admin Mail
$adsense =  $veri['adsense']; //adsense pub_no
$sinir =  $veri['sinir'];
$boyut =  $veri['sifre'];
$uzun =  $veri['guvenlik'];
$uyelik =  $veri['uyelik'];
$cookie = $veri['Cookie'];

//sayfalama limiti..
function LIMIT()
{
global $sinir;
$limit = $sinir;
return $limit;
}

//Yeni &thorn;ifre taleplerinde kullan&yacute;l&yacute;r
function SifreUret() {
global $boyut;
$plength = $boyut;
   if(!is_numeric($plength) || $plength <= 0) {
      $plength = 8;
   }
   if($plength > 32) {
      $plength = 32;
   }
   $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
   mt_srand(microtime() * 1000000);
   for($i = 0; $i < $plength; $i++) {
      $key = mt_rand(0,strlen($chars)-1);
      $pwd = $pwd . $chars{$key};
   }
   for($i = 0; $i < $plength; $i++) {
     $key1 = mt_rand(0,strlen($pwd)-1);
     $key2 = mt_rand(0,strlen($pwd)-1);
            
     $tmp = $pwd{$key1};
     $pwd{$key1} = $pwd{$key2};
     $pwd{$key2} = $tmp;
   }
   return $pwd;
   } 
   
//Güvenlik resmi üretmek için..
function ResimUret() {
global $uzun;
$uzunluk = $uzun;
  session_start();
  header ("Content-type: image/png");
  srand((double)microtime() * 1000000);

  # Guvenlik kodu
  $kod   = substr(md5(uniqid(rand())),0,$uzunluk);
  $_SESSION["kod"] = $kod; // Kodu oturuma kaydet

  # Fontlar ..
  $font  = array(
       "arial.ttf",
     "tahoma.ttf",
     "verdana.ttf", 
     "enya.ttf",
     "inkburro.ttf",
     "marydale.ttf",
     );

  # Resmi haz&yacute;rla
  $resim = @imagecreate((strlen($kod)*20)+20,50);
  $zemin = imagecreatefrompng('zemin.png');
  $metin = imagecolorallocate ($resim, 0, 0, 0);

  imagesettile($resim,$zemin);
  imagefilledrectangle($resim,0,0,(strlen($kod)*20)+20,50,IMG_COLOR_TILED);

  # Kodu bas ..
  for($i=0; $i < strlen($kod); $i++){
     shuffle($font);
     imagettftext($resim, 20, 0, 10+($i*20),35, $metin, "Font/".current($font),$kod[$i]);
     }

  # Resmi Ç&yacute;kart
  imagepng($resim);
  imagedestroy($resim);
   }
   
//db_Baglanti_kapat();
?>