© Сделано на LiveStreet
Дизайн - ©2009 MODx RED Group
@EVAL return $modx->evalSnippets("[[SqlFilter?&Docfield=`id`&filterTV =`filter_1_parameter,$_GET['pagetitle']|filter_2_sostav,$_GET['pagetitle']`&mode=`OR`]]");,','=>'','?'=>'','!'=>'','"'=>'','@'=>'','%'=>'','$'=>'',
'#'=>'',';'=>'',':'=>'','&'=>'','='=>'','('=>'',')'=>'','+'=>'','/'=>'','}'=>'','{'=>'',']'=>'',
'['=>'','*'=>'','`'=>'','~'=>'','№'=>''case 9 : // case insenstive version of #7 - exclude records that do not contain the text of the criterion
mb_internal_encoding("UTF-8");
if (strpos(mb_strtolower($value[$this->array_key]), mb_strtolower($this->filterValue))===FALSE)
$unset = 0;
break;mb_internal_encoding("UTF-8"); и заменить strtolower на mb_strtolower
<?php
$mode = isset($mode) ? $mode : 'show';
$outerTpl = isset($outerTpl) ? $outerTpl : '@CODE: <h1>Вы уже смотрели:</h1><ul class="[+outer-class+]">[+rows+]</ul>';
$outerClass = isset($outerClass) ? $outerClass : 'last-view';
$rowTpl = isset($rowTpl) ? $rowTpl : '@CODE: <li><a href="[+url+]">[+name+]</a></li>';
$maxRows = isset($maxRows) ? $maxRows : 10;
if(!function_exists('fetchTpl')) {
function fetchTpl($tpl){
global $modx;
$template = "";
if(substr($tpl, 0, 6) == "@FILE:") {
$tpl_file = MODX_BASE_PATH . substr($tpl, 6);
$template = file_get_contents($tpl_file);
} else if (substr($tpl, 0, 6) == "@CODE:") {
$template = substr($tpl, 6);
} else if($modx->getChunk($tpl) != "") {
$template = $modx->getChunk($tpl);
} else {
$template = false;
}
return $template;
}
}
if(!function_exists('parseTplChunk')) {
function parseTplChunk($tpl,$placeholder=array()){
$chunk = fetchTpl($tpl);
foreach ($placeholder as $key => $value){
$chunk = str_replace("[+".$key."+]", $value, $chunk);
}
return $chunk;
}
}
$item = array();
if (isset($_COOKIE['last_view']) and $_COOKIE['last_view'] != '') {
$item = explode(',', $_COOKIE['last_view']);
}
switch ($mode) {
case 'register':
if (!in_array($modx->documentIdentifier, $item)) {
if (count($item) >= $maxRows) {
array_shift($item);
array_unshift($item, $modx->documentIdentifier);
} else {
array_unshift($item, $modx->documentIdentifier);
}
setcookie('last_view', implode(',', $item), time()+60*60*24*30, '/');
}
break;
case 'show':
if (!empty($item)) {
$docs = $modx->getDocuments($item);
$output = '';
foreach ($docs as $doc) {
$rows .= parseTplChunk($rowTpl, array('url'=>$modx->makeUrl($doc['id']), 'name'=>$doc['pagetitle']));
}
return parseTplChunk($outerTpl, array('rows'=>$rows, 'outer-class'=>$outerClass));
}
break;
}
?>$rows .= parseTplChunk($rowTpl, array('url'=>$modx->makeUrl($doc['id']), 'name'=>$doc['pagetitle'], 'image'=>$modx->getTemplateVar('img_product_home')));Array