1
biglove
how to Clone Most Viewed Topics block in newbb2
  • 2005/2/24 20:33

  • biglove

  • Not too shy to talk

  • Posts: 157

  • Since: 2004/8/18


I would like to clone the Most Viewed Topics block in newbb2 because I would like to show the
most viewed in topics in Forum A
AND separately
most viewed in topics in Forum B

is there an easy way to do this?

I've poked around on this site and haven't seen any info on cloning a block. I have found module cloning, but I would think cloning a block would be easier.

Thanks

2
jansen
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/2/24 20:59

  • jansen

  • Just popping in

  • Posts: 71

  • Since: 2004/3/9 1


There is a simple and quick way to do this. Just edit the xoops_version.php file as follows:

Search for:

$modversion['blocks'][3]['file'] = "newbb_block.php";
$modversion['blocks'][3]['name'] = _MI_NEWBB_BNAME3;
$modversion['blocks'][3]['description'] = "Shows most active topics in the forums";
$modversion['blocks'][3]['show_func'] = "b_newbb_show";
$modversion['blocks'][3]['options'] = "10|0|replies|0";
$modversion['blocks'][3]['edit_func'] = "b_newbb_edit";
$modversion['blocks'][3]['template'] = 'newbb_block.html';


And add:

$modversion['blocks'][4]['file'] = "newbb_block.php";
$modversion['blocks'][4]['name'] = _MI_NEWBB_BNAME3;
$modversion['blocks'][4]['description'] = "Shows most active topics in the forums";
$modversion['blocks'][4]['show_func'] = "b_newbb_show";
$modversion['blocks'][4]['options'] = "10|0|replies|0";
$modversion['blocks'][4]['edit_func'] = "b_newbb_edit";
$modversion['blocks'][4]['template'] = 'newbb_block.html';


Save the file and update the module in the system admin. You'll see that a new block is available. You can add as many blocks as you like...

All the best,

Bob


P.S.

This is for the most recent topic, didn't see that you needed the most viewed. To do that replace line 5 with:

$modversion['blocks'][4]['options'] = "10|0|views|0";


That should do!

3
biglove
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/2/24 23:45

  • biglove

  • Not too shy to talk

  • Posts: 157

  • Since: 2004/8/18


Thanks

Nice site BTW. My brother run's a small wakeboard clinic.

4
hyperpod
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/2/25 0:59

  • hyperpod

  • Quite a regular

  • Posts: 359

  • Since: 2004/10/4


Im not sure, but i think you may need to also copy the blocks .php file and rename it. and also reflect this change in yout new block entry. Then you can edit the code that drives the block to only show 1 forum as suggested, without losing the original blocks functionality.

Then just clone it again this way for Forum B (copying the block.php and adding in the new xoops_version.php block info as suggested previously.)

Cheers,

5
jansen
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/2/25 9:36

  • jansen

  • Just popping in

  • Posts: 71

  • Since: 2004/3/9 1


I see no reason to copy the newbb_block.php file. I've done the method I described on my test server (newbb2 not yet online on production) and it works as needed. The newbb_block.php file is used to create multiple blocks based on some settings in xoops_version.php, so just adding a few lines in it does the trick, in the block settings you can change which forums to show (new functionality in NewBB2).

6
phppp
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/2/28 20:42

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


plz read readme.html of newbb 2.
adding block on-fly is available.

7
phppp
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/5/20 22:27

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


No need to modify xoops_version.php.

There is a tutorial about how to clone newbb blocks using custom block.

8
JamesSAEP
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/5/20 22:38

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


I've tried the way of modifying the verson file and the on the fly blocks and they do add the content. The problem is that I want to only display the contents for Category 15 for example.

When I try to select the forums only to display, everything appears. It wont' take my selections.

Can you also tell me where the tutorial is?

Thanks.

9
phppp
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/5/21 3:33

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


It was with NewBB 2.01/2.02 release news

Or check if jdseymour has the tutorial.

10
JamesSAEP
Re: how to Clone Most Viewed Topics block in newbb2
  • 2005/5/23 19:33

  • JamesSAEP

  • Just can't stay away

  • Posts: 732

  • Since: 2005/2/28


I'm still having a problem of the cloned dispalying the last post from ALL my categories. I only want a block to display the first 3 categories. Is this possible?

Thanks.

Login

Who's Online

61 user(s) are online (27 user(s) are browsing Support Forums)


Members: 0


Guests: 61


more...

Donat-O-Meter

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

Latest GitHub Commits