1
biomech
How do I get the list of recent topics?
  • 2004/12/29 11:26

  • biomech

  • Not too shy to talk

  • Posts: 161

  • Since: 2002/2/25


Hi,

I'm trying to add to one of my modules, and I want to include a listbox containing the recent topics in the forums. At the moment, I have the Recent Topics block enabled on my bbs, but I also want to make a custom listbox of the recent topics themselves.

Can someone point me to some code/sql that will do this?

Thanks,

-b-

2
irmtfan
Re: How do I get the list of recent topics?
  • 2004/12/29 11:48

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


what is your newbb version?
with newbb 2 final you can create as many as recent topic blocks you want with ability to select forums to show in each block. its very functional and IMO you can do anything with blocks in bewbb2

Quote:
I also want to make a custom listbox of the recent topics themselves

could you describe more about custom list?

3
biomech
Re: How do I get the list of recent topics?
  • 2004/12/29 11:53

  • biomech

  • Not too shy to talk

  • Posts: 161

  • Since: 2002/2/25


Not 100% sure about the version, but the first line of ~modules/newbb/index.php says:
// $Id: index.php,v 1.13 2003/09/22 04:37:25 okazu Exp $

... so I assume its 1.13. Apparently I need to upgrade the module... I guess I just download it from the modules section here at xoops.org and upgrade it through the modules admin control panel?

By custom list, I just mean that I want to code my own listbox in my own module which gives a list of the recent topics.

-b-

4
irmtfan
Re: How do I get the list of recent topics?
  • 2004/12/29 12:07

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


newbb final still is not release for public download but you can download it from dev.xoops.org
read the readme file carefully

5
biomech
Re: How do I get the list of recent topics?
  • 2004/12/29 12:51

  • biomech

  • Not too shy to talk

  • Posts: 161

  • Since: 2002/2/25


I tried to get this working, but ran into problems:

1)
I downloaded the following files:

XOOPS2_mod_newbb_2.0Final.zip
main.php
modules-newbb-include-functions.zip

2)
I backed up
~modules/newbb and
~modules/system/admin/modulesadmin/main.php

3)
I removed ~modules/newbb, and replaced it with the new one I downloaded. I also copied in the new modules/newbb/include/functions.php which I downloaded in 1) above.

4)
I copied main.php to
~modules/system/admin/modulesadmin/main.php

5)
I went to my XOOPS administration menu, system admin, modules. I then clicked on the Update icon to the right of the Forum icon, which was displayed as version one. I confirmed the Update, and received Update output, and was told that th Update was successful. The Forum icon in the Modules administration menu now shows version 2.

6)
I went to look at my forums, but all I see is a list of forum categories, no forums. At the very top of the page, this is displayed in plain text:

NewbbForumHandler::getForums error::SELECT * FROM kt__bb_forums ORDER BY forum_order

and a couple of other weird html anomalies show up as well. I wonder if this is because i haven't updated the newbb templates as instructed in the readme file. However, the readme file doesn't say what or where the newbb templates are, or how to udpate them, which is a bit useless.

If anyone could tell me where to go from here, I'd appreciate any advice.

Thanks,

-b-

Edit: Now that I look at that error, its obvious that the forums aren't showing up because of the getForums error, but I'm not sure why that's happening or where to look for a solution. Advice appreciated...

6
irmtfan
Re: How do I get the list of recent topics?
  • 2004/12/29 14:16

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


do you run the upgrade script?
for upgrade from newbb1 to newbb2 you must run the following file:
newbb/update/newbb1_to_newbb2.php

7
biomech
Re: How do I get the list of recent topics?
  • 2004/12/29 14:46

  • biomech

  • Not too shy to talk

  • Posts: 161

  • Since: 2002/2/25


Ok, thanks, I missed that.

I'll go ahead and upgrade to newbb2, but I'm not sure I explained what I want to do well enough. I don't need to make a new block.

I am writing a custom module, and in this module I want to make an html form listbox, which is populated with the most recent topics, so that the users of the module can select one of the topics as a form element. Do you understand what I mean? I'm just looking for the code I need to retrieve the list of most recent topics. I assumed that the "Recent Topics" block must do this in order to show the recent topics, so I thought maybe I could use some of that code, but I couldn't find what I needed.

For example, what database table do I have to query to get the list of recent topics?

Thanks,

-b-

PS: By the way, your Persian H.P. site looks really really cool! I only wish I could read Persian. (What countries or areas do you refer to as "Persia?")

8
irmtfan
Re: How do I get the list of recent topics?
  • 2004/12/29 15:00

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


what is your custom module exactly?
im not a developer but you can take a look at blocks/newbb_block.php and see how it work. but IMHO the newbb2 module is very hard to understand. why not take a look at newbb1 recent topics block?
thanks for your comment about the HP site. i create this site for all persian spoken in the world not only for iranian users.there are many visiors from whole world.

9
biomech
Re: How do I get the list of recent topics?
  • 2004/12/29 15:06

  • biomech

  • Not too shy to talk

  • Posts: 161

  • Since: 2002/2/25


I don't see any file called newbb_block.php.
I did see ~modules/newbb/blocks/newbb_new.php , but I didn't see any code that I thought was useful for getting a list of the recent topics. That's all I need just a list...

-b-

10
irmtfan
Re: How do I get the list of recent topics?
  • 2004/12/29 15:17

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


sorry
in newbb2 its: newbb/blocks/newbb_block.php
in newbb1 its: newbb/blocks/newbb_new.php
but as i said in last post i dont know how you can migrate/use these codes for your own block.

Login

Who's Online

192 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 192


more...

Donat-O-Meter

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

Latest GitHub Commits