Kredi Kartı Tanıma

<?php
error_reporting(4);
if(!defined(PHP_CREDITCARD_CLASS))
{

define(PHP_CREDITCARD_CLASS, 1);

define(UNKNOWN, 0);
define(MASTERCARD, 1);
define(VISA, 2);
define(AMEX, 3);
define(DINNERS, 4);
define(DISCOVER, 5);
define(ENROUTE, 6);
define(JCB, 7);

define(CC_OK, 0);
define(CC_ECALL, 1);
define(CC_EARG, 2);
define(CC_ETYPE, 3);
define(CC_ENUMBER, 4);
define(CC_EFORMAT, 5);
define(CC_ECANTYPE, 6);

class creditcard
{
  var $number;
  var $type;
  var $errno;

  function creditcard()
  {
    $this->number = 0;
    $this->type = UNKNOWN;
    $this->errno = CC_OK;
  }
  function check($cardnum)
  {
    $this->number = $this->_strtonum($cardnum);

    if(!$this->detectType($this->number))
    {
      $this->errno = CC_ETYPE;
      return false;
    }

    if($this->mod10($this->number))
    {
      $this->errno = CC_ENUMBER;
      return false;
    }

    return true;
  }
  function detectType($cardnum = 0)
  {
    if($cardnum)
      $this->number = $this->_strtonum($cardnum);
    if(!$this->number)
    {
      $this->errno = CC_ECALL;
      return UNKNOWN;
    }

    if(preg_match("/^5[1-5]d{14}$/", $this->number))
      $this->type = MASTERCARD;

    else if(preg_match("/^4(d{12}|d{15})$/", $this->number))
      $this->type = VISA;

    else if(preg_match("/^3[47]d{13}$/", $this->number))
      $this->type = AMEX;

    else if(preg_match("/^[300-305]d{11}$/", $this->number) ||
      preg_match("/^3[68]d{12}$/", $this->number))
      $this->type = DINNERS;

    else if(preg_match("/^6011d{12}$/", $this->number))
      $this->type = DISCOVER;

    else if(preg_match("/^2(014|149)d{11}$/", $this->number))
      $this->type = ENROUTE;

    else if(preg_match("/^3d{15}$/", $this->number) ||
      preg_match("/^(2131|1800)d{11}$/", $this->number))
      $this->type = JCB;

    if(!$this->type)
    {
      $this->errno = CC_ECANTYPE;
      return UNKNOWN;
    }

    return $this->type;
  }
  function detectTypeString($cardnum = 0)
  {
    if(!$cardnum)
    {
      if(!$this->type)
        $this->errno = CC_EARG;
    }
    else
      $this->type = $this->detectType($cardnum);

    if(!$this->type)
    {
      $this->errno = CC_ETYPE;
      return NULL;
    }

    switch($this->type)
    {
      case MASTERCARD:
        return "MASTERCARD";
      case VISA:
        return "VISA";
      case AMEX:
        return "AMEX";
      case DINNERS:
        return "DINNERS";
      case DISCOVER:
        return "DISCOVER";
      case ENROUTE:
        return "ENROUTE";
      case JCB:
        return "JCB";
      default:
        $this->errno = CC_ECANTYPE;
        return NULL;
    }
  }

  function getCardNumber()
  {
    if(!$this->number)
    {
      $this->errno = CC_ECALL;
      return 0;
    }

    return $this->number;
  }
  function errno()
  {
    return $this->errno;
  }

  function mod10($cardnum)
  {
    for($sum=0, $i=strlen($cardnum)-1; $i >= 0; $i--)
    {
      $sum += $cardnum[$i];
      $doubdigit = "".(2 * $cardnum[--$i]);
      for($j = strlen($doubdigit)-1; $j >= 0; $j--)
        $sum += $doubdigit[$j];
    }
    return $sum % 10;
  }

  function resetCard()
  {
    $this->number = 0;
    $this->type = 0;
  }

  function strError()
  {
    switch($this->errno)
    {
      case CC_ECALL:
        return "Geçersiz Arama";
      case CC_ETYPE:
        return "Bilinmeyen Kart Tipi";
      case CC_ENUMBER:
        return "Geçersiz Kart Numarası";
      case CC_EFORMAT:
        return "Geçersiz Format";
      case CC_ECANTYPE:
        return "Kart tipi taranamadı";
      case CC_OK:
        return "Başarılı";
    }
  }

  function _strtonum($string)
  {
    for($i=0; $i< strlen($string); $i++)
    {
      if(!is_numeric($string[$i]))
        continue;
      $nstr = "$nstr".$string[$i];
    }
    return $nstr;
  }

}


}

//ÖRNEK 
$cc = new creditcard;
$card=$_GET[card];
if($card)
{
  printf("%s  nolu kart %s <br>n", $card,
    (($ccret = $cc->check($card))?" gecerli":"gecersiz"));

  if($ccret)
  {
    printf("Kart Tipi: %s veya %d<br>n", $cc->detectTypeString(),
      $cc->detectType());
    printf("Kart Numarasi: %s<br>n", $cc->getCardNumber());
  }
  else
    printf("%s<br>n", $cc->strError());

}

?>

<form action="" method=get>
<input type=text name=card size=20><p>
<input type=submit value="Hesapla">
</form>

</body>

 

Adresten zip yükleme ve dizine çıkartma

 <?php
class urluploader {
                  private $filename; 
                  private $url; 
                  private $unzipdir;
       function __construct($fileurl,$dir=0)
              {
               if ($dir==0)
                      { $this->unzipdir=getcwd() . "/"; }
                      else {$this->unzipdir=$dir . "/";}
               $this->filename=$this->unzipdir . basename($fileurl);
                $this->url=$fileurl;
                }
       public function uploadFromUrl ()
               {
                 if(!filter_var($this->url, FILTER_VALIDATE_URL))
                     {die ("The provided url is invalid");}
                  $length=5120; 
                  $handle=fopen($this->url,'rb') or die ('gecersiz adres ');
                  $write=fopen ( $this->filename,'w');
                      while ( !feof($handle))
                        {
                           $buffer=fread ( $handle,$length );
                           fwrite ( $write,$buffer);
                         }
                  fclose ( $handle);
                  fclose ($write);
                  echo "<br>basarili:" . basename($this->filename) . "<br>" ;
                  return true;
               }
        public function unzip($newdir=false,$delete=false,$filename=false)
                {  if (!$filename){$filename=$this->filename;}
                          if(!$newdir){$newdir=$this->unzipdir;}
                     if (!file_exists($filename))
                           {die( 'bu dosya mevcut');}
                     if (class_exists('ZipArchive'))
	                  	{$zip = new ZipArchive;
			                  if($zip->open($filename) !== TRUE)
			                        {die('Unable to open the zip file');  }
		               	   $zip->extractTo($newdir) or die ('Unable to extract the file');
		                     echo "<br>Extracted the zip file<br>";
		                 	    $zip->close();
		                 }
		else
		{
			@shell_exec('unzip -d $newdir '. $this->filename);
			echo "<br>Unzipped the file using shell command<br>";
		}              
              If ($delete) {unlink($filename);
                 echo "<br>Deleting" . basename($filename);}
                return true;

                }
 }

 //örnek
 
        $upload= new urluploader("http://localhost/test.zip");//upload linki
       if($upload->uploadFromUrl())
       {$upload->unzip();}
       else {echo "basarisiz";}

 

Sorgu Sonucunu Excel’e Aktarmak

