query("SELECT * FROM ".$db->prefix("visit_user_page").""); $numrows = $db->num_rows($res); if (($numrows + 1) >= $httprefmax) { $db->query("delete FROM ".$db->prefix("visit_user_page")." WHERE ip='termine'"); $db->query("delete FROM ".$db->prefix("visit_user")." WHERE enregis='termine'"); } if ($xoopsUser) { $lognom = $xoopsUser->uname(); $addip = getenv("REMOTE_ADDR"); $langue = getenv("HTTP_ACCEPT_LANGUAGE"); $nav = getenv("HTTP_USER_AGENT"); $page = getenv("REQUEST_URI"); $page = ereg_replace("/modules/", "/", $page); if (!$page) { $page = "index.php"; } $result = $db->query("SELECT visitname, temps, tempsf FROM ".$db->prefix("visit_user")." WHERE visitname='$lognom' AND ip='$addip'"); while ($resultat = $db->fetch_array($result)) { $visitname = $resultat[visitname]; $tem = $resultat[temps]; $temf = $resultat[tempsf]; } $tempe = time(); // si le visiteur revient apres + 1 heure avec la meme ip if ($visitname && (($tempe - $tem) > 3600)) { $addips = "termine"; $db->query("UPDATE ".$db->prefix("visit_user")." SET ip='$addips' WHERE visitname='$lognom' AND ip='$addip'"); $db->query("UPDATE ".$db->prefix("visit_user_page")." SET enregis='$addips' WHERE nom='$lognom' AND enregis='$addip'"); $nvisit = 1; $tempes = $tempe + 1; $db->query("INSERT INTO ".$db->prefix("visit_user")." VALUES ('','$lognom','$nvisit','$addip','$tempe','$tempes')"); $db->query("INSERT INTO ".$db->prefix("visit_user_page")." VALUES ('', '$lognom', '$page', '$nav', '$langue', '$addip')"); } if ($visitname && (($tempe - $tem) < 3600)) { $db->query("UPDATE ".$db->prefix("visit_user")." SET nvisit=nvisit+1, tempsf='$tempe' WHERE visitname='$lognom' AND ip='$addip'"); $db->query("INSERT INTO ".$db->prefix("visit_user_page")." VALUES ('', '$lognom', '$page', '$nav', '$langue', '$addip')"); } // si le visiteur n'existe pas dans la base if (!$visitname) { $nvisit = 1; $tempes = $tempe + 1; $db->query("INSERT INTO ".$db->prefix("visit_user")." VALUES ('','$lognom','$nvisit','$addip','$tempe','$tempes')"); $db->query("INSERT INTO ".$db->prefix("visit_user_page")." VALUES ('', '$lognom', '$page', '$nav', '$langue', '$addip')"); } } ?> Orsatti Mauro

Non puoi effettuare questa operazione in quanto non hai i permessi richiesti.


Se la pagina non dovesse caricarsi automaticamente, puoi cliccare qui