We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Help on creating a module

Development and Programming

pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

I’m new to EE but have about 6 years experience in PHP. I can do plugins fine, no problem. I’m using a plugin right now to create extended data for some stuff and storing it in a database, with tools that can be used to edit this data that can be called with EE tags.

Now, this works fine but I would love to make it a module and have the tools being used right in EE with EE’s own control panel. But, every time I try and make a module (editing the Fortunes example, or rather using it as a template) I get the same weird problem. When I click install, it doesn’t say it installs. But when I click on “install” again it asks me to uninstall it. It also doesn’t show the version number.

When I just upload the Fortunes example as-is, I have no problem. But the minute I rename it (I rename all the proper stuff, the file names, the folder, and the actual classes in the file (this I do with Scite’s find and replace utilities) and try that out I get the same error.

       
Paul Burdick's avatar
Paul Burdick
480 posts
17 years ago
Paul Burdick's avatar Paul Burdick

Are you modifying the queries for exp_modules in modulename_module_install() method to have the new class name?

       
pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

I think so. Let me check. If it is and still not working, I’ll post the contents of my install function

       
pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

Here is the install function: function searchvi_module_install() { global $DB;

    $sql[] = "INSERT INTO exp_modules (module_id,
                                       module_name,
                                       module_version,
                                       has_cp_backend)
                                       VALUES
                                       ('',
                                       'searchVi',
                                       '$this->version',
                                       'y')";

    $sql[] = "CREATE TABLE IF NOT EXISTS `exp_vidata` (  `id` int(11) NOT NULL auto_increment,  `bedrooms` int(11) NOT NULL default '0',  PRIMARY KEY  (`id`) ) ;";

    foreach ($sql as $query)
    {
        $DB->query($query);
    }

    return true;
}
       
Paul Burdick's avatar
Paul Burdick
480 posts
17 years ago
Paul Burdick's avatar Paul Burdick

That class name is not following the Developer Guidelines for Class Naming

       
pauljessup's avatar
pauljessup
6 posts
17 years ago
pauljessup's avatar pauljessup

That was it! Thanks. The actual class was named properly, but not the one mentioned in INSERT.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.