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

Contents of /contributions/modules/ad_geoip/ad_geoip.install

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


Revision 1.1 - (show annotations) (download) (as text)
Thu Jun 12 00:34:30 2008 UTC (17 months, 2 weeks ago) by jeremy
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
 - ad_geoip.module
    o alter advertisement forms, adding section to configure GeoTargeting
    o automatically populate ad_geoip_codes table, downloading ISO3166 document
      every 30 days to register 2 letter country codes and country names
 - ad_geoip.install
    o create ad_geoip_codes table for storing country codes and names
    o create ad_geoip_ads table for storing ad geotargeting configuration
1 <?php
2 // $Id: $
3
4 /**
5 * Ad GeoIP module database schema.
6 * Copyright (c) 2008 Jeremy Andrews <jeremy@tag1consulting.com>.
7 */
8
9 function ad_geoip_install() {
10 switch ($GLOBALS['db_type']) {
11 case 'mysql':
12 case 'mysqli':
13 default:
14 db_query("CREATE TABLE {ad_geoip_codes} (
15 code CHAR(2) NOT NULL DEFAULT '',
16 country varchar(64),
17 PRIMARY KEY code (code)
18 ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
19
20 db_query("CREATE TABLE {ad_geoip_ads} (
21 aid INT(11) NOT NULL DEFAULT '0',
22 code CHAR(2) NOT NULL DEFAULT '',
23 format INT(1) NOT NULL DEFAULT '0',
24 PRIMARY KEY aid_code (aid, code)
25 ) /*!40100 DEFAULT CHARACTER SET UTF8 */");
26
27 break;
28 }
29 }

  ViewVC Help
Powered by ViewVC 1.1.2