<?PHP
error_reporting(4);
class ExportToExcel
{
	function exportWithPage($php_page,$excel_file_name)
	{
		$this->setHeader($excel_file_name);
		require_once "$php_page";
	}
	function setHeader($excel_file_name)
	{
		header("Content-type: application/octet-stream");
		header("Content-Disposition: attachment; filename=$excel_file_name");
		header("Pragma: no-cache");
		header("Expires: 0");
	}
	function exportWithQuery($qry,$excel_file_name,$conn)//to export with query
	{
		$tmprst=mysql_query($qry,$conn);
		$header="<center><table border=1px><th>Tablo Dökümü</th>";
		$num_field=mysql_num_fields($tmprst);
		while($row=mysql_fetch_array($tmprst,MYSQL_BOTH))
		{
			$body.="<tr>";
			for($i=0;$i<$num_field;$i++)
			{
				$body.="<td>".$row[$i]."</td>";
			}
			$body.="</tr>";	
		}
		$this->setHeader($excel_file_name);
		echo $header.$body."</table";
	}
}
$conn=mysql_connect('localhost','root','')or die('bağlanmadı');
mysql_select_db('test');


//ÖRNEK
$exp=new ExportToExcel();

//$exp->exportWithPage("export_file.php","test.xls");

$qry="select * from qa_users";
$exp->exportWithQuery($qry,"test.xls",$conn);

?>

 

Google Map Koordinat Bulucu

<?php

if($_POST){
print_r($_POST);
exit;
}
?>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
  
  var placeSearch,autocomplete;
  var component_form = {
    'street_number': 'short_name',
    'route': 'long_name',
    'locality': 'long_name',
    'country': 'long_name',
    'postal_code': 'short_name'
  };
  
  function initialize() {
    autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] });
    google.maps.event.addListener(autocomplete, 'place_changed', function() {
      fillInAddress();
    });
  }
  
  function fillInAddress() {
    var place = autocomplete.getPlace();
	var lat = place.geometry.location.lat();
	var lng = place.geometry.location.lng();
    for (var component in component_form) {
      document.getElementById(component).value = "";
      document.getElementById(component).disabled = false;
	document.getElementById("long").value = lng;
	document.getElementById("lat").value = lat;
    }
    
    for (var j = 0; j < place.address_components.length; j++) {
      var att = place.address_components[j].types[0];
      if (component_form[att]) {
        var val = place.address_components[j][component_form[att]];
        document.getElementById(att).value = val;
      }
    }
  }
    
  function geolocate() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        var geolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
        autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));
      });
    }
  }

</script>
</head>
<body onload="initialize()">
	
  <div id="locationField">
    <input id="autocomplete" placeholder="Adresinizi Giriniz" onFocus="geolocate()" type="text"></input>
  </div>
  <form action="streetfindexportinput.php" method="post">
	Sokak No:<input id="street_number" disabled="true"/><br>
	Güzergah:<input id="route" disabled="true"/><br>
    Semt:<input id="locality" disabled="true"/><br>
    Posta<input id="postal_code" disabled="true"/><br>
    Ülke<input id="country" disabled="true"/><br>
    <input type="hidden" name="lng"  id="long" />
    <input type="hidden" name="lat"  id="lat" />
   <button type="submit">Gönder</button>
	</form>
	
  </body>
</html>

 

Google Map Arama ve Marker Ekleme

 

<title>Google Maps JavaScript API v3 Example: Map Simple</title>
<?php
if($_POST){
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title></title>
  <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  <script type='text/javascript' src="http://maps.google.com/maps/api/js?sensor=true&.js"></script>
  <script type='text/javascript' src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
  <style type='text/css'>
    html,
body,
#map {
    display: block;
    width: 70%;
    height: 90%;
}
  </style>
<script type='text/javascript'>//<![CDATA[ 
$(function(){
    
    var options = {
      center : new google.maps.LatLng(<?php echo $_POST["lat"]; ?>, <?php echo $_POST["lng"]; ?>),
      zoom : 15
    };
	
    var div = document.getElementById('map');
    var map = new google.maps.Map(div, options);
    var marker = new google.maps.Marker({
        position: new google.maps.LatLng(<?php echo $_POST["lat"]; ?>,<?php echo $_POST["lng"]; ?>),
        map: map,
        title: ''
    });

});
//]]></script>

