1
invertigo7
Help With Creating a Module
  • 2006/12/13 13:24

  • invertigo7

  • Just popping in

  • Posts: 14

  • Since: 2005/7/1 1


I've been using XOOPS on a couple of different sites for a while now, and I feel pretty comfortable with how most things work. However, I'm extremely new at trying to make a module, and maybe I'm in way over my head, but I have a question.

I have created a very basic module called "squad". So far I don't have any blocks or anything, and I don't have an admin page. I just browse to http://www.mysite.com/modules/squad and it displays the data. The problem I'm having is that I can only view the module when I'm logged in as a user who is a webmaster. I know how to assign groups access rights to modules in the control panel. I have set up my news module, content module, etc to be accessible by all groups and they work fine. However, my module does not show up on the groups page as a module I can assign rights to. How do I make it so my module shows up there so I can grant access permissions? If this doesn't make sense let me know and I'll try to clarify.

I'm really sorry if this is posted in the wrong place, but I can't find any basic newbie guides for making a mod anywhere, and the dev forums don't seem to be visited very much.

Thank you all in advance!

2
Mithrandir
Re: Help With Creating a Module

Have you read the module development guide on the dev wiki?

http://dev.xoops.org/modules/phpwiki/index.php/ModuleDevGuide

especially the part about xoops_version.php
http://dev.xoops.org/modules/phpwiki/index.php/ModVersion
can be useful.

it is not said very explicitly, but for the module to be recognised by XOOPS as a module with front-side pages, you have to put
modversion['hasMain'] = 1;

in your xoops_version.php (then update the module) - then it will show up in groups management and you can assign module access permissions.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

3
chippyash
Re: Help With Creating a Module
  • 2006/12/13 14:24

  • chippyash

  • Friend of XOOPS

  • Posts: 501

  • Since: 2004/1/29


Getting the basic structure of a module right can be a real pain for the uninitiated. For this reason I developed XBS ModGen. You can get it via this site in the module repository.

Create new module with it and then cut and paste your page display logic into the pages you create with it. The module will install and provide admin, user and block pages (if you specify them that is).

Modgen comes with extensive documentation (via the module admin screens) so please read that first. Any questions on its use, go to the support forum, also linked via the module admin pages.

4
invertigo7
Re: Help With Creating a Module
  • 2006/12/13 21:51

  • invertigo7

  • Just popping in

  • Posts: 14

  • Since: 2005/7/1 1


Mithrandir, my friend, are my hero! The modversion['hasMain'] = 1; was exactly what I needed. I had it in there, but set to zero because the description only said something about the main menu. I didn't realize it did more than just that. Thank you!

akitson, I am going to take a look at that mod right now. Thank you both very much!

5
Peekay
Re: Help With Creating a Module
  • 2006/12/14 0:39

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I second XBS Modgen. An excellent solution for creating XOOPS module frameworks (IMHO)

For those that have never developed a module, I can also recommend the tutorials by kaotik that are mentioned in this thread. They provide a step-by-step example of how to build a simple XOOPS module with PHP and Smarty templates.
A thread is for life. Not just for Christmas.

Login

Who's Online

382 user(s) are online (300 user(s) are browsing Support Forums)


Members: 0


Guests: 382


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