Modules: Conjecture - replacement for comments

Posted by: MithrandirOn 2006/10/31 10:57:28 12902 reads

How to extend with more modules:

1) Add a file in modules/conjecture/class/ called [moduledirname].php
2) include_once(XOOPS_ROOT_PATH."/modules/conjecture/class/comments.php");
3) Make a new class called Conjecture[Moduledirname]Handler that extends ConjectureCommentsHandler
4) Make a constructor that calls the parent's constructor
5) Add $this->pages['filename'] = array('param' => 'param_name', 'handler' => 'handler_name'); replacing filename with the name of the accessed script in the module. param_name is e.g. id, itemid or storyid. handler_name is the name of the handler, handling the objects
6) If no param is set, you MUST override the getId() class function to set $this->item_id
7) If no handler is set, you MUST override the getTitle() class function to set the title of the forum topic properly

You can add several $this->pages indexes if you have multiple item types with comments.

The module should automatically pick up the new available class if the module is installed.