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

Display recent topics replies, ti custom block!

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2006/4/7 21:28
JimKarvo  °ìÅùʼ   Posts: 19
I want to put the "Recent topic replies", of newbb forum, to my custom block!

I am comfused of block, and templete!

How I can do it?
Votes:2 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/4/8 5:18
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Just a query hint.

"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 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"
Votes:7 Average:7.14
Previous post - Next post | Parent - Children.1 | Posted on 2006/4/8 6:20
JimKarvo  °ìÅùʼ   Posts: 19
I imaginate that it is a html code, correct?
Votes:2 Average:0.00
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

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!