Skip to content

Instantly share code, notes, and snippets.

@pjhoberman
Created November 15, 2013 19:38
Show Gist options
  • Select an option

  • Save pjhoberman/7490339 to your computer and use it in GitHub Desktop.

Select an option

Save pjhoberman/7490339 to your computer and use it in GitHub Desktop.
diff --git a/wp-content/plugins/wordpress-popup/popoverincludes/classes/popoverajax.php b/wp-content/plugins/wordpress-popup/popoverincludes/classes/popoverajax.php
index 81db67e..d2cdeda 100644
--- a/wp-content/plugins/wordpress-popup/popoverincludes/classes/popoverajax.php
+++ b/wp-content/plugins/wordpress-popup/popoverincludes/classes/popoverajax.php
@@ -319,15 +319,15 @@ if(!class_exists('popoverajax')) {
}
- // Add the cookie
- if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) ) {
- $count = intval($_COOKIE['popover_view_'.COOKIEHASH]);
+ // Add the cookie -- edited to reset
+ if ( isset($_COOKIE['popover_view_2_'.COOKIEHASH]) ) {
+ $count = intval($_COOKIE['popover_view_2_'.COOKIEHASH]);
if(!is_numeric($count)) $count = 0;
$count++;
} else {
$count = 1;
}
- if(!headers_sent()) setcookie('popover_view_'.COOKIEHASH, $count , time() + 30000000, COOKIEPATH, COOKIE_DOMAIN);
+ if(!headers_sent()) setcookie('popover_view_2_'.COOKIEHASH, $count , time() + 2592000, COOKIEPATH, COOKIE_DOMAIN); // changed this to 30 days
return $popover;
@@ -424,7 +424,7 @@ if(!class_exists('popoverajax')) {
}
function has_reached_limit($count = 3) {
- if ( isset($_COOKIE['popover_view_'.COOKIEHASH]) && addslashes($_COOKIE['popover_view_'.COOKIEHASH]) >= $count ) {
+ if ( isset($_COOKIE['popover_view_2_'.COOKIEHASH]) && addslashes($_COOKIE['popover_view_2_'.COOKIEHASH]) >= $count ) {
return true;
} else {
return false;
@@ -563,4 +563,4 @@ if(!class_exists('popoverajax')) {
}
}
-?>
\ No newline at end of file
+?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment