• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

GhazaliTajuddin.com

Another Kuantan Blogger

  • Home
  • Blog
    • Kuantan
    • Foods
    • Technology
    • Health
  • Stock Photography
    • Senarai Microstock Agency
    • Membuka akaun contributor Shutterstock.com
    • Tips untuk 10 keping gambar pertama Shutterstock.com
    • Mengapa Shutterstock.com reject gambar / submission
    • Model Release
    • Bagaimana withdraw earning daripada Fotolia
    • Bagaimana untuk mengisi keyword kepada imej dengan menggunakan Adobe Photoshop

General

Pembangunan WordPress Plugin Yang Menggunakan Shortcodes

May 16, 2016 by ghazalitajuddin

Develop pulgin yang menggunakan shortcodes ini perlu tahu beberapa perkara

  1. Widget text tak support shortcodes secara default.
    • Jika anda ingin menggunakan shortcodes pada bahagian widget. Pasti anda akan gunakan Widget Text.
    • Tetapi secara defaultnya, widget text tak support shortcodes.
    • Anda perlu aktifkan seperti berikut
      //Remove the filter if it already exists
      remove_filter('widget_text', 'do_shortcode');
      
      //Add the filter to apply the shotcode action to widget text
      add_filter('widget_text', 'do_shortcode');
  2. Guna return, bukan echo.
    • Sekiranya anda ingin memaparkan suatu keputusan melalui shortcodes anda, anda akan perasan sekiranya menggunakan echo, hasil keputusan berkenaan akan di paparkan sebelum atau diluar daripada kawasan <div> sepatutnya.
    • Untuk itu elakkan gunakan echo, kerana secara asasnya formatnya adalah menggunakan return.

      Note that the function called by the shortcode should never produce output of any kind. Shortcode functions should return the text that is to be used to replace the shortcode. Producing the output directly will lead to unexpected results. This is similar to the way filter functions should behave, in that they should not produce expected side effects from the call, since you cannot control when and where they are called from.

    • Contohnya seperti berikut
      function callmyshortcode() {
      return 'This is correct';
      }
      add_shortcode('correctshortcode', 'callmyshortcode');
      
      /*--------------------
      function callmyshortcode() {
      echo 'This is wrong';
      }
      add_shortcode('wrongshortcode', 'callmyshortcode');
      --------------------*/

Reference: Wordperss Function Reference/add shortcode

Filed Under: General Tagged With: echo, return, shortcodes, wordpress

Kalendar Hijrah Islam

May 8, 2016 by ghazalitajuddin Leave a Comment

Dah lama aku mencari algorithm Hijrah ni.

Kebanyakan kalendar Hijrah ni menggunakan 2 algorithm

  • Um Al Qura algorithm
  • Tabular Algorithm

Tapi buat masa ni baru jumpa Um Al Qura algorithm dibuat berdasarkan hasil kerja Robert Harry van Gent work. Beliau menulis algorithm bagi menukankan tarikh gregorian kepada hijriah.

Boleh dapatkan library javascript menukar tarikh daripada Geregorian kepada Hijriah di Github https://github.com/talomaireeni/Umm-Al-Qura-Calendar.

Al-habib.info ada kongsikan calculation yang telah dipermudahkan disini.

function gmod(n,m){
	return ((n%m)+m)%m;
}

