Facebook Business Sayfasına Yeni Uygulama Ekleme

1- https://developers.facebook.com/apps sayfasını açın. 2- Yukarıdaki sayfada sağ üst köşede bulunan “+ Add a New App” butonuna tıklayın. 3- Yukarıdaki açılan pop-up’ta “Website” icon’una tıklayın. 4- Daha sonra açılan “Quick Start” sayfasında sağ üst köşede bulunan “Skip and Create App ID” butonuna tıklayın. 5- Sonra açılan yukarıki sayfada uygulamanızın adını, iletişim e-posta bilgisini ve kategorisini […]

Read More

Proje Toplam Dosya/Kod Satır Sayısı Hesaplama

$fileCounter = array(); $totalLines = countLines(‘.’, $fileCounter); echo $totalLines.” lines in the current folder<br>”; echo $totalLines – $fileCounter['gen']['commentedLines'] – $fileCounter['gen']['blankLines'] .” actual lines of code (not a comment or blank line)<br><br>”; foreach($fileCounter['gen'] as $key=>$val) { echo ucfirst($key).”:”.$val.”<br>”; } echo “<br>”; foreach($fileCounter as $key=>$val) { if(!is_array($val)) echo strtoupper($key).”:”.$val.” file(s)<br>”; } function countLines($dir, &$fileCounter) { $_allowedFileTypes = […]

Read More

Çok Kullanılan MIME Types

text/html html htm shtml; text/css css; text/xml xml; image/gif gif; image/jpeg jpeg jpg; application/x-javascript js; application/atom+xml atom; application/rss+xml rss; text/mathml mml; text/plain txt; text/vnd.sun.j2me.app-descriptor jad; text/vnd.wap.wml wml; text/x-component htc; image/png png; image/tiff tif tiff; image/vnd.wap.wbmp wbmp; image/x-icon ico; image/x-jng jng; image/x-ms-bmp bmp; image/svg+xml svg svgz; image/webp webp; application/java-archive jar war ear; application/mac-binhex40 hqx; application/msword doc; […]

Read More

IP’den Lokasyon Bulma

function detect_city($ip){ $default = ‘Hollywood, CA’; if (!is_string($ip) || strlen($ip) < 1 || $ip == ’127.0.0.1′ || $ip == ‘localhost’) $ip = ’8.8.8.8′; $curlopt_useragent = ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)’; $url = ‘http://ipinfodb.com/ip_locator.php?ip=’ . urlencode($ip); $ch = curl_init(); $curl_opt = array( CURLOPT_FOLLOWLOCATION => 1, CURLOPT_HEADER => 0, […]

Read More

Readable Random String

function readable_random_string($length = 6){ $conso = array(“b”,”c”,”d”,”f”,”g”,”h”,”j”,”k”,”l”,”m”,”n”,”p”,”q”,”r”,”s”,”t”,”v”,”w”,”x”,”y”,”z”); $vocal = array(“a”,”e”,”i”,”o”,”u”); $password = “”; $rand = ((double)microtime()*1000000); $max = $length / 2; for($i=1; $i<=$max; $i++){ $password .= $conso[rand(0,19)]; $password .= $vocal[rand(0,4)]; } return $password; }

Read More

Encryption Class

class Encryption { var $skey = “encKey2016″; public function safe_b64encode($string) { $data = base64_encode($string); $data = str_replace(array(‘+’,’/’,’=’),array(‘-’,’_’,”),$data); return $data; } public function safe_b64decode($string) { $data = str_replace(array(‘-’,’_’),array(‘+’,’/’),$string); $mod4 = strlen($data) % 4; if ($mod4) { $data .= substr(‘====’, $mod4); } return base64_decode($data); } public function encode($value){ if(!$value){return false;} $text = $value; $iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB); […]

Read More

Decrypt – Encrypt Fonksiyonu

function encrypt_url($string) { $key = “1zm3TcwckS”; $result = ”; for($i=0; $i<strlen($string); $i++) { $result .= substr($string, $i, 1); } return base64_encode($result); } function decrypt_url($string) { $key = “1zm3TcwckS”; $result = ”; $string = base64_decode($string); for($i=0; $i<strlen($string); $i++) { $result .= substr($string, $i, 1); } return $result; }

Read More

Cookie Fonksiyonları

(function($){ $.cookie = function(options) { // Default Settings var settings = $.extend({ action : ‘check’, // create or delete cookie_name : ‘cookie’, cookie_value : ‘default’, expiration : ‘Sun, 31 Dec 2017 12:00:00 GMT’, path : ‘/’ }, options); switch(settings.action){ case “create”: create_cookie(); break; case “delete”: delete_cookie(); break; case “check”: return check_for_cookie(); break; case “get”: get_cookie(); […]

Read More

Türkçe Karakter Dönüştürme

function replaceTurkish(text){ var textLower = text.toLowerCase(); var turkish = new Array(“ı”,”ğ”,”ü”,”ş”,”i”,”ö”,”ç”,”I”,”Ğ”,”Ü”,”Ş”,”İ”,”Ö”,”Ç”); var english = new Array(“i”,”g”,”u”,”s”,”i”,”o”,”c”,”i”,”g”,”u”,”s”,”i”,”o”,”c”); for (var i = 0; i < textLower.length; i++){ for(var j = 0; j < 14; j++){ if((textLower.charAt(i)) == turkish[j]){ textLower= textLower.replace((textLower.charAt(i)), english[j]); } } } return textLower; }

Read More

Utf-8 Karakter Düzeltme

function cleanString($text, $convert = false, $cp1252 = false, $strip_tags = false, $html_entity = false, $windows_1252 = false, $new_line = false, $xml = false) { // 1) convert á ô => a o if($convert == true){ $text = preg_replace(“/[áàâãªä]/u”,”a”,$text); $text = preg_replace(“/[ÁÀÂÃÄ]/u”,”A”,$text); $text = preg_replace(“/[ÍÌÎÏ]/u”,”I”,$text); $text = preg_replace(“/[íìîï]/u”,”i”,$text); $text = preg_replace(“/[éèêë]/u”,”e”,$text); $text = preg_replace(“/[ÉÈÊË]/u”,”E”,$text); $text = […]

Read More