1
ultimike
2 news modules?
  • 2004/4/27 10:58

  • ultimike

  • Just popping in

  • Posts: 13

  • Since: 2004/4/21


Good morning,

I'm curious to know if I can set up two news modules within XOOPS.

I would like to have one news section for all users (registered and non-registered) as well as a news section for registered only users.

The admin area doesn't seem to allow adding a second news module - am I missing something?

Or is there a way to set up a single news module so that certain topics are for registered users only?

I have been looking into adding an additional module from the Downloads section that would act like a second new module - specifically, I've been looking at the "Stories Module, Replacement for News" module. Is this the best way to go?

Thanks in advance,
-mike

2
ladon
Re: 2 news modules?
  • 2004/4/27 11:48

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


You're not missing something, it is not possible to use two identical modules. You'll have to make some changes, you'll have to clone the newsmodule. Here's what you'll need to do:

- copy all files and directory's in /modules/news to modules/a_new_name
- Search everywhere for the name of the module, news (in all php files that is) and change it to what you want.
- Do the same thing for the path name and change the name to what you named the directory.
- Last but not least, make changes in the SQL file (can be found in the SQL dir) and change the table names.

3
rabideau
Re: 2 news modules?
  • 2004/4/27 12:27

  • rabideau

  • Home away from home

  • Posts: 1042

  • Since: 2003/4/25


You could try using one of the available FAQ modules (of which there are several) for on of your "News" modules. Or...

You could use something like iContent (which is what I do) for items that can be accessed from a "Library". You can see an example of this here:http://eirenicon.org/modules/icontent/

4
ultimike
Re: 2 news modules?
  • 2004/4/27 12:35

  • ultimike

  • Just popping in

  • Posts: 13

  • Since: 2004/4/21


ladon,

Thanks for the info - I'm attempting to clone the news module now.

One question though - your 2nd step says to:

Search everywhere for the name of the module, news (in all php files that is) and change it to what you want.

What exactly am I searching for? I'm not sure where/how the module name is defined?

I've completed the other 3 steps without a problem.

Thanks,
-mike

5
Mithrandir
Re: 2 news modules?

The module dirname is "news"
When you clone the news module, you put it in another directory, so you should replace "news" with the new dirname wherever the original files include "news" as in dirname

This is mostly in the block and class functions, when configuration options or similar are needed.

Try searching for "->getByDirname("news");" and you should find most of them (but possibly not all)

Edit: You will also need to change the names of the template files (since they need to be unique) - both the actual filenames in news/templates and the templates listing in news/xoops_version.php. Also notice that the news_index.html template includes news_item.html, so that template also needs editing to reflect the new name.

Unfortunately, News is not really the best module to clone, but I do hope you succeed.
Good luck

6
ladon
Re: 2 news modules?
  • 2004/4/27 12:58

  • ladon

  • Quite a regular

  • Posts: 284

  • Since: 2003/10/31


In addition to what mithrandir said, look at xoops_version.php in the root of the newsmodule. This is where everything is defined (name, dirname, tablenames etc.)

7
Mithrandir
Re: 2 news modules?

Yup, xoops_version.php is very important to go through, but don't go in the trap of thinking that just because you have changed things there, then everything is alright.

One other thing: When you change the template names, you will also need to change the code in the php files, setting the template to use. It is done with this line:
$xoopsOption['template_main'] = "template_name";

where you of course will need to change it to the new name.

If, on the other hand, you don't intend to have different templates in the modules, you can also completely remove the templates directory and the lines regarding templates from xoops_version.php, then the templates used will be the ones form the original module (also meaning, that if you change the template in one clone, you will also change it in other clones)

8
krobi
Re: 2 news modules?
  • 2004/4/27 14:00

  • krobi

  • Quite a regular

  • Posts: 290

  • Since: 2003/12/21


hello

you can download a cloned news modul from myxoops.de
take the new one based on XOOPS news modul 2.0.6

9
ultimike
Re: 2 news modules?
  • 2004/4/30 16:47

  • ultimike

  • Just popping in

  • Posts: 13

  • Since: 2004/4/21


Thanks to everybody who chimed in on this one - I got it working.

I made all the changes that ladon and Mithrandir suggested and finally got it working.

One point worth noting for anyone else who may want to do this - don't install the module until the very end. I made the mistake of installing it before all the changes were made that and screwed stuff up quite badly!

Thanks for your help!

-mike

Login

Who's Online

255 user(s) are online (163 user(s) are browsing Support Forums)


Members: 0


Guests: 255


more...

Donat-O-Meter

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

Latest GitHub Commits