6 9

pieX Ver0.7をリリースしました。
変更点は以下の通りです。

  • 旧テンプレートの3つのパート分けから1つのテンプレートに変更
  • no itemのテンプレート名称をerrorに変更
  • 不要となったオブジェクトを破棄するように修正(流儀に従って)

記事テンプレートが変更になりましたので、旧版をお使いの方は注意が必要です。

記事テンプレートの変更について

旧版までは、ヘッダ部(header)、記事部(item)、フッタ部(footer)の3つに分かれていましたが、これを1つのテンプレートで記述できるようにしました。
書き方は、以下のようにHTMLコメントの記述をテンプレートの内部に記述することにより上記の3つのパートを内部で判別します。
分離するHTMLコメントには、記事の表示部分の開始と終了の箇所にを記述することになります。
例)


<h2><a href="[+permalink+]" target=_blank title="[+description(text,128)+]">[+title+]</a></h2>
<ul>
<!-- start -->
<li><a href="[+permalink+]" target=_blank>[+title+]</a>([+date+]/[+category+]/[+author+])<br />
[+description(text,256)+]
[+enclosure+]
</li>
<!-- end -->
</ul>

記事のループ部分の開始、終了位置をHTMLのコメントとして囲んでください。
書式は上記の通りにstart及びendをコメント形式で書きます(コピペしてもらう方が安全です)
なお、内部のプレイスホルダの変数等は今まで通りになります。
呼び出し時のテンプレートの変数名がtplの1つになり、またnoitemの変数がerrorに変更されます。

スニペット呼び出しの例

[!pieX?url=`Feed Url`&tpl=`piex_template`&error=`piex_error`&max=3!]

ダウンロード

こちらからダウンロードしてください。
なお、今回からSimplepieのアーカイブ(ZIP)も同梱しておりますので、simplepieのアーカイブからsimplepie.incを取り出して、スニペットのディレクトリにコピーしてください。

投稿者 ZeRo

このエントリに定義されたタグ: ,

13 コメント