</head>
<body>
  <div id="map"></div>
</body>
</html>
<?php
}else{
?>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&libraries=places"></script>
<script type="text/javascript">
  
  var placeSearch,autocomplete;
  var component_form = {
'street_address' : 'long_name',
'route' : 'long_name',//sadece sokak varsa
'country' : 'long_name',//ülke
'administrative_area_level_1' : 'long_name',//il
'administrative_area_level_2' : 'long_name',//ilçe
'administrative_area_level_3' : 'long_name',
'locality' : 'long_name',//il
'sublocality' : 'long_name',//alt bölge
'neighborhood' : 'long_name',//sadece ilçe varsa
'postal_code' : 'long_name',//posta kodu
'street_number' : 'long_name'
  };
  
  function initialize() {
    autocomplete = new google.maps.places.Autocomplete(document.getElementById('autocomplete'), { types: [ 'geocode' ] });
    google.maps.event.addListener(autocomplete, 'place_changed', function() {
      fillInAddress();
    });
  }
  
  function fillInAddress() {
    var place = autocomplete.getPlace();
	var lat = place.geometry.location.lat();
	var lng = place.geometry.location.lng();
	
	var name = place.name;
    var phone = place.formatted_phone_number;
    var fullAddress = place.formatted_address;

    for (var component in component_form) {
      document.getElementById(component).value = "";
      document.getElementById(component).disabled = false;
	document.getElementById("long").value = lng;
	document.getElementById("lat").value = lat;
	document.getElementById("fa").value = fullAddress;
	
    }
    
    for (var j = 0; j < place.address_components.length; j++) {
      var att = place.address_components[j].types[0];
      if (component_form[att]) {
        var val = place.address_components[j][component_form[att]];
        document.getElementById(att).value = val;
      }
    }
  }
    
  function geolocate() {
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function(position) {
        var geolocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
        autocomplete.setBounds(new google.maps.LatLngBounds(geolocation, geolocation));
      });
    }
  }

</script>
</head>
<body onload="initialize()">
	
  <div id="locationField">
    <input id="autocomplete" placeholder="Adresinizi Giriniz" onFocus="geolocate()" type="text"></input>
  </div>
  <form action="" method="post">
	Full Adres:<input id="fa" name="fa"/><br>
Cadde<input id="street_address" disabled="true"/><br>
Sokak<input id="route" disabled="true"/><br>
Ülke<input id="country" disabled="true"/><br>
İl<input id="administrative_area_level_1" disabled="true"/><br>
İlçe<input id="administrative_area_level_2" disabled="true"/><br>
Köy<input id="administrative_area_level_3" disabled="true"/><br>
Bölge<input id="locality" disabled="true"/><br>
Alt Bölge<input id="sublocality" disabled="true"/><br>
Mahalle<input id="neighborhood" disabled="true"/><br>
Posta<input id="postal_code" disabled="true"/><br>
Sokak No<input id="street_number" disabled="true"/><br>

Enlem<input type="text" name="lat"  id="lat" /><br>
Boylam<input type="text" name="lng"  id="long" /><br>
   <button type="submit">Gönder</button>
	</form>
	
  </body>
</html>
<?php } ?>

 

Localhost ve Web Seçmeli Veritabanı

Tek bir uygulamayı hem localhost’da düzenleyip hem sitenizde yayınlarken büyük kolaylık. Veritabanı bilgilerini değiştirmeden ikisinde birden rahatlıkla çalışabileceksiniz.

