1
phatjew
Are templates necessary before posting modules?
  • 2003/11/6 20:45

  • phatjew

  • Just popping in

  • Posts: 56

  • Since: 2003/10/8


I guess this question could go in the Modules forum, but I thought it was a more general, community-oriented question.

I have a restaurant review module (that can easily be made to work for any kind of reviews), and I think it has a lot of nice features (hierarchical categories, full search on any field (inclusive or exclusive), unlimited number of locations/addresses, etc.). However, I wrote it without templates for (much) easier debugging. Now I'd like to release it to the community, and I want people to be able to use it and change it to meet their own needs.

The question is, should I convert it all to templates before releasing it, thus putting that date off quite a bit, or should I just get it out there for people to start using and testing?

Thanks in advance for any advice.


2
Mithrandir
Re: Are templates necessary before posting modules?

To get the future "XOOPS Official Module" certification you'll need to use the core features where it is logical. That means, using SMARTY templates for pages with lots of HTML, using classes/making your own, where it will make the code "nicer". You should also use the Administration Menu features, where applicable.

However, to release it to the public, it should just work with XOOPS 2.0.5 and be installable through the System Admin -> Modules interface.

There have been several requests for a review module and I'll be watching your module development with interest

Welcome aboard

3
phatjew
Re: Are templates necessary before posting modules?
  • 2003/11/6 21:49

  • phatjew

  • Just popping in

  • Posts: 56

  • Since: 2003/10/8


Quote:

MithyT2 wrote:
To get the future "XOOPS Official Module" certification you'll need to use the core features where it is logical. That means, using SMARTY templates for pages with lots of HTML, using classes/making your own, where it will make the code "nicer". You should also use the Administration Menu features, where applicable.


What do you mean by "Administration Menu" features? I have several admin pages, just like many of the core modules. Is that all you mean?

As far as classes, I do have several files full of families of functions that I could turn into classes without too much trouble. Are basic "script" functions frowned upon even within modules?

4
phatjew
Re: Are templates necessary before posting modules?
  • 2003/11/6 21:53

  • phatjew

  • Just popping in

  • Posts: 56

  • Since: 2003/10/8


Oh, and I also had concerns about speed when using SMARTY templates. Should I be concerned? Is there any speed hit at all, or just a minimal one, or a significant one?

I'm worried about speed overall, especially in graphically-heavy modules like this forum -- the pages load really slow for me. (off-topic: is there a more stripped-down, faster-loading forums module?)


5
Mithrandir
Re: Are templates necessary before posting modules?

SMARTY usually reduces loading times (or so I am told)

By Administration Menu features, I mean using the config options in the automatic Preferences menu (which you set in xoops_version.php of your module). Also if you have module-wide things to admin (e.g. My Team Module has some Team Management - which teams are there? which members do each team have? Maps? Positions? etc.) place it in the Administration Menu and not in special pages inside the module.

Basic "script" functions are not frowned upon at all, at least not by me, who did exactly that before going OO. I went OO because I had all functions in one file and since I was going to split those functions into their own separate files, I might as well go OO.

OO also means of course that you can use the features like Inheritance etc.
If you aren't seeing any benefits from going Object Oriented, there is no reason to do so - as long as you use the existing core classes where applicable instead of writing new functions.

6
Mithrandir
Re: Are templates necessary before posting modules?

Basically - as long as your code is nice and easy to read (preferably split up with code in one file - or first in the file - and HTML in another - or later in the file) and preferably with functions doing the database calls instead of having them cluttering up the code, then you should be all set.

Some more measurable criteria will be announced as soon as we get them into writing

7
Catzwolf
Re: Are templates necessary before posting modules?
  • 2003/11/6 22:16

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I think that the speed increase are minimal compared to the benefits for the web designers out there, these guys like the ability to have some type of uniformity throughout the whole site and the way you have done this would restrict them.

The main problem with combining PHP and HTML is that you 'take away this ability' from them and there is nothing worse than having to 'wade' through tons of PHP code to change one line of HTML.

I would suggest looking throu the XOOPS core, there are many hidden feature (functions, classes) that could be used within your own module.

To answer your second question, I found even with dial up that this forum was quicker than others I used, maybe it is your location in compared to where you are that 'could' make it seem so?



8
DobePhat
Re: Are templates necessary before posting modules?
  • 2003/11/7 0:03

  • DobePhat

  • Friend of XOOPS

  • Posts: 656

  • Since: 2003/4/15


Quote:
especially in graphically-heavy modules like this forum -- the pages load really slow for me. (off-topic: is there a more stripped-down, faster-loading forums module?)


I find that the images on the forum index are annoying and pretty useless (for me anyways) they never show the correct "latest topic" graphic etc...

Im considering just modifying the template and basically taking out that whole left column...
But will it freak because of the php script?

Ill advised?
Thanks

9
phatjew
Re: Are templates necessary before posting modules?
  • 2003/11/7 16:11

  • phatjew

  • Just popping in

  • Posts: 56

  • Since: 2003/10/8


First, thanks for all the great answers. I think I'll go ahead and templatify the display pages at least before making it public.

Quote:

Catzwolf wrote:

I would suggest looking throu the XOOPS core, there are many hidden feature (functions, classes) that could be used within your own module.


Look through throught the core, huh? That's a big task. The most frustrating problem I am having is that I have no idea what the "core" classes are, and what functionality they provide. For example, I started using HTMLSpecialChars() freely, then found the text sanitizer weeks later. I made all my forms, then learned of the existence of the XoopsForms classes (which has a great class diagram in the Wiki, BTW -- nice use of UML).

So, I'm sure that there are cases where I am doing unnecessary coding simply due to ignorance. The API that I found was just an alphabetical laundry list of functions, but not very useful as a real summary of what is available in the core. Does anyone have a list of core classes with description? Even a short description would be helpful, so that I know which classes I should investigate further.

Sorry for being so long-winded.

--Rafi

Login

Who's Online

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


Members: 0


Guests: 192


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