Using canvas for image masking.
Image courtesy of Laura Aziz | Unsplash https://unsplash.com/photos/Zx5UKS3zC60
A Pen by Paul Mealy on CodePen.
| SELECT | |
| t1.ID, t1.user_email, | |
| MAX(CASE WHEN t2.meta_key = 'first_name' THEN meta_value END) AS first_name, | |
| MAX(CASE WHEN t2.meta_key = 'last_name' THEN meta_value END) AS last_name, | |
| MAX(CASE WHEN t2.meta_key = 'paying_customer' THEN meta_value END) AS paying_customer, | |
| MAX(CASE WHEN t2.meta_key = 'billing_title' THEN meta_value END) AS billing_title | |
| FROM th_users AS t1 | |
| INNER JOIN th_usermeta AS t2 ON t1.ID = t2.user_id | |
| GROUP BY t1.ID, t1.user_email |
| # 301 Redirects for .htaccess | |
| # =========================== | |
| # Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| # Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| # Redirect an entire site to a subfolder |
| &where=`{ "template:IN" : [ 1,2,3 ] } | |
| &where=`{ "template:NOT IN" : [ 1,2,3 ] } | |
| &where=`[{"alias:LIKE":"foo%", "OR:alias:LIKE":"%bar"},{"OR:pagetitle:=":"foobar", "AND:description:=":"raboof"}]` |
| <?php | |
| /*[[newGetTvList? &tvname=`articlestags`]] | |
| * Аналогично: | |
| *@EVAL return $modx->runSnippet('GetTvList',array('tvname'=>'articlestags')); | |
| * | |
| * | |
| *Убирает все пробелы, заменяет ','=>'||' | |
| *Сниппет получает все значения ТВ по tv.name и формирует в список возможных значений | |
| *для tv Множественный выбор, Одиночный выбор. | |
| */ |
| <?php | |
| $chunks = $modx->getCollection('modChunk'); | |
| $snippets = $modx->getCollection('modSnippet'); | |
| foreach ($chunks as $chunk) { | |
| $content = $chunk->getContent(); | |
| $category = "SELECT category FROM `modx_categories` WHERE id = " . $chunk->get('category') . ""; |
| var SimplxStudio = {}; | |
| SimplxStudio.modx = {}; | |
| /* Creating JSON representation for modAccess */ | |
| SimplxStudio.modx.modAccess={ | |
| "class": "modAccess", | |
| "extends":"xPDOSimpleObject", | |
| "fields": [ | |
| "id","alias","target","principal_class","principal","authority","policy" |
| <?php | |
| // [[!WebHook? &secret=`dh730>soteW` &runsnippet=`updateSettings` ¶ms=`setting=savings`]] | |
| $mySecret = $modx->getOption('secret', $scriptProperties); | |
| $mySnippet = $modx->getOption('runsnippet', $scriptProperties); | |
| $myParams = $modx->getOption('params', $scriptProperties); | |
| $achunks = array_chunk(preg_split('/(=|,)/', $myParams), 2); | |
| $myParams = array_combine(array_column($achunks, 0), array_column($achunks, 1)); | |
| $webhookContent = ""; |
Using canvas for image masking.
Image courtesy of Laura Aziz | Unsplash https://unsplash.com/photos/Zx5UKS3zC60
A Pen by Paul Mealy on CodePen.
| 01-autoResizeOnUpload.php - Plugin to automatically resize images uploaded via MODX that are larger than the dimensions specified | |
| in the config within the plugin code. This should be considered experimental but has been tested | |
| successfully on MODX Revolution 2.3.2-pl (traditional) running on Windows Server 2008. | |
| 02-set-expires-headers.php - Sets expires headers to value defined in plugin |