1: 2014-03-21 (金) 15:55:17 marine[4] [5] | 現: 2014-03-21 (金) 16:01:38 marine[4] [6] | ||
---|---|---|---|
Line 1: | Line 1: | ||
TITLE:xugj_date で NEW 表示 | TITLE:xugj_date で NEW 表示 | ||
- | うちのサイトでは、XUGJ の 「Smarty小ネタ」 や 「XUGJ_date を作ろう」を参考に、投稿一覧表示の新規投稿にNew表示をする方法を採用しています。ここでは、その方法をご説明したいと思います。 | + | うちのサイトでは、XUGJ の 「[[Smarty小ネタ:http://www.xugj.org/modules/xpwiki/?Smarty%E5%B0%8F%E3%83%8D%E3%82%BF]]」 や 「[[XUGJ_date を作ろう:http://www.xugj.org/modules/d3forum/index.php?topic_id=127]]」を参考に、投稿一覧表示の新規投稿にNew表示をする方法を採用しています。ここでは、その方法をご説明したいと思います。 |
ネタもとを参考にして、テーマの images フォルダに new01.gif と new02.gif をコピー、テーマ用の style.css に次の記述を加えて、altsys のテンプレート管理にて、該当するd3forum の forum_block_list_posts.html を編集・反映すると、記事投稿が24時間以内の場合は 赤い new01.gif ファイルが、7日以内は灰色の new02.gif が表示されるようになりました。 | ネタもとを参考にして、テーマの images フォルダに new01.gif と new02.gif をコピー、テーマ用の style.css に次の記述を加えて、altsys のテンプレート管理にて、該当するd3forum の forum_block_list_posts.html を編集・反映すると、記事投稿が24時間以内の場合は 赤い new01.gif ファイルが、7日以内は灰色の new02.gif が表示されるようになりました。 | ||
当初、ネタもとの記事をそのまま適用したところ、NEW画像が記事表題の下に改行された状態で表示されたので、表題の頭にもっていって float:left 指定することにより、表題の頭に NEW画像が表示されるようになりました。 | 当初、ネタもとの記事をそのまま適用したところ、NEW画像が記事表題の下に改行された状態で表示されたので、表題の頭にもっていって float:left 指定することにより、表題の頭に NEW画像が表示されるようになりました。 | ||
+ | |||
style.css に下記内容を追加 | style.css に下記内容を追加 | ||
- | span.new1 { | + | span.new1 { |
- | display:block; | + | display:block; |
width:27px; | width:27px; | ||
height:10px; | height:10px; | ||
Line 17: | Line 17: | ||
text-indent:-9999px; | text-indent:-9999px; | ||
float:left; | float:left; | ||
- | } | + | } |
- | span.new2 { | + | span.new2 { |
display:block; | display:block; | ||
width:30px; | width:30px; | ||
Line 26: | Line 26: | ||
text-indent:-9999px; | text-indent:-9999px; | ||
float:left; | float:left; | ||
- | } | + | } |
+ | |||
d3forum の forum_block_list_posts.html を次のように編集・反映 | d3forum の forum_block_list_posts.html を次のように編集・反映 | ||
- | <ol style=”padding:3px;margin:0;”> | + | <ol style=”padding:3px;margin:0;”> |
- | <{foreach item=post from=$block.posts}> | + | <{foreach item=post from=$block.posts}> |
- | <li style=”margin:1px;”><a href=”<{$block.mod_url}>/index.php?post_id=<{$post.id}>”><{$post.subject}></a> <{$post.uname}><{$post.post_time_formatted}> </li> | + | <li style=”margin:1px;”><a href=”<{$block.mod_url}>/index.php?post_id=<{$post.id}>”><{$post.subject}></a> <{$post.uname}><{$post.post_time_formatted}> </li> |
- | <{/foreach}> | + | <{/foreach}> |
- | </ol> | + | </ol> |
- | <{* $post.forum_id, $post.forum_title *}> | + | <{* $post.forum_id, $post.forum_title *}> |
を | を | ||
- | <ol style=”padding:3px;margin:0;”> | + | <ol style=”padding:3px;margin:0;”> |
- | <{foreach item=post from=$block.posts}> | + | <{foreach item=post from=$block.posts}> |
- | <li style=”margin:1px;”><a href=”<{$block.mod_url}>/index.php?post_id=<{$post.id}>”><{$post.post_time_formatted|xugj_date:”"}><{$post.subject}></a> <{$post.uname}> </li> | + | <li style=”margin:1px;”><a href=”<{$block.mod_url}>/index.php?post_id=<{$post.id}>”> <{$post.post_time_formatted|xugj_date:”"}><{$post.subject}></a> <{$post.uname}> </li> |
- | <{/foreach}> | + | <{/foreach}> |
- | </ol> | + | </ol> |
- | <{* $post.forum_id, $post.forum_title *}> | + | <{* $post.forum_id, $post.forum_title *}> |
に変更。 | に変更。 |
(This host) = https://xoops123.com