1119 lines
33 KiB
PHP
1119 lines
33 KiB
PHP
<?php
|
|
|
|
require_once __DIR__.'/common.inc.php';
|
|
|
|
$prefix = $xoopsDB->prefix();
|
|
|
|
// Recent Contents
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`ib`.`item_id`, `ib`.`doi`, `ib`.`last_update_date`,
|
|
GROUP_CONCAT(DISTINCT `it`.`title` ORDER BY `it`.`title_id` ASC SEPARATOR '\n') AS `title`
|
|
FROM `${prefix}_xoonips_ranking_new_item` AS `ri`
|
|
INNER JOIN `${prefix}_xoonips_item_basic` AS `ib` ON `ri`.`item_id`=`ib`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_index_item_link` AS `iil` ON `ib`.`item_id`=`iil`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_item_title` AS `it` ON `ib`.`item_id`=`it`.`item_id`
|
|
WHERE `iil`.`certify_state`=2
|
|
GROUP BY `ib`.`item_id`
|
|
ORDER BY `ib`.`last_update_date` DESC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$ranking = [];
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('item_id', 'last_update_date'));
|
|
$ranking[] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/recent-contents.json', json_encode($ranking, JSON_UNESCAPED_UNICODE));
|
|
unset($ranking);
|
|
|
|
// Rankings
|
|
$ranking = [];
|
|
// - most accessed items
|
|
$ranking['accessed'] = [];
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`ib`.`item_id`, `ib`.`doi`,
|
|
GROUP_CONCAT(DISTINCT `it`.`title` ORDER BY `it`.`title_id` ASC SEPARATOR '\n') AS `title`,
|
|
`vi`.`count`
|
|
FROM `${prefix}_xoonips_ranking_viewed_item` AS `vi`
|
|
INNER JOIN `${prefix}_xoonips_item_basic` AS `ib` ON `vi`.`item_id`=`ib`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_item_title` AS `it` ON `ib`.`item_id`=`it`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_index_item_link` AS `iil` ON `ib`.`item_id`=`iil`.`item_id`
|
|
WHERE `iil`.`certify_state`=2
|
|
GROUP BY `ib`.`item_id`
|
|
ORDER BY `vi`.`count` DESC
|
|
LIMIT 10
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('item_id', 'count'));
|
|
$ranking['accessed'][] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
// - most accessed items
|
|
$ranking['downloaded'] = [];
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`ib`.`item_id`, `ib`.`doi`,
|
|
GROUP_CONCAT(DISTINCT `it`.`title` ORDER BY `it`.`title_id` ASC SEPARATOR '\n') AS `title`,
|
|
`di`.`count`
|
|
FROM `${prefix}_xoonips_ranking_downloaded_item` AS `di`
|
|
INNER JOIN `${prefix}_xoonips_item_basic` AS `ib` ON `di`.`item_id`=`ib`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_item_title` AS `it` ON `ib`.`item_id`=`it`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_index_item_link` AS `iil` ON `ib`.`item_id`=`iil`.`item_id`
|
|
WHERE `iil`.`certify_state`=2
|
|
GROUP BY `ib`.`item_id`
|
|
ORDER BY `di`.`count` DESC
|
|
LIMIT 10
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('item_id', 'count'));
|
|
$ranking['downloaded'][] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
// - most contributed users
|
|
$ranking['contributed'] = [];
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`u`.`uid`, `u`.`uname`, `u`.`name`, COUNT(`cu`.`item_id`) AS `count`
|
|
FROM `${prefix}_xoonips_ranking_contributing_user` AS `cu`
|
|
INNER JOIN `${prefix}_users` AS `u` ON `cu`.`uid`=`u`.`uid`
|
|
GROUP BY `u`.`uid`
|
|
ORDER BY `count` DESC
|
|
LIMIT 10
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('uid', 'count'));
|
|
$ranking['contributed'][] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
// - most searched keywords
|
|
$ranking['searched'] = [];
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`sk`.`keyword`, `sk`.`count`
|
|
FROM `${prefix}_xoonips_ranking_searched_keyword` AS `sk`
|
|
ORDER BY `sk`.`count` DESC
|
|
LIMIT 10
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('count'));
|
|
$ranking['searched'][] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/rankings.json', json_encode($ranking, JSON_UNESCAPED_UNICODE));
|
|
unset($ranking);
|
|
|
|
// get public index with certified item count
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`idx`.*,
|
|
`it`.`title`,
|
|
(SELECT COUNT(*)
|
|
FROM `${prefix}_xoonips_index_item_link` AS `iil`
|
|
INNER JOIN `${prefix}_xoonips_item_basic` AS `ib` ON `iil`.`item_id`=`ib`.`item_id`
|
|
WHERE `iil`.`index_id`=`idx`.`index_id` AND `iil`.`certify_state`=2
|
|
) AS `num_items`
|
|
FROM `${prefix}_xoonips_index` AS `idx`
|
|
INNER JOIN `${prefix}_xoonips_item_title` AS `it` ON `idx`.`index_id`=`it`.`item_id`
|
|
WHERE `it`.`title_id`=0
|
|
AND `idx`.`open_level`=1
|
|
SQL;
|
|
|
|
$limitItems = array();
|
|
$limitFiles = array();
|
|
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$tree = array();
|
|
$root = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
$tree[$row['index_id']] = $row;
|
|
$root[$row['parent_index_id']][$row['sort_number']] = $row['index_id'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
foreach ($root as &$node) {
|
|
ksort($node);
|
|
}
|
|
unset($node);
|
|
|
|
$data[] = getTreeNode($tree, $root, 3);
|
|
$json = json_encode($data, JSON_UNESCAPED_UNICODE); //, JSON_PRETTY_PRINT);
|
|
file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/tree.json', $json);
|
|
unset($json, $data, $root);
|
|
|
|
// get public items
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`ib`.*,
|
|
GROUP_CONCAT(DISTINCT `it`.`title` ORDER BY `it`.`title_id` ASC SEPARATOR '\n') AS `title`,
|
|
`ity`.`display_name` AS `item_type_display_name`, `ity`.`name` AS `item_type_name`,
|
|
`u`.`uname`, `u`.`name`, `u`.`email`
|
|
FROM `${prefix}_xoonips_item_basic` AS `ib`
|
|
INNER JOIN `${prefix}_xoonips_item_title` AS `it` ON `ib`.`item_id`=`it`.`item_id`
|
|
INNER JOIN `${prefix}_xoonips_item_type` AS `ity` ON `ib`.`item_type_id`=`ity`.`item_type_id`
|
|
INNER JOIN `${prefix}_xoonips_index_item_link` AS `iil` ON `ib`.`item_id`=`iil`.`item_id`
|
|
LEFT JOIN `${prefix}_users` AS `u` ON `ib`.`uid`=`u`.`uid`
|
|
WHERE `ity`.`display_name` != 'Index'
|
|
AND `iil`.`certify_state`=2
|
|
GROUP BY `ib`.`item_id`
|
|
ORDER BY `ib`.`item_id` ASC
|
|
SQL;
|
|
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$items = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('item_id', 'item_type_id', 'uid', 'last_update_date', 'creation_date', 'publication_year', 'publication_month', 'publication_mday'));
|
|
// $row['item_url'] = getItemUrl($row);
|
|
$row['index'] = getIndexes($tree, $row['item_id']);
|
|
if (0 === count($row['index'])) {
|
|
// no public indexes found.
|
|
continue;
|
|
}
|
|
$row['changelog'] = getChangeLogs($row['item_id']);
|
|
$row['related_to'] = getRelatedTo($row['item_id']);
|
|
$row['keyword'] = getKeyword($row['item_id']);
|
|
$row['file'] = getFile($row['item_id']);
|
|
switch ($row['item_type_name']) {
|
|
case 'xnpbinder':
|
|
appendBinderInfo($row);
|
|
break;
|
|
case 'xnpbook':
|
|
appendBookInfo($row);
|
|
break;
|
|
case 'xnpconference':
|
|
appendConferenceInfo($row);
|
|
break;
|
|
case 'xnpdata':
|
|
appendDataInfo($row);
|
|
break;
|
|
case 'xnpfiles':
|
|
appendFilesInfo($row);
|
|
break;
|
|
case 'xnpmemo':
|
|
appendMemoInfo($row);
|
|
break;
|
|
case 'xnpmodel':
|
|
appendModelInfo($row);
|
|
break;
|
|
case 'xnppaper':
|
|
appendPaperInfo($row);
|
|
break;
|
|
case 'xnppresentation':
|
|
appendPresentationInfo($row);
|
|
break;
|
|
case 'xnpsimulator':
|
|
appendSimulatorInfo($row);
|
|
break;
|
|
case 'xnpstimulus':
|
|
appendStimulusInfo($row);
|
|
break;
|
|
case 'xnptool':
|
|
appendToolInfo($row);
|
|
break;
|
|
case 'xnpurl':
|
|
appendUrlInfo($row);
|
|
break;
|
|
case 'xnpnimgcenter':
|
|
appendNimgcenterInfo($row);
|
|
break;
|
|
default:
|
|
exit('Unsupported item type: '.$row['item_type_name']);
|
|
}
|
|
if (isset($row['attachment_dl_limit']) && $row['attachment_dl_limit']) {
|
|
$found = false;
|
|
foreach ($row['file'] as $file) {
|
|
if ($file['file_type_name'] !== 'preview') {
|
|
$limitFiles[] = $file['file_id'];
|
|
$found = true;
|
|
}
|
|
}
|
|
if ($found) {
|
|
$limitItems[] = array(
|
|
'uname' => $row['uname'],
|
|
'name' => $row['name'],
|
|
'email' => $row['email'],
|
|
'item_id' => $row['item_id'],
|
|
'doi' => $row['doi'],
|
|
);
|
|
}
|
|
}
|
|
myDumpToolDropColumn($row, ['email', 'item_type_id']);
|
|
if (isset($row['rights']) && isset($row['use_cc']) && isset($row['cc_commercial_use']) && isset($row['cc_modification']) && $row['use_cc'] == 1) {
|
|
$label = 'Creative Commons Attribution';
|
|
if ($row['cc_commercial_use'] == 0) {
|
|
$label .= '-NonCommercial';
|
|
}
|
|
switch ($row['cc_modification']) {;
|
|
case 0:
|
|
$label .= '-NoDerivatives';
|
|
break;
|
|
case 1:
|
|
$label .= '-ShareAlike';
|
|
break;
|
|
}
|
|
$label .= ' 4.0 International License.';
|
|
$row['rights'] = $label;
|
|
}
|
|
$items[] = $row;
|
|
//if (!is_dir(MYDUMPTOOL_OUTPUTDIR.'/items')) {
|
|
// mkdir(MYDUMPTOOL_OUTPUTDIR.'/items');
|
|
//}
|
|
// $json = json_encode($row, JSON_UNESCAPED_UNICODE); //, JSON_PRETTY_PRINT);
|
|
//file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/items/'.$row['item_id'].'.json', $json);
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$json = json_encode($items, JSON_UNESCAPED_UNICODE); //, JSON_PRETTY_PRINT);
|
|
file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/items.json', $json);
|
|
|
|
$fp = fopen(MYDUMPTOOL_OUTPUTDIR.'/dl-limit-items.csv', 'w');
|
|
foreach ($limitItems as $row) {
|
|
$data = array(
|
|
$row['item_id'],
|
|
$row['uname'],
|
|
$row['name'],
|
|
$row['email'],
|
|
getItemUrl($row),
|
|
);
|
|
fputcsv($fp, $data);
|
|
}
|
|
fclose($fp);
|
|
|
|
// get files
|
|
$fthandler = xoonips_getormhandler('xoonips', 'file_type');
|
|
$criteria = new Criteria('name', 'preview');
|
|
$ftobjs = $fthandler->getObjects($criteria);
|
|
$ftId = $ftobjs[0]->get('file_type_id');
|
|
$fhandler = xoonips_getormhandler('xoonips', 'file');
|
|
$join = new XooNIpsJoinCriteria('xoonips_item_basic', 'item_id', 'item_id', 'INNER', 'ib');
|
|
$join->cascade(new XooNIpsJoinCriteria('xoonips_index_item_link', 'item_id', 'item_id', 'INNER', 'iil'), 'ib', true);
|
|
$join->cascade(new XooNIpsJoinCriteria('xoonips_index', 'index_id', 'index_id', 'INNER', 'idx'), 'iil', true);
|
|
$criteria = new CriteriaCompo(new Criteria('is_deleted', 0));
|
|
// $criteria->add(new Criteria('file_type_id', $ftId));
|
|
$criteria->add(new Criteria('certify_state', 2));
|
|
$criteria->add(new Criteria('open_level', 1));
|
|
$res = $fhandler->open($criteria, '', false, $join);
|
|
$filesDir = MYDUMPTOOL_OUTPUTDIR.'/file';
|
|
if (!is_dir($filesDir)) {
|
|
mkdir($filesDir);
|
|
}
|
|
$xconfig_handler = xoonips_getormhandler('xoonips', 'config');
|
|
$basePath = $xconfig_handler->getValue('upload_dir');
|
|
while ($obj = $fhandler->getNext($res)) {
|
|
$file_id = $obj->get('file_id');
|
|
$file_name = $obj->get('original_file_name');
|
|
if (in_array($file_id, $limitFiles)) {
|
|
echo 'download limit file found.. skip to copy .. file_id:'.$file_id.PHP_EOL;
|
|
continue;
|
|
}
|
|
$tmp = [];
|
|
$tmp['file_name'] = $file_name;
|
|
myDumpToolDecode($tmp);
|
|
$file_name = $tmp['file_name'];
|
|
$file_dir = $filesDir.'/'.$file_id;
|
|
if (!is_dir($file_dir)) {
|
|
@mkdir($file_dir);
|
|
}
|
|
if (!file_exists($file_dir.'/'.$file_name)) {
|
|
if (!copy($basePath.'/'.$file_id, $file_dir.'/'.$file_name)) {
|
|
echo 'failed to copy file: '.$basePath.'/'.$file_id.PHP_EOL;
|
|
}
|
|
$htaccess = $file_dir.'/.htaccess';
|
|
$data = "RewriteEngine On\nRewriteBase /database/file/$file_id\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteRule .* $file_name [R=301,L]\n";
|
|
file_put_contents($htaccess, $data);
|
|
}
|
|
if ($ftId == $obj->get('file_type_id')) {
|
|
// create preview thubmnails
|
|
createThumbnail($obj, $basePath, $filesDir);
|
|
}
|
|
}
|
|
$fhandler->close($res);
|
|
|
|
// functions
|
|
|
|
function getItemUrl($row)
|
|
{
|
|
$url = XOONIPS_URL.'/detail.php?';
|
|
if ('' != $row['doi']) {
|
|
$url .= XNP_CONFIG_DOI_FIELD_PARAM_NAME.'='.$row['doi'];
|
|
} else {
|
|
$url .= 'item_id='.$row['item_id'];
|
|
}
|
|
|
|
return $url;
|
|
}
|
|
|
|
function getTreeNode($tree, $root, $index_id)
|
|
{
|
|
$children = array();
|
|
if (isset($root[$index_id])) {
|
|
foreach ($root[$index_id] as $child_index_id) {
|
|
$children[] = getTreeNode($tree, $root, $child_index_id);
|
|
}
|
|
}
|
|
|
|
return array(
|
|
'id' => (int) $tree[$index_id]['index_id'],
|
|
'title' => $tree[$index_id]['title'],
|
|
'num_of_items' => (int) $tree[$index_id]['num_items'],
|
|
'children' => $children,
|
|
);
|
|
}
|
|
|
|
function getIndexes($tree, $item_id)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$sql = <<< SQL
|
|
SELECT
|
|
`iil`.*
|
|
FROM `${prefix}_xoonips_index_item_link` AS `iil`
|
|
WHERE `iil`.`item_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$indexes = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
$index_id = $row['index_id'];
|
|
if (isset($tree[$index_id])) {
|
|
$idxes = array();
|
|
$idxes[] = $tree[$index_id]['title'];
|
|
$parent_id = $tree[$index_id]['parent_index_id'];
|
|
while (1 != $parent_id) {
|
|
$idxes[] = $tree[$parent_id]['title'];
|
|
$parent_id = $tree[$parent_id]['parent_index_id'];
|
|
}
|
|
$idxes[] = '';
|
|
$indexes[] = array(
|
|
'index_id' => (int) $index_id,
|
|
'title' => trim(implode(' / ', array_reverse($idxes))),
|
|
);
|
|
}
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
|
|
return $indexes;
|
|
}
|
|
|
|
function getChangeLogs($item_id)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$sql = <<< SQL
|
|
SELECT `log_date`, `log`
|
|
FROM `${prefix}_xoonips_changelog`
|
|
WHERE `item_id`=$item_id
|
|
ORDER BY `log_date` DESC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$ret = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('log_date'));
|
|
$ret[] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
|
|
return $ret;
|
|
}
|
|
|
|
function getRelatedTo($item_id)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$sql = <<< SQL
|
|
SELECT `item_id`
|
|
FROM `${prefix}_xoonips_related_to`
|
|
WHERE `parent_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$ret = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
$ret[] = (int) $row['item_id'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
|
|
return $ret;
|
|
}
|
|
|
|
function getKeyword($item_id)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xoonips_item_keyword`
|
|
WHERE `item_id`=$item_id
|
|
ORDER BY `keyword_id` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$ret = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
$ret[] = $row['keyword'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
|
|
return $ret;
|
|
}
|
|
|
|
function getFile($item_id)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$sql = <<< SQL
|
|
SELECT `f`.`file_id`, `f`.`original_file_name`, `f`.`mime_type`, `f`.`file_size`, `f`.`caption`, `f`.`timestamp`,
|
|
`ft`.`name` AS `file_type_name`, `ft`.`display_name` AS `file_type_display_name`
|
|
FROM `${prefix}_xoonips_file` AS `f`
|
|
INNER JOIN `${prefix}_xoonips_file_type` AS `ft` ON `f`.`file_type_id`=`ft`.`file_type_id`
|
|
WHERE `item_id`=$item_id
|
|
AND `is_deleted`=0
|
|
ORDER BY `ft`.`name` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$ret = array();
|
|
while ($row = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($row);
|
|
myDumpToolConvertToInt($row, array('file_id', 'file_size'));
|
|
$ret[] = $row;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
|
|
return $ret;
|
|
}
|
|
|
|
function appendBinderInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpbinder_item_detail`
|
|
WHERE `binder_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('binder_id'));
|
|
myDumpToolDropColumn($detail, ['binder_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpbinder_binder_item_link`
|
|
WHERE `binder_id`=$item_id
|
|
ORDER BY `binder_item_link_id` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($link = $xoopsDB->fetchArray($res)) {
|
|
$row['link_item_ids'][] = (int) $link['item_id'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendBookInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpbook_item_detail`
|
|
WHERE `book_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('book_id', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolConvertToInt($detail, array('volume', 'number')); // for CBSN
|
|
myDumpToolDropColumn($detail, ['book_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpbook_author`
|
|
WHERE `book_id`=$item_id
|
|
ORDER BY `author_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['author'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['author'][] = $author['author'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendConferenceInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpconference_item_detail`
|
|
WHERE `conference_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('conference_id', 'conference_from_year', 'conference_from_month', 'conference_from_mday', 'conference_to_year', 'conference_to_month', 'conference_to_mday', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['conference_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpconference_author`
|
|
WHERE `conference_id`=$item_id
|
|
ORDER BY `author_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['author'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['author'][] = $author['author'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendDataInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpdata_item_detail`
|
|
WHERE `data_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('data_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['data_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpdata_experimenter`
|
|
WHERE `data_id`=$item_id
|
|
ORDER BY `experimenter_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['experimenter'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['experimenter'][] = $author['experimenter'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendFilesInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpfiles_item_detail`
|
|
WHERE `files_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('files_id'));
|
|
myDumpToolDropColumn($detail, ['files_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendMemoInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpmemo_item_detail`
|
|
WHERE `memo_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('memo_id'));
|
|
myDumpToolDropColumn($detail, ['memo_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendModelInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpmodel_item_detail`
|
|
WHERE `model_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('model_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['model_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpmodel_creator`
|
|
WHERE `model_id`=$item_id
|
|
ORDER BY `creator_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['creator'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['creator'][] = $author['creator'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendPaperInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnppaper_item_detail`
|
|
WHERE `paper_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('paper_id', 'volume', 'number'));
|
|
myDumpToolDropColumn($detail, ['paper_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnppaper_author`
|
|
WHERE `paper_id`=$item_id
|
|
ORDER BY `author_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['author'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['author'][] = $author['author'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendPresentationInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnppresentation_item_detail`
|
|
WHERE `presentation_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('presentation_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['presentation_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnppresentation_creator`
|
|
WHERE `presentation_id`=$item_id
|
|
ORDER BY `creator_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['creator'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['creator'][] = $author['creator'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendSimulatorInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpsimulator_item_detail`
|
|
WHERE `simulator_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('simulator_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['simulator_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpsimulator_developer`
|
|
WHERE `simulator_id`=$item_id
|
|
ORDER BY `developer_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['developer'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['developer'][] = $author['developer'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
|
|
function appendStimulusInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpstimulus_item_detail`
|
|
WHERE `stimulus_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('stimulus_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['stimulus_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpstimulus_developer`
|
|
WHERE `stimulus_id`=$item_id
|
|
ORDER BY `developer_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['developer'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['developer'][] = $author['developer'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendToolInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnptool_item_detail`
|
|
WHERE `tool_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('tool_id', 'use_cc', 'cc_commercial_use', 'cc_modification', 'attachment_dl_limit', 'attachment_dl_notify'));
|
|
myDumpToolDropColumn($detail, ['tool_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnptool_developer`
|
|
WHERE `tool_id`=$item_id
|
|
ORDER BY `developer_order` ASC
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['developer'] = array();
|
|
while ($author = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($author);
|
|
$row['developer'][] = $author['developer'];
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendUrlInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpurl_item_detail`
|
|
WHERE `url_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
myDumpToolConvertToInt($detail, array('url_id', 'url_count'));
|
|
myDumpToolDropColumn($detail, ['url_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function appendNimgcenterInfo(&$row)
|
|
{
|
|
global $xoopsDB;
|
|
$prefix = $xoopsDB->prefix();
|
|
$item_id = $row['item_id'];
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpnimgcenter_item_detail`
|
|
WHERE `nimgcenter_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
while ($detail = $xoopsDB->fetchArray($res)) {
|
|
myDumpToolDecode($detail);
|
|
$detail['coord_type_name'] = (0 === $detail['coord_type']) ? 'Talairach' : 'MNI';
|
|
myDumpToolDropColumn($detail, ['nimgcenter_id']);
|
|
$row += $detail;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
$sql = <<< SQL
|
|
SELECT *
|
|
FROM `${prefix}_xnpnimgcenter_talairach_list`
|
|
WHERE `nimgcenter_id`=$item_id
|
|
SQL;
|
|
if (!($res = $xoopsDB->query($sql))) {
|
|
var_dump($xoopsDB);
|
|
exit();
|
|
}
|
|
$row['coordinate'] = array();
|
|
while ($t = $xoopsDB->fetchArray($res)) {
|
|
$row['coordinate'][] = $t;
|
|
}
|
|
$xoopsDB->freeRecordSet($res);
|
|
}
|
|
|
|
function createThumbnail($obj, $basePath, $outputDir)
|
|
{
|
|
$fileId = $obj->get('file_id');
|
|
$outputFile = $outputDir.'/'.$fileId.'.png';
|
|
$thumbnail_file = $obj->get('thumbnail_file');
|
|
$size = strlen($thumbnail_file);
|
|
if ($size > 0) {
|
|
file_put_contents($outputFile, $thumbnail_file);
|
|
|
|
return true;
|
|
}
|
|
$file_path = $basePath.'/'.$fileId;
|
|
$finfo = finfo_open(FILEINFO_NONE);
|
|
$label = finfo_file($finfo, $file_path);
|
|
finfo_close($finfo);
|
|
$mime_type = $obj->get('mime_type');
|
|
if (preg_match('/^([^\\/]*)\\/(.*)$/', $mime_type, $matches)) {
|
|
if ('audio' == $matches[1]) {
|
|
$img_type = 'audio';
|
|
} elseif ('image' == $matches[1]) {
|
|
$img_type = 'image';
|
|
} elseif ('video' == $matches[1]) {
|
|
$img_type = 'video';
|
|
} elseif ('text' == $matches[1]) {
|
|
$img_type = 'text';
|
|
} elseif ('application' == $matches[1]) {
|
|
$text_types = array('pdf', 'xml', 'msword', 'vnd.ms-excel');
|
|
$image_types = array('vnd.ms-powerpoint', 'postscript');
|
|
$audio_types = array('vnd.rn-realmedia');
|
|
if (in_array($matches[2], $text_types)) {
|
|
$img_type = 'text';
|
|
} elseif (in_array($matches[2], $audio_types)) {
|
|
$img_type = 'audio';
|
|
} elseif (in_array($matches[2], $image_types)) {
|
|
$img_type = 'image';
|
|
} else {
|
|
$img_type = 'application';
|
|
}
|
|
} else {
|
|
$img_type = 'unknown';
|
|
}
|
|
} else {
|
|
$img_type = 'unknown';
|
|
}
|
|
$img_file = XOOPS_ROOT_PATH.'/modules/xoonips/images/thumbnail_'.$img_type.'.png';
|
|
// create image resource
|
|
$w = 100;
|
|
$h = 100;
|
|
$im = imagecreatetruecolor($w, $h);
|
|
// label setting
|
|
$f = 2;
|
|
// font number
|
|
$lp = 5;
|
|
// label padding
|
|
$fw = imagefontwidth($f);
|
|
// font width
|
|
$fh = imagefontheight($f);
|
|
// font height
|
|
$fmaxlen = ($w - $lp * 2) / $fw;
|
|
// max label length
|
|
$labels = explode(',', $label);
|
|
$label = $labels[0];
|
|
$llen = strlen($label);
|
|
if ($llen > $fmaxlen) {
|
|
$label = substr($label, 0, $fmaxlen - 3);
|
|
$label .= '...';
|
|
$llen = strlen($label);
|
|
}
|
|
$lx = ($w - $llen * $fw) / 2;
|
|
$ly = $h - $fh - $lp;
|
|
// change alpha attributes and create transparent color
|
|
imageantialias($im, true);
|
|
imagealphablending($im, false);
|
|
imagesavealpha($im, true);
|
|
$transparent = imagecolorallocatealpha($im, 255, 255, 255, 0);
|
|
$col_white = imagecolorallocate($im, 255, 255, 255);
|
|
$col_gray = imagecolorallocate($im, 127, 127, 127);
|
|
$col_black = imagecolorallocate($im, 0, 0, 0);
|
|
// fill all area with transparent color
|
|
imagefill($im, 0, 0, $col_white);
|
|
imagealphablending($im, true);
|
|
$imicon = imagecreatefrompng($img_file);
|
|
imagecopy($im, $imicon, $w / 2 - 48 / 2, $h / 2 - 48 / 2, 0, 0, 48, 48);
|
|
imagepolygon($im, array(0, 0, $w - 1, 0, $w - 1, $h - 1, 0, $h - 1), 4, $col_gray);
|
|
if (0 != strlen($label)) {
|
|
imagestring($im, $f, $lx, $ly, $label, $black);
|
|
}
|
|
imagepng($im, $outputFile);
|
|
imagedestroy($imicon);
|
|
imagedestroy($im);
|
|
|
|
return true;
|
|
}
|