Changeset 41611 in spip-zone


Ignore:
Timestamp:
Oct 7, 2010, 10:09:37 AM (9 years ago)
Author:
marcimat@…
Message:

Se conformer aux mots_liens

Location:
_core_/plugins/forum
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/forum/base/forum.php

    r41051 r41611  
    2929        $interfaces['table_date']['forums']='date_heure';
    3030
    31         $interfaces['tables_jointures']['spip_forum'][]= 'mots_forum';
     31        $interfaces['tables_jointures']['spip_forum'][]= 'mots_liens';
    3232        $interfaces['tables_jointures']['spip_forum'][]= 'mots';
    3333        $interfaces['tables_jointures']['spip_forum'][]= 'documents_liens';
     
    3838        $interfaces['tables_jointures']['spip_messages'][] = 'forums';
    3939
    40         $interfaces['tables_jointures']['spip_mots'][]= 'mots_forum';
    4140
    4241        $interfaces['table_des_traitements']['PARAMETRES_FORUM'][]= 'htmlspecialchars(%s)';
     
    108107}
    109108
    110 /**
    111  * Tables de jointures mots_forums
    112  *
    113  * @param array $tables_auxiliaires
    114  * @return array
    115  */
    116 function forum_declarer_tables_auxiliaires($tables_auxiliaires){
    117 
    118         $spip_mots_forum = array(
    119                         "id_mot"        => "bigint(21) DEFAULT '0' NOT NULL",
    120                         "id_forum"      => "bigint(21) DEFAULT '0' NOT NULL");
    121 
    122         $spip_mots_forum_key = array(
    123                         "PRIMARY KEY"   => "id_forum, id_mot",
    124                         "KEY id_mot"    => "id_mot");
    125         $tables_auxiliaires['spip_mots_forum'] = array(
    126                 'field' => &$spip_mots_forum,
    127                 'key' => &$spip_mots_forum_key);
    128 
    129         return $tables_auxiliaires;
    130 }
    131 
    132109?>
  • _core_/plugins/forum/base/forum_upgrade.php

    r39602 r41611  
    7474function forum_vider_tables($nom_meta_base_version) {
    7575        sql_drop_table("spip_forum");
    76         sql_drop_table("spip_mots_forum");
    7776
    7877        effacer_meta("mots_cles_forums");
  • _core_/plugins/forum/forum_pipelines.php

    r41079 r41611  
    282282
    283283
    284         # les liens mots-forum sur des mots effaces
    285         $res = sql_select("mots_forum.id_mot AS id",
    286                         "spip_mots_forum AS mots_forum
    287                         LEFT JOIN spip_mots AS mots
    288                           ON mots_forum.id_mot=mots.id_mot",
    289                         "mots.id_mot IS NULL");
    290 
    291         $n+= optimiser_sansref('spip_mots_forum', 'id_mot', $res);
    292 
    293284        //
    294285        // Forums
     
    297288        sql_delete("spip_forum", "statut='redac' AND maj < $mydate");
    298289
    299 
    300         # les liens mots-forum sur des forums effaces
    301         $res = sql_select("mots_forum.id_forum AS id",
    302                         "spip_mots_forum AS mots_forum
    303                         LEFT JOIN spip_forum AS forum
    304                           ON mots_forum.id_forum=forum.id_forum",
    305                         "forum.id_forum IS NULL");
    306 
    307         $n+= optimiser_sansref('spip_mots_forum', 'id_forum', $res);
    308290
    309291
     
    407389                if ($objet['type']=='message')
    408390                        sql_delete("spip_forum", "id_message=".sql_quote($objet['id']));
    409                 if ($objet['type']=='mot')
    410                         sql_delete("spip_mots_forum", "id_mot=".intval($objet['id']));
    411391        }
    412392        return $objets;
  • _core_/plugins/forum/inc/forum_insert.php

    r36015 r41611  
    6464function mots_du_forum($ajouter_mot, $id_message)
    6565{
    66         $t = array('id_forum' => $id_message);
    67         foreach ($ajouter_mot as $id_mot)
    68                 if ($t['id_mot'] = intval($id_mot))
    69                         sql_insertq('spip_mots_forum', $t);
     66        include_spip('action/editer_mot');
     67        mot_associer($ajouter_mot, array('forum'=>$id_message));
    7068}
    7169
Note: See TracChangeset for help on using the changeset viewer.