function kuwaiticalendar(adjust){
	var today = new Date();
	if(adjust) {
		adjustmili = 1000*60*60*24*adjust; 
		todaymili = today.getTime()+adjustmili;
		today = new Date(todaymili);
	}
	day = today.getDate();
	month = today.getMonth();
	year = today.getFullYear();
	m = month+1;
	y = year;
	if(m<3) {
		y -= 1;
		m += 12;
	}

	a = Math.floor(y/100.);
	b = 2-a+Math.floor(a/4.);
	if(y<1583) b = 0;
	if(y==1582) {
		if(m>10)  b = -10;
		if(m==10) {
			b = 0;
			if(day>4) b = -10;
		}
	}

	jd = Math.floor(365.25*(y+4716))+Math.floor(30.6001*(m+1))+day+b-1524;

	b = 0;
	if(jd>2299160){
		a = Math.floor((jd-1867216.25)/36524.25);
		b = 1+a-Math.floor(a/4.);
	}
	bb = jd+b+1524;
	cc = Math.floor((bb-122.1)/365.25);
	dd = Math.floor(365.25*cc);
	ee = Math.floor((bb-dd)/30.6001);
	day =(bb-dd)-Math.floor(30.6001*ee);
	month = ee-1;
	if(ee>13) {
		cc += 1;
		month = ee-13;
	}
	year = cc-4716;

	if(adjust) {
		wd = gmod(jd+1-adjust,7)+1;
	} else {
		wd = gmod(jd+1,7)+1;
	}

	iyear = 10631./30.;
	epochastro = 1948084;
	epochcivil = 1948085;

	shift1 = 8.01/60.;
	
	z = jd-epochastro;
	cyc = Math.floor(z/10631.);
	z = z-10631*cyc;
	j = Math.floor((z-shift1)/iyear);
	iy = 30*cyc+j;
	z = z-Math.floor(j*iyear+shift1);
	im = Math.floor((z+28.5001)/29.5);
	if(im==13) im = 12;
	id = z-Math.floor(29.5001*im-29);

	var myRes = new Array(8);

	myRes[0] = day; //calculated day (CE)
	myRes[1] = month-1; //calculated month (CE)
	myRes[2] = year; //calculated year (CE)
	myRes[3] = jd-1; //julian day number
	myRes[4] = wd-1; //weekday number
	myRes[5] = id; //islamic date
	myRes[6] = im-1; //islamic month
	myRes[7] = iy; //islamic year

	return myRes;
}
function writeIslamicDate(adjustment) {
	var wdNames = new Array("Ahad","Ithnin","Thulatha","Arbaa","Khams","Jumuah","Sabt");
	var iMonthNames = new Array("Muharram","Safar","Rabi'ul Awwal","Rabi'ul Akhir",
	"Jumadal Ula","Jumadal Akhira","Rajab","Sha'ban",
	"Ramadan","Shawwal","Dhul Qa'ada","Dhul Hijja");
	var iDate = kuwaiticalendar(adjustment);
	var outputIslamicDate = wdNames[iDate[4]] + ", " 
	+ iDate[5] + " " + iMonthNames[iDate[6]] + " " + iDate[7] + " AH";
	return outputIslamicDate;
}

Untuk menggunakan script atas seperti berikut

document.write(writeIslamicDate());

Other reference

  • http://www.staff.science.uu.nl/~gent0113/islam/islam_tabcal.htm
  • http://calndr-l.10958.n7.nabble.com/Umm-al-Qura-calendar-algorithms-td6422.html
  • http://www.phpclasses.org/ucal by http://aziz.oraij.com/
  • http://www.phpclasses.org/package/9435-PHP-Convert-and-manipulate-Hijri-dates.html

 

 

Filed Under: General

Bagaimana menggunakan Font Awesome dalam Laravel

April 19, 2016 by ghazalitajuddin Leave a Comment

Kejadah Font Awesome? Baca sini.

Add dalam head / master layout view

<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css" rel='stylesheet' type='text/css'>

Cara guna, contoh nak add button facebook dengan icon “f”.

<div class="quote"><a href="/login/facebook"> <div class="btn btn-md btn-primary"> <i class="fa fa-facebook"></i> Login with Facebook </div></a></div>

pZzc4

Banyak lagi boleh tengok disini.

Filed Under: General

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

April 18, 2016 by ghazalitajuddin Leave a Comment

Biasa berlaku pada pengguna window.

Ko download http://curl.haxx.se/ca/cacert.pem (mesti download dalam forman .pem, bukan .txt)

Pastikan save dalam directory yang sama dengan PHP.INI (Biasanya C:/XAMPP/PHP/)

Buka PHP.INI

Gantikan link ke file yang anda download tadi dengan actual path baru.

