Hello,
My name is mita.
I installed the newes version of xhld, so I cannot display
New! mark by usiing ryus_date.
Does the value or the format of "pubdate" ?
I want
New! mark !!
I now use the code as follows,
<{$items[i].pubdate|ryus_date:"new"}>
Could you give me any advices ?
Best regards,
mita
----
はじめまして。mitaといいます。
xhldを最新版に入れ替えたら、ryus_dateを使えなくなってしまったのですが、pubdateの中身が変わってしまったのでしょうか。
New!をつけたいのですが、できますでしょうか。
ちなみに、以前のバージンの時は、
<{$items[i].pubdate|ryus_date:"new"}>
で表示されていました。
アドバイスいただけるとうれしいです。
Hi,
Now I can display "
New!" by using
<{$items[i].pubdate|date:"new"}>
<{$items[i].date|ryus_date:"new"}>
But timestamp is ignored.
If you have a time, could you check it out?
thanks.
----
mitaです。
とりあえず、
<{$items[i].pubdate|date:"new"}>
<{$items[i].date|ryus_date:"new"}>
で代替しました。ただ、当然ながら時刻は無視されているようです。
お時間があるときにチェックしていただけるとありがたいです。
hi mita.
Since I'm on journey, I can only reply a brief.
'pubdate' has unix_timestamp.
'pubdate_utz' has unix_timestamp offsetted user's timezone.
'date' is the result of formatTimestamp(... , 'm');
Perhaps, you can use ryus_date like this:
<{$items[i].date|ryus_date:"new"}>
Hello,
Thank you for your reply.
Yes, I use this script. Sorry, I mistyped before.
<{$items[i].date|ryus_date:"new"}>
But time is ignored. I use "M" istead of "new", then time is always displayed "09:00", when RSS use "dc:date". (see my site)
Could you checked it out, after your journey?
Enjoy holidays. Take care.
Bye.
hi mita.
I've checked ryus_date by myself, ryus_date itself works fine with $block.item[i].date
Perhaps it is a problem of parsing the format of "dc:date".
Tell me the URL of the RSS.
The RSS displays a wrong format of w3c.
wrong:
<dc:date>2004-08-10T20:19:46+9:00</dc:date>
correct:
<dc:date>2004-08-10T20:19:46+09:00</dc:date>
But there are many wrong formats in the world, I think.
I've modified the parser for w3c (dc:date).
replace the function of class RssDcDateHandler in line 705 of xmlrss2parser.php
function dateW3cToUnix( $w3cDT )
{
$w3cDT = strtoupper( $w3cDT ) ;
$tzoffset = date( 'Z' ) ;
if( $pos = strrpos( $w3cDT , 'Z' ) ) {
// GMT
$localdatetime = substr( $w3cDT , 0 , $pos ) ;
} else if( ( $pos = strrpos( $w3cDT , '+' ) ) > 0 ) {
$hourmin = explode( ':' , substr( $w3cDT , $pos + 1 ) ) ;
if( ! empty( $hourmin[0] ) ) $tzoffset -= $hourmin[0] * 3600 ;
if( ! empty( $hourmin[1] ) ) $tzoffset -= $hourmin[1] * 60 ;
$localdatetime = substr( $w3cDT , 0 , $pos ) ;
} else if( ( $pos = strrpos( $w3cDT , '-' ) ) > 7 ) {
$hourmin = explode( ':' , substr( $w3cDT , $pos + 1 ) ) ;
if( ! empty( $hourmin[0] ) ) $tzoffset += $hourmin[0] * 3600 ;
if( ! empty( $hourmin[1] ) ) $tzoffset += $hourmin[1] * 60 ;
$localdatetime = substr( $w3cDT , 0 , $pos ) ;
} else {
// no timezone
$localdatetime = $w3cDT ;
}
$localunixtime = strtotime( str_replace( 'T' , ' ' , $localdatetime ) ) ;
if( $localunixtime == -1 ) return time() ;
else return $localunixtime + $tzoffset ;
}
Hello GIJOE,
Thank you very much.
Quote:
GIJOE wrote:
The RSS displays a wrong format of w3c.
I will tell the webmaster of the site that the RSS is wrong.
Thank you.
Best regards,
mita