سلام
من دنبال تاریخ شمسی phpbb3 گشتم ولی فقط تاریخ قمری رو پیدا کردم. آیا می شه اونو به شمسی تبدیل کرد. کدشو زیر می ذارم...
من دنبال تاریخ شمسی phpbb3 گشتم ولی فقط تاریخ قمری رو پیدا کردم. آیا می شه اونو به شمسی تبدیل کرد. کدشو زیر می ذارم...
کد:
##############################################################
## MOD Title: Display Hijriah Date After Current Date on Index Page
## MOD Author: zarif < [email protected] > (Zumaidi Zainuddin) http://www.ok2it.com
## MOD Description: This mod will display an equivalent Hijriah Date to the Gregorian Date
## after the display of current date on Index page.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: function.php, lang_main.php, page_header.php and index_body.tpl.
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes: Algoritm for Hijriah date calculation used here is taken from ## http://www.geocities.com/bruastronomy/sunmoon_hijrah_calculator.htm with permisssion.
## This method is not 100% accurate that it might differ 1 or 2 days for certain months.
## This is due to the fact that Hijriah date is determined by physical sighting of a new
## moon.
##
##############################################################
## MOD History:
##
## 2003-08-01 - Version 1.0.0
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Create hijriah date based on timezone;
//
function hijriah_date($gmepoch, $tz)
{
global $lang;
$today = getdate($gmepoch + (3600 * $tz));
$yr = $today[year];
$d=$today[mday];;
$m=$today[mon];
$y=$yr;
if (($y>1582)||(($y==1582)&&($m>10))||(($y==1582)&&($m==10)&&($d>14)))
{
$jd=(int)((1461*($y + 4800 + (int)( ($m-14) /12) ))/4) + (int)((367*($m-2-12*((int)(($m-14)/12))))/12)-(int)((3*(int)(( ($y+4900+(int)(($m-14)/12))/100)))/4)+$d-32075;
}
else
{
$jd = 367*$y-(int)((7*($y+5001+(int)(($m-9)/7)))/4)+(int)((275*$m)/9)+$d+1729777;
}
$l=$jd-1948440+10632;
$n=(int)(($l-1)/10631);
$l=$l-10631*$n+354;
$j=((int)((10985-$l)/5316))*((int)((50*$l)/17719))+((int)($l/5670))*((int)((43*$l)/15238));
$l=$l-((int)((30-$j)/15))*((int)((17719*$j)/50))-((int)($j/16))*((int)((15238*$j)/43))+29;
$m=(int)((24*$l)/709);
$d=$l-(int)((709*$m)/24);
$y=30*$n+$j-30;
return $lang['hari'][$today[wday]].' '. $d .' '.$lang['bulan'][$m].' '.$y;
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
'SITENAME' => $board_config['sitename'],
#
#-----[ AFTER, ADD ]---------------------------------------
#
'HIJRAH' => hijriah_date(time(), $board_config['board_timezone']),
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_user_logged_in -->
{CURRENT_TIME}
#
#-----[ AFTER, ADD ]---------------------------------------
#
({HIJRAH})
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
//
// That's all, Folks!
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// HIJRIAH MOD
$lang['bulan']['1'] = 'Muharam';
$lang['bulan']['2'] = 'Safar';
$lang['bulan']['3'] = 'Rab Awal';
$lang['bulan']['4'] = 'Rab Akhir';
$lang['bulan']['5'] = 'Jam Awal';
$lang['bulan']['6'] = 'Jam Akhir';
$lang['bulan']['7'] = 'Rejab';
$lang['bulan']['8'] = 'Syaaban';
$lang['bulan']['9'] = 'Ramadhan';
$lang['bulan']['10'] = 'Syawal';
$lang['bulan']['11'] = 'Zulkaedah';
$lang['bulan']['12'] = 'Zulhijjah';
$lang['hari']['0'] = 'Sunday';
$lang['hari']['1'] = 'Monday';
$lang['hari']['2'] = 'Tuesday';
$lang['hari']['3'] = 'Wednesday';
$lang['hari']['4'] = 'Thursday';
$lang['hari']['5'] = 'Friday';
$lang['hari']['6'] = 'Saturday';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM