PEAK XOOPS - Re: Display recent topics replies, ti custom block! in englishin japanese

Re: Display recent topics replies, ti custom block!

List posts in the topic

question Re: Display recent topics replies, ti custom block!

msg# 1.1.1.1
depth:
3
Previous post - Next post | Parent - No child | Posted on 2006/4/9 5:47
GIJOE  ÀèǤ·³Áâ   Posts: 4110
More hint.
make a "PHP" customblock.

$db =& Database::getInstance() ;
$myts =& MyTextSanitizer::getInstance() ;

$result = $db->query( "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.topic_time, t.topic_views, t.topic_replies, t.forum_id, f.forum_name, p.post_id, p.uid, p.subject, p.post_time FROM ".$db->prefix("bb_topics")." t LEFT JOIN ".$db->prefix("bb_forums")." f ON f.forum_id=t.forum_id LEFT JOIN ".$db->prefix("bb_posts")." p ON p.topic_id=t.topic_id ORDER BY p.post_time" ) ;

$lines = '' ;
while( $row = $db->fetchArray($result) ) {
	$subject4disp = $myts->makeTboxData4show( $row['subject'] ) ;
	$post_time4disp = formatTimestamp( $row['post_time'] , 'm' ) ;

	$lines .= '
		<tr>
			<td class="odd">'.$subject4disp.'</td>
			<td class="odd">'.$post_time4disp.'</td>
		</tr>
	' ;
}

echo '
	<table class="outer">
		<tr>
			<th>Subject</th>
			<th>date</th>
		</th>
		'.$lines.'
	</table>
' ;


Votes:45 Average:9.78

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!