PEAK XOOPS - I cannot use ryus_date in xhld. in englishin japanese

I cannot use ryus_date in xhld.

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 .2 | Posted on 2004/8/6 2:27
mita  企霹始   Posts: 6
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"}>

で表示されていました。

アドバイスいただけるとうれしいです。
Votes:2 Average:5.00
Previous post - Next post | Parent - No child | Posted on 2004/8/6 20:04
mita  企霹始   Posts: 6
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"}>

で代替しました。ただ、当然ながら時刻は無視されているようです。

お時間があるときにチェックしていただけるとありがたいです。

Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/8/8 5:40
GIJOE  黎扦烦菱   Posts: 4110
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"}>
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/8/8 10:17
mita  企霹始   Posts: 6
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.


Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/8/10 19:09
GIJOE  黎扦烦菱   Posts: 4110
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.


Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/8/10 20:44
mita  企霹始   Posts: 6
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2004/8/11 5:48
GIJOE  黎扦烦菱   Posts: 4110
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 ;
	}
Votes:0 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2004/8/11 8:29
mita  企霹始   Posts: 6
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
Votes:1 Average:10.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!