Skip to content

Instantly share code, notes, and snippets.

View beyazitkolemen's full-sized avatar
🎯

Beyazıt Kölemen beyazitkolemen

🎯
  • Turkey/Gaziantep
View GitHub Profile
<?php
$ipAddr = $_SERVER['REMOTE_ADDR'];
$geopluginURL = 'http://www.geoplugin.net/php.gp?ip=' . $ipAddr;
$addrDetailsArr = unserialize(file_get_contents($geopluginURL));
$country = $addrDetailsArr['geoplugin_countryCode'];
if ($country == "US")
{
?>
Amerikadan selamlar
@beyazitkolemen
beyazitkolemen / postview eklentisi
Created June 15, 2011 23:43
Wordpress Konu Okunma Sayısı - Postview eklentisi
<?php if (function_exists('get_most_viewed')): ?>
<ul>
<?php get_most_viewed('both', 8); ?>
</ul>
<?php endif; ?>
@beyazitkolemen
beyazitkolemen / gist:1028411
Created June 15, 2011 23:41
Wordpress Özel Alan Sorgulama
<?php
$anarschi = get_post_meta($post->ID,'ozelalanismi', true);
if($anarschi != "") { ?>
<? echo strtolower($anarschi); ?>
<?php }else{ ?>
özel alan yok
<?php } ?>
@beyazitkolemen
beyazitkolemen / gist:1028417
Created June 15, 2011 23:48
Kategoriye Ait Konular
<?php $anarschi = new WP_Query("showposts=3&cat=14"); while($anarschi->have_posts()) : $anarschi->the_post();?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
//cat id - ise dahil değil
@beyazitkolemen
beyazitkolemen / wordpress
Last active December 10, 2015 23:58
jquery-json post vs
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this.name]) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
function ozet($max_char, $more_link_text = '(devamı&raquo;)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo "";
echo $content;
echo " ";
<?php
/**
* Language File
*
* @package Freelance Manager
* @author wojoscripts.com
* @copyright 2012
* @version $Id: language.php, v1.00 2012-01-10 10:11:25 gewa Exp $
*/
if (!defined("_VALID_PHP"))
Route::group(array('domain' => '{magaza}.domain'), function ($magaza) {
if ($magaza == "www") {
Route::controller('/', 'SiteController');
}
else {
Route::controller('/', 'MagazaController');
}
});
<?php
$columnSizes = [
'sm' => [3, 9],
'xs' => [12, 12],
];
?>
{!!BootForm::open($columnSizes)->action(route('admin.update'))->enctype('multipart/form-data') !!}
{!! BootForm::bind($variable) !!}
public function getLinkSettings()
{
$settings = Setting::all();
return view('backend.settings.settings', compact('settings'));
}
public function postSystemSettings(Request $request)
{
$data = $request->except(['_token', '_method']);
foreach ($data as $key => $value) {
Setting::set($key, $value);