content.install
Search API
- 7.x modules/content/content.install
 - 6.x modules/content/content.install
 - 4.x modules/content/content.install
 - 5.x modules/content/content.install
 
File
modules/content/content.installView source
- <?php
 - 
 - /**
 -  * This file should contain only hooks relating to installing, enabling, disabling, and uninstalling this module.
 -  *  
 - */
 - 
 - 
 - 
 - 
 - 
 - /**
 -  * Hook install.  Called when the module is installed on the admin modules page.
 -  */
 - function content_install() {
 -   
 -  
 -   // Create our tables 
 -   $query = "    
 -        CREATE TABLE `content` (
 -   `cid` int unsigned NOT NULL AUTO_INCREMENT,
 -   `vid` int unsigned NOT NULL DEFAULT '0',
 -   `user_id` int NOT NULL DEFAULT '0',
 -   `type` varchar(255) NOT NULL DEFAULT '',
 -   `title` varchar(1000) NOT NULL DEFAULT '',
 -   `posted` int unsigned NOT NULL DEFAULT '0',
 -   `updated` int unsigned NOT NULL DEFAULT '0',
 -   `published` tinyint DEFAULT NULL,
 -   `delete_flag` tinyint DEFAULT '0',
 -   `log` longtext DEFAULT NULL,
 -   PRIMARY KEY (`cid`),
 -   KEY `posted` (`posted`),
 -   KEY `updated` (`updated`),
 -   KEY `user_id` (`user_id`),
 -   KEY `type` (`type`),
 -   KEY `vid` (`vid`),
 -   KEY `delete_flag` (`delete_flag`)
 - );";
 -   
 -   db_query($query);
 - 
 - 
 -   $query = "    
 -        CREATE TABLE `content_versions` (
 -   `vid` int unsigned NOT NULL AUTO_INCREMENT,
 -   `cid` int unsigned NOT NULL,
 -   `user_id` int NOT NULL DEFAULT '0',  
 -   PRIMARY KEY (`vid`) ,
 -   KEY `cid` (`cid`),
 -   KEY `user_id` (`user_id`)
 - );";
 -   
 -   db_query($query);
 - 
 - 
 -   
 -   
 -   $query = "    
 -   CREATE TABLE `content_last_access` (
 -    `cid` int unsigned NOT NULL,
 -    `user_id` int NOT NULL,
 -    `last_access` int unsigned DEFAULT NULL,
 -   PRIMARY KEY (`cid`,`user_id`)
 - );";
 -   
 -   db_query($query);
 - 
 -   $query = "    
 - CREATE TABLE `content_files` (
 -   `fid` int unsigned NOT NULL AUTO_INCREMENT,
 -   `cid` int unsigned DEFAULT 0,
 -   `original_filename` varchar(255) DEFAULT NULL,
 -   `filename` varchar(255) DEFAULT NULL,
 -   `mimetype` varchar(255)  DEFAULT NULL,
 -   `is_encrypted` tinyint(4) DEFAULT 0,
 -   `posted` int unsigned DEFAULT NULL,
 -   `attributes` tinyint(4) unsigned DEFAULT 0,
 -   PRIMARY KEY (`fid`),
 -   KEY `original_filename` (`original_filename`),
 -   KEY `filename` (`filename`),
 -   KEY `cid` (`cid`),
 -   KEY `mimetype` (`mimetype`),
 -   KEY `is_encrypted` (`is_encrypted`),
 -   KEY `attributes` (`attributes`),
 -   KEY `posted` (`posted`) 
 - );";
 -    
 -   db_query($query);
 -   
 -   
 -   
 -   $query = "
 - CREATE TABLE `content__page` (
 -   `cid` int(10) unsigned NOT NULL,
 -   `vid` int(10) unsigned NOT NULL,
 -   `field__body` text DEFAULT NULL,  
 -   PRIMARY KEY (`vid`),
 -   KEY `cid` (`cid`),
 -   KEY `field__body` (`field__body`(768))  
 -   );  
 -   ";
 -   
 -   db_query($query);
 -   
 -   if (!file_exists(fp_get_files_path() . '/content_uploads/')) {
 -     mkdir(fp_get_files_path() . '/content_uploads/');
 -   }
 -   
 -   
 -   if (!file_exists(fp_get_files_path() . '/content_uploads/public_uploads/')) {
 -     mkdir(fp_get_files_path() . '/content_uploads/public_uploads/');
 -   }
 -   
 -   
 -     
 - }
 - 
 - 
 - 
 - 
 - function content_update($old_schema, $new_schema) {
 -    
 - 
 - }
 - 
 - 
 - 
 - 
 - 
 
Functions
| 
            Name | 
                  Description | 
|---|---|
| content_install | Hook install. Called when the module is installed on the admin modules page. | 
| content_update | 
