1
This commit is contained in:
@@ -439,7 +439,7 @@ class Base extends Controller
|
||||
if($refer_start&&$v!=""){
|
||||
if (strlen($v) > 500) {
|
||||
$refer_start = false;
|
||||
$cc_t = $this->replaceChinesePunctuation($this->removeExtraSpaces(trim($v)));
|
||||
$cc_t = $this->formatMain($v);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['type'] = 0;
|
||||
$insert['content'] = $cc_t;
|
||||
@@ -455,7 +455,7 @@ class Base extends Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
$c_t = $this->replaceChinesePunctuation($this->removeExtraSpaces(trim($v)));
|
||||
$c_t = $this->formatMain($v);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['type'] = 0;
|
||||
$insert['content'] = $c_t;
|
||||
@@ -574,6 +574,11 @@ class Base extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function formatMain($string){
|
||||
return $this->blueIntegerChange($this->replaceChinesePunctuation($this->removeExtraSpaces($string)));
|
||||
}
|
||||
|
||||
|
||||
public function replaceChinesePunctuation($str) {
|
||||
// 定义中文标点和对应的英文标点替换
|
||||
$replacements = [
|
||||
@@ -598,6 +603,13 @@ class Base extends Controller
|
||||
return str_replace(array_keys($replacements), array_values($replacements), $str);
|
||||
}
|
||||
|
||||
|
||||
public function blueIntegerChange($string){
|
||||
return preg_replace_callback('/\[(\d+)\]/', function($matches) {
|
||||
return '<blue>[' . $matches[1] . ']</blue>';
|
||||
}, $string);
|
||||
}
|
||||
|
||||
public function getBoardsForJournal($journal_id, $aar = false)
|
||||
{
|
||||
$ca_board = [];
|
||||
|
||||
Reference in New Issue
Block a user