[cURL] curl.cainfo="D:\xampp\php\cacert.pem"

Referece: Here

Filed Under: General

Adding Country & State Drop Down List In Laravel

April 18, 2016 by ghazalitajuddin Leave a Comment

Download at http://www.cssscript.com/generic-country-state-dropdown-list-countries-js/

Create public/js directory and put all the .js file inside.

Create public/css directory and put all the .css file inside.

Add to the master blade head tags

<script type="text/javascript" src="{{ asset('js/countries.js') }}"></script>

Add to the bottom of master body tags area

<script language="javascript">
populateCountries("country", "state"); // first parameter is id of country drop-down and second parameter is id of state drop-down
</script>

 

Filed Under: General, Kuantan Web Developer, Technology Tagged With: Framework, laravel, model, MVC, PHP

Adding Jquery Datepicker in Laravel Form

April 18, 2016 by ghazalitajuddin Leave a Comment

Add jquery css in your header (view)

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">

Add jquery js in yoyr footer (view – body tags)

<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>

Edit your forms

{!! Form::text('date', '', array('id' => 'datepicker','class' => 'form-control')) !!}

 

Reference: Laracast

Filed Under: General, Kuantan Web Developer, Technology Tagged With: Framework, laravel, model, MVC, PHP

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 10
  • Page 11
  • Page 12
  • Page 13
  • Page 14
  • Interim pages omitted …
  • Page 28
  • Go to Next Page »

Primary Sidebar

“Solat. Sabar. Syukur. Senyum. Sedekah.”

For Collaboration, Events & Review, kindly contact me at +6016[-]9212092 or click Whatsapp button on this page.

Sponsor

Recent Posts

BadMethodCallException Method Illuminate\Database\Eloquent\Collection::roles does not exist.

User Roles And Permissions Without Package Laravel 10

Laravel Many To Many Relationship

Makan malam bersama keluarga di Awangan Palace

Sarapan pagi di Warung Gulai Kawah

Recent Comments

  • helmi on Personal Tips Berhenti Merokok
  • ghazalitajuddin on Personal Tips Berhenti Merokok
  • helmi on Personal Tips Berhenti Merokok
  • ghazalitajuddin on Nasi Lemak Kukus Restoran Zaman. Otai masih berbisa.
  • ghazalitajuddin on Air tangki radiator Proton Exora cepat kering? Cuba tukar penutup radiator!
  • Mal on Nasi Lemak Kukus Restoran Zaman. Otai masih berbisa.
  • Firdaus on Air tangki radiator Proton Exora cepat kering? Cuba tukar penutup radiator!

My Link

  • Takaful Insurance Web

JJCM

Lain macam Nasi Kerabu Mekla ni

Popia basah terbaik di Kuantan?

Variasi Coconut Shake Hogoh De Coco

Diet snack untuk abang-abang kacak

Kuih Akok Kedut Kelantan

Tags

bebas rokok berhenti merokok breakfast Controller Framework Gezzeg Photography & Design health jalan-jalan cari makan jalan-jalan cari makan kuantan jjcm jjcm kuantan Jurufoto Kuantan Kuantan Kuantan Photographer kuantan programmer kuantan web developer kuantan webmaster laravel merokok merbahayakan kesihatan model MVC nikmat rokok OOP Pahang Pahangtourism pahang tourism Photo Manipulation PHP rajalanun retired smoking revisit pahang 2018 shutterstock stop smoking stop smoking tips stop smoking withdrawal symptom tips tips berhenti merokok View visit malaysia 2020 visit pahang visitpahang white wordpress yii Yii Framework

Recent Posts

  • BadMethodCallException Method Illuminate\Database\Eloquent\Collection::roles does not exist.
  • User Roles And Permissions Without Package Laravel 10
  • Laravel Many To Many Relationship
  • Makan malam bersama keluarga di Awangan Palace
  • Sarapan pagi di Warung Gulai Kawah

Copyright © 2025 — Ghazali Tajuddin • All rights reserved. •