<?php header('Content-Type: text/html; charset=utf-8');
function remote_connect($dbhost,$dbuser,$dbpass,$dbname,$lang){
if($lang="en"){//Eng Lang
$error_db_connect_www='<!--Could not connect to the online database-->';
$error_dbselect_www='<!--Online database not selected-->';
$connect_ok_www='<!--Connected to the online database-->';
$error_db_connect_local='<!--Could not connect to the local database-->';
$error_dbselect_local='<!--Local database not selected-->';
$connect_ok_local='<!--Connected to the local database-->';
}
if($lang="tr"){//Tr Dil
$error_db_connect_www='<!--Çevrimiçi veritabanı ile bağlantı sağlanamadı-->';
$error_dbselect_www='<!--Çevrimiçi veritabanı seçilemedi-->';
$connect_ok_www='<!--Çevrimiçi veritabanına bağlanıldı-->';
$error_db_connect_local='<!--Yerel veritabanı ile bağlantı sağlanamadı-->';
$error_dbselect_local='<!--Yerel veritabanı seçilemedi-->';
$connect_ok_local='<!--Yerel veritabanına bağlanıldı-->';
}
        $connect = @mysql_connect($dbhost["www"], $dbuser["www"] , $dbpass["www"]);
        if(!$connect){
            echo $error_db_connect_www;
        }
        $db = @mysql_select_db( $dbname["www"] , $connect);
        if($db){
            echo $connect_ok_www;
        }
        else{
            echo $error_dbselect_www;
    $connect = @mysql_connect($dbhost["local"], $dbuser["local"] , $dbpass["local"]);
        if(!$connect){
            echo $error_db_connect_local;
        }
    $db = @mysql_select_db( $dbname["local"] , $connect);
        if($db){
            echo $connect_ok_local;
        }
        else{
            echo $error_dbselect_local;
        }
    }
}
$db_host=array();
$db_user=array();
$db_pass=array();
$db_name=array();
//www Connect
$db_host["www"] =   "localhost";        
$db_user["www"] =   ""; 
$db_pass["www"] =   "";
$db_name["www"] =   "p";
//Local Connect
$db_host["local"]   =   "localhost";        
$db_user["local"]   =   "root"; 
$db_pass["local"]   =   "";
$db_name["local"]   =   "survivor";
$lang ="tr"; //en
remote_connect($db_host,$db_user,$db_pass,$db_name,$lang);

?>

 

Eklentisiz WordPress Meta Etiketi ile Seo Oluşturmak

Temanızın içindeki header.php‘yi açıp head tagları arasına yapıştırın. Kendinize göre değiştirebilirsiniz.

<meta name="resource-type" content="document" />
<meta http-equiv="content-type" content="text/html;" />
<meta http-equiv="content-language" content="tr-TR" />
<meta name="author" content="Ulusan" />
<link rel="author" href="https://plus.google.com/+MehmetAliUlusan/posts"/>
<meta name="contact" content="ulusanyazilim@gmail.com" />
<meta name="copyright" content="Copyright (c)2006-2018 UlusanYazılım. All Rights Reserved." />
<meta name="description" content="<?php if ( is_single() ) {
		single_post_title('', true); 
} else {
		bloginfo('name'); echo " - "; bloginfo('description');
}
?>" />
<?php
function csv_tags() {
	$posttags = get_the_tags();
	foreach((array)$posttags as $tag) {
		$csv_tags .= $tag->name . ',';
	}
	if($csv_tags == ","){$csv_tags="";}
	$csv_tags .=",ulusanyazilim";
	return $csv_tags;
}?>
<meta name="keywords" content="<?php echo csv_tags(); ?>" />

 

Bootstrap Sayfalama

Eskiden kullandığım bir sistemi paylaşmak isterim.

Veritabanı tablosu table sütunu id olarak belirtilmiştir.