コメント表示形式(一覧 | スレッド)
  1. ZeRo says:

    トラックバック先の情報もチェックしてね・・・修正版は後日アップします、説明書もちょっと改版ですね(^^;
    shintata.com様ありがとうございました。

  2. kay says:

    最近、 MODx の勉強をしており pieX 使わせていただいております。
    使っていて思ったのですが、 feed_url という変数、エラー処理時でなく通常時も使えるようになりませんか?
    記事一覧を表示して、フィード URL を表示するところまでをテンプレートにしようと思ったんですがうまくいかず…コードを自分で書き直そうかと思ったんですが、まずは作者様にお願いが筋かと思いまして。
    ご検討ください m(_ _)m

  3. ZeRo says:

    どうもコメントありがとうございます。
    早速ですが、お試し版ってことでここのダウンロードに入れてみました。
    各アイテムおよびヘッダ・フッタにも使えるようにしたつもりです・・・

    が、現在MODx環境がないので実はテストできていません ;-)

    人柱状態になっちゃいますが、よろしければお試し頂ければと・・・。
    ではでは :-)

  4. kay says:

    うまくいきました (^^)b
    早速の対応ありがとうございました m(_ _)m

  5. ZeRo says:

    遅くなりましたぁ。
    そのまま正式版にしてお知らせログを書こうかと思いつつ、ずるずると今日に至ったり。

    とりあえず、無事動いて何よりです。
    そのまま正式版としてこのままダウンロードページにおいておくことにします。
    もしかすると、ちゃんとSimplepieを最新のものにしてアップしなおすかも知れませんが・・・ただ、確認してる暇と環境がないのでこのままにするかもです。

    まずはご報告ありがとうございました。

  6. 0ad says:

    こんにちは。 v0.7へのダウンロードリンク、私は私のために正しい働かないか。

  7. 0ad says:

    MODxのフォーラムで見つけた!コードをありがとう!

  8. LuK says:

    Hi,

    first of all, thank you very much for porting simplepie to modx! I love to work with both very much =)!

    I'm working with the 0.8 version from your server here, it does fine and I like the idea with the comments to separate header/footer from body very much, nice work!

    I wanted to add some features but I get stuck so I thought I ask you, the author =)...

    My first problem was, that I need the date (without time) and the time (without date) on different sections of my output, I tried to make a placeholder [+time+] but I couldn't find a solution...could you tell me how to achieve this best?

    The second problem is with one of the very nice features of simplepie: multiple feeds. I used it before to aggregate 3 feed together like this:

    CODE:
    <br />     $news->set_feed_url(array(<br />      'http://www.bernerzeitung.ch/region/rss.html',<br />      'http://www.bernerzeitung.ch/schweiz/rss.html',<br /> 'http://www.bernerzeitung.ch/ausland/rss.html'<br />     ));<br />


    I saw you did it in the snippet like this:

    CODE:
    <br /> $this->feed->set_feed_url($feedURL);<br />


    so $feedURL would have to be this array of feeds, but I couldn't figure out how to implement this...I think it would be nice if I could give comma separated feed-urls in the &url=`url1, url2, url3` parameter, do you think this would be possible?

    sorry for those questions, I'm pretty new to modx, so I have never written a complex snippet myself (shame on me...but I will hopefully soon =D)

    thx in advance for your help!

  9. ZeRo says:

    Hello, Luk san.
    Thank you for using piex.
    Two issues, the 0.8 version is not an easy fix.
    I think to be resolved in the next version.

    The date and time for the separation, [+date (H: i)+] as the format as possible.
    It's about multiple URL, the URL parameter "|xx|" or "," to allow for a separator.

    Please wait, thank you.

  10. LuK says:

    Thank you for the fast answer Zero!

    Your idea for the date/time separation is very nice, would like it even more than a placeholder [+time+]...[+date(H:i)+] is far more elegant!

    The multiple URL thing I don't understand really (my japanese isn't very good and the google translator is not a big help =D), is it already possible to separate multiple URLs with "| xx |" or "," or will this come in the next version? As far as I understood it, it's not possible yet?

    I'm really looking forward to the next version!

    PS: Did you "install" the wiki here: http://wiki.modxcms.com/index.php/PieX

    It could use an update and if you want to, I can do this (new links and also the explanation for the changes in 0.8 and so on...)

    Regards from Switzerland

  11. ZeRo says:

    Lukさん、お返事ありがとうございます。
    英語は全然だめなので、日本語で書いてみます。

    1.複数URLについて
    下記のような書式を考えています。

    [[piex?url=`http://example123.com/rss.xml,http://example456.com/rss.xml`]]
    上の例ですとURLの区切りとして、,を使っています。 同様に区分文字列として、|xx|などURLの変換文字と同様の形式にするか、現時点ではいずれかを考えているということです

    2.バージョンアップについて
    クリスマスまでにバージョンアップをしたいと考えています。
    しかし、MODxの環境が手元にありませんのでテストがされない状態でファイルをサイトに掲示するかも知れません。


    一応、Lukさんがテストもしてくれるようでしたらなるべく早くソースをアップします。

    スイスには、一度は行ってみたいです(^^; 
    これから冬になる日本より

  12. LuK says:

    Hi ZeRo,

    would write in Japanese if I could, but my keyboard is a swiss one =)...this would probably be a great mess...

    I wrapped my head again around this multiple feed problem...but couldn't solve it =/...

    thought about something like that (just a thought...not working):

    $param["feedURL"] = $urls;
    $urls = explode(',', $urls);
    $feeds = array();
    foreach ($urls as $url){
    $feeds[] = trim(FeedJob::create_feed_url($url));
    }


    what do you think...could that work somehow?

    Would you maybe do the update as a job when I pay you some money (in the currency you want =D...paypal would be good...)?

    thanks for your answer,

    regards,

    LuK

  13. ZeRo says:

    issued a test version.
    This version is intended to allow you to specify the time and date for multiple feeds.
    Do you tried the latest test version?
    If you, please come try this test version If you have not already done so.
    Specify multiple URL corresponds to a comma-delimited.

    Test version, please see below.
    http://www.petit-power.com/permalink/piex-ver0.9-testVersion.html


    Thank you.

コメント追加


BB コード 書式を許可します。
標準的な感情表現、 :-) や ;-) といったものは画像に変換します。
スマイル
電子メールアドレスは表示せず、電子メールの通知にのみ使用します。

ロボットからの自動的なコメントスパムを防ぐために、画像の下の入力ボックスに適切な文字列を入力してください。文字列が一致する場合のみ、コメントが送信されるでしょう。ブラウザーが Cookie をサポートし、受け入れることを確認してください。さもなければ、コメントを正確に確認することができません。
CAPTCHA