News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Hicri takvim PHP. smf ENTEGRE

Started by cee山, November 14, 2013, 10:25:00 AM

Previous topic - Next topic

cee山

İyi günler.Vericeğim kodlarla HİCRİ takvimi sitenize ekleyebilirsiniz.

temanızın index.template.php açarak
Bu kodu ?> öncesine ekleyin.
function Hicri($GetDate){
// Aylar
$mname[1] = "Muharrem";$mname[2] = "Safer";$mname[3] = "Rebiü'l-Evvel";$mname[4] = "Rebiü'l-Ahir";$mname[5] = "Cemaziye'l-Evvel";$mname[6] = "Cemaziye'l-Ahir";$mname[7] = "Recep";$mname[8] = "Şaban";$mname[9] = "Ramazan";$mname[10] = "Sevval";$mname[11] = "Zi'l-ka'de";$mname[12] = "Zi'l-Hicce";

$TDays=round(strtotime($GetDate)/(60*60*24));$HYear=round($TDays/354.37419);$Remain=$TDays-($HYear*354.37419);$HMonths=round($Remain/29.531182);$HDays=$Remain-($HMonths*29.531182);$HYear=$HYear+1389;$HMonths=$HMonths+10;$HDays=$HDays+23;
if ($HDays>29.531188 and round($HDays)!=30){$HMonths=$HMonths+1;$HDays=Round($HDays-29.531182);}

else{
$HDays=Round($HDays);}
if($HMonths>12){$HMonths=$HMonths-12;$HYear=$HYear+1;}

echo "$HDays $mname[$HMonths] $HYear";
}

function hicritakvim() {
    $today = date("Y-m-d");
    echo Hicri($today);
}

kodu ekledikten sonra body içinde  echo eklemeden hicritakvim();   echo ekli ise ',hicritakvim(),' bu şekilde kullanarak aktif edebilirsiniz.İyi Günler.K.Gelsin.


Not: bu kod ilede ', $context['current_time'],' miladi takvimi aktifleştirebilirsiniz saat ile beraber.

Demo:

Advertisement: