diff --git a/.gitignore b/.gitignore index 4d29575..89deecf 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,11 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# database contents +/public/database/items.json +/public/database/file +/src/database/assets/tree.json +/src/database/assets/rankings.json +/src/database/assets/recent-contents.json +/src/forum/assets/forum.json diff --git a/etc/common.inc.php b/etc/common.inc.php new file mode 100644 index 0000000..9c51453 --- /dev/null +++ b/etc/common.inc.php @@ -0,0 +1,87 @@ + $v) { + $v = $textutil->html_numeric_entities($v); + $v = mb_decode_numericentity($v, array(0x0, 0x10000, 0, 0xfffff), 'UTF-8'); + $data[$k] = \Normalizer::normalize(trim($v), \Normalizer::FORM_C); + } +} + +function myDumpToolConvertToInt(&$data, $keys, $zerofill = false) +{ + foreach ($keys as $key) { + if (isset($data[$key])) { + $data[$key] = '' === $data[$key] ? ($zerofill ? 0 : null) : (int) $data[$key]; + } + } +} + +function myDumpToolDropColumn(&$data, $keys) +{ + foreach ($keys as $key) { + if (isset($data[$key])) { + unset($data[$key]); + } + } +} + diff --git a/etc/config.inc.php b/etc/config.inc.php new file mode 100644 index 0000000..26e7d56 --- /dev/null +++ b/etc/config.inc.php @@ -0,0 +1,3 @@ +prefix(); + +$d3forum = 'forum'; + +$gidGuest = XOOPS_GROUP_ANONYMOUS; + +// get anonymous readable categories +$categories = []; +$sql = <<< SQL +SELECT + `c`.* + FROM `${prefix}_${d3forum}_categories` AS `c` + INNER JOIN `${prefix}_${d3forum}_category_access` AS `ca` ON `c`.`cat_id`=`ca`.`cat_id` + WHERE `ca`.`groupid`=${gidGuest} + GROUP BY `c`.`cat_id` + ORDER BY `c`.`cat_order_in_tree` ASC, `c`.`cat_weight` ASC +SQL; +if (!($res = $xoopsDB->query($sql))) { + var_dump($xoopsDB); + exit(); +} +while ($row = $xoopsDB->fetchArray($res)) { + myDumpToolDecode($row); + myDumpToolConvertToInt($row, ['cat_id', 'pid', 'cat_topics_count', 'cat_posts_count', 'cat_last_post_id', 'cat_last_post_time', 'cat_topics_count_in_tree', 'cat_posts_count_in_tree', 'cat_last_post_id_in_tree', 'cat_last_post_time_in_tree', 'cat_depth_in_tree', 'cat_order_in_tree', 'cat_weight']); + $row['cat_path_in_tree'] = unserialize($row['cat_path_in_tree']); + $row['cat_options'] = unserialize($row['cat_options']); + $categories[] = $row; +} +$xoopsDB->freeRecordSet($res); +//var_dump($categories); + +// get anonymous readable forums +$forums = []; +$sql = <<< SQL +SELECT + `f`.* + FROM `${prefix}_${d3forum}_forums` AS `f` + INNER JOIN `${prefix}_${d3forum}_forum_access` AS `fa` ON `f`.`forum_id`=`fa`.`forum_id` + INNER JOIN `${prefix}_${d3forum}_category_access` AS `ca` ON `f`.`cat_id`=`ca`.`cat_id` + WHERE `fa`.`groupid`=${gidGuest} + AND `ca`.`groupid`=${gidGuest} + GROUP BY `f`.`forum_id` + ORDER BY `f`.`cat_id` ASC, `f`.`forum_weight` ASC +SQL; +if (!($res = $xoopsDB->query($sql))) { + var_dump($xoopsDB); + exit(); +} +while ($row = $xoopsDB->fetchArray($res)) { + myDumpToolDecode($row); + myDumpToolConvertToInt($row, ['forum_id', 'cat_id', 'forum_topics_count', 'forum_posts_count', 'forum_last_post_id', 'forum_last_post_time', 'forum_weight'], true); + $row['forum_options'] = unserialize($row['forum_options']); + $forums[] = $row; +} +$xoopsDB->freeRecordSet($res); +//var_dump($forums); + +// get anonymous readable topics +$topics = []; +$sql = <<< SQL +SELECT + `t`.*, + `uf`.`name` AS `topic_first_uid_name`, `uf`.`uname` AS `topic_first_uid_uname`, + `ul`.`name` AS `topic_last_uid_name`, `ul`.`uname` AS `topic_last_uid_uname` + FROM `${prefix}_${d3forum}_topics` AS `t` + INNER JOIN `${prefix}_${d3forum}_forums` AS `f` ON `t`.`forum_id`=`f`.`forum_id` + INNER JOIN `${prefix}_${d3forum}_forum_access` AS `fa` ON `f`.`forum_id`=`fa`.`forum_id` + INNER JOIN `${prefix}_${d3forum}_category_access` AS `ca` ON `f`.`cat_id`=`ca`.`cat_id` + LEFT JOIN `${prefix}_users` AS `uf` ON `t`.`topic_first_uid`=`uf`.`uid` + LEFT JOIN `${prefix}_users` AS `ul` ON `t`.`topic_last_uid`=`ul`.`uid` + WHERE `fa`.`groupid`=${gidGuest} + AND `ca`.`groupid`=${gidGuest} + GROUP BY `t`.`topic_id` + ORDER BY `t`.`forum_id` ASC, `t`.`topic_id` ASC +SQL; +if (!($res = $xoopsDB->query($sql))) { + var_dump($xoopsDB); + exit(); +} +while ($row = $xoopsDB->fetchArray($res)) { + myDumpToolDecode($row); + myDumpToolConvertToInt($row, ['topic_id', 'forum_id', 'topic_first_uid', 'topic_first_post_id', 'topic_first_post_time', 'topic_last_uid', 'topic_last_post_id', 'topic_last_post_time', 'topic_views', 'topic_posts_count', 'topic_locked', 'topic_sticky', 'topic_solved', 'topic_invisible', 'topic_votes_sum', 'topic_votes_count'], true); + $topics[] = $row; +} +$xoopsDB->freeRecordSet($res); +//var_dump($topics); + +// get anonymous readable posts +$posts = []; +$sql = <<< SQL +SELECT + `p`.*, + `u`.`name` AS `uid_name`, `u`.`uname` AS `uid_uname`, `u`.`rank` AS `uid_rank`, `u`.`posts` AS `uid_posts` + FROM `${prefix}_${d3forum}_posts` AS `p` + INNER JOIN `${prefix}_${d3forum}_topics` AS `t` ON `p`.`topic_id`=`t`.`topic_id` + INNER JOIN `${prefix}_${d3forum}_forums` AS `f` ON `t`.`forum_id`=`f`.`forum_id` + INNER JOIN `${prefix}_${d3forum}_forum_access` AS `fa` ON `f`.`forum_id`=`fa`.`forum_id` + INNER JOIN `${prefix}_${d3forum}_category_access` AS `ca` ON `f`.`cat_id`=`ca`.`cat_id` + LEFT JOIN `${prefix}_users` AS `u` ON `p`.`uid`=`u`.`uid` + WHERE `fa`.`groupid`=${gidGuest} + AND `ca`.`groupid`=${gidGuest} + GROUP BY `p`.`post_id` + ORDER BY `t`.`topic_id` ASC, `p`.`post_id` ASC +SQL; +if (!($res = $xoopsDB->query($sql))) { + var_dump($xoopsDB); + exit(); +} +while ($row = $xoopsDB->fetchArray($res)) { + myDumpToolDecode($row); + myDumpToolConvertToInt($row, ['post_id', 'pid', 'topic_id', 'post_time', 'modified_time', 'uid', 'uid_hidden', 'html', 'smiley', 'xcode', 'br', 'number_entity', 'special_entity', 'icon', 'attachsig', 'invisible', 'approval', 'votes_sum', 'votes_count', 'depth_in_tree', 'order_in_tree', 'uid_rank', 'uid_posts'], true); + myDumpToolDropColumn($row, ['guest_email', 'guest_url', 'guest_pass_md5', 'guest_trip']); + $posts[] = $row; +} +$xoopsDB->freeRecordSet($res); +//var_dump($posts); +var_dump(count($posts)); + + +$data = [ + 'categories' => $categories, + 'forums' => $forums, + 'topics' => $topics, + 'posts' => $posts, +]; + +file_put_contents(MYDUMPTOOL_OUTPUTDIR.'/forum.json', json_encode($data, JSON_UNESCAPED_UNICODE)); diff --git a/etc/dumpXooNIps.php b/etc/dumpXooNIps.php new file mode 100644 index 0000000..c84befe --- /dev/null +++ b/etc/dumpXooNIps.php @@ -0,0 +1,1118 @@ +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; +} diff --git a/package.json b/package.json index f96daa4..39784c9 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,36 @@ { "name": "cbsn", - "version": "0.1.0", + "version": "1.0.0", "private": true, "dependencies": { + "@types/async-lock": "^1.1.1", "@types/jest": "24.0.15", + "@types/lokijs": "^1.5.2", "@types/node": "12.0.8", + "@types/rc-tree": "^1.11.3", "@types/react": "16.8.20", "@types/react-dom": "16.8.4", + "@types/react-helmet": "^5.0.8", + "@types/react-overlays": "^1.1.2", + "@types/react-router-dom": "^4.3.4", + "@types/react-router-hash-link": "^1.2.1", + "async-lock": "^1.2.0", + "axios": "^0.19.0", + "lokijs": "^1.5.6", + "moment": "^2.24.0", + "rc-tree": "^2.1.0", "react": "^16.8.6", + "react-app-polyfill": "^1.0.1", + "react-cookie": "^4.0.0", "react-dom": "^16.8.6", + "react-ga": "^2.5.7", + "react-helmet": "^5.2.1", + "react-image-lightbox": "^5.1.0", + "react-overlays": "^1.2.0", + "react-router-dom": "^5.0.0", + "react-router-hash-link": "^1.2.1", "react-scripts": "3.0.1", + "react-spinner-material": "^1.1.1", "typescript": "3.5.2" }, "scripts": { @@ -25,12 +46,14 @@ "production": [ ">0.2%", "not dead", - "not op_mini all" + "not op_mini all", + "ie 11" ], "development": [ "last 1 chrome version", "last 1 firefox version", - "last 1 safari version" + "last 1 safari version", + "ie 11" ] } } diff --git a/public/.htaccess b/public/.htaccess new file mode 100644 index 0000000..c0d9bbc --- /dev/null +++ b/public/.htaccess @@ -0,0 +1,8 @@ +RewriteEngine on +RewriteBase / + +RewriteCond %{QUERY_STRING} (^|&)file_id=([0-9]+)($|&) +RewriteRule ^modules/xoonips/download.php /database/file/%2? [R=301,L] + +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule . /index.html [L] diff --git a/public/favicon.ico b/public/favicon.ico index a11777c..40ed9b8 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/public/index.html b/public/index.html index dd1ccfd..77d53a0 100644 --- a/public/index.html +++ b/public/index.html @@ -5,34 +5,15 @@ - + + + + - -