
03-30-2012, 08:36 AM
|
|
|
Join Date: Dec 2010
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by ballpnet
PHP Code:
<![CDATA[$array1 = explode("|", $vbulletin->options['ah_word_replace_find']);
$array2 = explode("|", $vbulletin->options['ah_word_replace_replace']);
$ah_text = $this->post['message'];
$breadcrumb = array();
if(count($array1) > 0) {
for($j=0; $j<count($array1); $j++) { $breadcrumb[] = '/'.$array1[$j].'/i'; }
$ah_text = preg_replace($breadcrumb, $array2, $ah_text);
$separators = array('. ', '? ', '! '); for($i=0; $i<count($separators); $i++) {
$var = $separators[$i]; $sentences = explode($var, $ah_text); $tmp_sentence = ''; $k = 0; foreach($sentences as $single_sentence) { $tmp_sentence .= ucfirst($single_sentence);
if ($k<count($sentences)-1) { $tmp_sentence .= $var; } $k++; } $ah_text = $tmp_sentence; } }
$this->post['message'] = $ah_text;]]>
|
Thank you so much. It works in vbb 4.
|