Mercurial > defr > drupal > ad
annotate weight/probability/ad_weight_probability.install @ 8:32c1a7d9e1fa ad tip
maj module ad en 2.1
| author | sly | 
|---|---|
| date | Fri, 11 Sep 2009 11:10:20 +0000 | 
| parents | 948362c2a207 | 
| children | 
| rev | line source | 
|---|---|
| pierre@1 | 1 <?php | 
| pierre@1 | 2 // $Id: ad_weight_probability.install,v 1.1.4.2 2009/02/27 22:11:20 jeremy Exp $ | 
| pierre@1 | 3 | 
| pierre@1 | 4 /** | 
| pierre@1 | 5 * Ad weight probability module database schema. | 
| pierre@1 | 6 * Copyright (c) 2008-2009 | 
| pierre@1 | 7 * Jeremy Andrews <jeremy@tag1consulting.com>. | 
| pierre@1 | 8 */ | 
| pierre@1 | 9 | 
| pierre@1 | 10 /** | 
| pierre@1 | 11 * Installation of the ad_weight_probability schema. | 
| pierre@1 | 12 */ | 
| pierre@1 | 13 function ad_weight_probability_install() { | 
| pierre@1 | 14 switch ($GLOBALS['db_type']) { | 
| pierre@1 | 15 case 'mysql': | 
| pierre@1 | 16 case 'mysqli': | 
| pierre@1 | 17 default: | 
| pierre@1 | 18 db_query("CREATE TABLE {ad_weight_probability} ( | 
| pierre@1 | 19 aid INT NOT NULL DEFAULT '0', | 
| pierre@1 | 20 probability INT(3) NOT NULL DEFAULT '0', | 
| pierre@1 | 21 | 
| pierre@1 | 22 PRIMARY KEY (aid))"); | 
| pierre@1 | 23 } | 
| pierre@1 | 24 } | 
| pierre@1 | 25 | 
| pierre@1 | 26 /** | 
| pierre@1 | 27 * Complete uninstallation of the ad_weight_probability module. | 
| pierre@1 | 28 */ | 
| pierre@1 | 29 function ad_weight_probability_uninstall() { | 
| pierre@1 | 30 db_query('DROP TABLE IF EXISTS {ad_weight_probability}'); | 
| pierre@1 | 31 drupal_set_message('The ad_weight_probability module has been completely uninstalled.'); | 
| pierre@1 | 32 } | 
| pierre@1 | 33 | 
