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 | |
// [[!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
<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 | |
// [[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
<?php | |
$timestamp = date('m/d/Y h:i:s'); | |
$ip = $_SERVER['HTTP_CLIENT_IP']?:($_SERVER['HTTP_X_FORWARDED_FOR']?:$_SERVER['REMOTE_ADDR']); | |
| |
// post to webhook url | |
$url = $scriptProperties['webhook']; | |
if (isset($url)) { | |
$postvars = 'timestamp=' . $timestamp . '&ip=' . $ip . '&search=' . $search; | |
$ch = curl_init($url); | |
curl_setopt( $ch, CURLOPT_POST, 1); |
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 | |
//[[!FormItYearOptions? &name=`rentexpireYear` &futureYears=`3` &pastYears=`1` &selectedOffset=`1`]] | |
$name = $modx->getOption('name',$scriptProperties,'year'); | |
$futureYears = $modx->getOption('futureYears',$scriptProperties,'5'); | |
$pastYears = $modx->getOption('pastYears',$scriptProperties,'1'); | |
$selectedOffset = $modx->getOption('selectedOffset',$scriptProperties,'1'); | |
$reverse = $modx->getOption('reverse',$scriptProperties,''); | |
$thisYear = date('Y'); |
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 | |
$linkArray = explode(',', $input); | |
foreach ($linkArray as $key => $resource ) { | |
$page = $modx->getObject('modResource', $resource); | |
$published = $page->get('published'); | |
if ($published){ | |
$publishedArray[] = $resource; | |
} | |
} | |
$publishedList = implode(",", $publishedArray); |
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 | |
$eventName = $modx->event->name; | |
switch($eventName) { | |
case 'OnDocFormRender': | |
if ($mode == modSystemEvent::MODE_NEW) { | |
$resource->setProperty('_isContentBlocks', false, 'contentblocks'); | |
} | |
break; | |
} |
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 | |
$number = floatval($input); | |
$optionsXpld = @explode('&', $options); | |
$optionsArray = array(); | |
foreach ($optionsXpld as $xpld) { | |
$params = @explode('=', $xpld); | |
array_walk($params, create_function('&$v', '$v = trim($v);')); | |
if (isset($params[1])) { | |
$optionsArray[$params[0]] = $params[1]; | |
} else { |
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 | |
$optionsXpld = @explode('&', $options); | |
$optionsArray = array(); | |
foreach ($optionsXpld as $xpld) { | |
$params = @explode('=', $xpld); | |
array_walk($params, create_function('&$v', '$v = trim($v);')); | |
if (isset($params[1])) { | |
$optionsArray[$params[0]] = $params[1]; | |
} else { | |
$optionsArray[$params[0]] = ''; |