Where do I configure the module to display the image "NEW" in the block of topics?
Thanks
hi leco1.
Quote:
Where do I configure the module to display the image "NEW" in the block of topics?
Just a general customization of templates.
I use "xugj_date" as Smarty Plugin.
(This plugin is well known in Japan)
make a file class/smarty/plugins/modifier.xugj_date.php
<?php
/**
* Smarty plugin
*/
/**
* Include the {@link shared.make_timestamp.php} plugin
*/
/**
* Smarty xugj_date modifier plugin
*
* Type: modifier
* Name: xugj_date
* Purpose: format datestamps via date()
* Input:
* - string: input date string or integer
* - format: format of date() for output
* - new1_string: message for the latest timestamp
* - new2_string: message for the second latest timestamp
* - is_uzone: is the string offsetted for user's timezone
* @link http://www.xugj.org/
* @author xugj members
* @param string or integer
* @param string (optional)
* @param string (optional)
* @param string (optional)
* @param bool (optional)
* @return string|void
*/
function smarty_modifier_xugj_date( $string , $format = 'Y-n-j' , $new1_string = 'New!' , $new2_string = 'New' , $is_uzone = true )
{
if( is_numeric( $string) ) {
// specified by UNIX TIMESTAMP
$time = intval( $string ) ;
} else {
// specified by format
$time = strtotime( $string ) ;
}
if( $time <= 0 ) {
$time = time() ;
}
$utime = $is_uzone ? $time : xoops_getUserTimestamp( $time ) ;
$unow = xoops_getUserTimestamp( time() ) ;
$new_marks = '' ;
if( $new1_string ) {
if( $utime > $unow - 1 * 86400 ) {
$new_marks = '<span class="new1">' . $new1_string . '</span>' ;
} else if( $new2_string ) {
if( $utime > $unow - 7 * 86400 ) {
$new_marks = '<span class="new2">' . $new2_string . '</span>' ;
}
}
}
return date( $format , $utime ) . $new_marks ;
}
?>
Usage:
- 'Y-n-j' with "New"
- Just "New!"(24hour) "new"(7days)
<{$news.date|xugj_date:"":"New!":"new"}>
etc.
Quote:
GIJOE wrotes:
hi leco1.
Usage:
- 'Y-n-j' with "New"
- Just "New!"(24hour) "new"(7days)
<{$news.date|xugj_date:"":"New!":"new"}>
etc.
Great invention, I very much enjoy it
Please help HACK
Useless, it should be added to it?
What add ?
htdocs/d3forum/templates/block_list_topics.php 24~28 ?
<{if ! $topic.solved}><img src="<{$block.mod_imageurl}>/block_unsolved.gif" alt="<{$block.lang_alt_unsolved}>" /><{/if}></td>
<td align="center"><{$topic.replies}></td>
<td align="center"><{$topic.views}></td>
<td align="center" nowrap="nowrap"><{$topic.last_uname}></td>
<td align="right" nowrap="nowrap"><{$topic.last_post_time_formatted}></td>
Did not affect the
<{$news.date|xugj_date:"":"New!":"new"}>
be added where
Please help.
Thanks Gj
I will try to implement this.
Cut and past this template in d3forum:
d3forum_block_list_topics.html
<{if $block.full_view == true}>
<table class="outer" cellspacing="1">
<thead>
<tr>
<th><{$block.lang_forum}></th>
<th><{$block.lang_topic}></th>
<th align="center"><{$block.lang_replies}></th>
<th align="center"><{$block.lang_views}></th>
<th align="center" colspan="2"><{$block.lang_lastpost}></th>
</tr>
</thead>
<{foreach item=topic from=$block.topics}>
<{strip}>
<tr class="<{cycle values="even,odd"}>">
<td><a href="<{$block.mod_url}>/index.php?forum_id=<{$topic.forum_id}>"><{$topic.forum_title}></a></td>
<td><a href="<{$block.mod_url}>/index.php?topic_id=<{$topic.id}>#post_id<{$topic.last_post_id}>">
<{if $topic.u2t_marked}><img src="<{$block.mod_imageurl}>/block_marked.gif" alt="<{$block.lang_alt_marked}>" /><{/if}>
<{* displays the last post's subject or topic title *}>
<{if $block.disp_last_subject }>
<{$topic.last_subject}>
<{else}>
<{$topic.title}>
<{/if}></a>
<{if ! $topic.solved}><img src="<{$block.mod_imageurl}>/block_unsolved.gif" alt="<{$block.lang_alt_unsolved}>" /><{/if}></td>
<td align="center"><{$topic.replies}></td>
<td align="center"><{$topic.views}></td>
<td align="center" nowrap="nowrap"><{$topic.last_uname}></td>
<td align="right" nowrap="nowrap"><{$topic.last_post_time_formatted}><{$news.date|xugj_date:"":"Novo!":"novo"}></td>
</tr>
<{/strip}>
<{/foreach}>
</table>
<div style="text-align:right; padding: 5px;">
<a href="<{$block.mod_url}>/index.php?page=search"><{$block.lang_linktosearch}></a>
<{if is_numeric( $block.forums ) }>
<a href="<{$block.mod_url}>/index.php?forum_id=<{$block.forums}>"><{$block.lang_linktolisttopics}></a>
<{else}>
<a href="<{$block.mod_url}>/index.php?cat_ids=<{$block.categories}>"><{$block.lang_linktolisttopics}></a>
<{/if}>
<{if is_numeric( $block.categories ) }>
<a href="<{$block.mod_url}>/index.php?cat_id=<{$block.categories}>"><{$block.lang_linktolistforums}></a>
<{/if}>
<a href="<{$block.mod_url}>/index.php"><{$block.lang_linktolistcategories}></a>
</div>
<{else}>
<ol style="padding:3px;margin:0;">
<{foreach item=topic from=$block.topics}>
<li><a href="<{$block.mod_url}>/index.php?topic_id=<{$topic.id}>"><{$topic.title}></a>(<{$topic.replies}>) <{$topic.last_uname}> <{$topic.last_post_time_formatted}></li>
<{/foreach}>
</ol>
<{/if}>
See running at
http://investbizu.comThanks Gj