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 | |
| $base_path = dirname(__FILE__) . '/content/'; | |
| if($_GET['q']) { | |
| $q = explode('?', $_GET['q']); | |
| $file_check = $base_path.preg_replace('"\.html$"', '.php', $q[0]); | |
| if (substr($file_check, -1) == "/") { | |
| $file_check .= "index.php"; | |
| } |
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
| const showrandom = document.querySelectorAll("[showrandom]"); | |
| showrandom.forEach(el=>{ | |
| const count = el.getAttribute('showrandom') ? el.getAttribute('showrandom') : 1; | |
| const children = el.children; | |
| while(children.length > count){ | |
| const random = Math.floor(Math.random() * children.length); | |
| children[random].remove(); | |
| } | |
| }); |
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 | |
| if(empty($input)) return; | |
| $url = rtrim($modx->getOption('site_url'), '/').'/'.ltrim($input,'/'); | |
| echo "<meta name=\"image\" property=\"og:image\" content=\"$url\" />"; | |
| $path = rtrim($modx->getOption('base_path'), '/').'/'.ltrim($input,'/'); | |
| $size = @getimagesize($path); | |
| if ($size) { | |
| $width = $size[0]; |
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 | |
| switch ($modx->event->name) { | |
| case "OnFileManagerUpload": | |
| if(!empty($files)){ | |
| foreach($files as $file){ | |
| $path = $directory . $source->sanitizePath($file['name']); | |
| $object = $source->getObjectContents($path); | |
| if(empty($object) || empty($object['mime']) || empty($object['content'])) continue; | |
| switch($object['mime']) { | |
| case 'image/svg': |
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 | |
| /** elFinder Plugin Options **/ | |
| switch ($modx->event->name) { | |
| case 'FredOnElfinderRoots': | |
| $params = $modx->getOption('params', $scriptProperties); | |
| if (empty($params)) return false; | |
| // Enable Sanitizer | |
| $params->bind['upload.pre mkdir.pre mkfile.pre rename.pre archive.pre ls.pre'][] = 'Plugin.Sanitizer.cmdPreprocess'; | |
| $params->bind['paste.copyfrom upload.presave'][] = 'Plugin.Sanitizer.onUpLoadPreSave'; | |
| $params->plugin['Sanitizer'] = [ |
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
| location ~* \.(?:ico|css|js|jpe?g|png|gif|svg|pdf|mov|mp4|mp3|woff|woff2|otf|ttf)$ { | |
| expires 7d; | |
| add_header Pragma public; | |
| add_header Cache-Control "public"; | |
| gzip_vary on; | |
| rewrite ^/(it|de|es|fr|cz)(/.*)$ $2 last; | |
| } |
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 | |
| $regex = <<<'END' | |
| / | |
| ( | |
| (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx | |
| | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | |
| | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 | |
| | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 | |
| ){1,100} # ...one or more times |
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 | |
| /** | |
| * FixedPreLite plugin | |
| * | |
| * * | |
| * Updated by matdave <https://matdave.com> | |
| * * | |
| * Original author Bob Ray <http://bobsguides.com> | |
| * Copyright 2011-2014 Bob Ray | |
| * 3/23/11 |
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
| SELECT id, type, pagetitle, longtitle, description, alias, alias_visible, link_attributes, published, pub_date, unpub_date, parent, isfolder, introtext, content, richtext, template, menuindex, searchable, cacheable, createdby, createdon, editedby, editedon, deleted, deletedon, deletedby, publishedon, publishedby, menutitle, donthit, privateweb, privatemgr, content_dispo, hidemenu, 'MODX\\Revolution\\modDocument' AS class_key, 'web' AS context_key, 1 AS content_type, null AS uri, 0 AS uri_override, 0 AS hide_children_in_tree, 1 AS show_in_tree, null AS properties FROM `modx_site_content` |
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 | |
| /** | |
| * Plugin to add a read only "url" field to the document tab | |
| * | |
| * @var modX $modx | |
| * @var array $scriptProperties | |
| * | |
| * @event OnDocFormPrerender | |
| */ | |
| if(!$resource || !$mode || $modx == "new") return; |