This file contains hidden or 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 gets the first image from the parameter text | |
Usage: | |
{% include 'get-image' with page.content %} | |
Return: | |
{{ imageSrc }} is the string of the original image | |
Required: |
This file contains hidden or 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
/**************************************************************| CONVERT VARIANT TO SWATCHES |*/ | |
$(function() { | |
if($(".single-option-selector").length) { | |
$(".single-option-selector").each(function(i) { | |
var $thisSelect = $(this); | |
var $newClass = "js-option-selector-" + i; | |
var $newOptions = '<ul class="new-variant-swatchs">'; | |
var $currentOption = $thisSelect.val(); |
This file contains hidden or 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 sizes | |
Usage: | |
{% include 'show-sizes' with product %} | |
Return: | |
no return | |
Required: |
This file contains hidden or 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({ |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
* |