1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
<?php
// Include de connexion
include("menu//connexion.php");
// Requête de consultation
$result = $bdd->prepare("SELECT * From `sponsor`");
$result->execute();
// Contrôle qu'il y a bien un sponsor enregistré
if (!empty ($result))
{
$tabSponsor = array();
// Débuter la boucle d'extraction de toutes les actualités du groupe
while ($ligne= $result->fetch(PDO::FETCH_ASSOC))
{
//Récupération des variables
$tabSponsor[] = array($ligne['Mail'],$ligne['Lien'],$ligne['Nom']);
}
}
?>
<!DOCTYPE html>
<html lang="fr-CA">
<head>
<meta charset="utf-8">
<title>Bannières rotatives des Trucsweb</title>
<script type="text/javascript">
<!--
// Délais de la rotation
var nBanDelais = 2;
aBannieres = new Array();
aText = new Array();
// Bannières
<?php
$i=0;
foreach($tabSponsor as $valeur) {
?>
aBannieres[<?php echo $i;?>] = new twBanniere(<?php echo '"'.$valeur[0].'","'.$valeur[1].'","'.$valeur[2].'"';?>);
<?phP
$i=$i+1;
}
?>
// Ne pas modifier le code suivant
function twBanniere(_url,_src,_texte) {this.url=_url;this.src=_src;this.texte=_texte;}
function twText(_desc) {this.texte=_desc;}
function twRotation(){
nBanPos=(nBanPos<nBanMax-1)?nBanPos+1:0;
if (document.all){
document.images["twban"].style.filter="blendTrans(duration=1)";
document.images["twban"].style.filter="blendTrans(duration=CrossFadeDuration)";
document.images["twban"].filters.blendTrans.Apply();
}
document.images["twban"].src=aBannieres[nBanPos].src;
if (document.all) document.images["twban"].filters.blendTrans.Play();
oTimer = setTimeout("twRotation()",nBanDelais*1000);
}
var nBanPos = 0;
var oTimer;
var nBanMax = aBannieres.length;
// -->
</script>
</head>
<body>
<a href="javascript:document.location.href=aBannieres[nBanPos].url" onMouseOver="window.status=aBannieres[nBanPos].url; return true" onMouseOut="window.status=;">
<img src="sponsor/no_image.jpg" alt="Chargement..." style="width:120px" name="twban" border="0" onMouseOver="this.title=aBannieres[nBanPos].texte;"/></a>
<script type="text/javascript" language="javascript">
<!--
twRotation();
// -->
</script>
</body>
</html> |
Partager