0 && strlen($_GET['annee']) == 4) { $annee = $_GET['annee']; } if (isset($_GET['mois']) && !empty($_GET['mois']) && preg_match('/^[a-zéû]{3,9}+$/i',$_GET['mois'])) { $mois = $_GET['mois']; } $using = $annee.' '.$mois; //recuperation de la page precedente et suivante (mois precedent et mois suivant) $sqlrecup = "SELECT DISTINCT annee,mois FROM actualites WHERE online = 1 ORDER BY date DESC"; $resrecup=mysql_query($sqlrecup,$connexion) or die("Invalid request " . $sqlrecup); $j = 0; $tableau = array(); $current = ''; $next = ''; $prev = ''; while ($row[] = mysql_fetch_row($resrecup)) { $tableau[] = pos($row[$j]).' '.next($row[$j]); $j++; } foreach ($tableau as $key => $value) { if ($using == $value) { $current = $tableau[$key]; $next = isset($tableau[$key+1]) && !empty($tableau[$key+1]) ? $tableau[$key+1] : ''; $prev = isset($tableau[$key-1]) && !empty($tableau[$key-1]) ? $tableau[$key-1] : ''; } } $pieces1 = explode(" ", $current); $pieces2 = explode(" ", $next); $pieces3 = explode(" ", $prev); //$curMois = $pieces1[1]; //$curAannee = $pieces1[0]; $nextMois = $pieces2[1]; $nextAnnee = $pieces2[0]; $prevMois = isset($pieces3[1]) && !empty($pieces3[1]) ? $pieces3[1] : ''; $prevAnnee = isset($pieces3[0]) && !empty($pieces3[0]) ? $pieces3[0] : ''; $sql = "SELECT * FROM actualites a, images i WHERE a.annee = '".$annee."' AND a.mois = '".$mois."' AND online = 1 AND a.id_actu = i.id_actu ORDER by date DESC"; $res=mysql_query($sql,$connexion) or die("Invalid request " . $sql); while ($data = mysql_fetch_assoc($res)) { $testanchor = $data['noanchor'] == 0 ? '' : ''; $contenu .= $testanchor.'

'.substr(($data['date']),-2,2).' '.$data['mois'].' '.$data['annee'].'
> '.stripslashes($data['titre']).'
'.stripslashes($data['chapeau']).'

'; if ($data['img1'] != "" || $data['img1'] != NULL) { $contenu .= '

'.stripslashes($data['leg1']).'
'; } $contenu .= stripslashes($data['texte']).'

'; if ($data['img2'] != "" || $data['img2'] != NULL) { //$contenu .= '
'.stripslashes($data['leg2']).'


'; $contenu .= '
'.stripslashes($data['leg2']).'

'; } $contenu .= '

'; } //*********construction du contenu de la colonne de classement par date**************// $sqlmenu = "SELECT DISTINCT annee,mois FROM actualites WHERE online = 1 ORDER BY date DESC"; $resmenu=mysql_query($sqlmenu,$connexion) or die("Invalid request " . $sqlmenu); while ($liste = mysql_fetch_assoc($resmenu)) { $dataFull[] = $liste; } foreach ($dataFull as $key => $value) { $tabAnnee[$dataFull[$key]['annee']] = $dataFull; } foreach ($tabAnnee as $key => $months) { $colonne .= '
'.$key.'
'; $colonne .= "\n"; foreach ($months as $tabMonths) { //print_r($tabMonths); foreach ($tabMonths as $cle => $value) { if ($tabMonths['annee'] == $key && $value != $key) { if ($using == $key.' '.$value) $value = ''.$value.''; $colonne .= '
'.$value.'
'; $colonne .= "\n"; } } } $colonne .= '

'; $colonne .= "\n"; } ?> Wheelcom - Actualité

Actualité
Il se passe toujours quelque chose chez wheelcom.
Découvrez mois après mois notre actualité
(nouveaux budgets, clients, réalisations...)
'; echo ''; echo ''; if(!empty($nextAnnee)) echo ''; ?>