- Remove index on template name via: ALTER TABLE
modx3_site_templates
DROP INDEXtemplatename
- comment out 25-30 in /core/model/modx/processors/element/template/create.php
- comment out 40-46 in /core/model/modx/processors/element/template/update.php
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 | |
if( !defined('VENDOR_PATH')) { | |
define('VENDOR_PATH', MODX_BASE_PATH.'/vendors'); | |
} | |
class RevoSnippet | |
{ | |
public function __construct() | |
{ |
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
var toggleFullScreen = false; | |
jQuery(document).ready(function($) { | |
$('#toggleButton').click(function() { | |
toggleFullScreen = true; | |
flowplayer.pause(); | |
toggleFullScreen = false; |
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
Array | |
( | |
[0] => __construct | |
[1] => listGroups | |
[2] => getTemplateVarCollection | |
[3] => refreshURIs | |
[4] => process | |
[5] => getContent | |
[6] => setContent | |
[7] => getCacheKey |
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 | |
function variable_name( &$var, $scope=false, $prefix='UNIQUE', $suffix='VARIABLE' ){ | |
if($scope) { | |
$vals = $scope; | |
} else { | |
$vals = $GLOBALS; | |
} | |
$old = $var; | |
$var = $new = $prefix.rand().$suffix; |
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 | |
class Template | |
{ | |
public $context = array(); | |
private $template; | |
public function __construct($template) |
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
$('label').autoWidth({limitWidth: 350}); | |
jQuery.fn.autoWidth = function(options) | |
{ | |
var settings = { | |
limitWidth : false | |
} | |
if(options) { | |
jQuery.extend(settings, options); |
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
var resourcesFolderName = "my/folder/here"; | |
var documentName = "name-of-doc"; | |
var documentLoaderFilename = "this-script-name.js"; | |
// find the URL for this script's absolute path and set as the resourceFolderName | |
try { | |
var scripts = document.getElementsByTagName('script'); | |
for(var i = 0; i < scripts.length; i++) { | |
var scriptSrc = scripts[i].src; | |
if(scriptSrc != null && scriptSrc.indexOf(documentLoaderFilename) != -1) { |
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 | |
function trim_text($input, $length, $ellipses = true, $strip_html = true, $output_entities = true){ | |
// Strip tags, if desired | |
if($strip_html) { | |
$input = strip_tags($input); | |
} | |
// No need to trim, already shorter than trim length | |
if(strlen($input) <= $length) { |
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 | |
function detect_mobile() | |
{ | |
$_SERVER['ALL_HTTP'] = isset($_SERVER['ALL_HTTP']) ? $_SERVER['ALL_HTTP'] : ''; | |
$mobile_browser = '0'; | |
if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|iphone|ipad|ipod|android|xoom)/i', strtolower($_SERVER['HTTP_USER_AGENT']))) | |
$mobile_browser++; |