This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class LoginController extends BaseController { | |
// | |
public function getLogin($id){ | |
$user=Auth::loginUsingId($id); | |
if (!$user){ | |
throw new Exception('Giriş Hatası'); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author Savaş Can ALTUN <[email protected]> | |
* @link http://savascanaltun.com.tr | |
* PHP strpos function in array | |
*/ | |
function strposa($text, $finds, $offset=0) { | |
if(!is_array($finds)) $finds = array($finds); | |
foreach($finds as $query) { | |
if(strpos($text, $query, $offset) !== false) return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$source = file_get_contents("https://graph.facebook.com/?id=http://www.savascanaltun.com.tr"); | |
$json = json_decode($source, true); | |
echo "Total : ".$json['shares']; // return number format | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create random time [ PHP ] | |
* @author Savaş Can ALTUN <[email protected]> | |
*/ | |
function randomTime($first,$last){ | |
$number = rand($first,$last); | |
if($number<10){ | |
$result='0'.$number; | |
return $result; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^siteadi.com$ [NC] | |
RewriteRule ^(.*)$ http://siteadi.com/$1 [L,R=301] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$extension = "ffmpeg"; | |
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX; | |
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname; | |
if(!extension_loaded($extension)) { | |
dl($extension_soname) or die("Can't load extension $extension_fullname\n"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Gravatar Function PHP | |
* 07.02.2015 - Savaş Can ALTUN | |
* <[email protected]> | |
*/ | |
public function gravatar($mail,$size=50,$noavatar=NULL){ | |
$pass=md5(strtolower(trim($mail))); | |
return "http://www.gravatar.com/avatar/$pass?d=$noavatar&s=$size"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function havadurumu ($plaka=00) { | |
if (!is_numeric($plaka) && strlen($plaka)!=2) $plaka=00; | |
switch ($plaka) { | |
case 01: $link="AF"; break; // Adana | |
case 02: $link="AF"; break; // Adıyaman | |
case 06: $link="AC"; break; // Ankara | |
case 07: $link="AI"; break; // Antalya | |
case 16: $link="BR"; break; // Bursa | |
case 20: $link="AY"; break; // Denizli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Savaş Can ALTUN < [email protected] > | |
* Github : @saltun | |
*/ | |
function url_split(url){ | |
url_parts = url.split('/'); | |
domain_name_parts = url_parts[2].split(':'); | |
domain_name = domain_name_parts[0]; | |
if ( domain_name.substring(0,4) == 'www.' ) domain_name = domain_name.substring(4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Google Maps Single Marker</title> | |
<style type="text/css"> | |
#map_canvas {height:600px;width:800px} | |
</style> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |