[Phpslash-devel] How to add a module?
Brought to you by:
joestewart,
nhruby
From: Peter C. <li...@cr...> - 2003-11-05 14:50:22
|
I'm trying to add a new module to phpSlash 0.8alpha and I need some help... This is what I've done so far. 1. Copied the glossary files to use as a basis for my new module (called House) - /public_html/glossary.php -> property.php - /public_html/admin/glossaryAdmin.php -> propertyAdmin.php - /include/modules/glossary/ -> house/ (You might be able to work out what the application's for...) 2. Edited the code to use House.class instead of Glossary.class 3. Edited config.ini.php - Added a new module House = house - Set jpcache.enable = false so I'm looking at live pages 4. Added new menu items $menuitem[] = array( 'name' => "House", 'link' => $_PSL['rooturl'] . "/property.php", 'perm' => "nobody", 'module' => "House" ); and (for admin menu) $menuitem[] = array( 'name' => "House", 'link' => $_PSL['adminurl'] . "/propertyAdmin.php", 'perm' => "glossary", 'module' => "House" ); This was enough for the admin screen to work (ie the glossary admin screen appears, since I have made no changes to the code), but there was nothing for the main page (property.php). After a little thinking and digging around, I did a bit more: 5. Created a House section 6. Added a new module block - Owned by section: House - Order number = 90 - column = center - box_type = contentsonly - module = House ** Incidentally, the code went berserk when I missed the module paremeter, adding c200 copies of the new module block. I will track this down and submit a fix. ...Still nothing. Konqueror helpfully tells me that the connection to the host is broken (which is a lie - it's only that something's going wrong with the page). If I remove the link between the House block at the House section, I get a page with an empty center column, so I am fairly sure that the issue is with generating the content to go into the House-module block. I can't see how to pin it down though. - I have put a debug line in modules/house/index.php - it is never reached - debug on propery.php shows module.current == "block" (if I force it to 'house' I get the glossary search page, but nothing else) All the debug statements have been removed along the line, so turning debug on isnt helping a whole lot. What else do I need to do? I'm sure it's something pretty simple I've missed out... The benefit of helping me - I will write this up as a how-to for the website once everything's working. Unless there is one already, and I've missed it... Thanks in advance! Peter |