本文整理汇总了PHP中thesaurus::get_comment方法的典型用法代码示例。如果您正苦于以下问题:PHP thesaurus::get_comment方法的具体用法?PHP thesaurus::get_comment怎么用?PHP thesaurus::get_comment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thesaurus
的用法示例。
在下文中一共展示了thesaurus::get_comment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: record
function record($id, $termType)
{
$uses = "";
$term = thesaurus::get_name($id);
$uses = extract_pattern($term, "/\\(BS[: ](?<use>.*)\\)/");
$recordArray = array();
$record = new simpleXmlElement("<record />");
// check if term already exists
// define array for record creation
$recordArray['input.name'] = "Thesaurus Redaktion";
$recordArray['input.date'] = date("Y-m-d", time());
$recordArray['input.time'] = date("h:i:s", time());
$recordArray['term.type'] = $termType;
$recordArray['term.status'] = thesaurus::get_status_name(thesaurus::get_status($id));
$recordArray['term'] = $term;
$recordArray['notes'] = thesaurus::get_comment($id);
$recordArray['broader_term'] = thesaurus::get_parent($id);
// $recordArray['narrower_term'] = thesaurus::get_child($id);
$recordArray['related_term'] = thesaurus::get_assoc($id);
$recordArray['used_for'] = $uses;
xml_insert($record->record, create_record($recordArray, $termType));
return $record;
}
示例2: print_tree
function print_tree($descId, $type = "", $depth = "")
{
switch ($type) {
case txt:
$delimitor = "*";
break;
case csv:
$delimitor = ";";
break;
case adlib:
$adlibString = adlib($descId, $type);
return $adlibString;
break;
}
// display id entry
$comment = thesaurus::get_comment($descId);
// remove \r\n
$comment = str_replace("\n", '', $comment);
$comment = str_replace("\r", '', $comment);
$paramArray = explode(";", $comment);
$idArray = explode("=", $paramArray[0]);
$rootArray = explode("=", $paramArray[1]);
$commentArray = explode("=", $paramArray[2]);
$levelCnt = 7;
// insert title
if (!$depth) {
$treeString .= $idArray[0] . $delimitor;
for ($i = 0; $i < $levelCnt; $i++) {
$treeString .= "Level {$i}" . $delimitor;
}
$treeString .= $delimitor . $rootArray[0] . $delimitor . $commentArray[0] . "\r\n";
}
// insert id at beginning
$treeString .= $idArray[1] . $delimitor;
// insert blank tree elements on beginn
$i = 0;
while ($i++ < $depth - 1) {
$treeString .= $delimitor;
}
if ($type == "txt") {
$treeString .= " ";
}
// whitespace in textfile
// display entry
$treeString .= thesaurus::get_name($descId);
// insert blank tree elements at end
while ($i++ < $levelCnt) {
$treeString .= $delimitor;
}
if ($type == "txt") {
$treeString .= " ";
}
// whitespace in textfile
// insert root entry
$treeString .= $delimitor . "{$rootArray['1']}";
// insert comment entry
$treeString .= $delimitor . "{$commentArray['1']}";
// insert crlf
$treeString .= "\r\n";
$childArray = thesaurus::get_child($descId);
// loop all childs recursive
if (is_array($childArray)) {
foreach ($childArray as $entry) {
$treeString .= export::print_tree($entry, $type, $depth + 1);
}
}
return $treeString;
}