set_custom_template('template', 'default'); //The 'template' is the name of the folder that your
// template files are in. You can have multiple templates
// by using a switch or if based on user settings and including
// different template folders.
/*récup des infos dans la BDD*/
$rqt_artiste = "SELECT * FROM Artiste ORDER BY Nom ASC";
//on met les Id des artistes dont le nom comment par $lettreToView dans un tableau
$dataset = mysql_query($rqt_artiste) or die($rqt_artiste."
\n".mysql_error());
$tbl_idArtiste = array();
$tbl_expos = array();
//on parcours la liste des artistes et on va afficher les expos correspondantes
while ($artiste = mysql_fetch_array($dataset)){
//on est sur un artiste dont le nom commence par la lettre demandée
$lettreTemp = strtoupper(substr($artiste['Nom'] , 0 , 1));
if ($lettreTemp == $lettreToView){
//array_push($tbl_idArtiste,$artiste['ID']);
$rqt_expos = "SELECT * FROM Evenements WHERE id in (
SELECT ID_Evenement FROM Artiste_Evenement WHERE ID_Artiste = ".$artiste['ID'].")";
//echo $rqt_expos."\n";
$template->assign_block_vars('artiste', array(
'ARTISTENOM' => $artiste['Nom'],
'ARTISTEPRENOM' => $artiste['Prenom'],
//PRENOMETNOM utilisé pour comparé avec le titre des expos ( titres eponymes supprimés)
'PRENOMETNOM' => $artiste['Prenom'].' '.$artiste['Nom']
));
$dataset_expos = mysql_query($rqt_expos) or die($rqt_expos."
\n".mysql_error());
//on parcours les expos correspondates et on rempli les variables
while ($expo = mysql_fetch_array($dataset_expos)){
//pour la conversion des dates
setlocale (LC_TIME, 'fr_FR');
$dateDeb = strtotime($expo['date_debut']);
$dateFin = strtotime($expo['date_fin']);
//on assigne les valeurs à la boucle du template
$template->assign_block_vars('artiste.expo', array(
'ID' => $expo['id'],
'TITRE' => $expo['titre_principal'],
'SOUSTITRE' => $expo['sous-titre'],
'DATEDEBUT' => strftime("%d %B %Y",$dateDeb),
'DATEFIN' => strftime("%d %B %Y",$dateFin),
'COMPLEMENTDATE' => $expo['complement_date'],
'LIEU' => $expo['lieu'],
'LIEUCOMPLEMENT' => $expo['lieu_complement'],
'SITEWEB' => $expo['site_web'],
'ADRESSE' => $expo['adresse'],
'ARRONDISSEMENT' => $expo['arrondissement'],
'TELEPHONE' => $expo['telephone'],
'INFOPRATIQUE' => nl2br($expo['info_pratique']),
'IMAGEPHOTO' => $expo['path_photo'],//chemin de l'image
'IMAGETHUMB' => $expo['path_thumbnail'],
'COPYRIGHT' => $expo['copyright'],
'DESCRIPTION' => nl2br($expo['description']),
'COMMENTAIRE' => $expo['commentaire'],
//'ARTISTENOM' => $nom,
//'ARTISTEPRENOM' => $prenom,
'COLLECTIF' => $expo['collectif']
));
}
}
}
//fin de la connexion
mysql_close();
$template->assign_var('CHEMIN_LANGUE', $pathLanguage); // This is an example of assigning a template variable
$template->set_filenames(array(
'head' => 'header.html',
'left' => 'allLeftExp.html',
'foot' => 'footer.html',
'body' => 'exposParArtiste.html' // This is where you set different aspects of your page.
)); // Set properly, you can have different files for different parts
// of your site defined here, and then just call them when you need
// them using the function below.
//on affiche les infos
$template->display('head');
$template->display('left');
$template->display('body'); // This would normally be called in phpBB using the page_footer() function
// However, because we aren't using phpBB, this is used here.
// 'body' corresponds to which
$template->display('foot');
?>