Ads Refresh - Ajax V4 Multiple
The functions that allow to refresh ads are the following:
Ā
1. eplDoc.epl.refreshAdsM();
It loads all the page spaces:
Ā
Implementation example:
<html> <body> <script language='JavaScript' type='text/javascript'><!-- window.onload = function(){ Ā Ā Ā Ā Ā Ā Ā timeReload(); } var eplDoc = document; var eplLL = false; var eS1 = 'us.img.e-planning.net';var eplArgs = { iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'504',sec:'Home',eIs:['Espacio1','Espacio2','Espacio3','Espacio4','Espacio5'] } function eplCheckStart() { Ā Ā Ā if (document.epl) { Ā Ā Ā Ā Ā Ā var e = document.epl; Ā Ā Ā Ā Ā Ā if (e.eplReady()) { Ā Ā Ā Ā Ā Ā Ā Ā Ā return true; Ā Ā Ā Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā Ā Ā Ā e.eplInit(eplArgs); Ā Ā Ā Ā Ā Ā Ā Ā Ā if (eplArgs.custom) { Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā for (var s in eplArgs.custom) { Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā document.epl.setCustomAdShow(s, eplArgs.custom[s]); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā Ā Ā Ā return e.eplReady();Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā if (eplLL) return false; Ā Ā Ā Ā Ā Ā if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf('EPLSERVER='); Ā Ā Ā Ā Ā Ā if (ci != -1) { Ā Ā Ā Ā Ā Ā Ā Ā Ā ci += 10; var ce = dc.indexOf(';', ci); Ā Ā Ā Ā Ā Ā Ā Ā Ā if (ce == -1) ce = dc.length; Ā Ā Ā Ā Ā Ā Ā Ā Ā eS2 = dc.substring(ci, ce); Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā var eIF = document.createElement('IFRAME'); Ā Ā Ā Ā Ā Ā eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe'; Ā Ā Ā Ā Ā Ā eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px'; Ā Ā Ā Ā Ā Ā eIF.style.display='none'; document.body.appendChild(eIF); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document; Ā Ā Ā Ā Ā Ā eIFD.open();eIFD.write('<html><head><title>e-planning</title></head><bo'+'dy></bo'+'dy></html>');eIFD.close(); Ā Ā Ā Ā Ā Ā var s = eIFD.createElement('SCRIPT'); s.src = 'http://' + (eS2?eS2:eS1) +'/layers/epl-41.js'; Ā Ā Ā Ā Ā Ā eIFD.body.appendChild(s); Ā Ā Ā Ā Ā Ā if (!eS2) { Ā Ā Ā Ā Ā Ā Ā Ā Ā var ss = eIFD.createElement('SCRIPT'); Ā Ā Ā Ā Ā Ā Ā Ā Ā ss.src = 'http://ads.eu.e-planning.net/egc/4/b'; Ā Ā Ā Ā Ā Ā Ā Ā Ā eIFD.body.appendChild(ss); Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā eplLL = true; Ā Ā Ā Ā Ā Ā return false; Ā Ā Ā } } eplCheckStart(); function eplSetAdM(eID,custF) { Ā Ā Ā if (eplCheckStart()) { Ā Ā Ā Ā Ā Ā if (custF) { document.epl.setCustomAdShow(eID,eplArgs.custom[eID]); } Ā Ā Ā Ā Ā Ā document.epl.showSpace(eID); Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā var efu = 'eplSetAdM(''+eID+'', '+ (custF?'true':'false') +');'; Ā Ā Ā Ā Ā Ā setTimeout(efu, 250);Ā Ā Ā Ā Ā Ā } } function eplAD4M(eID,custF) { Ā Ā Ā document.write('<div id='eplAdDiv'+eID+''></div>'); Ā Ā Ā if (custF) { Ā Ā Ā Ā Ā Ā if (!eplArgs.custom) { eplArgs.custom = {}; } Ā Ā Ā Ā Ā Ā eplArgs.custom[eID] = custF; Ā Ā Ā } Ā Ā Ā eplSetAdM(eID, custF?true:false); } function eplSetAd(eID) { Ā Ā Ā if (eplCheckStart()) { Ā Ā Ā Ā Ā Ā var opts = (eplArgs.sOpts && eplArgs.sOpts[eID]) ? eplArgs.sOpts[eID] : {}; Ā Ā Ā Ā Ā Ā if (opts.custF) { document.epl.setCustomAdShow(eID,opts.custF); } Ā Ā Ā Ā Ā Ā document.epl.setSpace(eID, opts); Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā setTimeout('eplSetAd(''+eID+'');', 250);Ā Ā Ā Ā Ā Ā } } function eplAD4(eID, opts) { Ā Ā Ā document.write('<div id='eplAdDiv'+eID+''></div>'); Ā Ā Ā if (!opts) opts = {t:1}; Ā Ā Ā if (!eplArgs.sOpts) { eplArgs.sOpts = {}; } Ā Ā Ā eplArgs.sOpts[eID] = opts; Ā Ā Ā eplSetAd(eID); } function timeReload(){ Ā Ā Ā Ā Ā Ā Ā intervalo = setInterval( Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā function(){ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā eplDoc.epl.refreshAdsM(); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā },10000Ā Ā Ā Ā Ā Ā Ā Ā ); } //--></script> <script type='text/javascript'>eplAD4M('Space1');</script> <script type='text/javascript'>eplAD4M('Space2');</script> <script type='text/javascript'>eplAD4M('Space3');</script> <script type='text/javascript'>eplAD4M('Space4');</script> </body> </html> |
Ā
References:
Refresh time in thousandths of seconds.
'Reload' function to add into the code.
Ā
2 eplDoc.epl.refreshAdsM('zone_name');
It rotates the entire zone to another. To accomplish this, it is required that the spaces in both sections have the same names.
Ā
Implementation example:
<html> <body> <script language='JavaScript' type='text/javascript'><!-- window.onload = function(){ Ā Ā Ā Ā Ā Ā Ā timeReload(); } var eplDoc = document; var eplLL = false; var eS1 = 'us.img.e-planning.net';var eplArgs = { iIF:1,sV:'http://ads.eu.e-planning.net/',vV:'4',sI:'504',sec:'Home',eIs:['Espacio1','Espacio2','Espacio3','Espacio4','Espacio5'] } function eplCheckStart() { Ā Ā Ā if (document.epl) { Ā Ā Ā Ā Ā Ā var e = document.epl; Ā Ā Ā Ā Ā Ā if (e.eplReady()) { Ā Ā Ā Ā Ā Ā Ā Ā Ā return true; Ā Ā Ā Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā Ā Ā Ā e.eplInit(eplArgs); Ā Ā Ā Ā Ā Ā Ā Ā Ā if (eplArgs.custom) { Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā for (var s in eplArgs.custom) { Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā document.epl.setCustomAdShow(s, eplArgs.custom[s]); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā Ā Ā Ā return e.eplReady();Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā } Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā if (eplLL) return false; Ā Ā Ā Ā Ā Ā if (!document.body) return false; var eS2; var dc = document.cookie; var ci = dc.indexOf('EPLSERVER='); Ā Ā Ā Ā Ā Ā if (ci != -1) { Ā Ā Ā Ā Ā Ā Ā Ā Ā ci += 10; var ce = dc.indexOf(';', ci); Ā Ā Ā Ā Ā Ā Ā Ā Ā if (ce == -1) ce = dc.length; Ā Ā Ā Ā Ā Ā Ā Ā Ā eS2 = dc.substring(ci, ce); Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā var eIF = document.createElement('IFRAME'); Ā Ā Ā Ā Ā Ā eIF.src = 'about:blank'; eIF.id = 'epl4iframe'; eIF.name = 'epl4iframe'; Ā Ā Ā Ā Ā Ā eIF.width=0; eIF.height=0; eIF.style.width='0px'; eIF.style.height='0px'; Ā Ā Ā Ā Ā Ā eIF.style.display='none'; document.body.appendChild(eIF); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā var eIFD = eIF.contentDocument ? eIF.contentDocument : eIF.document; Ā Ā Ā Ā Ā Ā eIFD.open();eIFD.write('<html><head><title>e-planning</title></head><bo'+'dy></bo'+'dy></html>');eIFD.close(); Ā Ā Ā Ā Ā Ā var s = eIFD.createElement('SCRIPT'); s.src = 'http://' + (eS2?eS2:eS1) +'/layers/epl-41.js'; Ā Ā Ā Ā Ā Ā eIFD.body.appendChild(s); Ā Ā Ā Ā Ā Ā if (!eS2) { Ā Ā Ā Ā Ā Ā Ā Ā Ā var ss = eIFD.createElement('SCRIPT'); Ā Ā Ā Ā Ā Ā Ā Ā Ā ss.src = 'http://ads.eu.e-planning.net/egc/4/b'; Ā Ā Ā Ā Ā Ā Ā Ā Ā eIFD.body.appendChild(ss); Ā Ā Ā Ā Ā Ā } Ā Ā Ā Ā Ā Ā eplLL = true; Ā Ā Ā Ā Ā Ā return false; Ā Ā Ā } } eplCheckStart(); function eplSetAdM(eID,custF) { Ā Ā Ā if (eplCheckStart()) { Ā Ā Ā Ā Ā Ā if (custF) { document.epl.setCustomAdShow(eID,eplArgs.custom[eID]); } Ā Ā Ā Ā Ā Ā document.epl.showSpace(eID); Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā var efu = 'eplSetAdM(''+eID+'', '+ (custF?'true':'false') +');'; Ā Ā Ā Ā Ā Ā setTimeout(efu, 250);Ā Ā Ā Ā Ā Ā } } function eplAD4M(eID,custF) { Ā Ā Ā document.write('<div id='eplAdDiv'+eID+''></div>'); Ā Ā Ā if (custF) { Ā Ā Ā Ā Ā Ā if (!eplArgs.custom) { eplArgs.custom = {}; } Ā Ā Ā Ā Ā Ā eplArgs.custom[eID] = custF; Ā Ā Ā } Ā Ā Ā eplSetAdM(eID, custF?true:false); } function eplSetAd(eID) { Ā Ā Ā if (eplCheckStart()) { Ā Ā Ā Ā Ā Ā var opts = (eplArgs.sOpts && eplArgs.sOpts[eID]) ? eplArgs.sOpts[eID] : {}; Ā Ā Ā Ā Ā Ā if (opts.custF) { document.epl.setCustomAdShow(eID,opts.custF); } Ā Ā Ā Ā Ā Ā document.epl.setSpace(eID, opts); Ā Ā Ā } else { Ā Ā Ā Ā Ā Ā setTimeout('eplSetAd(''+eID+'');', 250);Ā Ā Ā Ā Ā Ā } } function eplAD4(eID, opts) { Ā Ā Ā document.write('<div id='eplAdDiv'+eID+''></div>'); Ā Ā Ā if (!opts) opts = {t:1}; Ā Ā Ā if (!eplArgs.sOpts) { eplArgs.sOpts = {}; } Ā Ā Ā eplArgs.sOpts[eID] = opts; Ā Ā Ā eplSetAd(eID); } function timeReload(){ Ā Ā Ā Ā Ā Ā Ā intervalo = setInterval( Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā function(){ Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā eplDoc.epl.refreshAdsM('News'); Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā },10000Ā Ā Ā Ā Ā Ā Ā Ā ); } //--></script> <script type='text/javascript'>eplAD4M('Space1');</script> <script type='text/javascript'>eplAD4M('Space2');</script> <script type='text/javascript'>eplAD4M('Space3');</script> <script type='text/javascript'>eplAD4M('Space4');</script> </body> </html> |
References:
Refresh time in thousandths of seconds.
'Reload' function to add into the code.
Name of the section/zone to rotate
IMPORTANT: Is not possible to reload only one space with AjaxV4 Multiple. All the spaces will be reloaded. |
Ā
Ā
3. eplDoc.epl.reloadSpace(space_id)
It reloads only 1 space in the zone.
Ā
Implementation example:
<html> |
Ā
References:
Refresh time in thousandths of seconds.Ā
'Reload' function to add into the code.
ID of the space to rotate.