TAG | php
Mikvatime.com is looking for developers
0 Comments | Posted by Moishe Beshkin in News
Dear all,
some time ago I started a project MikvaTime.com.
It was initiated this project on demand from my wife, who asked me to create an universal tool, which would help her to calculate “clean” days.
(more…)
Popularity: 36% [?]
Jewish calendar calculation in PHP
0 Comments | Posted by Moishe Beshkin in Reviews
I wanted to give a credit to Ulrich and David Greve for their great scripts which help to integrate Jewish Calendar in PHP.
Here you can see the source code and wonderful explanations.
First I used these scripts on Dvinsker.lv site. It took me some time to translate scripts’ output to Russian and Latvian. And I really appreciate the Greves’ documentation on their code.
Then I adopted these scripts for Shamir.lv and Chabad.lv sites.
Now, I work on some new projects, which report not only zmanim, but also Jewish holidays. And these scripts again help in my development.
Great work, guys.
Popularity: 10% [?]
Two years ago, I got an idea to create a Jewish map of Daugavpils (Dvinsk) Latvia. This is my native city and I wanted to mark all the places, which were important for Jews in pre-second-world-war period.
On that time in Daugavpils, there were 43 synagogues and Jewish population was about 30 thousand people.
After some time, I decided to make such map for whole Latvia. I found a support from rabbi Menachem Barkagan and organization Shamir Latvia.
I just started learning php and javascript 3 years ago. So, looking from now, I would do it much better and easier. But still the project is alive and working. So, do not want to change anything there as soon as it is working properly.
Here is the whole map of Latvia with marked cities where are/were Jewish places. Map is interactive and clickable.
Example of City view – Riga.
Check checkboxes to see the markers on the map.
In future I plan to move to JQuery library and use more of ajax technology.
Popularity: 5% [?]
Hebrew Date plugin + jq theme
4 Comments | Posted by Moishe Beshkin in Reviews
I really want to thank kosherjava.com for a wonderful plug-in to display Hebrew date of posts.
I found that this plug-in does not correctly work with the theme selected for this blog jq.
It corrupted date display area fully.
I added to hebrewdate.php the following code to get timestamp from jq date format.
//first we change jq date format to more readable.
if (preg_match('/(.*)\s?
([0-9][0-9]?)<\/p>/',$content)) //list of posts
$date_preg=preg_replace('/(.*)\s?
([0-9][0-9]?)<\/p>/','\1/\2/00/00/00',$content);
elseif (preg_match('/(.*)\s([0-9][0-9]?),\s20([0-9][0-9])/',$content)) //single post
$date_preg=preg_replace('/(.*)\s([0-9][0-9]?),\s20([0-9][0-9])/','\1/\3/\2/00/00/00',$content);
elseif (preg_match('/.*[0-9]{4}/',$content)) { //archive display
$date_preg=preg_replace('/(.*)\s[0-9]{2}([0-9]{2})/','\1/\2/1/00/00/00',$content);
$informat = '%B/%y/%d/%H/%M/%S';
$isArchiveFormat = true;
}else return $content;
//define format of the previously created string
$informat = '%b/%y/%d/%H/%M/%S';
//convert string to array of date/time data
$ftime = strptime($date_preg,$informat);
// create timestamp
$unxTimestamp = mktime(
$ftime['tm_hour'],
$ftime['tm_min'],
$ftime['tm_sec'],
1 ,
$ftime['tm_yday'] + 1,
$ftime['tm_year'] + 1900
);
//$pdate is timestamp
$pdate=$unxTimestamp;
//comment old string of $pdate definition.
// $pdate = strtotime(str_replace("","",$content)); //WP-Admin adds a break tag for display purposes which we have to strip out.
You can see correct date in Gregorian and Jewish style on a left side.
UPD: Thanks to KosherJava.com, I absolutely forgot about date format for comments – fixed.
Popularity: 27% [?]
Sunset/Sunrise detection in php
0 Comments | Posted by Moishe Beshkin in Reviews
During working on a project, which includes zmanim time detection, I investigated proper way to detect sunset and sunrise time.
There are integrated functions date_sunset and date_sunrise.
//detect current time $ts=mktime(); //latitude and longitude for Daugavpils, Latvia $lat=56+58/60; $long=24+8/60 //GMT offset for current location $gmtoffset=2; //traditional zenith for detecting zmanim $zenith=90+50/60; $today=date_sunset($ts, SUNFUNCS_RET_STRING, $lat, $long, $zenith, $gmtoffset);
This function will return value in the view HH:MM.
Popularity: 12% [?]
