Skip to content

Instantly share code, notes, and snippets.

View netProphET's full-sized avatar

Mike Schell netProphET

  • MODX, LLC
  • Bancroft, Ontario, Canada
View GitHub Profile
@netProphET
netProphET / nginx.conf
Created November 2, 2013 12:10
phpThumbStatCache rewrite rules for MODX Cloud
location ~ ^/i/(.*) {
error_log /c0324/log/image.log notice;
rewrite_log on;
set $phptfn $1;
rewrite ^(.*?)\/w\/(\d+)\/(.*)$ $1/$3?w=$2&$args;
rewrite ^(.*?)\/h\/(\d+)\/(.*)$ $1/$3?h=$2&$args;
rewrite ^(.*?)\/new\/(\d+)\/(.*)$ $1/$3?new=$2&$args;
rewrite ^(.*?)\/wp\/(\d+)\/(.*)$ $1/$3?wp=$2&$args;
rewrite ^(.*?)\/hp\/(\d+)\/(.*)$ $1/$3?hp=$2&$args;
rewrite ^(.*?)\/w1\/(\d+)\/(.*)$ $1/$3?w1=$2&$args;
@netProphET
netProphET / babelContextRouter.plugin.php
Last active October 19, 2023 07:08
MODX Cloud web rules example for Babel with two languages.In this example, German is the default language with resources in the 'web' context; English is the secondary language, set up in the 'en' context.This technique is based on the "SEO Friendly Multilingual Websites" article archived here: https://web.archive.org/web/20180927220103/http://w…
<?php
if($modx->context->get('key') != "mgr"){
/* grab the current langauge from the cultureKey request var */
switch ($_REQUEST['cultureKey']) {
case 'en':
/* switch the context */
$modx->switchContext('en');
break;
default:
/* Set the default context here */
<?php
$simplx_debugger_js = $modx->getChunk('simplx.debugger.js');
$simplx_rpc_js = $modx->getChunk('simplx.jsonrpc.js');
$modx->regClientStartupHTMLBlock($simplx_rpc_js);
$modx->regClientStartupHTMLBlock($simplx_debugger_js);