We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19033
    • 892 Posts
    これは、PHxのlimitを使う際に、呼び込むドキュメントに配置されている画像もとりこみたい、と思っていてできました。
    notagsを使わないと、divなどの余計なhtmlタグを読み込んでしまい、コール側のレイアウトが崩れてしまいます。
    なんとかimgタグだけを残し、あとはnotagsで、ということを実現できました。
    これで、トップページなどで記事の一部を画像付きで表示することが可能になりました。

    改造は、/assets/plugins/phx/phx.parser.class.inc.phpの250行目の
    					case "notags": $output = strip_tags($output); break;
    


    					case "notags":
    					  $notags = $modifier_value[$i];
    						$output = strip_tags($output,$notags);
    						break;
    

    に変えます。
    そして、PHxは、例えば、
    [+content:notags=`<font><img>`:limit=`500`+]
    

    とします。すると、contentで、<font>と<img>を除くhtmlタグが除去されたものが出力されます。

    phpのstrip_tagsのオプションを利用したものです。



    [green]リソースの情報[/green]

    [table]
    [tr][td]モデファイ[/td][td]★wmo[/td][/tr]
    [tr][td]リソース名[/td][td]★phx notags 改造版[/td][/tr]
    [tr][td]バージョン[/td][td]★2.1.2 +[/td][/tr]
    [tr][td]ライセンス[/td][td]★GPL[/td][/tr]
    [tr][td]動作環境[/td][td]★MODx 0.9.6 +[/td][/tr]
    [tr][td]リソースの種別[/td][td]★プラグイン[/td][/tr]
    [tr][td]タグ[/td][td]★phx[/td][/tr]
    [/table]