// defines the template to use for a section of Spip-Clear function spipclear_styliser($flux){ // article or section ? if (($fond = $flux['args']['fond']) AND in_array($fond, array('article','rubrique'))) { $ext = $flux['args']['ext']; // [...] if ($section_id = $flux['args']['id_rubrique']) { // calculates the branch $branch_id = sql_getfetsel('id_secteur', 'spip_rubriques', 'id_rubrique=' . intval($section_id)); // comparison of the branch with the config of Spip-Clear if (in_array($branch_id, lire_config('spipclear/secteurs', 1))) { // if the template $fond_spipclear exists if ($template = test_squelette_spipclear($fond, $ext)) { $flux['data'] = $template; } } } } return $flux; } // returns a template $fond_spipclear.$ext when it exists function test_squelette_spipclear($fond, $ext) { if ($template = find_in_path($fond."_spipclear.$ext")) { return substr($template, 0, -strlen(".$ext")); } return false; }