This file contains 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 | |
$adminId = 1; | |
$polisyID = 4; | |
$authorityLevel = 9999; | |
$extendedField = 'redirect'; | |
//resorce setings | |
$template = 1; | |
$parent = 2; | |
$published = 1; |
This file contains 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 | |
$parent = 156; //parent to put the new pages under | |
$published = 1; //published? 0 or 1 | |
$hidemenu = 0; //hidemenu? 0 or 1 | |
$template = 11; // template that you like to use for page | |
$newsdateId = 7; //newsdate tv id | |
$rssfeed = 'http://www.BLABLABLA.co.uk/index.php?id=68'; //put your feed here | |
$doc = new DOMDocument(); | |
$doc->load($rssfeed); |
This file contains 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 | |
$c = $modx->newQuery('modResource'); | |
$c->innerJoin('modTemplateVarResource','TemplateVarResources'); | |
$c->innerJoin('modTemplateVar','TemplateVar','TemplateVarResources.tmplvarid = TemplateVar.id'); | |
$c->where(array( | |
'TemplateVar.name' => 'access_front', | |
'TemplateVarResources.value' => true, | |
)); | |
$ress = $modx->getCollection('modResource',$c); |
This file contains 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 ($debug) { | |
$modx->setLogLevel(modx::LOG_LEVEL_DEBUG); | |
$mtime = microtime(); | |
$mtime = explode(" ", $mtime); | |
$mtime = $mtime[1] + $mtime[0]; | |
$tstart = $mtime; | |
} |
This file contains 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 | |
$debug = $modx->getOption('debug', $scriptProperties, false); | |
if ($debug) { | |
$modx->setLogLevel(modX::LOG_LEVEL_DEBUG); | |
} | |
//new user object | |
$user = $modx->newObject('modUser'); | |
//get all form fields | |
$formFields = $hook->getValues(); |
This file contains 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 | |
//http://modxcms.com/forums/index.php?topic=58644.msg354702#msg354702 | |
$query->where(array( | |
array( | |
'id:IN' => $children_of_this_folder, | |
'published' => true, | |
'deleted' => false, | |
'hidemenu' => false, | |
'isfolder' => false, |
This file contains 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? | |
//phpthumbof 1.1.0 | |
//Multiple fltr not working. Works only the last filter | |
//[[*photo:phpthumbof=`&fltr=gray&fltr=flip|y&w=100&h=100&zc=1`]] | |
//I changed snippet code from this | |
if (!empty($opt[0])) { | |
$ptOptions[$opt[0]] = $opt[1]; | |
} |
This file contains 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 | |
$parent = isset($parent) ? $parent : 0;//родительская папка | |
$published = isset($published) ? $published : 0;//публиковать? | |
$hidemenu = isset($hidemenu) ? $hidemenu : 0;//показывать в меню? | |
$template = isset($template) ? $template : 0;//ид нужного шаблона | |
//настройки транслитерации | |
if (!isset ($plugin_dir) ) { $plugin_dir = 'transalias'; } | |
if (!isset ($plugin_path) ) { $plugin_path = $modx->config['base_path'].'assets/plugins/'.$plugin_dir; } | |
if (!isset ($table_name)) { $table_name = 'russian'; } |
This file contains 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
function factorial(n) { | |
function recur(n, result) { | |
if (n == 0) { | |
throw result; | |
} else { | |
recur(n-1, result*n); | |
} | |
} | |
try { | |
recur(n, n); |
OlderNewer