Installing MetaCat comes in one not-so-easy and three easy steps:
Upload the /metacat directory from the distribution into your Xoops 2.0 /modules directory.
Before you can install MetaCat, you need to tell it which modules' categories it should manage and how these modules handle categories internally. This is done by editing the /modules/metacat/class/modules.dat.php file in a text editor. Here's a sample from that file, showing the module data for the "mydownloads" module:
$modules['mydownloads'] = array( // name of the module-directory 'name' => 'mydownloads', // name of the GET variable to select a category 'cat_get_var' => 'cid', // url (relative to site root) to display a category 'cat_view_url' => '/modules/mydownloads/viewcat.php?cid=%s', // descriptive name of the type of items the module has 'item_type' => 'Downloads', // database table where the module stores its category information 'cat_table' => 'mydownloads_cat', // column in cat_table that holds the category title 'title_field' => 'title', // column in cat_table that holds the category ID 'cat_id_field' => 'cid', // column in cat_table that holds the parent's ID // (leave empty if module has no sub-categories.) 'parent_id_field' => 'pid', // column in cat_table that holds the information about the category image/icon // (leave empty if module has no category images.) 'image_reference_field' => 'imgurl', // type of the image information used. // "URL" - image can be anywhere, fully qualified URL given // "PATH" - image is in module-specific directory "image_upload_path". Give filename only. 'image_reference_type' => 'URL', // if "image_reference_type" is "PATH", this is the absolute path to copy images to 'image_upload_path' => '', // table in the database that holds content for this module 'content_table' => 'mydownloads_downloads', // column in content_table that holds the category ID 'content_cat_field' => 'cid', // column in content_table that holds the content ID 'content_id_field' => 'lid', // name of the GET var to select one content item. 'content_get_var' => 'lid', );
This is a lot of information, but it is all needed for MetaCat to function correctly. Data for the Xoops 2.0 default modules is already provided. you only need to edit this if you've changed e.g. the directory a module is installed in.
If you don't have one of these modules installed or don't want MetaCat to manage its categories, simply comment out that modules definition by enclosing it in comment delimiters like this:
/* ... */
The modules.dat.php file makes it quite easy to add support for addon Xoops 2.0 modules. Simply copy the block of an existing module and change it to match your module's specifications. You may have to do some research in the module's database table definitions to do that, or try to get help from the module's author. Hopefully module authors will start to include MetaCat definition data in their distributions.
Now you are ready to install MetaCat using the Xoops 2.0 Module Manager Console, just like you would any other module.
To start managing your categories with MetaCat, you will first want to import your current categories from the modules into MetaCat. To do this, select "
" from the MetaCat popup menu and click " " in reply to the security prompt.MetaCat will first erase its own category database, then scan through all installed modules and import the categories. Top-level categories with identical names in different modules will be treated as one category that is active in all those modules. Sub-categories will only be treated as one module if they have the same name and are children of parents that are treated as one category.
It is not possible to import category images from the modules. The categories will keep their current images until you change it from MetaCat. Until you do that, the category will be shown as "no image" in MetaCat, even though there may be images active in individual modules. (Take this to mean "no centrally managed image".)
Due to the process used in initialization, all categories already in MetaCat, but not activated in any module will be deleted.