I'd like for displayimage.php to issue a popup every 'x' amount of clicks to 'x' popup - I guess by means of a cookie / counter.
I want to be able to define x both for both the amount of clicks before a user gets a popup, (every 3rd click, every 4th click, etc) and I also want to be able to define the amount of popups they get, and obviously, want to be able to define the links of the popups.
I previously had this working with cpg 1.3.x programmed by George_CC but it doesn't seem to be working with cpg 1.4.4 that I just upgraded to
Here is the previous code:
session_start();
$a_link[0] = "window.open('http://www.link1.com');";
$a_link[1] = "window.open('http://www.secondlink.com');";
$a_link[2] = "window.open('http://www.anotherlink.com');";
$a_link[3] = "window.open('http://www.andanother.com');";
$a_link[4] = "window.open('http://www.example.com');";
$a_link[5] = "window.open('http://www.lastone.com');";
if (strstr($_SERVER['PHP_SELF'], "displayimage.php")) {
if(!isset($_SESSION['c_count']) || !is_numeric($_SESSION['c_count']) || $_SESSION['c_count']>(count($a_link)-1)){
$_SESSION['c_count'] = 0;
}
if(!isset($_SESSION['c_cpg']) || !is_numeric($_SESSION['c_cpg'])){
$_SESSION['c_cpg'] = 0;
}
if(!isset($_SESSION['c_link']) or $_SESSION['c_link']==""){
$_SESSION['c_link'] = $a_link[0];
$_SESSION['c_count'] = 0;
}
if(++$_SESSION['c_cpg']==3) {
$showpopup = true;
$_SESSION['c_link'] = $a_link[$_SESSION['c_count']];
$_SESSION['c_cpg'] = 0;
$_SESSION['c_count']++;
}
}
George did this for 30$, I'll pay another 30$ if someone can edit/get this working for me with the latest ver of CPG.