Project

General

Profile

« Previous | Next » 

Revision 989

Added by aldus almost 15 years ago

Add Droplets Modul to the project and the modificated files (index, seach and frontendfunctions)

View differences:

search_modext.php
89 89
	$match_array = array();
90 90
	$excerpt_array = array();
91 91
	$word = '('.implode('|', $search_words).')';
92

  
93
	//Filter droplets from the page data
94
	preg_match_all('~\[\[(.*?)\]\]~', $text, $matches);
95
	foreach ($matches[1] as $match) {
96
		$text = str_replace('[['.$match.']]', '', $text);					
97
	}
98

  
92 99
	// Build the regex-string
93 100
	if(strpos(strtoupper(PHP_OS), 'WIN')===0) { // windows -> see below
94 101
		$str1=".!?;";
......
123 130
	} else { // compatible, but may be very slow with large pages
124 131
		if(preg_match_all($regex, $text, $match_array)) {
125 132
			foreach($match_array[1] AS $string) {
126
				if(!preg_match('/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\./', $string)) // skip excerpts with email-addresses
133
				if(!preg_match('/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\./', $string))  // skip excerpts with email-addresses
127 134
					$excerpt_array[] = trim($string);
135
				
128 136
			}
129 137
		}
130 138
	}

Also available in: Unified diff