Changeset 77123 in spip-zone


Ignore:
Timestamp:
Oct 10, 2013, 11:59:18 AM (8 years ago)
Author:
kent1@…
Message:

Supprimons les urls dans spip_urls des tradlangs disparus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/trad-lang/trunk/genie/tradlang_maintenance.php

    r76975 r77123  
    3434                sql_delete('spip_versions_fragments','objet="tradlang" AND '.sql_in('id_objet',$disparus));
    3535        }
     36
     37        /**
     38         * Suppression des urls des tradlangs disparus
     39         */
     40        $tradlang_disparus = sql_allfetsel('url.id_objet','spip_urls AS url','url.type="tradlang" AND NOT EXISTS(SELECT * FROM spip_tradlangs AS tradlangs WHERE url.id_objet = tradlangs.id_tradlang)','url.id_objet');
     41        $disparus_url = array();
     42        foreach($tradlang_disparus as $tradlang){
     43                $disparus_url[] = $tradlang['id_objet'];
     44        }
     45        if(count($disparus_url) && count($disparus_url) > 0){
     46                sql_delete('spip_urls','type="tradlang" AND '.sql_in('id_objet',$disparus_url));
     47        }
    3648        return 0;
    3749}
Note: See TracChangeset for help on using the changeset viewer.