Support Forums

what i miss in create module

This is a discussion on what i miss in create module within the Modules / Plugins / Modifications forums, part of the Developer Forums category; hi i tried to create module but i fail i follow the instructure in doc how to create module but ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 08-10-2011, 04:22 AM   #1
Customer
 
Abdulaziz's Avatar
 
Join Date: Sep 2008
Location: Kuwait
Posts: 61
Rep Power: 14
Abdulaziz is on a distinguished road
Default what i miss in create module

hi

i tried to create module but i fail i follow the instructure in doc how to create module but i didn't know what i miss

here what i do
in config.php
PHP Code:

$data
['module']['name'] = "review";
$data['module']['displayname'] = "Listing Review";
$data['module']['description'] = "Allows members to write review on listing.";
$data['module']['version'] = "v1";
$data['module']['admin_capable'] = "1";
$data['module']['user_capable'] = "0"

init.php

PHP Code:


function install() {
    global 
$db$class_tpl;
    
$sSQL "DROP TABLE IF EXISTS " PREFIX "review";
    
$db->query($sSQL);
    
$sSQL "CREATE TABLE  " PREFIX "review (
`reid` INT( 255 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`lid` INT( 255 ) NOT NULL ,
`uid` INT( 255 ) NOT NULL ,
`username` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`review` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
) ENGINE = MYISAM ;"
;
    
$db->query($sSQL);
    
$class_tpl->assign('msg''Everything installed successfully.');
}
function 
uninstall()
{
    
    global 
$db$class_tpl;
    
$sSQL="DROP TABLE IF EXISTS ".PREFIX."review";
    
$db->query($sSQL);
    if ( 
$db->isError() )
    {
        
$class_tpl->assign('msg''ERROR dropping the database.');
    }
    else
    {
        
$class_tpl->assign('msg''Everything removed successfully.');
    }

in hooks.php
PHP Code:


class review {

    function 
review(&$modules) {
        global 
$db$class_tpl$modules;

        
$modules->register('showReviewInHome'$this'showReview');
    }

    function 
showReview() {
        echo 
"hello world";
    }



so when i tried to put {modulehook function="showReviewInHome" options=""}
it didnot work


so any idea or some help to know what i miss

thank in advance
__________________
Developer 4.1.9
Abdulaziz is offline   Reply With Quote
Old 08-10-2011, 09:33 AM   #2
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Did you activate the module in the admin?
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-10-2011, 12:34 PM   #3
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

Try adding "_events" to then end of your class name and constructor as well.
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Old 08-10-2011, 01:44 PM   #4
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

Quote:
Originally Posted by John Snyder
Try adding "_events" to then end of your class name and constructor as well.
Holy cow! How the heck did I miss that when I looked at that post?

That's why YOUR DA MAN, John!
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 08-10-2011, 08:17 PM   #5
Customer
 
Abdulaziz's Avatar
 
Join Date: Sep 2008
Location: Kuwait
Posts: 61
Rep Power: 14
Abdulaziz is on a distinguished road
Default

thanks a lot

i don't know how it passed over me

i am working on reviewing the module of listing which would allow the members to write their reviews on it.

and i would be proud to share the module here.
__________________
Developer 4.1.9
Abdulaziz is offline   Reply With Quote
Old 08-10-2011, 09:27 PM   #6
Staff
 
Join Date: Mar 2006
Location: New Jersey
Posts: 2,149
Rep Power: 68
John Snyder is a jewel in the rough
Default

If you don't plan on selling it, you should create a github account and put it there, this way people can contribute to it and you can link directly to your source.
__________________
John
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
John Snyder is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create RSS for Featured only? Paul M Technical Support 3 11-13-2010 01:09 PM
create a Newsletter OldCarLocator Technical Support 4 04-13-2010 08:59 AM
create a function sergio_hs TemplateCodes 5 08-27-2009 07:40 AM
How to create your own Template? nagrap2 Technical Support 3 01-12-2009 02:52 PM
How to create a Usergroup cathouse911 Technical Support 3 11-24-2008 02:43 PM


All times are GMT -4. The time now is 04:42 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0