Newbee needs help develop a module

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
musicscore
Power Poster
Power Poster
Posts: 478
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Newbee needs help develop a module

Post by musicscore »

Hi there.
Because I use cmsmadesimple now for several years (start in the year 2007 with a 0.x version) and because I will have some extra free time in the near future (I'm almost 65) I want to help cmsmadesimple and start building some modules.
I have some programmer experience (powershell, a little php and javascript, dbase scripts) so I started with reading the "Module_writing_Tutorial " for CMSMS 2.0.1+ writen by Robert Campbell.

After succefull creating and install and uninstall (checked with myphpadmin) I started with the HolidayItem Class (in my case the IwPopupManagerItem Class) and the "Your First Admin Action". And the the fight started. After creating the action.defaultadmin.php and the template "defaultadmin.tpl" I tryed to start the Popup Manager Screen in the admin panel I received a 500 error. So I did something wrong.

I checked the code (defaultadmin.tpl, action.defaultadmin.php and the class.IwPopuManagerItem.php) over and over again but still 500 error.

Now I have 2 questions :

Is the manual still valued.
How can I check where the error is (in what code).

Please advise. After the startup I think I will learn how to create modules but the startup is a little hard it seems.

Please help.
musicscore
Power Poster
Power Poster
Posts: 478
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Newbee needs help develop a module

Post by musicscore »

Her are the files I created :

This is what I see in the error_log :
[29-Jun-2025 15:47:31 Europe/Amsterdam] PHP Deprecated: Using unregistered function "count" in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier. in /home/xxxxxx/sub/ontwikkel.dev-infowebs.nl/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 649
Attachments
iwpopupmanager.zip
(1.55 KiB) Downloaded 6 times
musicscore
Power Poster
Power Poster
Posts: 478
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Newbee needs help develop a module

Post by musicscore »

YESSSSSSSSSS

Found the problem.

In the manual in the action.defaultadmin.php the php close sign is missing. (?>)

After adding this to the code, no 500 error any more.
Now we getting somewhere

;D
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1968
Joined: Mon Jan 29, 2007 4:47 pm

Re: Newbee needs help develop a module

Post by Jo Morg »

musicscore wrote: Sun Jun 29, 2025 1:32 pm Now I have 2 questions :

Is the manual still valued.
How can I check where the error is (in what code).

Please advise. After the startup I think I will learn how to create modules but the startup is a little hard it seems.

Please help.
The manual is still valid. Most modifications made to the core don't break backward compatibility, and functionalities need to be deprecated on a release before being removed in a future release, as a warning to developers, not to use it. Usually and preferably with some notice about what changed and what are the alternatives.

On the question about how can you check errors... there are a number of different ways at your disposal but they may differ a bit depending on what development environment you are using. The most raw too you may use is to use the die('Code executed until this point. Stop!'); at points in your code where you might suspect there something wrong and move it to see if it dies on your line or before it, to pin point the error.
PS: ?> is not mandatory on PHP.... but at the end of a line or complete statement the ; is... and that is what is really missing on your code.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
musicscore
Power Poster
Power Poster
Posts: 478
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

[Solved] Newbee needs help develop a module

Post by musicscore »

Thank you for the quick response Jo Morg.
Seems that I did not check my code enought and it was indeed the ; at the end of one off the codes.
All is working now and I can continue to learn how to build a module.

Thanks again.
Post Reply

Return to “Developers Discussion”