Skip to content
This repository was archived by the owner on Mar 8, 2021. It is now read-only.
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ function _getExtract($text, $searchString, $advSearch, $highlightClass, &$nbExtr
$wordLength = $mbStrlen($searchTerm);
$wordLength2 = $wordLength / 2;
// $pattern = '/' . preg_quote($searchTerm, '/') . $lookAhead . '/' . $pcreModifier;
if ($advSearch == EXACTPHRASE) $pattern = '/\b' . preg_quote($searchTerm, '/') . '\b/' . $pcreModifier;
if ($advSearch == EXACTPHRASE) $pattern = '/(\b|\W)' . preg_quote($searchTerm, '/') . '(\b|\W)/' . $pcreModifier;
else $pattern = '/' . preg_quote($searchTerm, '/') . '/' . $pcreModifier;
$matches = array();
$nbr = preg_match_all($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
Expand Down Expand Up @@ -592,7 +592,7 @@ function _getExtract($text, $searchString, $advSearch, $highlightClass, &$nbExtr
if ($this->asCfg->cfg['highlightResult']) {
$rank = $extracts[$i]['rank'];
$searchTerm = $searchList[$rank - 1];
if ($advSearch == EXACTPHRASE) $pattern = '/\b' . preg_quote($searchTerm, '/') . '\b/' . $pcreModifier;
if ($advSearch == EXACTPHRASE) $pattern = '/(\b|\W)' . preg_quote($searchTerm, '/') . '(\b|\W)/' . $pcreModifier;
else $pattern = '/' . preg_quote($searchTerm, '/') . '/' . $pcreModifier;
$subject = '<span class="' . $highlightClass . ' ' . $highlightClass . $rank . '">\0</span>';
$extract = preg_replace($pattern, $subject, $extract);
Expand Down Expand Up @@ -881,7 +881,7 @@ function _doFilterTags($results, $searchString, $advSearch) {
$searchList = $this->asCtrl->getSearchWords($searchString, $advSearch);
$pcreModifier = $this->asCfg->pcreModifier;
foreach ($searchList as $searchTerm) {
if ($advSearch == EXACTPHRASE) $pattern = '/\b' . preg_quote($searchTerm, '/') . '\b/' . $pcreModifier;
if ($advSearch == EXACTPHRASE) $pattern = '/(\b|\W)' . preg_quote($searchTerm, '/') . '(\b|\W)/' . $pcreModifier;
else $pattern = '/' . preg_quote($searchTerm, '/') . '/' . $pcreModifier;
$matches = array();
$found = preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
Expand Down
14 changes: 11 additions & 3 deletions assets/snippets/ditto/classes/filter.class.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,20 @@ function basicFilter ($value) {
if (trim($ii) == trim($iii))
$check++;
}

}
}
}
$unset = $check>0 ? 1 : 0;
unset($val,$check);
break;
break;
// Cases 21-22 created by Sergey Davydov <webmaster@collection.com.ua> 08.11.2011
case 21 : // array version of #1 - exlude records that do not in miltiple values such a "65||115" and have output delimeted list by comma
if (!isset ($value[$this->array_key]) || !in_array($this->filterValue,explode(',',$value[$this->array_key])))
$unset = 0;
break;
case 22 : // array version of #2 - exlude records that in miltiple values such a "65||115" and have output delimeted list by comma
if (in_array($this->filterValue,explode(',',$value[$this->array_key])))
$unset = 0;
break;
}
return $unset;
}
Expand Down
14 changes: 8 additions & 6 deletions assets/snippets/phpthumb/snippet.phpthumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

$cacheFolder=isset($cacheFolder) ? $cacheFolder : "assets/cache/images";
$tmpFolder = 'assets/cache/tmp';
if (!empty($input)) $input = rawurldecode($input);

if(empty($input) || !file_exists(MODX_BASE_PATH . $input)){
$input = isset($noImage) ? $noImage : 'assets/snippets/phpthumb/noimage.png';
Expand All @@ -15,25 +16,26 @@
file_put_contents(MODX_BASE_PATH . $cacheFolder . '/.htaccess', "order deny,allow\nallow from all\n");
}

$options = 'f=jpg&q=96&'.strtr($options, Array("," => "&", "_" => "=", '{' => '[', '}' => ']'));
parse_str($options, $params);

if(!is_dir(MODX_BASE_PATH.$tmpFolder)) mkdir(MODX_BASE_PATH.$tmpFolder);

$path_parts=pathinfo($input);
$tmpImagesFolder=str_replace(MODX_BASE_PATH . "assets/images","",$path_parts['dirname']);
$tmpImagesFolder=str_replace("assets/images","",$tmpImagesFolder);
$tmpImagesFolder=explode("/",$tmpImagesFolder);

$ext=strtolower($path_parts['extension']);
$options = 'f='.(in_array($ext,explode(",","png,gif"))?$ext:"jpg&q=96").'&'.strtr($options, Array("," => "&", "_" => "=", '{' => '[', '}' => ']'));
parse_str($options, $params);
foreach ($tmpImagesFolder as $folder) {
if (!empty($folder)) {
$cacheFolder.="/".$folder;
if(!is_dir(MODX_BASE_PATH.$cacheFolder)) mkdir(MODX_BASE_PATH.$cacheFolder);
}
}

$fname=$cacheFolder."/".$params['w']."x".$params['h'].'-'.$path_parts['filename'].".".substr(md5(serialize($params)),0,3).".".$params['f'];
$outputFilename =MODX_BASE_PATH.$fname;
$fname_preffix=$cacheFolder."/".$params['w']."x".$params['h'].'-';
$fname = $path_parts['filename'].".".substr(md5(serialize($params)),0,3).".".$params['f'];
$outputFilename =MODX_BASE_PATH.$fname_preffix.$fname;
if (!file_exists($outputFilename)) {
require_once MODX_BASE_PATH.'assets/snippets/phpthumb/phpthumb.class.php';
$phpThumb = new phpthumb();
Expand All @@ -48,5 +50,5 @@
$modx->logEvent(0, 3, implode('<br/>', $phpThumb->debugmessages), 'phpthumb');
}
}
return $fname;
return $fname_preffix.rawurlencode($fname);
?>
2 changes: 1 addition & 1 deletion install/action.options.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
for ($i = 0; $i < $limit; $i++) {
$class = !in_array('sample', $moduleTVs[$i][12]) ? "toggle" : "toggle demo";
$chk = in_array($i, $tvs) || (!$options_selected) ? 'checked="checked"' : "";
$tvOutput .= "<input type=\"checkbox\" name=\"tv[]\" value=\"$i\" class=\"{$class}\" $chk />" . $_lang['install_update'] . " <span class=\"comname\">" . $moduleTVs[$i][0] . "</span> - " . $moduleTVs[$i][2] . "<hr />\n";
$tvOutput .= "<input type=\"checkbox\" name=\"tv[]\" value=\"$i\" class=\"{$class}\" $chk />" . $_lang['install_update'] . " <span class=\"comname\">" . $moduleTVs[$i][0] . "</span> - {$moduleTVs[$i][1]} <span class=\"description\">({$moduleTVs[$i][2]})</span><hr />\n";
}
if($tvOutput != '') {
echo "<h3>" . $_lang['tvs'] . "</h3><br />\n";
Expand Down
6 changes: 6 additions & 0 deletions install/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,12 @@ font-size:1.3em;
#rtl #installChoices input {
margin: 0 0 10px 10px;
}
#installChoices .comname {
font-weight: bold;
}
#installChoices .description {
font-size: 0.9em;
}

p.labelHolder {
clear: left;
Expand Down