Skip to content

Instantly share code, notes, and snippets.

View addisonhall's full-sized avatar

Addison Hall addisonhall

View GitHub Profile
@addisonhall
addisonhall / BC-Resize-Images.html
Created August 7, 2013 16:02
Parameters to automatically resize images in Adobe Business Catalyst
<!-- Basic resize -->
<img src="/folder_name/image_file_name.jpg?Action=thumbnail&Width=80&Height=80" alt="image">
<!-- Proportional resize -->
<img src="/folder_name/image_file_name.jpg?Action=thumbnail&Width=80&Height=80&algorithm=fill_proportional" alt="image">
<!-- Non-proportional resize -->
<img src="/folder_name/image_file_name.jpg?Action=thumbnail&Width=80&Height=80&algorithm=fill" alt="image">
<!-- Set output format -->
@addisonhall
addisonhall / BC-Category-Select-List.html
Last active December 20, 2015 18:39
Output full dropdown select list of Business Catalyst classifications (also called categories)
<!-- Output full list of Business Catalyst classifications -->
<tr>
<td><label for="CAT_Category">Classifications:</label>
<select name="CAT_Category" id="CAT_Category" class="cat_listbox">{module_categorylist}</select></td>
</tr>
@addisonhall
addisonhall / EE-Image-Placement-With-MX-Jumper.php
Last active December 20, 2015 20:19
ExpressionEngine image placement within bodies of text using Matrix and MX Jumper
{exp:channel:entries channel="pages" disable="categories|member_data|pagination"}
{!-- GRAB IMAGES WITH MX JUMPER, IF ANY --}
{page_images}
{exp:mx_jumper:put name="image_{row_count}"}
<figure class="align-{image_align}"{if image_width} style="width:{image_width}"{/if}>
<img src="{image_url}{url:normal}{/image_url}" alt="{image_alt}">
<figcaption class="caption-and-credit">
{if image_caption}<span class="image-caption">{image_caption}</span>{/if}
{if image_credit}<span class="image-credit">{image_credit}</span>{/if}
@addisonhall
addisonhall / EE-Specific-Image-Size.php
Created August 9, 2013 15:40
ExpressionEngine tag to output specific image sizes defined in File Upload Preferences
{image_field}
<img src="{url:thumbnail}" alt="{title}">
{/image_field}
@addisonhall
addisonhall / EngineHosting-https-redirect.php
Created August 20, 2013 15:43
PHP that successfully redirects http to https on Engine Hosting.
<?php
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off") {
$redirect = "https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
header("Location: $redirect");
exit();
}
?>
@addisonhall
addisonhall / BC-Alerts-and-jGrowl.js
Last active December 21, 2015 13:29
Customizing Business Catalyst default javascript alerts with jGrowl
// Default BC alert messages
/*
var Oshoplang = {
RemoveError: 'ERROR: To remove or update quantities select the View Cart link.',
Added: ' item(s) added to your cart.',
OutOfStock: 'Either product is out of stock or choose a smaller quantity',
PreOrder: ' item(s) pre-ordered and added to your cart.',
MinLimit: 'ERROR: Quantity entered is too small, please enter a larger quantity.',
MaxLimit: 'ERROR: Quantity entered is too large, please enter a smaller quantity.',
InvalidQuantity: 'ERROR: Quantity entered is not valid.',
# Months
January,February,March,April,May,June,July,August,September,October,November,December
#Dates
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
@addisonhall
addisonhall / ee2x-delete-members.sql
Last active December 27, 2015 19:39
These SQL statements help get rid of unwanted members that may have spammed your ExpressionEngine 2.x site. Be sure to include the correct member IDs that you want to keep!
DELETE FROM exp_member_homepage
WHERE member_id not in ( 1, 2, 3 )
DELETE FROM exp_member_data
WHERE member_id not in ( 1, 2, 3 )
# 'Members' member group
DELETE FROM exp_members
WHERE group_id = 5
AND member_id not in ( 1, 2, 3 )
@addisonhall
addisonhall / if-element-exists.js
Created February 19, 2014 18:21
jQuery if element exists
// if element length is greater than 0
if ($('.selector').length) {
// do something
}
@addisonhall
addisonhall / GetSimple-get-field-from-page.php
Created March 17, 2014 20:04
Grab data from a separate page in Get-Simple CMS
<?php getPageField('page-slug-name','field-name'); ?>