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 | |
| $db_host='dbserver'; | |
| $db_name='dbame'; | |
| $db_user='dbuser'; | |
| $db_passwd='dbpassword'; | |
| mysql_connect($db_host, $db_user, $db_passwd) | |
| or die('Could not connect: ' . mysql_error()); | |
| mysql_select_db($db_name) or die('Could not select database'); |
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
| /* | |
| Important note! This code is included in PMPro versions 1.5.7 and later. | |
| Adding this code will add 2x the number of days to the end of the subscription. | |
| */ | |
| //if checking out for the same level, add remaining days to the enddate | |
| function my_pmpro_checkout_level($level) | |
| { | |
| global $pmpro_msg, $pmpro_msgt; | |
| //does this level expire? are they an existing user of this level? |
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 | |
| /** | |
| * ----------------------------------------------------------------------------------------- | |
| * Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php` | |
| * ----------------------------------------------------------------------------------------- | |
| */ | |
| // HTML Minifier | |
| function minify_html($input) { |
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
| /*Custom Radio Buttons and Checkboxes using Font Awesome*/ | |
| input[type=radio], | |
| input[type='checkbox'] { | |
| display: none; | |
| } | |
| input[type=radio] + label { | |
| display: block; | |
| } | |
| input[type='checkbox'] + label:before, |
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 | |
| function slugify($string, $replace = array(), $delimiter = '-') { | |
| // https://github.com/phalcon/incubator/blob/master/Library/Phalcon/Utils/Slug.php | |
| if (!extension_loaded('iconv')) { | |
| throw new Exception('iconv module not loaded'); | |
| } | |
| // Save the old locale and set the new locale to UTF-8 | |
| $oldLocale = setlocale(LC_ALL, '0'); | |
| setlocale(LC_ALL, 'en_US.UTF-8'); | |
| $clean = iconv('UTF-8', 'ASCII//TRANSLIT', $string); |
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 | |
| function array_to_tree(array $array, $parent_id = 0) | |
| { | |
| $array = array_combine(array_column($array, 'id'), array_values($array)); | |
| foreach ($array as $k => &$v) { | |
| if (isset($array[$v['parent_id']])) { | |
| $array[$v['parent_id']]['children'][$k] = &$v; | |
| } |
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
| /* | |
| ajax-send.js - copyright Jake Bellacera (http://jakebellacera.com) | |
| This script uses JQuery & JQuery Validate (https://github.com/jzaefferer/jquery-validation) | |
| For this example, we will have a form named '#ajaxform', you can of course change this to whatever you'd like. | |
| */ | |
| $(function(){ | |
| $('#submitbutton').click(function() { |
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
| AddDefaultCharset UTF-8 | |
| Options -Indexes | |
| <IfModule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE application/javascript | |
| AddOutputFilterByType DEFLATE application/json | |
| AddOutputFilterByType DEFLATE application/x-javascript | |
| AddOutputFilterByType DEFLATE application/vnd.ms-fontobject | |
| AddOutputFilterByType DEFLATE font/ttf |
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 | |
| /* | |
| * Remote File Copy PHP Script 2.0.0 | |
| * | |
| * Copyright 2012, Sebastian Tschan | |
| * https://blueimp.net | |
| * | |
| * Licensed under the MIT license: | |
| * http://www.opensource.org/licenses/MIT | |
| */ |