PEAK XOOPS - Image "NEW" in line of block Topics in englishin japanese

Image "NEW" in line of block Topics

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2008/10/17 10:50
leco1  »°Åù·³Áâ From: Porto Alegre  Posts: 93
Where do I configure the module to display the image "NEW" in the block of topics?

Thanks
Votes:22 Average:5.91
Previous post - Next post | Parent - Children.1 .2 | Posted on 2008/10/19 4:43
GIJOE  ÀèǤ·³Áâ   Posts: 4110
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"
<{$news.date|xugj_date}>

- Just "New!"(24hour) "new"(7days)
<{$news.date|xugj_date:"":"New!":"new"}>

etc.
Votes:21 Average:7.62
Previous post - Next post | Parent - Children.1 | Posted on 2009/3/1 11:19 | Last modified
vietnam  ÆóÅùʼ   Posts: 2
Quote:

GIJOE wrotes:
hi leco1.
Usage:

- 'Y-n-j' with "New"
<{$news.date|xugj_date}>

- 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.
Votes:19 Average:6.32
Previous post - Next post | Parent - No child | Posted on 2009/3/16 22:02
leco1  »°Åù·³Áâ From: Porto Alegre  Posts: 93
Thanks Gj

I will try to implement this.

Votes:15 Average:6.67
Previous post - Next post | Parent - No child | Posted on 2009/3/22 1:55 | Last modified
leco1  »°Åù·³Áâ From: Porto Alegre  Posts: 93
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>
&nbsp;
<{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}>
&nbsp;
<{if is_numeric( $block.categories ) }>
<a href="<{$block.mod_url}>/index.php?cat_id=<{$block.categories}>"><{$block.lang_linktolistforums}></a>
&nbsp;
<{/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.com

Thanks Gj
Votes:27 Average:4.81

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!