• Hejira Shamsi Calendar (Iranian Calendar) for ver. 1.7.6 5 0 5 1
Currently:  

Author Topic: Hejira Shamsi Calendar (Iranian Calendar) for ver. 1.7.6  (Read 8585 times)

0 Members and 1 Guest are viewing this topic.

Offline omidkorat

  • Pre-Newbie
  • Posts: 6
    • View Profile
Hejira Shamsi Calendar (Iranian Calendar) for ver. 1.7.6
« on: April 07, 2008, 05:36:03 PM »
This mode is useful for Iranian users.

Sample: http://gallery.dementor.ir/

1-   First download "jalali.php" from below and copy it to "includes" folder on 4images root.
2-   Backup "includes/functions.php" and then open it.
3-   

Find this: (Line 705)
Code: [Select]
function format_date($format, $timestamp) {
  global $user_info;
  $timezone_offset = (defined("TIME_OFFSET")) ? TIME_OFFSET : 0;
  return date($format, $timestamp + (3600 * $timezone_offset));
}

Replace with:
Code: [Select]
function format_date($format, $timestamp) {
  global $user_info;
  $timezone_offset = (defined("TIME_OFFSET")) ? TIME_OFFSET : 0;
  $myformat = array('Y m d', ', G:H', 'D');
  $firststep = date($myformat[0], $timestamp + (3600 * $timezone_offset));
  $secstep = explode(" ", $firststep);
  require_once 'jalali.php';
  list( $jy, $jm, $jd ) = gregorian_to_jalali($secstep[0], $secstep[1], $secstep[2]);
  $myday = date($myformat[2], $timestamp + (3600 * $timezone_offset));
  return giveday($myday) . ' ' . $jd . ' ' . givemonth($jm) . ' ' . $jy.date($myformat[1], $timestamp + (3600 * $timezone_offset));
}
« Last Edit: April 08, 2008, 10:59:02 AM by omidkorat »

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: Hejira Shamsi Calendar (Iranian Calendar) for ver. 1.7.6
« Reply #1 on: April 08, 2008, 09:58:03 AM »
hi omidkorat,

moved to (Releases & Support)

thank you for sharing this mod!

cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi