/[drupal]/contributions/modules/favorite_nodes/favorite_nodes.install
ViewVC logotype

Contents of /contributions/modules/favorite_nodes/favorite_nodes.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download) (as text)
Wed Jun 18 14:44:15 2008 UTC (17 months, 1 week ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-6--1
Changes since 1.3: +26 -23 lines
File MIME type: text/x-php
#269377 by gagarine, Port to Drupal 6.x
1 <?php
2 // $Id:
3
4 /**
5 * Implementation of hook_install().
6 */
7 function favorite_nodes_install() {
8 $result = drupal_install_schema('favorite_nodes');
9 if (count($result) > 0) {
10 drupal_set_message(t('favorite node module installed.'));
11 }
12 else {
13 drupal_set_message(t('favorite node table creation failed. Please "uninstall" the module and retry.'));
14 }
15 }
16
17 /**
18 * Implementation of hook_uninstall().
19 *
20 */
21 function favorite_nodes_uninstall() {
22 db_query("DELETE FROM {variable} WHERE name LIKE 'favorite_node%'");
23 drupal_uninstall_schema('favorite_nodes');
24 }
25
26 /**
27 * Implementation of hook_schema().
28 */
29 function favorite_nodes_schema() {
30 $schema['favorite_nodes'] = array(
31 'fields' => array(
32 'nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0),
33 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0),
34 'last' => array('type' => 'int'),
35 ),
36 'primary key' => array('nid' ,'uid')
37 );
38
39 return $schema;
40
41 }

  ViewVC Help
Powered by ViewVC 1.1.2