| |
|
|
| |
|
|
|
// affichage publicité nicolas // ?>
require(dirname(__FILE__).'/Annonceur/fonction.inc.php');
if (!isset($DB_site)) {
require(dirname(__FILE__).'/libraries/common_db.php');
} ?>
// affichage de la pub 1
$continue=1;
$sLang = " ";
$sLang[0] = strtoupper($lang[0]);
$sLang[1] = strtoupper($lang[1]);
$rs_ad = $DB_site->query("SELECT * FROM annonces A INNER JOIN annonces_compte C
ON A.ID_P = C.ID_P
AND (A.Type_Ad='bouton carré')
AND (A.Langue_cible_Ad='" . $sLang . "'
OR A.Langue_cible_Ad='tous')
WHERE A.Etat_Ad='ok'
AND C.Etat='ok'
ORDER BY RAND()");
if ($rs_ad) {
while ($continue==1 && $row_ad=$DB_site->fetch_array($rs_ad)) {
if (!date_valide($row_ad['Date_initiale'])) {
$DB_site->query("UPDATE annonces_compte SET Etat='date' WHERE ID_P=" . $row_ad['ID_P']);
}
else if ($row_ad['Solde']<=0) {
$DB_site->query("UPDATE annonces_compte SET Etat='nounit' WHERE ID_P=" . $row_ad['ID_P']);
}
else {
// augmente le nombre de compteurs
$DB_site->query("UPDATE annonces SET Nb_vues_Ad=Nb_vues_Ad+1 WHERE ID_Ad=" . $row_ad['ID_Ad']);
afficher_pub($row_ad['ID_Ad'], $row_ad['Ext_Ad'], $row_ad['Type_Ad'], $row_ad['Codehtml_Ad'], $row_ad['Url_Ad']);
$continue = 0;
}
}
}
?>
|
|
// affichage de la pub 2
$continue = 1;
while ($continue==1 && $row_ad=$DB_site->fetch_array($rs_ad)) {
if (!date_valide($row_ad['Date_initiale'])) {
$DB_site->query("UPDATE annonces_compte SET Etat='date' WHERE ID_P=" . $row_ad['ID_P']);
}
else if ($row_ad['Solde']<=0) {
$DB_site->query("UPDATE annonces_compte SET Etat='nounit' WHERE ID_P=" . $row_ad['ID_P']);
}
else {
// augmente le nombre de compteurs
$DB_site->query("UPDATE annonces SET Nb_vues_Ad=Nb_vues_Ad+1 WHERE ID_Ad=" . $row_ad['ID_Ad']);
afficher_pub($row_ad['ID_Ad'], $row_ad['Ext_Ad'], $row_ad['Type_Ad'], $row_ad['Codehtml_Ad'], $row_ad['Url_Ad']);
$continue = 0;
}
}
?>
|
|
// affichage de la pub 3
$continue = 1;
while ($continue==1 && $row_ad=$DB_site->fetch_array($rs_ad)) {
if (!date_valide($row_ad['Date_initiale'])) {
$DB_site->query("UPDATE annonces_compte SET Etat='date' WHERE ID_P=" . $row_ad['ID_P']);
}
else if ($row_ad['Solde']<=0) {
$DB_site->query("UPDATE annonces_compte SET Etat='nounit' WHERE ID_P=" . $row_ad['ID_P']);
}
else {
// augmente le nombre de compteurs
$DB_site->query("UPDATE annonces SET Nb_vues_Ad=Nb_vues_Ad+1 WHERE ID_Ad=" . $row_ad['ID_Ad']);
afficher_pub($row_ad['ID_Ad'], $row_ad['Ext_Ad'], $row_ad['Type_Ad'], $row_ad['Codehtml_Ad'], $row_ad['Url_Ad']);
$continue = 0;
}
}
?>
|
|
// affichage de la pub 4
$continue = 1;
while ($continue==1 && $row_ad=$DB_site->fetch_array($rs_ad)) {
if (!date_valide($row_ad['Date_initiale'])) {
$DB_site->query("UPDATE annonces_compte SET Etat='date' WHERE ID_P=" . $row_ad['ID_P']);
}
else if ($row_ad['Solde']<=0) {
$DB_site->query("UPDATE annonces_compte SET Etat='nounit' WHERE ID_P=" . $row_ad['ID_P']);
}
else {
// augmente le nombre de compteurs
$DB_site->query("UPDATE annonces SET Nb_vues_Ad=Nb_vues_Ad+1 WHERE ID_Ad=" . $row_ad['ID_Ad']);
afficher_pub($row_ad['ID_Ad'], $row_ad['Ext_Ad'], $row_ad['Type_Ad'], $row_ad['Codehtml_Ad'], $row_ad['Url_Ad']);
$continue = 0;
}
}
?>
|
// fin affichage publicite nicolas // ?>
|
|
| |
|
|