public function LoadTagsByNameString($s)
{
$s = trim($s);
$s = str_replace(';', ',', $s);
$s = str_replace(',', ',', $s);
$s = str_replace('、', ',', $s);
$s = trim($s);
$s = strip_tags($s);
if ($s == '') {
return array();
}
if ($s == ',') {
return array();
}
$a = explode(',', $s);
$t = array_unique($a);
if (count($t) == 0) {
return array();
}
$a = array();
$b = array();
foreach ($t as $v) {
if (isset($this->tagsbyname[$v]) == false) {
$a[] = array('tag_Name', $v);
} else {
$b[$v] =& $this->tagsbyname[$v];
}
}
if (count($a) == 0) {
return $b;
} else {
$t = array();
$array = $this->GetTagList('', array(array('array', $a)), '', '', '');
foreach ($array as $v) {
$this->tags[$v->ID] = $v;
$this->tagsbyname[$v->Name] =& $this->tags[$v->ID];
$t[$v->Name] =& $this->tags[$v->ID];
}
return $b + $t;
}
}