This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
This snippet takes HTML content from the Shopify editor and parses out the first image in all sizes. | |
Usage: | |
{% include 'get-first-image' with page.content %} | |
Return: | |
{{ FirstImagePico }} | |
{{ FirstImageIcon }} | |
{{ FirstImageThumb }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
This snippet lookes at its input string and returns either the input or a fallback image in a specific size, no path though | |
Usage: | |
{% assign newImageSize = "medium" %} (optional) | |
{% include 'make-image' with imageString %} | |
Return: | |
{{ newImageSize }} (either as input or fallback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
This snippet displays "is-first" or "is-last" within a loop for class names | |
Usage: | |
{% for p in collection.products %} | |
<li class="{% include 'for-looper' %}"> ... </li> | |
{% endfor %} | |
Return: | |
no return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| MYSQLI CONNECTION FUNCTION |*****************************/ | |
/** | |
* Simple MySQLi abstraction layer | |
* | |
* @param resource $mysqli The MySQLi connection link | |
* @param string $query The MySQL query for prepaired statement | |
* @param array $v The parameters to replace ? in $query. First element must be the type | |
* @param integer $o Option for more debug infos [0]=no infos(default) [1]=adding debug infos | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| SYSTEM MESSAGE FUNCTION |*****************************/ | |
/** | |
* TINY SYSTEM MESSAGE GATHERER | |
* | |
* addMsg($msg,$o) | |
* @param string $msg Message to be added | |
* @param int $o Urgency [0](default)=normal [1]=warning [2]=error [3]=no HTML wrapper | |
* | |
* getMsg() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| UPLOAD FILES |*****************************/ | |
/** | |
* TINY FILE UPLOAD ABSTRACTION LAYER | |
* | |
* @param object $sysMsg System Message object | |
* @param string $el Name of _FILE element | |
* @param string $name Name of new file | |
* @param string $kind Kind of upload ["image"|"pdf"] | |
* @param array $dim Dimension of image [0]=width [1]=height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| STRING TO URL |*****************************/ | |
/** | |
* TINY STING TO URL CLEANER | |
* | |
* @param string $t String to be converted | |
* | |
* @return string string stripped off of all characters but A-Za-z0-9 and dash, spaces are converted to dash | |
*/ | |
function makeURL($t) { return strtolower(substr(preg_replace("/[^\w-]+/","",str_replace(" ","-",$t)),0,20)); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*****************************| TRUNCATE WORDS |*****************************/ | |
/** | |
* TINY TRUNCATE WORD FUNCTION | |
* | |
* @param string $t String to be shortened | |
* @param int $count Number of words to output | |
* @param boolen $dots Add dots at the end with string is larger than $count. (optional) [default=true] | |
* | |
* @return string of $count words with added dots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('php/ini.php'); //get mySQL settings | |
$SESSIONTAB = 'session'; //table for PHP sessions | |
/*****************************| MYSQLI CONNECTION FUNCTION |*****************************/ | |
/** | |
* Simple MySQLi abstraction layer | |
* | |
* @param resource $mysqli The MySQLi connection link | |
* @param string $query The MySQL query for prepaired statement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.fn.animateHeightAuto = function(speed, callback) { | |
var height; | |
return this.each(function(i, $element) { | |
var $this = $( $element ); | |
var heightBackup = $this.css('height'); | |
$this.css({ |
OlderNewer