1
pnppcs
Most Recent 10 Posts
  • 2005/7/10 5:28

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


Hello everyone, I have posted this question once before here: https://xoops.org/modules/newbb/viewtopic.php?forum=20&topic_id=34541 but didn't get the answers I was after (i can't read chinese) and the last post was a bit of a derailment.

Anyway, I am still trying to work out how I can display the last 10 recent posts (not last 10 recent topics) in a block.

I don't know PHP very well so if you can help please post here.

Thanks in advance,
Marty.

2
pnppcs
Re: Most Recent 10 Posts
  • 2005/7/10 6:26

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


After reading some other posts I think I would have to clone the "Recent Topic" block and call it [5] like this.

$modversion['blocks'][5]['file'] = "newbb_new.php";
$modversion['blocks'][5]['name'] = _MI_NEWBB_BNAME5;
$modversion['blocks'][5]['description'] = "Shows recent posts in the forums";
$modversion['blocks'][5]['show_func'] = "b_newbb_new_show";
[
b][color=CC0000]$modversion['blocks'][5]['options'] = "10|1|time";[/color][/b]
$modversion['blocks'][5]['edit_func'] = "b_newbb_new_edit";
[
b][color=CC0000]$modversion['blocks'][5]['template'] = 'newbb_block_new.html';[/color][/b]


By looking at the code I can see the differences between the blocks being the code that I have highlighted in red above.

Now, if I want to show last 10 posts instead of last 10 topics all I would have to change is the word "time" to "post" in the code for my [5] block and create a new file called 'newbb_block_newpost.html' ??

Or, am I way off track here I am so confused

[size=x-small]"Edited about 12 times"[/size]

3
Dave_L
Re: Most Recent 10 Posts
  • 2005/7/10 7:39

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


I'll assume you're talking about NewBB 2.x.

Quote:
$modversion['blocks'][5]['options'] = "10|1|time";


The third parameter merely determines the sorting order for the displayed items: "views" (number of views), "replies" (number of replies) or "time" (date/time posted).

If you want to display posts, rather than topics, I think you would have to change the database query in function b_newbb_show in modules/newbb/blocks/newbb_block.php. (I don't have time to figure out the details.)

You might want to see what's going on with CBB, the apparent replacement for NewBB. Maybe the feature you need is already available there, or the developers might be willing to add it.

4
pnppcs
Re: Most Recent 10 Posts
  • 2005/7/10 8:16

  • pnppcs

  • Just popping in

  • Posts: 55

  • Since: 2005/1/25


Thank you Dave_L I will have a look at CBB.

Marty.

Login

Who's Online

443 user(s) are online (369 user(s) are browsing Support Forums)


Members: 0


Guests: 443


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits