var current_page = 0; var total_pages = 1546; var loading = false; var oldscroll = 0; var niche = 0; $("body").off("click",".thumb"); $("body").on("click",".thumb", function(e){ $.ajax({ 'type': 'GET', 'url': '/pdvclick.php', 'data': 'site=30&pdv=33&aff=&tr=&trlfap=&cp=&tunl=4&tag=' }); return true; }); $("body").off("click","video"); $("body").on("click","video", function(e){ $.ajax({ 'type': 'GET', 'url': '/pdvclick.php', 'data': 'site=30&pdv=33>&aff=&tr=&trlfap=&cp=&tunl=4&tag=' }); return true; }); $(document).ready(function(){ $.ajax({ 'url':'/magazine/more.php', 'type':'get', 'data': 'aff=&page='+current_page+'&tag=&amatrice=&cat=&video=&search=&thid=&tr=&trlfap=&cp=&tunl=4&iduser=&catalogue=&serie=&lang=fr', success:function(data){ var data = $.parseJSON(data); $(data).appendTo('#content'); $('#content').trigger('create'); current_page++; } }); $.ajax({ 'url':'/magazine/morestars.php', 'type':'get', 'data': 'p=indextop&aff=&page='+current_page+'&tr=&trlfap=&cp=&tunl=4&iduser=&lang=fr', success:function(data){ var data = $.parseJSON(data); $(data).appendTo('#contentstars'); $('#contentstars').trigger('create'); //current_page_stars++; } }); $(window).scroll(function() { if( $(window).scrollTop() > oldscroll ){ //if we are scrolling down if( ($(window).scrollTop() + $(window).height() + 250 >= $(document).height() ) && (current_page <= total_pages) ) { if(!loading){ loading = true; $.ajax({ 'url':'/magazine/more.php', 'type':'get', 'data': 'aff=&page='+current_page+'&tag=&amatrice=&cat=&search=&tr=&trlfap=&cp=&tunl=4&iduser=&catalogue=&serie=&lang=fr', success:function(data){ var data = $.parseJSON(data); $(data).appendTo('#content'); $('#content').trigger('create'); current_page++; loading = false; } }); } } } }); $.ajax({ 'url':'/magazine/morevideossites.php', 'type':'get', 'data': 'aff=&page='+current_page+'&tag=&amatrice=&cat=&video=-&thid=&tr=&trlfap=&cp=&tunl=4&iduser=&catalogue=&serie=&lang=fr', success:function(data){ var data = $.parseJSON(data); $(data).appendTo('#contentsites'); $('#contentsites').trigger('create'); current_page++; } }); }); $("body").off("click",".starthumb"); $("body").on("click",".starthumb", function(e){ var my_id = $(this).attr('id'); $.ajax({ 'type': 'GET', 'url': '/magazine/thumbclickstar.php', 'data': 'idthumb='+my_id, success:function(data){} }); return true; }); $("body").off("click",".bonus"); $("body").on("click",".bonus", function(e){ document.location.href='acces?aff=&tr=&trlfap=&cp=&tunl=4'; return false; }); $("body").off("click",".slogan"); $("body").on("click",".slogan", function(e){ document.location.href='acces?aff=&tr=&trlfap=&cp=&tunl=4'; return false; }); $("body").off("click",".dwdbutton"); $("body").on("click",".dwdbutton", function(e){ document.location.href='acces?aff=&tr=&trlfap=&cp=&tunl=4'; return false; }); $('.slogan2').off("click"); $('.slogan2').on("click", function(e){ $("#myModal").load('/magazine/blank.php'); $("#myModal").load("/magazine/pop.php?idthumb=&aff=&mb=&iduser=&tr=&trlfap=&cp=&tunl=4&tag="); $('#myModal').modal('show'); return false; }); $('.headjoin').off("click"); $('.headjoin').on("click", function(e){ $("#myModal").load('/magazine/blank.php'); $("#myModal").load( "/magazine/pop.php?idthumb=&aff=&mb=&iduser=&tr=&trlfap=&cp=&tunl=4&tag=&lang=fr"); $('#myModal').modal('show'); return false; }); $('.headlogin').off("click"); $('.headlogin').on("click", function(e){ $("#myModal").load('/magazine/blank.php'); $("#myModal").load( "/magazine/pop2.php?idthumb=&aff=&mb=&iduser=&tr=&trlfap=&cp=&tunl=4&tag=&lang=fr"); $('#myModal').modal('show'); return false; }); $('#2257').off("click"); $('#2257').on("click", function(e){ $("#myModal").load('/2257.php'); $('#myModal').modal('show'); return false; }); /*$('#lmds').off("click","img"); $('#lmds').on("click","img", function(e){ var my_id = $(this).attr('id'); $("#myModal").load('blank.php'); $("#myModal").load( "/magazine/pop3.php?idthumb="+my_id+"&tr=&trlfap=&cp=&tunl=4&lang=fr"); $('#myModal').modal('show'); return false; }); */ function checkEmail(email,pdv,pop,form,tag,tunl,site,aff,trlfap,pays,cp,tr) { var errors=''; email = document.getElementById(email).value + ""; var reg = /^([_a-z0-9-]+(\.[_a-z0-9-]+)*)@([_a-z0-9-]+(\.[_a-z0-9-]+)*)\.([a-z]{2,6})$/i; if (!reg.test(email))errors+='Vous devez fournir une adresse e-mail valide\n'; if (errors) { alert(errors); } else { $.ajax({ 'url':'saveclicspdv.php', 'type':'get', 'data': 'pdv='+pdv+'&pop='+pop+'&form='+form+'&tag='+tag+'&tunl='+tunl+'&site='+site+'&cp='+cp+'&aff='+aff+'&trlfap='+trlfap+'&tr='+tr+'&pays='+pays }); } document.MM_returnValue = (errors == ''); return errors; } function callScript ( scriptName, args ){ var xhr_object = null; // ### Construction de l’objet XMLHttpRequest selon le type de navigateur if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest(); else if(window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); else { // XMLHttpRequest non supporté par le navigateur alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); return; } xhr_object.open("GET", scriptName, true); // Définition du comportement à adopter sur le changement d’état de l’objet XMLHttpRequest xhr_object.onreadystatechange = function() { if(xhr_object.readyState == 4) { // alert(xhr_object.responseText); // DEBUG MODE eval(xhr_object.responseText); } return xhr_object.readyState; } xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // Envoi de la requête xhr_object.send(args); } function CheckCode(code,pays,video,user,aff,mb,tr,trlfap,cp,catalogue,sitendd,tunl,site,pdv,pop,form,navconf) { callScript("/api/checkcode.php?code="+code+"&pays="+pays+"&video="+video+"&user="+user+"&aff="+aff+"&mb="+mb+"&tr="+tr+"&trlfap="+trlfap+"&cp="+cp+"&catalogue="+catalogue+"&sitendd="+sitendd+"&tunl="+tunl+"&site="+site+"&pdv="+pdv+"&pop="+pop+"&form="+form+"&navconf="+navconf); } $(document).on('mouseenter','.thumbing img',function() {$(this).parent().html("
");}); $(document).on('mouseleave','.thumbing',function() {$(this).html("");});