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 | |
// [[pingX? &url=`www.google.com` &offline=`site down`]] | |
$url = $modx->getOption('url', $scriptProperties, ''); | |
$offline = $modx->getOption('offline', $scriptProperties, ''); | |
$timeout = $modx->getOption('timeout', $scriptProperties, '30'); | |
$port = $modx->getOption('port', $scriptProperties, '80'); | |
if (!$socket = @fsockopen($url, $port, $errno, $errstr, $timeout)) { | |
// Offline | |
$result = $offline; |
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 name="dob-day" id="dob-day"> | |
<option value="">Day</option> | |
<option value="">---</option> | |
<option value="01" [[!+fi.dob-day:FormItIsSelected=`01`]]>01</option> | |
<option value="02" [[!+fi.dob-day:FormItIsSelected=`02`]]>02</option> | |
<option value="03" [[!+fi.dob-day:FormItIsSelected=`03`]]>03</option> | |
<option value="04" [[!+fi.dob-day:FormItIsSelected=`04`]]>04</option> | |
<option value="05" [[!+fi.dob-day:FormItIsSelected=`05`]]>05</option> | |
<option value="06" [[!+fi.dob-day:FormItIsSelected=`06`]]>06</option> | |
<option value="07" [[!+fi.dob-day:FormItIsSelected=`07`]]>07</option> |
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 | |
// [[!FormItNumberRanges? &numberStart=`50000` &numberStop=`200000` &numberStep=`10000` &numberSeparator=` – ` &fieldName=`loanAmount` &fieldValue=`low` ]] | |
$numberStart = $modx->getOption('numberStart',$scriptProperties,'50000'); | |
$numberStop = $modx->getOption('numberStop',$scriptProperties,'200000'); | |
$numberStep = $modx->getOption('numberStep',$scriptProperties,'10000'); | |
$numberSeparator = $modx->getOption('numberSeparator',$scriptProperties,' – '); | |
$numberFormat = $modx->getOption('numberFormat',$scriptProperties,'USD'); | |
$fieldName = $modx->getOption('fieldName',$scriptProperties,''); | |
$fieldValue = $modx->getOption('fieldValue',$scriptProperties,'low'); |
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 | |
$parameters = explode(',',$options); | |
$test = $parameters[0]; | |
$success = $parameters[1]; | |
$output = " "; // needed a space to make this work | |
if (stristr($input, $test) !== false) { | |
$output = $success; | |
} | |
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 | |
return substr($input, 0, strpos($input, $options)); |
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 | |
// [[!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 = ""; |
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 | |
$content = $modx->getOption('content', $scriptProperties, 'eof'); | |
$filename = $modx->getOption('filename', $scriptProperties, 'text.txt'); | |
$filedir = $modx->getOption('filedir', $scriptProperties, 'assets'); | |
$append = $modx->getOption('append', $scriptProperties, false); | |
$fopen = "w"; | |
if ($append > 0){ | |
$fopen = "a"; | |
}; |
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 | |
$setting = $modx->getOption('setting', $scriptProperties); | |
$value = $modx->getOption('value', $scriptProperties); | |
$systemSetting = $modx->getObject('modSystemSetting', $setting); | |
$systemSetting->set('value',$value); | |
$systemSetting->save(); | |
$modx->reloadConfig(); | |
return true; |
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 | |
$fileIn = $hook->formit->config['fileIn']; | |
$fileOut = $hook->formit->config['fileOut']; | |
$fileInPath = $modx->config['base_path'].$fileIn; | |
$fileOutPath = $modx->config['base_path'].$fileOut; | |
$formData = $hook->getValues(); | |
// FDF header section |
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 | |
$years = floor($input/12); | |
$months = $input%12; | |
$yearsDisplay = $years.($years > 1 ? ' years' : ' year'); | |
if($years == 0) { | |
$yearsDisplay = ''; | |
} | |
$monthsDisplay = $months.($months > 1 ? ' months' : ' month'); | |
if($months == 0) { |