Skip to content

Instantly share code, notes, and snippets.

View anderly's full-sized avatar

Adam Anderly anderly

View GitHub Profile
@anderly
anderly / DFP Wallpaper Ad
Last active May 28, 2019 05:16
DFP Wallpaper Ad Code
<script>
var WallpaperAd = WallpaperAd || {};
/*-------------------------------------------------------------------------------------------------------*/
/* Two values are needed for Wallpaper Ads: */
/* 1.) destinationURL (where you want visitors to go when they click the wallpaper) */
/* - NOTE: Click-throughs to this URL will automatically be tracked in DFP */
/* 2.) backgroundURL (URL of wallpaper background image) */
/* - NOTE: Make sure to change the URL to start with
http://assets.dmagazine.com so that it is served via CloudFlare CDN (this makes pages and images load faster) */
@anderly
anderly / FrmProEntriesController.php
Created April 9, 2012 21:53
Changed set_cookie() function to use new cookie_expiration option.
/* AJAX */
function set_cookie($entry_id, $form_id){
global $frm_form;
$form = $frm_form->getOne($form_id);
$form->options = stripslashes_deep(maybe_unserialize($form->options));
$expires = time() + 30000000;
if ( $form->options['cookie_expiration'] == 'midnight' ) {
$expires = mktime( 23, 59, 59, date( 'm' ), date( 'd' ), date( 'y' ) );
} elseif ( $form->options['cookie_expiration'] == 'one-day-from-now' ) {
$expires = time() + 60 * 60 * 24 * 1;