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
<#-- The strSlug function generates a URL friendly "slug" from the given string --> | |
<#-- TODO: convert non-ASCII chars to ASCII chars --> | |
<#-- Copyright (c) 2018 Thomas Wilhelm <thomas.p.wilhelm@gmail.com> --> | |
<#function strSlug title seperator="-" idSafe=true> | |
<#local flipped = "_" /> | |
<#if seperator == "_"> | |
<#local flipped = "-" /> | |
</#if> | |
<#local string = title?replace("[" + flipped + "]+", seperator, "r") /> |
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 | |
/** | |
* Given a string containing any combination of YouTube and Vimeo video URLs in | |
* a variety of formats (iframe, shortened, etc), each separated by a line break, | |
* parse the video string and determine it's valid embeddable URL for usage in | |
* popular JavaScript lightbox plugins. | |
* | |
* In addition, this handler grabs both the maximize size and thumbnail versions | |
* of video images for your general consumption. In the case of Vimeo, you must | |
* have the ability to make remote calls using file_get_contents(), which may be |