global $wp_query;
$term = $wp_query->get_queried_object();
?>
echo $term->name ?>
setlocale(LC_ALL, "fr_FR.utf-8");
include'get_articles.functions.php';
/* */
/* on recupere les actus de wordpress et des flux actu */
$actus=array();
/* actus flux actu */
if(!is_home()){ /* on affiche les actu du web seulement dans les catgories, mais pas sur la home */
$req="SELECT c.id, c.`date`, c.link, c.titre, c.stitre, c.resume, c.une, c.flux, c.loin, c.image, c.pays, c.theme, c.chantier, c.categorie, c.pdate, u.icon, u.lib, u.nom
FROM contenu_flux c, url_flux u WHERE c.flux=u.id AND actif=1 ";
if(isset($req_pays))
$req.=' AND pays = '.$req_pays[0];
if(isset($req_theme))
$req.=' AND theme = '.$req_theme[0];
if(isset($req_chantier))
$req.=' AND chantier = '.$req_chantier[0];
if(isset($req_rubrique)){
$req.=' AND c.categorie = '.$req_rubrique[0];
}
if(isset($search))
$req.=" AND MATCH (c.titre, c.stitre, c.resume) AGAINST ('".$search."' IN BOOLEAN MODE) ";
if(isset($depuis))
$req.=" AND pdate >= '".$depuis."' ";
if(!isset($search) && !isset($post_id))
$req.=" ORDER BY `date` DESC LIMIT 0,16";
$flux_actus=$wpdb->get_results($req);
foreach ($flux_actus as $f) {
$actus[]=format_fluxactus($f);
}
}
/* actus wordpress */
if(!isset($no_wp)){
$args['post_type'] = array('post', 'dossier');
if(!isset($search))
$args['numberposts']=40;
else{
$args['numberposts']=20;
$args['s']=$search;
}
if(isset($page))
$args['offset']=20*$page-20;
if(isset($req_rubrique))
$args['category']=$req_rubrique[0];
if(isset($req_theme))
$args['theme']=$req_theme[1];
if(isset($req_pays))
$args['pays']=$req_pays[1];
if(isset($req_chantier))
$args['chantier']=$req_chantier[1];
if(isset($post_id))
$args['post_id']=$post_id;
if(isset($depuis)){
$GLOBALS['depuis']=$depuis;
function filter_where( $where = '' ) {
$where .= " AND wp_posts.post_date > '".date('Y-m-d',$GLOBALS['depuis'])."' ";
return $where;
}
add_filter( 'posts_where', 'filter_where' );
}
if(false && is_home()){
function filter_where2( $where = '' ) {
$where .= " AND (
wp_posts.ID NOT IN (
SELECT wpostmeta.post_id
FROM wp_postmeta wpostmeta
WHERE wpostmeta.meta_key = 'oi_hide_home'
)
OR
wp_posts.ID IN (
SELECT wpostmeta.post_id
FROM wp_postmeta wpostmeta
WHERE wpostmeta.meta_key = 'oi_hide_home'
AND wpostmeta.meta_value = 0
)
)
";
return $where;
}
add_filter( 'posts_where', 'filter_where2' );
}
$args['suppress_filters']=false;
$myposts = get_posts( $args );
$mp = get_post( 21056 );
$actus[]=format_wordpress($mp,0);
foreach( $myposts as $post){
$actus[]=format_wordpress($post,0);
}
}
/* tri par date decroissant */
if(false && !isset($no_wp)){ /* si on mlange articles WP et Flux on retrie */
$ordre=array();
foreach($actus as $k => $v){
$ordre[$k]=$v['date'];
}
arsort($ordre);
$actus_trie=array();
$i=1;
foreach($ordre as $k=>$v){
//if($i<=16)
$actus_trie[]=$actus[$k];
//$i++;
}
$actus=$actus_trie;
}
remove_filter( 'posts_where', 'filter_where' );
remove_filter( 'posts_where', 'filter_where2' );
wp_reset_query();
for($i=1;$i<=8;$i++){
if($page==$i)
echo '
'.$i.' ';
else
echo '
'.$i.' ';
if($i<8)
echo ' - ';
}
?>