Skip to content

Instantly share code, notes, and snippets.

@thotbox
thotbox / ExpressionEngine: Query Count.html
Last active August 29, 2015 14:02
ExpressionEngine: Query Count
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2"}
<p><strong>Total Entries</strong> - {COUNT(*)}</p>
{/exp:query}
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2 WHERE form_field_10 = 'Yes' OR form_field_11 = 'Yes' "}
<p><strong>Bonus Entries</strong>* - {COUNT(*)}</p>
{/exp:query}
{exp:query sql="SELECT COUNT(*) FROM exp_freeform_form_entries_2 WHERE form_field_10 = 'Yes' "}
<p><strong>Facebook Shares</strong>** - {COUNT(*)}</p>
@thotbox
thotbox / ExpressionEngine: Switchee Template.html
Last active August 29, 2015 14:03
ExpressionEngine: Switchee Template
{exp:switchee variable="{segment_2}" parse="inward"}
{case value="#^P(\d+)$#|''"}
{/case}
{case default="yes"}
{/case}
@thotbox
thotbox / JavaScript: Foundation Init.js
Last active August 29, 2015 14:03
JavaScript: Foundation Init
// Foundation Init
if (!$('html').hasClass('lt-ie9')) {
$(document).foundation();
}
@thotbox
thotbox / JavaScript: Parallax Background.js
Last active August 29, 2015 14:03
JavaScript: Parallax Background
// Parallax
$(document).ready(function(){
$window = $(window);
var width = $window.width();
$(window).scroll(function() {
// #header
var offset = 0;
var speed = 3;
var calc = ($window.scrollTop() / speed) + offset;
@thotbox
thotbox / JavaScript: Google Map Fixes.js
Last active August 29, 2015 14:03
JavaScript: Google Map Fixes
// IE8 Map Fix - Add data-lat and data-long attributes to .map-container
if ($('html').hasClass('lt-ie9')) {
if($('.map-container').length ) {
var mapLat = $('.map-container').attr('data-lat');
var mapLong = $('.map-container').attr('data-long');
setTimeout(function() {
google.maps.event.trigger(map, 'resize');
map_map.setCenter(new google.maps.LatLng(mapLat,mapLong));
}, 500);
@thotbox
thotbox / JavaScript: Popup Function.js
Last active August 29, 2015 14:03
JavaScript: Popup Function
// Popup
function popupCenter(pageURL,title,w,h) {
var left = (window.screen.width/2)-(w/2);
var top = (window.screen.height/2)-(h/2);
var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
}
@thotbox
thotbox / HTML: Popup Social Links.html
Last active August 29, 2015 14:03
HTML: Popup Social Links
@thotbox
thotbox / JavaScript: Slick Init.js
Last active August 29, 2015 14:03
JavaScript: Slick Init
// Slick
$('.image-switcher').slick({
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
fade: true,
pauseOnHover: false,
autoplaySpeed: 5000,
});
@thotbox
thotbox / ExpressionEngine: Foundation Bootstrap Template.html
Last active August 29, 2015 14:03
ExpressionEngine: Foundation Bootstrap Template
<!doctype html>
{if '{exp:browser_detect:browser}' == 'IE8'}
<html class="no-js lt-ie9" lang="en">
{if:elseif '{exp:browser_detect:browser}' == 'IE9'}
<html class="no-js lt-ie10" lang="en">
{if:else}
<html class="no-js" lang="en">
{/if}
<head>
@thotbox
thotbox / JavaScript: Combo Box Search.js
Last active August 29, 2015 14:03
JavaScript: Combo Box Search
// Combo Box
$(document).ready(function() {
$('#providers li').click(function(e) {
$('#provider').val($(this).text()).change();
setTimeout(function () {
$('#provider-list').hide();
}, 300);
});
$('#provider').blur(function() {