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
| define("DATE_FORMAT", "F j, Y"); | |
| define("PUBDATE_FORMAT", "Y-m-d H:i"); | |
| define("MYSQL_DATETIME", "Y-m-d H:i:s"); |
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
| /* | |
| default.jpg | |
| mqdefault.jpg | |
| hqdefault.jpg | |
| maxresdefault.jpg | |
| 0.jpg - 3.jpg | |
| */ | |
| function youTubeThumbnail($id, $size = "mqdefault") { | |
| return "http://img.youtube.com/vi/" . $id . "/" . $size . ".jpg"; | |
| } |
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
| define("SECOND", 1); | |
| define("MINUTE", 60 * SECOND); | |
| define("HOUR", 60 * MINUTE); | |
| define("DAY", 24 * HOUR); | |
| define("MONTH", 30 * DAY); | |
| function relativeTime($time) { | |
| if (!is_numeric($time)) { | |
| $time = strtotime($time); | |
| } |
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
| function splitFirstP($html) { | |
| $parts = explode("</p>", $html, 2); | |
| $parts[0] = $parts[0]."</p>"; | |
| return $parts; | |
| } | |
| function splitCenterContent($html) { | |
| $return = array(); | |
| $parts = explode("</p>", $html); | |
| $middle = floor(count($parts) / 2) - 1; |
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
| ol { counter-reset: item; } | |
| ol li, ul li { color: black; list-style: none; } | |
| ol li:before { color: red; counter-increment: item; content: counter(item) ". "; margin: 0 0 0 -20px; text-align: right; } | |
| ul li:before { background: transparent; border: 1px solid red; border-radius: 100%; content: ''; display: block; float: left; height: 8px; margin: 10px 0 0 -20px; width: 8px; } |
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
| // Modernizr style test | |
| if (!(window.webkitMatchMedia || window.mozMatchMedia || window.oMatchMedia || window.msMatchMedia || window.matchMedia)) { | |
| var root = document.getElementsByTagName( 'html' )[0]; | |
| root.className += ' no-matchmedia'; | |
| } | |
| /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ | |
| window.matchMedia || (window.matchMedia = function() { | |
| "use strict"; |
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
| // Modernizr style test | |
| if (!(window.webkitMatchMedia || window.mozMatchMedia || window.oMatchMedia || window.msMatchMedia || window.matchMedia)) { | |
| var root = document.getElementsByTagName( 'html' )[0]; | |
| root.className += ' no-matchmedia'; | |
| } | |
| /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license - IE8 VERSION! */ | |
| window.matchMedia = window.matchMedia || (function(doc, undefined){ | |
| var docElem = doc.documentElement, |
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
| /* Pre-Define HTML5 Elements in IE */ | |
| (function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )(); |
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
| function getFirstPP($html) { | |
| $start = strpos($html, '<p'); | |
| $end = strpos($html, '</p>', $start); | |
| $html = substr($html, $start, ($end - $start + 4)); | |
| return $html; | |
| } | |
| function splitFirstPP($html) { | |
| $parts = explode("</p>", $html, 2); | |
| $first = $parts[0] . "</p>"; |
OlderNewer