Home Home




How to add comments-function to any XOOPS module


This module demonstrates how this hack works and have description how you can add it to your own module. It doesn't matter if your module use sql or not, you can now build a simple module with an index.php containing for example only a javascript, and still get comments to the module.

There are a few things you have to do to get it to work:

First copy the following files and folders in the module folder of this module, to your module folder:
  • comment_delete.php
  • comment_edit.php
  • comment_new.php
  • comment_post.php
  • comment_reply.php
  • comment_view.php
  • commentform.php
  • display_comments.php
  • extra_functions.php
  • Folder js (or add the files to your existing js folder).
  • Folder language (or add language/english/noitemcomments_lang.php to your existing language folder).

Next you have to connect the comments to your module by adding 3 includes as described in bottom of index.php in this module. Look for the commented lines and copy it to your module. Remember to change module name.

Then do the following:
  • Open the file xoop_version.php of this module and copy the commented code to your module's xoops_version.php
  • Open the file display_comments.php and do as described in the commented line (Line 38).
  • Open the file preloads/core.php and do as described in the commented lines.

Note! Only the first module with the comments hack, needs the preloads folder, so if you for example have this module installed, drop the included preloads folder for the rest of the modules you want to add the hack to!

Finally: UPDATE YOUR MODULE!

NOTE! This hack requires at least XOOPS version 2.4.0, so you better UPGRADE if you want to use it!



Register or login to post comment

 


 
 
Download XOOPS Modules
Module Demos
Top Downloads




© 2009 - 2014 all right reserved | Danordesign - Free XOOPS Modules and PHP Scripts | Powered by XOOPS