3 November 2009 - 16 Cheshvan 5770
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: 11% [?]



Twitter
Facebook
RSS
KosherJava | Nov 3, 2009 - 17 Cheshvan 5770 at 1:16 pm
Moishe,
See my comment on your comment on my KosherJava.com blog.
PS: can you provide details on the code plugin that you use?
KosherJava | Nov 3, 2009 - 17 Cheshvan 5770 at 1:20 pm
As you see, the date formatting causes issue in this page as well, and you will have to do some additional updates. I think that there must be a simpler way to get the actual raw date/time for this. I know that the WPtouch plugin had similar issues with internationalized blogs, and probably with your theme as well, and I believe that they solved the issue across the board. You may want to look into their code to see the way they did it, though it may not be simple to port to the HebrewDate WordPress plugin.
Moishe Beshkin | Nov 6, 2009 - 19 Cheshvan 5770 at 12:46 am
I use version 0.9, taken from your site. I send an e-mail to current supporter 3 days ago and no reply yet. Will wait for a while.
I will try current version from his site as well, but later
Moishe Beshkin | Nov 6, 2009 - 19 Cheshvan 5770 at 12:47 am
I updated date display for single post view and archive.