root/contributed_modules/modules/tweet2call/install.php

Revision 7773, 1.9 kB (checked in by jfinstrom, 3 years ago)

Add tweet2call

Line 
1 <?php
2 /* $Id$ */
3 //
4 /*
5  *      install.php
6  *     
7  *      Copyright 2009 James Finstrom <jfinstrom@RhinoEquipment.com>
8  *     
9  *      This program is free software; you can redistribute it and/or modify
10  *      it under the terms of the GNU General Public License as published by
11  *      the Free Software Foundation; either version 2 of the License, or
12  *      (at your option) any later version.
13  *     
14  *      This program is distributed in the hope that it will be useful,
15  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *      GNU General Public License for more details.
18  *     
19  *      You should have received a copy of the GNU General Public License
20  *      along with this program; if not, write to the Free Software
21  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22  *      MA 02110-1301, USA.
23  */
24 global $db;
25 global $amp_conf;
26
27 if (! function_exists("out")) {
28   function out($text) {
29     echo $text."<br />";
30   }
31 }
32
33 if (! function_exists("outn")) {
34   function outn($text) {
35     echo $text;
36   }
37 }
38
39 $sql = "CREATE TABLE IF NOT EXISTS tweet2call_settings (
40 twitid varchar(32) NOT NULL default '',
41 twitpass varchar(32) NOT NULL default '',
42 polltime varchar(32) NOT NULL default '',
43 blacklist varchar(512) NOT NULL default '',
44 trunk varchar(32) NOT NULL default '',
45 lasttweet varchar(32) NOT NULL default '',
46 PRIMARY KEY (twitid)
47 );";
48
49 $check = $db->query($sql);
50 if (DB::IsError($check)) {
51         die_freepbx( "Can not create `tweet2call` table: " . $check->getMessage() .  "\n");
52 }
53
54 $sql = "CREATE TABLE IF NOT EXISTS tweet2call_departments (
55 department varchar(32) NOT NULL default '',
56 queue varchar(32) NOT NULL default '',
57 weight varchar(32) NOT NULL default '',
58 PRIMARY KEY (department));";
59
60 $check = $db->query($sql);
61 if (DB::IsError($check)) {
62         die_freepbx( "Can not create `tweet2call` table: " . $check->getMessage() .  "\n");
63 }
64
65 ?>
Note: See TracBrowser for help on using the browser.