<?php
echo '<';
echo 'link href="https://stackpath.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"';
echo '>';
if(@$_GET['liste']){$sayfa=$_GET['liste'];}else{$sayfa=1;}
$ayir=20;$ilk=(($sayfa*$ayir)-$ayir);
//
if(@$_GET[ara]== "1"){
$sonuc= mysql_query("SELECT * FROM table ORDER BY id DESC Limit $ilk,$ayir");
$snc= mysql_query("SELECT * FROM table");
$sy=mysql_num_rows($snc);}
//sayfalama
$bul=ceil(@$sy/$ayir)+1;//Toplam Sayfa Sayisi
$start=(($ayir*$sayfa)-19); ?>

<table class="table table-hover">
<caption><center>Toplam <?php echo @$sy;?> sayfa</center></caption>
 <thead>
<tr>
<td >Sıra</td>
</tr>
 </thead>
<?php
while($yaz=@mysql_fetch_array($sonuc))  {echo "<tr><td>$id</td>"; } ?>
</table> 

<center>
<?php 
if(@$_GET['liste']){$sayfa=$_GET['liste'];}else{$sayfa=1;}

$sy=@mysql_num_rows($snc);
//sayfalama
$bul=ceil($sy/$ayir)+1;//Toplam Sayfa Sayisi
$bull=ceil($sy/$ayir);//Toplam Sayfa Sayisi
//sayfalama basliyor
function sec($no,$sayfa){
if($sayfa == $no){
return '
<input type="submit" name="liste" class="btn btn-primary" value="'.$no.'">';}
else{return '<input type="submit" name="liste" class="btn btn-info" value="'.$no.'">';}}
echo '<form class="navbar-form pull-left" method="get"><input type="hidden" name="ara" class="btn btn-primary" value="'.@$_GET["ara"].'">';

$listele=7;//Listeleme Sayisi 7 için test edildi
$ilkorta=($listele+1)*0.5;//yarısını aldık 7 için 4
$sonorta=$bul-(($listele+1)*0.5);//yarısını aldık 7 için 4
$ilkortabas=$sayfa-(($listele+1)*0.25);//yarısını aldık 7 için 3
$ilkortason=$ilkortabas+($listele-2);
if($sayfa <= $ilkorta){
for($d=1;$d<8;$d++){echo sec($d,$sayfa);}
echo "   ".sec($bull,$sayfa);
}
else{
if($sayfa >= $sonorta){
echo sec(1,$sayfa)."   ";
for($d=$bul-$listele;$d<$bul;$d++){echo sec($d,$sayfa);}
}
else{
echo sec(1,$sayfa)."   ";
for($d=$ilkortabas;$d<$ilkortason;$d++){echo sec($d,$sayfa);}
echo "   ".sec($bull,$sayfa);
}}


echo '</form>'; 
?></center>

 

Çok Renkli Küre Etiket Bulutu

Öncelikle jquery kütüphanemizi script tagı ile çağırıyoruz

https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js

istediğimiz alana bu menü linklerimizi ekliyoruz.

<ul id="test" class="xmpl" style="height: 390px; width: 698px;">
    <?php for($x=0;$x<100;$x++){
         echo '<li value="'.floor(100-$x).'"><a href="#'.$x.'" >d'.$x.'n</a></li>';
    }?>
</ul>

script tagı içerisinde bu kodları ekliyoruz

/*
* jQuery TagCloud 0.5.1
*/
;(function($) {
	// private variables
	var oSettings;
	var oUlCss = {};
	var oLiCss = {};
	var fGAng = 2.399963; // sphere angle in radians*pi
	// default settings
	$.tagcloud = {
		 id: "TagCloud"
		,version: "0.5.1"
		,defaults: {
			 height: null
			,type: "cloud"		// "cloud", "list" or "sphere"
			,sizemax: 20
			,sizemin: 10
			,colormax: "00F"
			,colormin: "B4D2FF"
			,seed: null			// only for type=="cloud"
			,power: .5			// only for type=="sphere"
			,padding: 0
		}
	};
	$.fn.extend({
		tagcloud: function(_settings) {
			oSettings = $.extend({}, $.tagcloud.defaults, _settings);
			if (oSettings.seed===null) oSettings.seed = Math.ceil(Math.random()*45309714203);

			switch (oSettings.type) {
				// treemap ::	http://www.jquery.info/The-TreeMap-plugin
								
				case "sphere":
				case "cloud":
					oUlCss = {position:"relative"};
					oLiCss = {position:"absolute",display:"block"};
				break;
				case "list":
					oUlCss = {height:"auto"};
					oLiCss = {position:"static",display:"inline"};
				break;
			}

			Rng.setSeed(oSettings.seed+123456);

			return this.each(function(i,o) {
				var mUl = $(o);
				var aLi = mUl.find(">li");
				var iNumLi = aLi.length;


				var iUlW = mUl.width();
//				var iUlH = oSettings.height===null?mUl.height():oSettings.height;
				var iUlH = oSettings.height===null?(.004*iUlW*iNumLi):oSettings.height;
				mUl.css({width:iUlW,height:iUlH,listStyle:"none",margin:0,padding:0});
				mUl.css(oUlCss);
				

				var iValMx = -2147483647;
				var iValMn = 2147483648;
				var iLastVal = -1;
				for (var j=0;j<iNumLi;j++) {
					var mLi = $(aLi[j]);
					var iVal = mLi.attr("value")==-1?iLastVal++:mLi.attr("value");
					if (iVal>iValMx) iValMx = iVal;
					if (iVal<iValMn) iValMn = iVal;
					iLastVal = iVal;
				}
				var iValRn = iValMx-iValMn;

				// place on line to create minimal overlays
				var aLine = new Array();
				for (var j=0;j<iNumLi;j++) aLine[j] = j;
				for (var j, x, k = aLine.length; k; j = parseInt(Rng.rand(0,1000)/1000 * k), x = aLine[--k], aLine[k] = aLine[j], aLine[j] = x);

				iLastVal = -1;
				for (var j=0;j<iNumLi;j++) {
					var mLi = $(aLi[j]);;
					var iVal = mLi.attr("value")==-1?iLastVal++:mLi.attr("value");
					iLastVal = iVal;
					//
					var fPrt = ((iNumLi-j-1)/(iNumLi-1));
					var fPrt = (iVal-iValMn)/iValRn;
					//
					var iSzFnt = oSettings.sizemin + fPrt*(oSettings.sizemax-oSettings.sizemin);
					var sColor = colorRng(oSettings.colormin,oSettings.colormax,fPrt);
					//
					mLi.css({"word-wrap":"break-word",
                             "fontSize":iSzFnt,
                             "position":"absolute",
                             "color":"#"+sColor,
                             "margin":0,
                             "padding":oSettings.padding}).children().css({color:"#"+sColor});
					var iLiW = mLi.width();
					var iLiH = mLi.height()
					//
					var oCss = {};
					if (oSettings.type!="list") {
						if (oSettings.type=="cloud") {
							var iXps = Rng.rand(0,iUlW-iLiW);
							var iYps = aLine[j]*(iUlH/iNumLi) - iLiH/2;
						} else {
							var fRds = Math.pow(j/iNumLi,oSettings.power);
							var fRad = (j+Math.PI/2)*fGAng;
							var iXps = iUlW/2 - iLiW/2 + .5*iUlW*fRds*Math.sin(fRad);
							var iYps = iUlH/2 - iLiH/2 + .5*iUlH*fRds*Math.cos(fRad);
						}
						oCss.left = iXps;
						oCss.top  = iYps;
					}
					for (var prop in oLiCss) oCss[prop] = oLiCss[prop];
					mLi.css(oCss);
				}
			});
		}
	});
	// Park-Miller RNG
	var Rng = new function() {
		this.seed = 23145678901;
		this.A = 48271;
		this.M = 2147483647;
		this.Q = this.M/this.A;
		this.R = this.M%this.A;
		this.oneOverM = 1.0/this.M;
	}
	Rng.setSeed = function(seed) {
		this.seed = seed;
	}
	Rng.next = function() {
		var hi   = this.seed/this.Q;
		var lo   = this.seed%this.Q;
		var test = this.A*lo - this.R*hi;
		this.seed = test + (test>0?0:this.M);
		return (this.seed*this.oneOverM);
	}
	Rng.rand = function(lrn, urn) {
		return Math.floor((urn - lrn + 1) * this.next() + lrn);
	}
	// hex dec
	function d2h(d) {return d.toString(16);}
	function h2d(h) {return parseInt(h,16);}
//	function getC(s,rgb) {
//		var aRng = [[[0,1],[1,2],[2,3]],[[0,2],[2,4],[4,6]]][s.length==3?0:1][rgb];
//		return s.substring(aRng[0],aRng[1]);
//	}
	function getRGB(s) {
		var b3 = s.length==3;
		var aClr = [];
		for (var i=0;i<3;i++) {
			var sClr = s.substring( i*(b3?1:2), (i+1)*(b3?1:2) );
			aClr.push(h2d(b3?sClr+sClr:sClr));
		}
		return aClr;
	}
	function getHex(a) {
		var s = "";
		for (var i=0;i<3;i++) {
			var c = d2h(a[i]);
			if (c.length==1) c = "0"+c; // todo: this can be better
			s += c;
		}
		return s;
	}
	function colorRng(mn,mx,prt) {
		var aMin = getRGB(mn);
		var aMax = getRGB(mx);
		var aRtr = [];
		for (var i=0;i<3;i++) aRtr.push( aMin[i] + Math.floor(prt*(aMax[i]-aMin[i])) );
		return getHex(aRtr);
	}
	// trace
	function trace(o) {
		if (window.console&&window.console.log) {
			if (typeof(o)=="string")	window.console.log(o);
			else						for (var prop in o) window.console.log(prop+": "+o[prop]);
		}
	};
	// set functions
	$.fn.TagCloud = $.fn.Tagcloud = $.fn.tagcloud;
})(jQuery);
$(document).ready(function() {
$("ul").tagcloud({type:"sephere",width:300,height:300,sizemin:8,sizemax:36,power:0.5});
 function createRandomColor() { 
 var hex = '0123456789ABC'.split(''), color = '#', i; 
 for (i = 0; i < 6; i += 1) {
 color = color + hex[Math.floor(Math.random() * 13)];
 } 
 return color;
}
 $('ul li').each(function() {
 var $a = $(this).find('a');
 var rastgelerenk = createRandomColor();
 $a.css({color: rastgelerenk});
 });
});

 

Başlığı Sef Linke Dönüştürmek

Sef: Search Engine Friendly (Arama Motoru Dostu)
Seo: Search Engine Optimization (Arama Motoru Uyumlaşması)

Seflink fonksiyonu ile sayfa başlıklarınızı linke dönüştürüp kullanabilirsiniz.

Örneğin veritabanında seolink tablosu açıp makale_id ve sef_link şeklinde iki alan oluşturarak adresteki veriyi sorgulatıp makale id’si ile yazdırıp kullanabilirsiniz.Kullanım alanı size kalmış.

<?php
function seflink($s) {
        $tr = array('ş','Ş','ı','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç');
        $eng = array('s','s','i','i','g','g','u','u','o','o','c','c');
        $s = str_replace($tr,$eng,$s);
        $s = strtolower($s);
        $s = preg_replace('/&amp;amp;amp;amp;amp;amp;amp;.+?;/', '', $s);
        $s = preg_replace('/[^%a-z0-9 _-]/', '', $s);
        $s = preg_replace('/s+/', '-', $s);
        $s = preg_replace('|-+|', '-', $s);
        $s = trim($s, '-');
        $s.=".html";
        return $s;
}

//kullanımı
echo seflink("test yazışma");//test-yazisma
?>