some packaging thins for banana
authorx2000habouzit <x2000habouzit>
Wed, 1 Dec 2004 14:25:43 +0000 (14:25 +0000)
committerx2000habouzit <x2000habouzit>
Wed, 1 Dec 2004 14:25:43 +0000 (14:25 +0000)
htdocs/banana/include/profile.inc.php
htdocs/banana/include/subscribe.inc.php
include/conf.d/banana.globals.inc.php
install.d/banana/install.sql
install.d/banana/uninstall.sql

index 9d7db62..ff02c9d 100644 (file)
@@ -27,7 +27,7 @@ function getprofile() {
         global $globals;
        $req = mysql_query("SELECT  nom,mail,sig,if(FIND_IN_SET('threads',flags),'1','0'),
                                    IF(FIND_IN_SET('automaj',flags),'1','0') 
-                             FROM  forums.profils
+                             FROM  {$globals->banana->table_prefix}profils
                             WHERE  uid='{$_SESSION['uid']}'");
        if (!(list($nom,$mail,$sig,$disp,$maj)=mysql_fetch_row($req))) {
            $nom = $_SESSION['prenom']." ".$_SESSION['nom'];
@@ -49,8 +49,8 @@ function getprofile() {
                .gmdate("YmdHis")."' WHERE user_id='{$_SESSION['uid']}'");
        }
        $req=mysql_query("SELECT  nom
-                           FROM  forums.abos
-                      LEFT JOIN  forums.list ON list.fid=abos.fid
+                           FROM  {$globals->banana->table_prefix}abos
+                      LEFT JOIN  {$globals->banana->table_prefix}list ON list.fid=abos.fid
                           WHERE  uid={$_SESSION['uid']};");
        $array['subscribe']=array();
        while (list($fnom)=mysql_fetch_array($req)) {
index 649265c..74138cd 100644 (file)
@@ -5,12 +5,12 @@
    */
 
 function update_subscriptions($_subscriptions) {
-  mysql_query("DELETE FROM forums.abos WHERE uid='{$_SESSION['uid']}'");
+  mysql_query("DELETE FROM {$globals->banana->table_prefix}abos WHERE uid='{$_SESSION['uid']}'");
   if (!count($_subscriptions)) {
     return true;
   }
   // Récupération des fid
-  $req = mysql_query("SELECT fid,nom FROM forums.list");
+  $req = mysql_query("SELECT fid,nom FROM {$globals->banana->table_prefix}list");
   $fids=array();
   while (list($fid,$fnom)=mysql_fetch_row($req)) {
     $fids[$fnom]=$fid;
@@ -23,13 +23,13 @@ function update_subscriptions($_subscriptions) {
   }
   if (count($diff)) {
     foreach ($diff as $g) {
-      mysql_query("INSERT INTO forums.list (nom) VALUES ('$g')");
+      mysql_query("INSERT INTO {$globals->banana->table_prefix}list (nom) VALUES ('$g')");
       $fids[$g]=mysql_insert_id();
     }
   }
   // MAJ Abonnements
   foreach ($_subscriptions as $g) {
-    mysql_query("REPLACE INTO forums.abos (fid,uid) VALUES "
+    mysql_query("REPLACE INTO {$globals->banana->table_prefix}abos (fid,uid) VALUES "
         ."('{$fids[$g]}','{$_SESSION['uid']}')");
   }
 }
index 8edc6f0..ec5f59e 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-    $Id: banana.globals.inc.php,v 1.1 2004-11-24 14:18:40 x2000habouzit Exp $
+    $Id: banana.globals.inc.php,v 1.2 2004-12-01 14:25:44 x2000habouzit Exp $
  ***************************************************************************/
 
 // {{{ class SkinConfig
 
 class BananaConfig
 {
-    var $server   = 'localhost';
-    var $port     = 119;
-    var $password = '***';
-    var $web_user = '***';
-    var $web_pass = '***';
+    var $server       = 'localhost';
+    var $port         = 119;
+    var $password     = '***';
+    var $web_user     = '***';
+    var $web_pass     = '***';
+
+    var $table_prefix = 'banana_';
 }
 
 // }}}
index 3fb4b40..714ed73 100644 (file)
@@ -1,3 +1,45 @@
 alter table auth_user_quick add column banana_last timestamp not null;
 
--- TODO: have to add forums database here
+--
+-- Table structure for table `abos`
+--
+
+CREATE TABLE banana_abos (
+  fid tinyint(3) unsigned NOT NULL default '0',
+  uid smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (fid,uid)
+) TYPE=MyISAM COMMENT='abonnements aux forums';
+
+--
+-- Table structure for table `list`
+--
+
+CREATE TABLE banana_list (
+  fid tinyint(3) unsigned NOT NULL auto_increment,
+  nom varchar(40) NOT NULL default '',
+  PRIMARY KEY  (fid)
+) TYPE=MyISAM COMMENT='liste des fora';
+
+--
+-- Table structure for table `profils`
+--
+
+CREATE TABLE banana_profils (
+  uid smallint(5) unsigned NOT NULL default '0',
+  nom varchar(50) NOT NULL default '',
+  mail varchar(70) NOT NULL default '',
+  sig tinytext NOT NULL,
+  flags set('threads','automaj') NOT NULL default '',
+  PRIMARY KEY  (uid)
+) TYPE=MyISAM;
+
+--
+-- Table structure for table `respofaqs`
+--
+
+CREATE TABLE banana_respofaqs (
+  fid tinyint(3) unsigned NOT NULL default '0',
+  uid smallint(5) unsigned NOT NULL default '0',
+  PRIMARY KEY  (fid,uid)
+) TYPE=MyISAM COMMENT='responsables des FAQs';
+
index 035db2a..b2566df 100644 (file)
@@ -1,3 +1,6 @@
 alter table auth_user_quick drop column banana_last;
 
--- TODO: have to drop forums database here
+drop table banana_abos;
+drop table banana_list;
+drop table banana_profils;
+drop table banana_respofaqs;