Commit 73d25e87 authored by Christoph Zysik's avatar Christoph Zysik

prepare easy ads, ads got option to enable framed or non-framed delivery

parent 3cf6f076
......@@ -14,29 +14,62 @@ $kampdaten = $campaigns->getByTanAndType( $tan, $art );
// TODO prevent malicious ziel urls
$ptc->invalidateAlreadyRunningAd( $_SESSION['uid'], $ip );
$ptc->setCurrentRunningAd( $art, $kampdaten->id, $tan );
?><!DOCTYPE html>
<html>
<head>
<!-- never is old spec but will be ignored by new browsers //-->
<meta name="referrer" content="never">
<meta name="referrer" content="no-referrer" />
<meta http-equiv="refresh" content="0; URL=<?php echo $kampdaten->ziel; ?>">
<?php
if( 0 == $kampdaten->use_frame )
{ ?>
<meta http-equiv="refresh" content="0; URL=<?php echo $kampdaten->ziel; ?>">
<?php
} else { ?>
<link rel="stylesheet" type="text/css" href="ext/css/frame_ads.css">
<script src="<?php echo $pageconfig['domain']; ?>/ext/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo $pageconfig['domain']; ?>/ext/js/visibility.core.js"></script>
<script src="<?php echo $pageconfig['domain']; ?>/ext/js/visibility.fallback.js"></script>
<script src="<?php echo $pageconfig['domain']; ?>/ext/js/ptc.js"></script>
<?php } ?>
<title>Anzeige</title>
</head>
<body>
<script>
var notified = false;
var campaign_data = <?php echo json_encode(array('earnings' => $kampdaten->verdienst, 'wait_time' => $kampdaten->aufendhalt, 'ad_type' => $kampdaten->werbeart, 'tan' => $kampdaten->tan)); ?>;
function notify()
{
if( false == notified )
{
notified = true;
window.opener.postMessage( { 'action': 'adcheck', 'art': '<?php echo $art; ?>', 'tan': '<?php echo $tan; ?>' }, '<?php echo $pageconfig['domain']; ?>');
window.opener.postMessage( { 'action': 'adcheck', 'art': campaign_data['ad_type'], 'tan': campaign_data['tan'] }, '<?php echo $pageconfig['domain']; ?>');
}
return true;
}
</script>
<a href="<?php echo $kampdaten->ziel; ?>" rel="noopener noreferrer nofollow" onclick="notify();" >Hier weiter, falls keine automatische Weiterleitung erfolgt.</a>
<?php
if( 0 == $kampdaten->use_frame )
{
?>
<a href="<?php echo $kampdaten->ziel; ?>" rel="noopener noreferrer nofollow" onclick="notify();" >Hier weiter, falls keine automatische Weiterleitung erfolgt.</a>
<?php } else { ?>
<div id="ad_bar">
<ul>
<li><a href="">Melden</a></li>
<li><a href="">Blacklist</a></li>
<li><a href="">Merken</a></li>
<li style="float:right"><span class="active" id="ad_status" >Bitte&nbsp;warten</span></li>
</ul>
</div>
<script src="ext/js/frame_ad.js"></script>
<iframe src="https://www.whatismyreferer.com/" id="ad_frame" sandbox="allow-scripts allow-popups allow-pointer-lock allow-forms"></iframe>
<?php } ?>
</body>
</html>
......@@ -7,7 +7,8 @@ class Campaigns
const FIELDS_gebuchte_werbung = ' `t1`.`id`, `t1`.`uid`, `t1`.`tan`, `t1`.`kid`, `t1`.`ziel`, `t1`.`banner`,
`t1`.`verdienst`, `t1`.`preis`, `t1`.`aufendhalt`, `t1`.`menge`, `t1`.`reload`,
`t1`.`sponsor`, `t1`.`werbeart`, `t1`.`status` ';
`t1`.`sponsor`, `t1`.`werbeart`, `t1`.`use_frame`, `t1`.`addata`, `t1`.`status`,
`t1`.`created`, `t1`.`modified`, `t1`.`expires` ';
public function __construct( $database )
{
......
......@@ -116,6 +116,9 @@ class Ptc
$art = ( isset($_SESSION['current_ad']['art']) ) ? $_SESSION['current_ad']['art'] : '';
$id = ( isset($_SESSION['current_ad']['id']) ) ? $_SESSION['current_ad']['id'] : 0;
$result = true;
$_SESSION['current_ad'] = array();
if( 0 !== $id )
{
$kamp = $this->campaigns->getIsClickableById( $id, $ip, $uid, $zeit );
......@@ -125,9 +128,8 @@ class Ptc
$this->addCampaignToReload( $id, $uid, $ip, $until );
}
}
unset( $_SESSION['current_ad'] );
$result = true;
}
return $result;
}
......
<?php
$sperre = mysqli_fetch_array(db_query("SELECT forced_sperre FROM ".$db_prefix."_kontodaten WHERE uid = '".$_SESSION['uid']."' "));
userstatus ();
include ('fakecheck/fc_redirect.php');
head ('Klickbanner');
head ('Klickbanner');
?>
$fstats_gesamt = $stats->adsTotalsCount( 'forcedbanner', $_SESSION['uid'] );
$fstats_uebrig = $stats->adsClickableCount( 'forcedbanner', $_SESSION['uid'], $ip );
<div id="forcedbanner_display"></div>
<input type="button" value="Neue Banner laden" id="loadAds_btn">
$uebriga = ( 0 != $fstats_gesamt->ganzahl && 0 != $fstats_uebrig->uanzahl ) ? 100/$fstats_gesamt->ganzahl * $fstats_uebrig->uanzahl : 0;
$uebrig = number_format($uebriga,2,',','.');
$abgebaut = 100-$uebriga; // breite fuer progressbar, nicht % oder anzahl abgebauter kampagnen
<script id="forcedBannerTmpl_list" type="text/x-jquery-tmpl">
<li class="list-group-item" data-tan="${tan}" data-art="${werbeart}"
data-sec="${aufendhalt}" data-use-frame="${use_frame}"><img src="${banner}" style="min-width:60px; min-height:10px; cursor:pointer;" />${verdienst} <?php echo $pageconfig['waehrung']; ?> f&uuml;r ${aufendhalt} Sekunden</li>
</script>
$aufenthalt = (0 != $fstats_gesamt->gaufenthalt && 0 != $fstats_gesamt->ganzahl) ? number_format($fstats_gesamt->gaufenthalt/$fstats_gesamt->ganzahl,0,",",".") : 0;
$verguetung = (0 != $fstats_gesamt->gverdienst && 0 != $fstats_gesamt->ganzahl) ? number_format( $fstats_gesamt->gverdienst/$fstats_gesamt->ganzahl ,2,",",".") : 0;
echo "<table class=\"table\">
<tr>
<td align='center''>Paidbanner gesamt: ". $fstats_gesamt->ganzahl ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Paidbanner uebrig: ". $fstats_uebrig->uanzahl ."</td>
</tr>
<tr>
<td align='center'>&Oslash; Aufenthalt: ".$aufenthalt." Sekunden</td>
<td>&nbsp;&nbsp;</td>
<td align='center''>&Oslash; Verg&uuml;tung: ".$verguetung." ". $pageconfig['waehrung'] ."</td>
</tr>
<tr>
<td align='center''>Gesamtwert: ". $fstats_gesamt->gverdienst ." ". $pageconfig['waehrung'] ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Offen: ". $fstats_uebrig->uverdienst ." ".$pageconfig['waehrung']."</td>
</tr>
</table>
<div id='fortschritt' style='width: 380px; font-weight: bold; margin: 0 auto' align='center''></div>
<script type=\"text/javascript\">
var width = ".$abgebaut.";
jQuery('#fortschritt').progressbar({value: width});
jQuery('#fortschritt').append(jQuery('<div>').html('Noch ".$uebrig."&#37; &uuml;brig ').css('position', 'relative').css('top', '-21px').css('width', '100%').css('font-size', '14px').attr('align', 'center').attr('id', 'fortschritttext'));
</script> ";
$reloffzeit = $campaigns->getTimeToFirstOffReloadAd( 'forcedbanner', $_SESSION['uid'] );
if ($reloffzeit != NULL)
{
echo '<center>Der n&auml;chste Banner kommt in '.ceil($zeit/60).' Minuten aus dem Reload!</center><hr><br>';
}
else
<script>
$( document )
.ready(
function()
{
echo '<center>Kein Banner im Reload.</center><hr><br>';
}
if($sperre['forced_sperre'] == 0){
$usr = mysqli_fetch_assoc (db_query ('SELECT max_forced FROM ' . $db_prefix . '_userdaten WHERE uid = ' . $_SESSION['uid'] . ' LIMIT 1'));
$ads = $campaigns->getNewAdData( 'forcedbanner', $_SESSION['uid'], $ip, $usr['max_forced'] );
if( 0 >= $ads['count'] )
{
echo '<div class="alert alert-warning text-center">Alle Banner im Reload !</div>';
} else {
foreach($ads['data'] as $f_banner)
{
echo '<div align="center" id="banner_'. $f_banner->tan .'">';
echo '<a href="top_forcedbanner.php?tan=' . $f_banner->tan . '" target="_blank">';
echo '<img src="'. $f_banner->banner .'" border="0" height="60" width="468" alt="'. $f_banner->tan .'" onclick="document.getElementById(\'banner_'. $f_banner->tan .'\').style.display=\'none\';">';
echo '</a>';
echo '<br>Reload:' . $f_banner->reload / 3600 . ' Std. | Verdienst: ' . number_format($f_banner->verdienst, 2, ',', '.') . ' | Aufenthalt: ' . $f_banner->aufendhalt . ' Sekunden<br><br></div>';
function displayAds(data, status)
{
var useData = jQuery.parseJSON( data );
if( 0 < useData.count )
{
$( "#forcedbanner_display" ).html('<ul class="list-group" id="forcedbanner_display_grp"></ul>');
$( "#forcedBannerTmpl_list" ).tmpl( useData.data ).appendTo( $( "#forcedbanner_display ul" ) );
}
}
echo '<div align="center"><input type="button" name="mehr_banner" value="Weitere Banner !" onclick="javascript:location.reload();" /></div>';
}
}else{
echo '<div class="alert alert-danger text-center">Du bist f&uuml;r den Klickbereich gesperrt.</div>';
}
$( "#loadAds_btn").on('click', function(e) { loadAds( 'forcedbanner', displayAds ) } );
loadAds( 'forcedbanner', displayAds );
/*
* gets executed on click on ad
*/
$( "#forcedbanner_display" )
.on('click',
function(e)
{
var elem = $( e.target ).closest( "li" );
var sec = elem.data('sec');
var tan = elem.data('tan');
var art = elem.data('art');
var use_frame = elem.data('use-frame');
if( (typeof tan !== typeof undefined && tan !== false) &&
(typeof sec !== typeof undefined && sec !== false) &&
(typeof art !== typeof undefined && art !== false) &&
(typeof use_frame !== typeof undefined && use_frame !== false)
)
{
$(elem).remove();
openAdWindow( art, tan, sec, use_frame );
}
}
);
}
);
</script>
<?php
foot ();
<?php
$sperre = mysqli_fetch_array(db_query("SELECT forced_sperre FROM ".$db_prefix."_kontodaten WHERE uid = '".$_SESSION['uid']."' "));
userstatus ();
head ('Klickbanner');
?>
<div id="forcedbanner_display"></div>
<input type="button" value="Neue Banner laden" id="loadAds_btn">
<script id="forcedBannerTmpl_list" type="text/x-jquery-tmpl">
<li class="list-group-item" data-tan="${tan}" data-art="${werbeart}" data-sec="${aufendhalt}"><img src="${banner}" style="min-width:60px; min-height:10px; cursor:pointer;" />${verdienst} <?php echo $pageconfig['waehrung']; ?> f&uuml;r ${aufendhalt} Sekunden</li>
</script>
<script src="<?php echo $pageconfig['domain']; ?>/ext/js/forcedbanner_nf.js"></script>
<?php
foot ();
<?php
$sperre = mysqli_fetch_array(db_query("SELECT forced_sperre FROM ".$db_prefix."_kontodaten WHERE uid = '".$_SESSION['uid']."' "));
userstatus ();
head("Paidlinks Information");
$fstats_gesamt = $stats->adsTotalsCount( 'paidlinks', $_SESSION['uid'] );
$fstats_uebrig = $stats->adsClickableCount( 'paidlinks', $_SESSION['uid'], $ip );
$uebriga = ( 0 != $fstats_gesamt->ganzahl && 0 != $fstats_uebrig->uanzahl ) ? 100/$fstats_gesamt->ganzahl * $fstats_uebrig->uanzahl : 0;
$uebrig = number_format($uebriga,2,',','.');
$aufenthalt = (0 != $fstats_gesamt->gaufenthalt && 0 != $fstats_gesamt->ganzahl) ? number_format($fstats_gesamt->gaufenthalt/$fstats_gesamt->ganzahl,0,",",".") : 0;
$verguetung = (0 != $fstats_gesamt->gverdienst && 0 != $fstats_gesamt->ganzahl) ? number_format( $fstats_gesamt->gverdienst/$fstats_gesamt->ganzahl ,2,",",".") : 0;
echo "<table class=\"table\">
<tr>
<td align='center''>Paidlinks gesamt: ". $fstats_gesamt->ganzahl ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Paidlinks uebrig: ". $fstats_uebrig->uanzahl ."</td>
</tr>
<tr>
<td align='center'>&Oslash; Aufenthalt: ".$aufenthalt." Sekunden</td>
<td>&nbsp;&nbsp;</td>
<td align='center''>&Oslash; Verg&uuml;tung: ".$verguetung." ". $pageconfig['waehrung'] ."</td>
</tr>
<tr>
<td align='center''>Gesamtwert: ". $fstats_gesamt->gverdienst ." ". $pageconfig['waehrung'] ."</td>
<td>&nbsp;&nbsp;</td>
<td align='center'>Offen: ". $fstats_uebrig->uverdienst ." ".$pageconfig['waehrung']."</td>
</tr>
</table>";
foot();
userstatus();
$max_banner = mysqli_fetch_array(db_query("SELECT `max_paidlinks` FROM ".$db_prefix."_userdaten WHERE uid=".$_SESSION['uid'].""));
head("");
$reloffzeit = $campaigns->getTimeToFirstOffReloadAd( 'paidlinks', $_SESSION['uid'] );
if ($reloffzeit != NULL)
{
echo '<center>Der n&auml;chste Paidlink kommt in '.ceil($zeit/60).' Minuten aus dem Reload!</center><hr><br>';
}
else
{
echo '<center>Kein Paidlink im Reload.</center><hr><br>';
}
if($sperre['forced_sperre'] == 0)
{
$ads = $campaigns->getNewAdData( 'paidlinks', $_SESSION['uid'], $ip, $max_banner['max_paidlinks'] );
if( 0 >= $ads['count'] )
{
echo '<div class="alert alert-warning text-center">Alle Paidlinks im Reload !</div>';
} else {
foreach($ads['data'] as $f_plinks)
{
echo '<div align="center"><a href="pl.php?tan='.$f_plinks->tan.'" target="_blank">'.$f_plinks->banner.'</a><br>Reload:'. $f_plinks->reload/3600 .' Std. | Verdienst: '.number_format($f_plinks->verdienst,2,',','.').' | Aufenthalt:'.$f_plinks->aufendhalt.' Sekunden<br><br></div>';
}
echo '<div align="center"><form action="" method="post"><input type="Submit" name="mehr_banner" value="Weitere Paidlinks ?"></form></div>';
}
}
foot();
?>
<?php
userstatus();
include ('fakecheck/fc_redirect.php');
head("Paidmailhistory");
$paidmails = db_query("SELECT
e.gueltig, e.tan, v.verdienst, v.beschreibung, v.mailtext, v.aufendhalt
FROM " . $db_prefix . "_paidmails_empfaenger e
LEFT JOIN " . $db_prefix . "_paidmails_versendet v ON v.tan = e.tan
WHERE e.uid=" . $_SESSION['uid'] . " && e.gueltig > " . time() . " && e.status=0
LIMIT 10");
while ($mail = mysqli_fetch_array($paidmails)) {
echo '
<table border="1" id="mail_' . $mail['tan'] . '" width="100%">
<tr>
<td colspan="2" align="center"><b>' . $mail['beschreibung'] . '</b></td>
</tr>
<tr>
<td colspan="2" align="center"><textarea readonly rows="5" cols="60">' . $mail['mailtext'] . '</textarea></td>
</tr>
<tr>
<td><font size="2"><b>Verdienst:</b> ' . $mail['verdienst'] . ' ' . $pageconfig['waehrung'] . ' &nbsp;&nbsp;&nbsp; <b>Aufenthalt:</b> ' . $mail['aufendhalt'] . ' Sek.</td>
<td align="center"><b><a href="pclick.php?tan=' . $mail['tan'] . '&uid=' . $_SESSION['uid'] . '" onClick=document.getElementById("mail_' . $mail['tan'] . '").style.display="none" target="_Blank">Bestätigen</a></td>
</Tr>
</table>
';
}
if (!mysqli_num_rows($paidmails)) {
echo '<center><b>Keine Paidmails vorhanden!</b></center>';
}
echo '<p align="center"><input type="button" onClick="javascript:location.reload();" value="Weitere Paidmails"></p>';
foot();
......@@ -12,7 +12,7 @@ $sperre = mysqli_fetch_assoc( $sperre_res );
if( 0 == $sperre['forced_sperre'] )
{
$result = array( 'count' => 0, 'data' => array() );
$result = false;
if( isset($_POST['action']) )
{
......@@ -29,10 +29,12 @@ if( 0 == $sperre['forced_sperre'] )
case 'checkAdOk':
if( isset( $_SESSION['current_ad']['id'] ) )
$result = $ptc->checkAdOkAndPay( $_SESSION['current_ad']['id'], $_SESSION['uid'], $ip );
else
$result = false;
break;
case 'invalidateAd':
$result = invalidateAlreadyRunningAd( $_SESSION['uid'], $ip );
$result = $ptc->invalidateAlreadyRunningAd( $_SESSION['uid'], $ip );
break;
}
}
......
body
{
margin: 0;
}
#ad_bar
{
position:relative;
left:0;
width:100%;
}
#ad_frame
{
display: block;
border: none;
height: calc(100vh - 90px);
width: 100%;
}
ul
{
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #333;
}
li
{
float: left;
}
li a
{
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
#ad_status
{
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover:not(.active)
{
background-color: #111;
}
.active
{
background-color: #4CAF50;
}
notify();
function use_frame_cll( secstatus, data )
{
if( false !== data )
{
if( 'false' == data )
{
$( "#ad_status" ).html( 'Nope, sry' );
$( "#ad_status" ).css( 'background-color', '#DC143C');
}
else
{
$( "#ad_status" ).html( 'OK' );
}
}
else
{
if( Number.isInteger( secstatus ) )
$( "#ad_status" ).html( campaign_data['wait_time'] - secstatus );
}
}
startAdCountdown( campaign_data['ad_type'], campaign_data['tan'], campaign_data['wait_time'], use_frame_cll );
Visibility.change(
function (e, state)
{
if( 'hidden' == state )
{
invalidateAd( campaign_data['ad_type'], campaign_data['tan'] );
}
}
);
$( document ).ready( function()
{
var adFenster = new Array();
window.addEventListener("message", function(event)
......@@ -9,27 +7,26 @@ $( document ).ready( function()
{
return;
}
console.log(event.data);
var art = event.data['art'],
tan = event.data['tan'],
action = event.data['action'];
if( 'adcheck' == action )
{
console.log('okokok');
adFenster[art][tan]['opened'] = true;
}
}
);
function checkAdOk( art, tan )
function checkAdOk( art, tan, use_frame )
{
console.log('checkadok');
if( false == adFenster[art][tan]['checked'] && false == adFenster[art][tan]['window'].closed )
if( 0 !== use_frame || (false == adFenster[art][tan]['checked'] && false == adFenster[art][tan]['window'].closed) )
{
var pdata = window.btoa(art) + '-' + window.btoa(tan)
adFenster[art][tan]['checked'] = true;
if( 0 == use_frame )
adFenster[art][tan]['checked'] = true;
$.post( "ext/ap/ads.php",
{
'action': "checkAdOk",
......@@ -38,7 +35,10 @@ $( document ).ready( function()
},
function(data, status)
{
window.open(pageconfig['domain']+'/adcheck.php?data='+pdata, art+'-'+tan, "height=120,width=200");
if( 0 == use_frame )
window.open(pageconfig['domain']+'/adcheck.php?data='+pdata, art+'-'+tan, "height=120,width=200");
else
use_frame( status, data );
}
);
}
......@@ -49,8 +49,9 @@ $( document ).ready( function()
*/
function invalidateAd( art, tan )
{
console.log('invalidatead');
adFenster[art][tan]['checked'] = true;
if( undefined !== adFenster[art] )
adFenster[art][tan]['checked'] = true;
var pdata = window.btoa(art) + '-' + window.btoa(tan)
$.post( "ext/ap/ads.php",
{
......@@ -58,46 +59,74 @@ $( document ).ready( function()
},
function(data, status)
{
window.open(pageconfig['domain']+'/adcheck.php?data='+pdata, art+'-'+tan, "height=120,width=200");
try
{
if( undefined != adFenster[art][tan]['checked'] )
window.open(pageconfig['domain']+'/adcheck.php?data='+pdata, art+'-'+tan, "height=120,width=200");
}
catch(e) { } // wurscht
}
);
}
async function startAdCountdown( art, tan, sec )
async function startAdCountdown( art, tan, sec, use_frame )
{
console.log('startadcountdown');
var sec_done = -1;
let timer = setInterval( () =>
{
console.log('checktimer');
if( true == adFenster[art][tan]['checked'] )
if( 0 == use_frame )
{
clearInterval(timer);
} else {
if( document.hasFocus() )
if( true == adFenster[art][tan]['checked'] )
{
invalidateAd( art, tan );
clearInterval(timer);
} else {
if( document.hasFocus() )
{
invalidateAd( art, tan );
clearInterval(timer);
}
try
{
if ( adFenster[art][tan]['window'].closed )
{
invalidateAd( art, tan );
clearInterval(timer);
}
}
catch (e)
{
invalidateAd( art, tan );
clearInterval(timer);
}
}
if ( 'undefined' == adFenster[art][tan]['window'].closed || adFenster[art][tan]['window'].closed )
}
if( 0 != use_frame )
{
if( sec_done >= sec )
{
invalidateAd( art, tan );
checkAdOk( art, tan, use_frame );
clearInterval(timer);
}
sec_done++;
use_frame( sec_done, false );
}
},
100
1000
);
await sleep(sec * 1000);
checkAdOk( art, tan );
if( 0 == use_frame )
{
await sleep(sec * 1000);
checkAdOk( art, tan, 0 );
}
}
/*
* communicates with ad window, placing detection of actual click
*/
function openAdWindow( art, tan, sec )
function openAdWindow( art, tan, sec, use_frame )
{
if ( 'undefined' == typeof adFenster[art] || (! adFenster[art] instanceof Array ) )
{
......@@ -117,62 +146,28 @@ $( document ).ready( function()
adFenster[art][tan]['window'].focus();
adFenster[art][tan]['opened'] = false;
adFenster[art][tan]['checked']= false;
console.log('meh');
adFenster[art][tan]['window'].onbeforeunload = function()
{ console.log('startadcountdowncall');
startAdCountdown( art, tan, sec );
}
}
}
/*
* gets executed on click on ad
*/
$( "#forcedbanner_display" ).on('click', function(e)
{
var elem = $( e.target ).closest( "li" );
var sec = elem.data('sec');
var tan = elem.data('tan');
var art = elem.data('art');
if (typeof tan !== typeof undefined && tan !== false)
if( 0 == use_frame )
{
if (typeof art !== typeof undefined && art !== false)
adFenster[art][tan]['window'].onbeforeunload = function()
{
if (typeof sec !== typeof undefined && sec !== false)
{
$(elem).remove();
openAdWindow( art, tan, sec );
}
startAdCountdown( art, tan, sec, use_frame );
}
}
}
);
}
/*
* gets executed first, loads available ads and prepares the bootstrap <ul>-list for display
*/
function loadAds( art )
function loadAds( art, fn)
{
$.post( "ext/ap/ads.php",
{
'action': "getNewAdData",
'adArt' : art
},
function(data, status)
{
var useData = jQuery.parseJSON( data );
if( 0 < useData.count )
{
$( "#forcedbanner_display" ).html('<ul class="list-group" id="forcedbanner_display_grp"></ul>');
$( "#forcedBannerTmpl_list" ).tmpl( useData.data ).appendTo( $( "#forcedbanner_display ul" ) );
}
}
fn
);
}
$( "#loadAds_btn").on('click', function(e) { loadAds( 'forcedbanner' ) } );
loadAds( 'forcedbanner' );
}
);
;(function (global) {
var lastId = -1;
// Visibility.js allow you to know, that your web page is in the background
// tab and thus not visible to the user. This library is wrap under
// Page Visibility API. It fix problems with different vendor prefixes and