パス変更
@@ -0,0 +1,44 @@ | ||
1 | +<?php +define("_MI_A_CONFIGURE","一般設定"); +define("_MI_REGISTER","登録(PMIDあり)"); +define("_MI_REGISTER2","登録(PMIDなし)"); +define("_MI_REGISTER3","ジャーナル登録"); +define("_MI_REGISTER4","PubMed検索"); +define("_MI_REGISTER5","検索"); +define("_MI_REGISTER6","データベースに登録されました。"); +define("_PA_CHECK","XML, PDF照合"); + +define("_MI_LOCALSEARCH","Local検索"); +define("_MI_FAVORITE", "お気に入り"); +define("_MI_FAVORITEPUB", "お気に入り(公開)"); +define("_MI_BIBLIO", "参考文献リスト作成"); + +define("_MI_UPDIR","アップロードディレクトリ"); +define("_MI_UPDIR_DESC","PDFファイルをアップロードするディレクトリ"); + +define("_MI_UPDIR2","アップロードディレクトリへの相対パス"); +define("_MI_UPDIR2_DESC","PubMedPDF/index.phpからみたアップロードディレクトリへの相対パス"); + +define("_MI_PROXY","プロキシの使用"); +define("_MI_PROXY_DESC","プロキシを使用するかどうか"); + +define("_MI_PURL","プロキシサーバ"); +define("_MI_PURL_DESC","プロキシアドレス"); + +define("_MI_PPORT","プロキシPORT"); +define("_MI_PPORT_DESC","プロキシポート"); + +define("_MI_NEWS","NEWS"); +define("_MI_NEWS_DESCR","論文登録情報をNEWSモジュールを通じて流しますか?"); + +define("_MI_SUFFIX","許可拡張子"); +define("_MI_SUFFIX_DESCR","メモに添付できる拡張子"); + +define("_MI_ACCESS","アクセス制限"); +define("_MI_ACCESS_DESC","PDFにアクセス制限をかけますか?"); + +define("_MI_GROUP","グループ設定"); +define("_MI_GROUP_DESC","PDFへのアクセスを許可するグループ"); + +define("_MI_LOG","ログ参照"); +?> | |
\ No newline at end of file |
@@ -0,0 +1,147 @@ | ||
1 | +<?php + +define("_MD_PDF_A","PDFアップロード"); +define("_MD_PDF_A_DESC"," ファイル名を「PMID.pdf」としてアップロードすることにより登録出来ます。"); +define("_MD_PDF_B","PMIDでの登録"); +define("_MD_PDF_B_DESC"," PDFファイルがなくてもここでPMIDを入力して送信すれば登録出来ます。<br>ファイルの追加アップロードは「PDF upload」で可能です。"); +define("_MD_PDF_C","一括登録(アップロード済みのデータが対象)"); +define("_MD_PDF_C_DESC"," アップロード済みのデータを一括で登録出来ます。<br>数によってはかなり時間がかかるので気長にお待ち下さい。"); +define("_MD_PDF_D","一括登録(PMIDのみ登録したいデータが対象)"); +define("_MD_PDF_D_DESC"," エクスポートで作成したデータを元にPMIDのみ一括登録出来ます。"); +define("_MD_PDF_E","リストエクスポート"); +define("_MD_PDF_E_DESC","登録されてあるデータのリストを取得することが出来ます。<br>このファイルを上の一括登録2で指定して登録して下さい。"); +define("_MD_L1","PDFがないデータ"); +define("_MD_L2","PDFがあるデータ"); +define("_MD_L3","全て"); +define("_MD_L4","自分の登録したデータのみ"); +define("_MD_PDF_F","データ消去"); +define("_MD_PDF_F_DESC","間違って登録したデータはここにPMIDを入力すれば消去することが出来ます。"); + +define("_MD_WO_A","論文情報"); +define("_MD_JOUR_REG","ジャーナル/書籍 新規登録"); +define("_MD_JOUR_EDIT","ジャーナル/書籍 修正"); +define("_MD_UPLOAD_INFO","PDFファイルのアップロード"); +define("_MD_REMOVE_INFO","論文情報を消去する"); +define("_MD_EDIT_INFO","論文情報を修正する"); +define("_MD_REGISTER_AUTO","自動登録"); +define("_MD_REGISTER_AUTOINFO","\"uploads_xml\" ディレクトリにあるXMLファイルを利用して自動登録を行う"); +define("_MD_REG_RESULT","登録結果"); + +define("_MD_XML_DOWNLOAD","XMLアーカイブのダウンロード"); +define("_MD_XML_DOWNLOAD_DESC","論文データのXMLファイルが入っています。"); + +define("_MD_FAVORITE_MKDIR","新規ディレクトリ"); +define("_MD_FAVORITE_DIRLIST","ディレクトリ一覧"); +define("_MD_FAVORITE_DIRTOP","トップディレクトリ"); + +define("_MD_NOTE","メモ一覧"); +define("_MD_NOTE_MES","メッセージ"); +define("_MD_NOTE_PRI","非公開"); +define("_MD_NOTE_PUB","公開"); +define("_MD_NOTE_NEW","新規"); +define("_MD_NOTE_NEW2","新規登録"); +define("_MD_NOTE_CLOSE","閉じる"); +define("_MD_NOTE_ADDED","上記のメモが登録されました。"); +define("_MD_NOTE_EDIT","メモ編集"); +define("_MD_NOTE_EDITED","メモが変更されました。"); +define("_MD_NOTE_EDIT_D","排除"); +define("_MD_NOTE_EDIT_C","編集"); +define("_MD_NOTE_PERMISSION_ERROR","このメモを編集する権限がありません。"); +define("_MD_NOTE_NODATA_ERROR","あなたの指定したメモは存在しません。"); +define("_MD_NOTE_DEL","このメモを排除してよろしいですか?"); +define("_MD_NOTE_DELETED","排除されました。"); +define("_MD_NOTE_ATTACHED","添付ファイル"); +define("_MD_NOTE_ATTACHED_EDIT","添付変更"); +define("_MD_NOTE_ATTACHED_DEL","添付ファイル排除"); +define("_MD_NOTE_ATTACHED_DELETED","添付ファイルは排除されました。"); +define("_MD_NOTE_ATTACHED_ADDED","ファイルがアップロードされました。"); +define("_MD_NOTEADDED", "メモを追加しました。"); +define("_MD_ATTACHERROR", "ファイル添付に失敗しました。"); +define("_MD_SUFFIXERROR", "この拡張子は許可されていません。"); + +define("_MD_FAVORITE", "お気に入り"); +define("_MD_FAVO_ADD","お気に入り登録"); +define("_MD_FAVO_WHICHD","どのディレクトリに登録しますか?"); +define("_MD_FAVO_ADDED","お気に入りに登録されました。"); +define("_MD_FAVORITE_PUB", "このディレクトリを公開する"); +define("_MD_FAVORITE_PRI", "このディレクトリを非公開する"); +define("_MD_FAVORITE_FREE", "解除"); +define("_MD_FAVORITE_ALL", "全データ"); + +define("_MD_CHECK_ALL","全て選択"); +define("_MD_DELETE","排除"); +define("_MD_INSERTINTO","へ移動"); +define("_MD_ADD_BIBLIO","参考文献リストに追加"); + +define("_MD_BIBLIO","参考文献リスト作成"); +define("_MD_BIBLIO_EXIST","件のデータが参考文献リストにあります"); +define("_MD_BIBLIO_EXPORT","出力する"); +define("_MD_BIBLIO_NEW","新規テンプレート"); +define("_MD_BIBLIO_MODIFY","テンプレート修正"); +define("_MD_BIBLIO_SELECT","テンプレート選択"); +define("_MD_BIBLIO_MAKENEW","新規テンプレートを作成する"); +define("_MD_BIBLIO_SHOW","参考文献リスト"); +define("_MD_BIBLIO_TEMPMADE", "テンプレートを作成しました。"); +define("_MD_BIBLIO_TEMPMADEERROR", "テンプレート作成失敗しました。"); +define("_MD_BIBLIO_TEMPEDIT", "テンプレートを編集しました。"); +define("_MD_BIBLIO_TEMPEDITERROR", "テンプレート編集失敗しました。"); +define("_MD_DELTEMPLATE", "このテンプレートを排除する場合はチェック"); + +define("_MD_PubMedSearch","PubMed 検索"); +define("_MD_PubMedSearch_unin_submit","チェックしたデータを隠す or 表示する"); +define("_MD_PubMedSearch_regist_submit","チェックしたデータを登録する"); +define("_MD_PubMedEditkeyword","キーワード編集"); +define("_MD_PubMedCreatekeyword","新規キーワード登録"); +define("_MD_PubMedreturn","PubMed 検索に戻る"); +define("_MD_PubMedmanage","登録キーワード管理"); +define("_MD_MKEYDEL", "Title, Keywordを空白にして送信するとデータが排除されます."); + +define("_MD_SCUT", "ショートカット"); +define("_MD_SCUTMADE", "ショートカットを作成しました。"); +define("_MD_SCUTDEL", "ショートカットを排除しました。"); + +define("_MD_DESCRIPTION", "詳細"); +define("_MD_DOSENTEXIST", "指定されたデータは存在しません。"); +define("_MD_NOTPERMITTED", "アクセス権がありません。"); +define("_MD_WRONGACCESS", "不正アクセス"); + +define("_MD_AUTHOR", "著者"); +define("_MD_YEAR", "発行年"); +define("_MD_JB", "ジャーナル/書籍"); +define("_MD_TITLE", "タイトル"); +define("_MD_INFO", "登録情報"); +define("_MD_ABST", "概要"); +define("_MD_JP", "日本語"); +define("_MD_VP", "巻/ページ"); + +define("_MD_EDITINFO", "論文情報を編集する"); +define("_MD_FAVO_ALREADY", "このデータは既に登録されています。"); +define("_MD_TXTONLY", "使用できるのはテキスト形式のファイルのみです。"); +define("_MD_REGISTERED", "登録しました。"); +define("_MD_REGISTEREDERROR", "登録失敗しました。"); +define("_MD_DATA_DELETED", "を排除しました。"); +define("_MD_DATA_DELETEDERROR", "排除失敗しました。"); +define("_MD_CHANGEPDF", "差し替え"); +define("_MD_DATA_EDITERROR", "変更失敗しました。"); +define("_MD_DEL_DATA", "文献情報を排除しました。<br>"); +define("_MD_DEL_DATA2", "文献情報排除に失敗しました。<br>"); +define("_MD_DEL_PDF", "PDFを排除しました。<br>"); +define("_MD_DEL_PDF2", "PDF排除に失敗しました。<br>"); +define("_MD_DEL_XML", "XMLを排除しました。<br>"); +define("_MD_DEL_XML2", "XML排除に失敗しました。<br>"); +define("_MD_CONFLICT", "既に登録されているXMLと名前が重複するため変更できません。"); +define("_MD_EDITED", "修正しました.<br>"); +define("_MD_DELXMLERROR", "古いXMLの排除に失敗しました.<br>"); +define("_MD_GENERATEXML", "XMLを生成しました.<br>"); +define("_MD_RENAMEPDFERROR", "PDFのリネームに失敗しました.<br>"); +define("_MD_RENAMEPDF", "PDFをリネームしました.<br>"); +define("_MD_UPLOADERROR", "アップロード失敗しました."); +define("_MD_UPLOADERROR2", "アップロードできるのはPDFファイルのみです。"); +define("_MD_UPLOADED", "PDFをアップロードしました。"); +define("_MD_DELETEDJ", "ジャーナルを排除しました。"); +define("_MD_DELETEDJERROR", "ジャーナルを排除に失敗しました。"); + +define("_MD_LOG_USER","ユーザ一覧"); +define("_MD_LOG_NUMTABLE","文献登録数"); +define("_MD_LOG_COMTABLE","コメント登録数"); +?> | |
\ No newline at end of file |
@@ -0,0 +1,19 @@ | ||
1 | +<?php | |
2 | + | |
3 | + define("_PA_CONFIG","一般設定"); | |
4 | + define("_PA_CHECK","XML, PDF照合"); | |
5 | + | |
6 | + define("_PA_DELPDF", "PDFの排除"); | |
7 | + define("_PA_DELETEDPDF", "を排除"); | |
8 | + define("_PA_DELETE", "排除"); | |
9 | + define("_PA_FALSE", "失敗"); | |
10 | + define("_PA_NOEXIST", "指定されたファイルが見つかりません。"); | |
11 | + define("_PA_CHECKXML", "XMLチェック"); | |
12 | + define("_PA_DELETEDXML", "以下のXMLデータは、データベースにあるデータと対応していないため削除されました。"); | |
13 | + define("_PA_NOPROBLEM", "問題なし"); | |
14 | + define("_PA_GENERATEDXML", "以下のXMLを作成しました。"); | |
15 | + define("_PA_CHECKPDF", "PDFチェック"); | |
16 | + define("_PA_NOTICEPDF", " 以下のPDFデータは、データベースにあるデータと対応していません。削除後、再アップロードが必要です。"); | |
17 | + define("_PA_DELTEDUNKNOWN", "PDFファイル以外のデータを排除しました。"); | |
18 | + | |
19 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,45 @@ | ||
1 | +<?php | |
2 | +define("_MI_A_CONFIGURE","Configure"); | |
3 | +define("_MI_REGISTER","Reg. with PMID"); | |
4 | +define("_MI_REGISTER2","Reg. without PMID"); | |
5 | +define("_MI_REGISTER3","Reg. Journal"); | |
6 | +define("_MI_REGISTER4","PubMed search"); | |
7 | +define("_MI_REGISTER5","Local search"); | |
8 | +define("_MI_REGISTER6","Registered"); | |
9 | +define("_PA_CHECK","Check XML, PDF"); | |
10 | + | |
11 | +define("_MI_LOCALSEARCH","Local search"); | |
12 | +define("_MI_FAVORITE", "Favorite" ); | |
13 | +define("_MI_FAVORITEPUB", "Favorite(Public)"); | |
14 | +define("_MI_BIBLIO", "Making Biblio list"); | |
15 | + | |
16 | +define("_MI_UPDIR","PDF upload directory"); | |
17 | +define("_MI_UPDIR_DESC","Upload directory for PDF file"); | |
18 | + | |
19 | +define("_MI_UPDIR2","Relative path for PDF upload directory"); | |
20 | +define("_MI_UPDIR2_DESC","Relative path for PDF upload directory from PubMedPDF/index.php"); | |
21 | + | |
22 | +define("_MI_PROXY","Use proxy"); | |
23 | +define("_MI_PROXY_DESC","using proxy to connect PubMed site"); | |
24 | + | |
25 | +define("_MI_PURL","Proxy server"); | |
26 | +define("_MI_PURL_DESC","IP address for proxy server"); | |
27 | + | |
28 | +define("_MI_PPORT","Proxy port"); | |
29 | +define("_MI_PPORT_DESC","Port number of proxy"); | |
30 | + | |
31 | +define("_MI_NEWS","NEWS"); | |
32 | +define("_MI_NEWS_DESCR","Do you release 'paper register news' using NEWS modules?"); | |
33 | + | |
34 | +define("_MI_SUFFIX","Permitted Suffix"); | |
35 | +define("_MI_SUFFIX_DESCR","You can upload these as memo attachement."); | |
36 | + | |
37 | +define("_MI_ACCESS","Restrict access"); | |
38 | +define("_MI_ACCESS_DESC","Do you restrict access to PDF files?"); | |
39 | + | |
40 | +define("_MI_GROUP","Permitted Group"); | |
41 | +define("_MI_GROUP_DESC","The group that permitted access to PDF files."); | |
42 | + | |
43 | +define("_MI_LOG","Log"); | |
44 | +?> | |
45 | + |
@@ -0,0 +1,148 @@ | ||
1 | +<?php + +define("_MD_PDF_A","Upload PDF file"); +define("_MD_PDF_A_DESC"," Register by uploading PDF file which is named \"PMID.pdf\""); +define("_MD_PDF_B","Submit PMID only for later uploading"); +define("_MD_PDF_B_DESC","Register by entering PMID<br>Even after registration, PDF file can be uploaded by \"Upload PDF file\""); +define("_MD_PDF_C","Automatic registraion"); +define("_MD_PDF_C_DESC","Automatic registration by PDF files in the pdf file directory <br>It will require considerable time."); +define("_MD_PDF_D","Automatic registration"); +define("_MD_PDF_D_DESC","Automatic registration by PMID list file (csv format)"); +define("_MD_PDF_E","Export registered PMID list"); +define("_MD_PDF_E_DESC","Export registered PMID list in csv format<br>This file can be used in \"Automatic registration (2)\""); +define("_MD_L1","without PDF file"); +define("_MD_L2","with PDF file"); +define("_MD_L3","all"); +define("_MD_L4","only data which were registered by you."); +define("_MD_PDF_F","Remove"); +define("_MD_PDF_F_DESC","Remove PMID registration"); + +define("_MD_WO_A","Bibliographic information"); +define("_MD_JOUR_REG","Journal/Book Registration"); +define("_MD_JOUR_EDIT","Journal/Book edit"); +define("_MD_UPLOAD_INFO","Upload PDF file"); +define("_MD_REMOVE_INFO","Remove registered information"); +define("_MD_EDIT_INFO","Edit registered information"); +define("_MD_REGISTER_AUTO","Automatic registration"); +define("_MD_REGISTER_AUTOINFO","Registration by XML files in \"uploads_xml\" directory"); +define("_MD_REG_RESULT","Registration result"); + +define("_MD_XML_DOWNLOAD","Download XML archive"); +define("_MD_XML_DOWNLOAD_DESC","You can get XML files."); + +define("_MD_FAVORITE_MKDIR","New Directory"); +define("_MD_FAVORITE_DIRLIST","Directory List"); +define("_MD_FAVORITE_DIRTOP","Directory Top"); + +define("_MD_NOTE","Note list"); +define("_MD_NOTE_MES","Message"); +define("_MD_NOTE_PRI","private"); +define("_MD_NOTE_PUB","public"); +define("_MD_NOTE_NEW","new"); +define("_MD_NOTE_NEW2","add new note"); +define("_MD_NOTE_CLOSE","close"); +define("_MD_NOTE_ADDED","Above note has added."); +define("_MD_NOTE_EDIT","Note Edit"); +define("_MD_NOTE_EDITED","Above note has changed."); +define("_MD_NOTE_EDIT_D","delete"); +define("_MD_NOTE_EDIT_C","edit"); +define("_MD_NOTE_PERMISSION_ERROR","You don't have the permission change this note."); +define("_MD_NOTE_NODATA_ERROR","Such data doesn't exist."); +define("_MD_NOTE_DEL","Do you delete this note?"); +define("_MD_NOTE_DELETED","The note has deleted."); +define("_MD_NOTE_ATTACHED","File attachment"); +define("_MD_NOTE_ATTACHED_EDIT","Attachment"); +define("_MD_NOTE_ATTACHED_DEL","Delete attachment"); +define("_MD_NOTE_ATTACHED_DELETED","Attachment was deleted."); +define("_MD_NOTE_ATTACHED_ADDED","Attachment was uploaded."); +define("_MD_NOTEADDED", "Note was added."); +define("_MD_ATTACHERROR", "Error: Attachment didn't be uploaded."); +define("_MD_SUFFIXERROR", "Error: This suffix doesn't be permitted."); + +define("_MD_FAVORITE", "Favorite"); +define("_MD_FAVO_ADD","Add Favorite"); +define("_MD_FAVO_WHICHD","Which directory do you want to add this data?"); +define("_MD_FAVO_ADDED","This data has added your favorite list."); +define("_MD_FAVORITE_PUB", "Make this dir public"); +define("_MD_FAVORITE_PRI", "Make this dir private"); +define("_MD_FAVORITE_FREE", "Release"); +define("_MD_FAVORITE_ALL", "All data"); + +define("_MD_CHECK_ALL","Check All"); +define("_MD_DELETE","Delete"); +define("_MD_INSERTINTO","insert into"); +define("_MD_ADD_BIBLIO","Add your bibliography list"); + +define("_MD_BIBLIO","Making Bibliography List"); +define("_MD_BIBLIO_EXIST","data exist on your bibliograpy list"); +define("_MD_BIBLIO_EXPORT","show bibliograpy list"); +define("_MD_BIBLIO_NEW","New template"); +define("_MD_BIBLIO_MODIFY","Modify template"); +define("_MD_BIBLIO_SELECT","Select template"); +define("_MD_BIBLIO_MAKENEW","Making new template"); +define("_MD_BIBLIO_SHOW","Show bibliography list"); +define("_MD_BIBLIO_TEMPMADE", "Template was made."); +define("_MD_BIBLIO_TEMPMADEERROR", "Error: Template didn't be made."); +define("_MD_BIBLIO_TEMPEDIT", "Template was edited."); +define("_MD_BIBLIO_TEMPEDITERROR", "Error: Template didn't be edited."); +define("_MD_DELTEMPLATE", "Check when you delete this template."); + +define("_MD_PubMedSearch","PubMed Search"); +define("_MD_PubMedSearch_unin_submit","Hide or show checked data."); +define("_MD_PubMedSearch_regist_submit","Register checked data."); +define("_MD_PubMedEditkeyword","Edit Keyword"); +define("_MD_PubMedCreatekeyword","Register Keyword"); +define("_MD_PubMedreturn","Go back to the PubMed Search"); +define("_MD_PubMedmanage","Keyword Management"); +define("_MD_MKEYDEL", "Make forms empty and click submit when you delete keyword."); + +define("_MD_SCUT","Shortcut"); +define("_MD_SCUTMADE", "Shortcut was made."); +define("_MD_SCUTDEL", "Shortcut was deleted."); + +define("_MD_DESCRIPTION", "Detail"); +define("_MD_DOSENTEXIST", "The data doesn't exist."); +define("_MD_NOTPERMITTED", "You don't have the permission to access."); +define("_MD_WRONGACCESS", "Unauthorized Access"); + +define("_MD_AUTHOR", "Author"); +define("_MD_YEAR", "Year"); +define("_MD_JB", "Journal/Book"); +define("_MD_TITLE", "Title"); +define("_MD_INFO", "Registered by"); +define("_MD_ABST", "Abstract"); +define("_MD_JP", "other language"); +define("_MD_VP", "vol/pp"); + +define("_MD_EDITINFO", "Edit this infomation"); +define("_MD_FAVO_ALREADY", "This data is already exists in your favorite."); +define("_MD_TXTONLY", "You can only use [.txt] file."); +define("_MD_REGISTERED", "The data was registered."); +define("_MD_REGISTEREDERROR", "Error: The data didn't be registered."); +define("_MD_DATA_DELETED", " was deleted."); +define("_MD_DATA_DELETEDERROR", "Error: fail to delete"); +define("_MD_CHANGEPDF", "Change PDF file"); +define("_MD_DATA_EDITERROR", "Error: fail to change"); +define("_MD_DEL_DATA", "The data was deleted.<br>"); +define("_MD_DEL_DATA2", "Error: fail to delete the data.<br>"); +define("_MD_DEL_PDF", "PDF was deleted.<br>"); +define("_MD_DEL_PDF2", "Error: PDF didn't be deleted.<br>"); +define("_MD_DEL_XML", "XML was deleted.<br>"); +define("_MD_DEL_XML2", "Error: XML didn't be deleted.<br>"); +define("_MD_CONFLICT", "Error: Conflict with already registered data."); +define("_MD_EDITED", "edited<br>"); +define("_MD_DELXMLERROR", "Error: Old XML didn't be deleted.<br>"); +define("_MD_GENERATEXML", "XML was made.<br>"); +define("_MD_RENAMEPDFERROR", "Error: PDF didnt't be renamed.<br>"); +define("_MD_RENAMEPDF", "PDF was renamed.<br>"); +define("_MD_UPLOADERROR", "Error: fail to upload"); +define("_MD_UPLOADERROR2", "You can upload [.pdf] file only."); +define("_MD_UPLOADED", "PDF was uploaded."); +define("_MD_DELETEDJ", "Journal was deleted."); +define("_MD_DELETEDJERROR", "Error: Journal didn't be deleted."); + +define("_MD_LOG_USER","Users"); +define("_MD_LOG_NUMTABLE","Papers"); +define("_MD_LOG_COMTABLE","Comments"); + +?> | |
\ No newline at end of file |
@@ -0,0 +1,19 @@ | ||
1 | +<?php | |
2 | + | |
3 | + define("_PA_CONFIG","Config"); | |
4 | + define("_PA_CHECK","Check XML, PDF"); | |
5 | + | |
6 | + define("_PA_DELPDF", "Deleted PDF"); | |
7 | + define("_PA_DELETEDPDF", ""); | |
8 | + define("_PA_DELETE", "Delete"); | |
9 | + define("_PA_FALSE", "False"); | |
10 | + define("_PA_NOEXIST", "The file does not exist."); | |
11 | + define("_PA_CHECKXML", "Check XML"); | |
12 | + define("_PA_DELETEDXML", "Following XML files are deleted because don't correspond with the database data."); | |
13 | + define("_PA_NOPROBLEM", "No Problem"); | |
14 | + define("_PA_GENERATEDXML", "Following XML files are Generated."); | |
15 | + define("_PA_CHECKPDF", "Check PDF"); | |
16 | + define("_PA_NOTICEPDF", "Following PDF files don't correspond with the database data. Delete these and upload again."); | |
17 | + define("_PA_DELTEDUNKNOWN", "Deleted unknown files."); | |
18 | + | |
19 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,20 @@ | ||
1 | +<?php | |
2 | + echo "<br><b>change values of F_num (".$T_ID.")</b><br>"; | |
3 | + | |
4 | + $sql = "update ".$T_ID." set F_num='0'"; | |
5 | + $res = mysql_query($sql, $conn); | |
6 | + | |
7 | + $num = array(); | |
8 | + $sql = "select * from ".$T_FDATA.""; | |
9 | + $res = mysql_query($sql, $conn); | |
10 | + while($row = mysql_fetch_array($res, MYSQL_ASSOC)){ | |
11 | + $num[$row["data_id"]] ++; | |
12 | + } | |
13 | + print_r($num); | |
14 | + echo "<br>"; | |
15 | + | |
16 | + foreach($num as $key => $value){ | |
17 | + $sql = "UPDATE ".$T_ID." SET F_num='".$value."' WHERE id='".$key."'"; | |
18 | + $res = mysql_query($sql, $conn); | |
19 | + } | |
20 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,88 @@ | ||
1 | +<?php | |
2 | + //database | |
3 | + echo "<br><b>change values of Custom_t1(".$T_ID.")</b><br><br>"; | |
4 | + $sql = "select * from ".$T_ID." where Custom_t1 != ''"; | |
5 | + $res = mysql_query($sql, $conn); | |
6 | + while($row = mysql_fetch_array($res, MYSQL_ASSOC)){ | |
7 | + $old = $row["Custom_t1"]; | |
8 | + $new = ren($old); | |
9 | + | |
10 | + if($old != $new){ | |
11 | + $sql2 = "update ".$T_ID." set Custom_t1='".$new."' where id='".$row["id"]."'"; | |
12 | + $res2 = mysql_query($sql2, $conn); | |
13 | + echo $old."<br>".$new."<br><br>"; | |
14 | + } | |
15 | + } | |
16 | + | |
17 | + //wo PDF dir | |
18 | + echo "<br><b>rename PDF file</b><br><br>"; | |
19 | + $sql = "SELECT * FROM ".$T_CONFIG." WHERE conf_name='updir'"; | |
20 | + $res = mysql_query($sql, $conn); | |
21 | + $row = mysql_fetch_array($res, MYSQL_ASSOC); | |
22 | + $dpdf = $row["conf_value"]; | |
23 | + if(substr($dpdf,-1) != "/") $dpdf.="/"; | |
24 | + $dpdf = $dpdf."wopmid/"; | |
25 | + mv($dpdf); | |
26 | + | |
27 | + //wo XML dir | |
28 | + echo "<br><b>rename XML file</b><br><br>"; | |
29 | + $dxml = XOOPS_ROOT_PATH."/modules/PubMedPDF/uploads_xml/"; | |
30 | + mv($dxml); | |
31 | + | |
32 | + function mv($dir){ | |
33 | + | |
34 | + include XOOPS_ROOT_PATH."/modules/PubMedPDF/include/conn.php"; | |
35 | + | |
36 | + if( $handle = opendir( $dir ) ){ | |
37 | + while ( false !== $file = readdir( $handle ) ){ | |
38 | + if( $file != "." && $file != ".."){ | |
39 | + if( substr($file,-4) == ".pdf" || substr($file,-4) == ".xml"){ | |
40 | + | |
41 | + $old = $file; | |
42 | + $new = ren($old); | |
43 | + if($old != $new){ | |
44 | + rename($dir.$old, $dir.$new); | |
45 | + echo $old."<br>".$new."<br><br>"; | |
46 | + } | |
47 | + | |
48 | + $sql = "select * from ".$T_ID." where Custom_t1='".substr($new,0,-4)."'"; | |
49 | + $res = mysql_query($sql, $conn); | |
50 | + $num = mysql_num_rows($res); | |
51 | + | |
52 | + if($num == 0){ | |
53 | + if(!is_dir($dir."unknown/")){ | |
54 | + $rc = mkdir($dir."unknown/", 0777); | |
55 | + } | |
56 | + rename($dir.$new, $dir."unknown/".$new); | |
57 | + echo $new." -> unknown dir.<br>"; | |
58 | + } | |
59 | + | |
60 | + } | |
61 | + } | |
62 | + } | |
63 | + closedir( $handle ); | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + function ren($str){ | |
68 | + | |
69 | + $str = str_replace('′', 'D', $str); | |
70 | + $str = str_replace('\"', 'ampS', $str); | |
71 | + $str = str_replace('&', 'A', $str); | |
72 | + $str = str_replace(',', '~', $str); | |
73 | + $str = str_replace(':', 'C', $str); | |
74 | + $str = str_replace(';', 'S', $str); | |
75 | + $str = str_replace('%', 'P', $str); | |
76 | + $str = str_replace('?', 'Q', $str); | |
77 | + $str = str_replace('!', 'X', $str); | |
78 | + $str = str_replace('#', 'S', $str); | |
79 | + $str = str_replace('\\', 'I', $str); | |
80 | + $str = str_replace('/', 'L', $str); | |
81 | + $str = str_replace('*', 'M', $str); | |
82 | + $str = str_replace('|', 'O', $str); | |
83 | + $str = str_replace('>', 'G', $str); | |
84 | + $str = str_replace('<', 'L', $str); | |
85 | + | |
86 | + return $str; | |
87 | + } | |
88 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,14 @@ | ||
1 | +<?php | |
2 | + include("../../../../mainfile.php"); | |
3 | + include (XOOPS_ROOT_PATH."/header.php"); | |
4 | + include XOOPS_ROOT_PATH."/modules/PubMedPDF/include/conn.php"; | |
5 | + | |
6 | + echo "<b>Upgrade script for v1.2 to v1.3.</b><br><br>"; | |
7 | + | |
8 | + include "insert_fnum.php"; | |
9 | + include "wo_conv.php"; | |
10 | + | |
11 | + echo "<br><br>Finish!"; | |
12 | + | |
13 | + include (XOOPS_ROOT_PATH."/footer.php"); | |
14 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,105 @@ | ||
1 | +<?xml version="1.0" ?> | |
2 | +<!DOCTYPE doc[ | |
3 | +<!ELEMENT ppdfArticleSet (ppdfArticle)> | |
4 | +<!ELEMENT ppdfAriticle (ppdfIndex,DateCreated,DateCompleted?,DateRevised?,Article)> | |
5 | +<!ELEMENT ppdfIndex (#PCDATA)> | |
6 | +<!ELEMENT DateCreated (Year,Month,Day)> | |
7 | +<!ELEMENT DateCompleted (Year,Month,Day)> | |
8 | +<!ELEMENT DateRevised (Year,Month,Day)> | |
9 | +<!ELEMENT Year (#PCDATA)> | |
10 | +<!ELEMENT Month (#PCDATA)> | |
11 | +<!ELEMENT Day (#PCDATA)> | |
12 | + | |
13 | +<!ELEMENT Article ((Journal|Book)?,ArticleTitle,Pagination?,Abstract?,Affiliation?, AuthorList)> | |
14 | +<!ELEMENT Journal (JournalIssue)> | |
15 | +<!ELEMENT JournalIssue (Volume?,Issue?,PubDate?)> | |
16 | +<!ELEMENT PubDate (Year,Month?,Day?)> | |
17 | +<!ELEMENT Volume (#PCDATA)> | |
18 | +<!ELEMENT Issue (#PCDATA)> | |
19 | +<!ATTLIST JournalIssue PrintYN (Y|N) "Y"> | |
20 | +<!ELEMENT ArticleTitle (#PCDATA)> | |
21 | +<!ELEMENT Pagination (MedlinePgn)> | |
22 | +<!ELEMENT MedlinePgn (#PCDATA)> | |
23 | +<!ELEMENT Abstract (#PCDATA)> | |
24 | +<!ELEMENT Affiliation (#PCDATA)> | |
25 | +<!ELEMENT AuthorList (Author*)> | |
26 | +<!ELEMENT Author (LastName, ForeName, Initials)> | |
27 | +<!ELEMENT LastName (#PCDATA)> | |
28 | +<!ELEMENT ForeName (#PCDATA)> | |
29 | +<!ELEMENT Initials (#PCDATA)> | |
30 | +<!ATTLIST AuthorList CompleteYN (Y|N) "Y"> | |
31 | + | |
32 | +<!ELEMENT Language (#PCDATA)> | |
33 | +<!ELEMENT PublicationTypeList (PublicationType)> | |
34 | +<!ELEMENT PublicationType (#PCDATA)> | |
35 | + | |
36 | +<!ELEMENT MedlineJournalInfo (Country?,MedlineTA?,NlmUniqueID?)> | |
37 | +<!ELEMENT Contry (#PCDATA)> | |
38 | +<!ELEMENT MedlineTA (#PCDATA)> | |
39 | +<!ELEMENT NlmUniqueID (#PCDATA)> | |
40 | +]> | |
41 | + | |
42 | +<ppdfArticleSet> | |
43 | +<ppdfArticle> | |
44 | + | |
45 | +<ppdfIndex>1999~Ikeno_H~Nishioka_T_test_10_512_2</ppdfIndex> | |
46 | +<DateCreated> | |
47 | +<Year>2004</Year> | |
48 | +<Month>12</Month> | |
49 | +<Day>7</Day> | |
50 | +</DateCreated> | |
51 | +<DateCompleted> | |
52 | +<Year>2004</Year> | |
53 | +<Month>12</Month> | |
54 | +<Day>7</Day> | |
55 | +</DateCompleted> | |
56 | +<DateRevised> | |
57 | +<Year>2004</Year> | |
58 | +<Month>12</Month> | |
59 | +<Day>7</Day> | |
60 | +</DateRevised> | |
61 | + | |
62 | +<Journal> | |
63 | +<JournalIssue PrintYN="Y"> | |
64 | +<Volume>12</Volume> | |
65 | +<Issue>4</Issue> | |
66 | +<PubDate> | |
67 | +<Year>2000</Year> | |
68 | +<Month>10</Month> | |
69 | +<Day>11</Day> | |
70 | +</PubDate> | |
71 | +</JournalIssue> | |
72 | +</Journal> | |
73 | + | |
74 | +<ArticleTitle>Test for XML</ArticleTitle> | |
75 | +<Pagination> | |
76 | +<MedlinePgn>461-74</MedlinePgn> | |
77 | +</Pagination> | |
78 | +<Abstract>This is abstract</Abstract> | |
79 | +<Affiliation>University of Hyogo</Affiliation> | |
80 | +<AuthorList CompleteYN="Y"> | |
81 | +<Author> | |
82 | +<LastName>Devaud</LastName> | |
83 | +<ForeName>J M</ForeName> | |
84 | +<Initials>JM</Initials> | |
85 | +</Author> | |
86 | +<Author> | |
87 | +<LastName>Masson</LastName> | |
88 | +<ForeName>C</ForeName> | |
89 | +<Initials>C</Initials> | |
90 | +</Author> | |
91 | +</AuthorList> | |
92 | + | |
93 | +<Language>eng</Language> | |
94 | +<PublicationTypeList> | |
95 | +<PublicationType>Journal Article</PublicationType> | |
96 | +</PublicationTypeList> | |
97 | + | |
98 | +<MedlineJournalInfo> | |
99 | +<Country>United State</Country> | |
100 | +<MedlineTA>J Neurobiol</MedlineTA> | |
101 | +<NlmUniqueID>0213640</NlmUniqueID> | |
102 | +</MedlineJournalInfo> | |
103 | + | |
104 | +</ppdfArticle> | |
105 | +</ppdfArticleSet> | |
\ No newline at end of file |
@@ -0,0 +1,72 @@ | ||
1 | +<?php | |
2 | +# PMIDなしの登録処理用スクリプト created by n_takuto | |
3 | + | |
4 | + if (!defined('XOOPS_ROOT_PATH')) { exit(); } | |
5 | + | |
6 | + include 'include/wopmid.php'; | |
7 | + | |
8 | + $error = ''; | |
9 | + if(empty($_POST['title_e']) || empty($_POST['author_e'])){ | |
10 | + $error = 'Fill in the required form.'; | |
11 | + redirect_header($return_url, 2, $error); | |
12 | + } | |
13 | + | |
14 | + $title_e = $myts->stripSlashesGPC($_POST['title_e']); | |
15 | + $author_e = $myts->stripSlashesGPC($_POST['author_e']); | |
16 | + | |
17 | + if(!ereg("^[_A-Za-z0-9 ,;:-]+$",$title_e)){ | |
18 | + $error = "You can only use alphabet in English title form."; | |
19 | + }elseif(!ereg("^[_A-Za-z0-9 ,;:-]+$",$author_e)){ | |
20 | + $error = "You can only use alphabet in English author form."; | |
21 | + } | |
22 | + if($error) redirect_header($return_url, 2, $error); | |
23 | + | |
24 | + $data = array(); | |
25 | + $data['id'] = 0; | |
26 | + $data['t'] = $myts->stripSlashesGPC($_POST['title_e']); | |
27 | + $data['t_jp'] = $myts->stripSlashesGPC($_POST['title_o']); | |
28 | + $data['a'] = $myts->stripSlashesGPC($_POST['author_e']); | |
29 | + $data['a_jp'] = $myts->stripSlashesGPC($_POST['author_o']); | |
30 | + $data['v'] = $myts->stripSlashesGPC($_POST['volume']); | |
31 | + $data['p'] = $myts->stripSlashesGPC($_POST['page']); | |
32 | + $data['ab'] = $myts->stripSlashesGPC($_POST['abstract']); | |
33 | + $data['jb'] = $myts->stripSlashesGPC($_POST['jb']); | |
34 | + $j0 = $myts->stripSlashesGPC($_POST['selectedJournal0']); | |
35 | + $j1 = $myts->stripSlashesGPC($_POST['selectedJournal1']); | |
36 | + | |
37 | + # journal/book name | |
38 | + if($data['jb'] == 'j'){ | |
39 | + ($j0 != '(unknown)') ? $data['j'] = $j0 : $data['j'] = '(unknown)'; | |
40 | + | |
41 | + }elseif($data['jb'] == 'b'){ | |
42 | + ($j1 != '(unknown)') ? $data['j'] = $j1 : $data['j'] = '(unknown)'; | |
43 | + } | |
44 | + | |
45 | + # year | |
46 | + if (!empty($_POST['year'])){ | |
47 | + $data['y'] = intval($_POST['year']); | |
48 | + | |
49 | + }elseif(!empty($_POST['selectedYear'])){ | |
50 | + $data['y'] = intval($_POST['selectedYear']); | |
51 | + | |
52 | + }else{ | |
53 | + $data['y'] = '0000'; | |
54 | + } | |
55 | + | |
56 | + # author | |
57 | + $Author = ""; | |
58 | + $Authors = explode(",", $data['a']); | |
59 | + foreach($Authors as $a){ | |
60 | + $Author .= trim($a).", "; | |
61 | + } | |
62 | + $data['a'] = substr($Author, 0, -2); | |
63 | + | |
64 | + # 以前のバージョンとの互換性を残すため消さない方が良い | |
65 | + foreach($data as $key => $value){ | |
66 | + $data[$key] = str_replace("\"", """, $data[$key]); | |
67 | + } | |
68 | + | |
69 | + # XMLファイル名を生成 | |
70 | + $wopmid_id = wopmid($data['y'], $data['a'], $data['j'], $data['v'], $data['p'], $data['t']); | |
71 | + $data['c_t1'] = $wopmid_id; | |
72 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,51 @@ | ||
1 | +<?php | |
2 | +# ニュース登録用スクリプト created by n_takuto | |
3 | + | |
4 | +# NEWSモジュールを利用している | |
5 | +# NEWS_REGISTER( category, title, body, user) | |
6 | + | |
7 | +function NEWS_REGISTER($news_topic, $title, $body, $user, $id){ | |
8 | + global $xoopsDB; | |
9 | + | |
10 | + $title = addslashes($title); | |
11 | + $body = $body.' [<a href="'.XOOPS_URL.'/modules/PubMedPDF/paper_desc.php?id='.$id.'">PubMedPDF</a>]'; | |
12 | + $body = addslashes($body); | |
13 | + | |
14 | + # whether news module exists or not | |
15 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('modules')." WHERE dirname='news'"; | |
16 | + $res = $xoopsDB->query($sql); | |
17 | + | |
18 | + if($xoopsDB->getRowsNum($res) > 0){ | |
19 | + $time = time(); | |
20 | + | |
21 | + # topic PubMedPDF | |
22 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('topics')." WHERE topic_title='PubMedPDF'"; | |
23 | + $res = $xoopsDB->query($sql); | |
24 | + if($xoopsDB->getRowsNum($res) <= 0){ | |
25 | + $sql = "INSERT INTO ".$xoopsDB->prefix('topics')." VALUES('','0','','PubMedPDF')"; | |
26 | + $res = $xoopsDB->query($sql); | |
27 | + } | |
28 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('topics')." WHERE topic_title='PubMedPDF'"; | |
29 | + $res = $xoopsDB->query($sql); | |
30 | + $row = $xoopsDB->fetchArray($res); | |
31 | + $pid = $row["topic_id"]; | |
32 | + | |
33 | + # subtopic | |
34 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('topics')." WHERE topic_title='".$news_topic."'"; | |
35 | + $res = $xoopsDB->query($sql); | |
36 | + if($xoopsDB->getRowsNum($res) <= 0){ | |
37 | + $sql = "INSERT INTO ".$xoopsDB->prefix('topics')." VALUES('','".$pid."','','".$news_topic."')"; | |
38 | + $res = $xoopsDB->query($sql); | |
39 | + } | |
40 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('topics')." WHERE topic_title='".$news_topic."'"; | |
41 | + $res = $xoopsDB->query($sql); | |
42 | + $row = $xoopsDB->fetchArray($res); | |
43 | + $pid = $row["topic_id"]; | |
44 | + | |
45 | + # reg news | |
46 | + $sql = "INSERT INTO ".$xoopsDB->prefix('stories')." VALUES('','1','".$title."','".$time."','".$time."','0','','0','1','".$body."','','0','".$pid."','0','0','".$user."','0','R','0')"; | |
47 | + $res = $xoopsDB->query($sql); | |
48 | + } | |
49 | +} | |
50 | + | |
51 | +?> |
@@ -0,0 +1,387 @@ | ||
1 | +<?php | |
2 | +# PubMedから文献情報を取得するスクリプト created by n_takuto, h_ikeno | |
3 | + | |
4 | +# PHP5対策 | |
5 | +if (version_compare(PHP_VERSION,'5','>=')) require_once('domxml-php4-to-php5.php'); | |
6 | + | |
7 | +# PubMed($PMID, $proxy, $snoopy, $xml_dir ) | |
8 | +#----------------------------------------------------------- | |
9 | +# PubMedサイトからデータを取得する | |
10 | +# | |
11 | +# 引数:PubMedID, array[proxy_yesno,proxy_url,proxy_port] | |
12 | +# | |
13 | +# 戻り値:PMIDが存在しなければ 0 | |
14 | +# PMIDが存在すれば論文情報の格納された配列 | |
15 | +# array[id,j,y,v,p,ab,t,a] | |
16 | +# (array[id,journal,year,volume,page,abstract,title,author]) | |
17 | +#------------------------------------------------------------ | |
18 | + | |
19 | + | |
20 | +function PubMed($PMID, $proxy, $snoopy, $xml_dir ){ | |
21 | + | |
22 | + $PMID = rtrim($PMID); | |
23 | + | |
24 | + $url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils"; | |
25 | + | |
26 | + # Do PubMed search | |
27 | + $esearch = $url."/esearch.fcgi?db=Pubmed&retmax=1&usehistory=y&term=".$PMID; | |
28 | + $pubmed_xml = ""; | |
29 | + | |
30 | + # Proxy mode | |
31 | + if($proxy){ | |
32 | + $proxy->fetch($esearch); | |
33 | + $pubmed_xml = $proxy->results ; | |
34 | + | |
35 | + # non Proxy mode | |
36 | + }else{ | |
37 | + // change to Snoopy by H.Ikeno 2005/04/19 | |
38 | + | |
39 | + $snoopy->fetch($esearch); | |
40 | + $pubmed_xml = $snoopy->results; | |
41 | + } | |
42 | + | |
43 | + $dom = domxml_open_mem($pubmed_xml); | |
44 | + | |
45 | + # Count | |
46 | + $array = $dom->get_elements_by_tagname("Count"); | |
47 | + $count = $array[0]->get_content(); | |
48 | + | |
49 | + if($count != "1"){ | |
50 | + return 0; | |
51 | + } | |
52 | + | |
53 | + # Query Key | |
54 | + $array = $dom->get_elements_by_tagname("QueryKey"); | |
55 | + $query_key = $array[0]->get_content(); | |
56 | + | |
57 | + # WebEnv | |
58 | + $array = $dom->get_elements_by_tagname("WebEnv"); | |
59 | + $webenv = $array[0]->get_content(); | |
60 | + | |
61 | + # Do PubMed fetch | |
62 | + $efetch = $url."/efetch.fcgi?rettype=XML&retmode=text&db=Pubmed&query_key=".$query_key."&WebEnv=".$webenv; | |
63 | + $pubmed_xml = ""; | |
64 | + | |
65 | + # Proxy mode | |
66 | + if($proxy){ | |
67 | + $proxy->fetch($efetch); | |
68 | + $pubmed_xml = $proxy->results ; | |
69 | + | |
70 | + # non Proxy mode | |
71 | + }else{ | |
72 | + // change to Snoopy by H.Ikeno 2005/04/19 | |
73 | + | |
74 | + $snoopy->fetch($efetch); | |
75 | + $pubmed_xml = $snoopy->results; | |
76 | + } | |
77 | + | |
78 | + if(!is_dir("pubmed_xml/")){ | |
79 | + $rc = mkdir("pubmed_xml/", 0777); | |
80 | + if(!$rc){ | |
81 | + echo "mkdir [ pubmed_xml ] false"; | |
82 | + } | |
83 | + } | |
84 | + | |
85 | + // save XML file | |
86 | + if (strlen($xml_dir)) { | |
87 | + if(substr($xml_dir,-1) != "/") $xml_dir.="/"; | |
88 | + $pass = $xml_dir.$PMID.".xml"; | |
89 | + $file= fopen($pass, "w"); | |
90 | + fputs($file, $pubmed_xml); | |
91 | + fclose($file); | |
92 | + } | |
93 | + | |
94 | + $pm_data = parseXML( $PMID, $pubmed_xml ); | |
95 | + | |
96 | + return $pm_data; | |
97 | +} | |
98 | + | |
99 | +# PubMedByFile($PMID, $xml_dir) | |
100 | +#----------------------------------------------------------- | |
101 | +# XMLファイルから情報を抽出する | |
102 | +# | |
103 | +# 引数:$PMID, $xml_dir | |
104 | +# $PMID: PubMedID | |
105 | +# $xml_dir: XMLファイルのディレクトリ, | |
106 | +# | |
107 | +# 戻り値:PMIDが存在しなければ 0 | |
108 | +# PMIDが存在すれば論文情報の格納された配列 | |
109 | +# array[id,j,y,v,p,ab,t,a] | |
110 | +# (array[id,journal,year,volume,page,abstract,title,author]) | |
111 | +#------------------------------------------------------------ | |
112 | + | |
113 | + | |
114 | +function PubMedByFile($PMID, $xml_dir ){ | |
115 | + | |
116 | + if(substr($xml_dir,-1) != "/") $xml_dir.="/"; | |
117 | + $file_name = $xml_dir.$PMID.".xml"; | |
118 | + $pm_data = array(); | |
119 | + | |
120 | + if(file_exists($file_name)){ | |
121 | + $pubmed_xml = ""; | |
122 | + $file= fopen($file_name, "r"); | |
123 | + while(!feof($file)){ | |
124 | + $pubmed_xml .= fgets($file,1000); | |
125 | + } | |
126 | + fclose($file); | |
127 | + | |
128 | + $pm_data = parseXML( $PMID, $pubmed_xml ); | |
129 | + } | |
130 | + return $pm_data; | |
131 | +} | |
132 | + | |
133 | + | |
134 | +# PubMedKWSearch($keywords, $proxy, $snoopy, $retmax, $retstart) | |
135 | +#----------------------------------------------------------- | |
136 | +# キーワードによりPubMedに対して検索をかける | |
137 | +# | |
138 | +# 引数:$keywords, $proxy, $retmax, $retstart | |
139 | +# $keywords: キーワード | |
140 | +# $proxy: プロキシ情報 | |
141 | +# $snoopy: snoopyインスタンス | |
142 | +# $retmax: 検索件数 | |
143 | +# $retstart: 検索開始番号 | |
144 | +# | |
145 | +# 戻り値:検索結果 | |
146 | +# array[n,r,s,p] | |
147 | +# (array[total,numberPerPage,startNumber,pmid]) | |
148 | +#------------------------------------------------------------ | |
149 | + | |
150 | + | |
151 | +function PubMedKWSearch($keywords, $proxy, $snoopy, $retmax, $retstart){ | |
152 | + | |
153 | + $keywords = rtrim($keywords); | |
154 | + | |
155 | + $url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils"; | |
156 | + | |
157 | + | |
158 | + # Do PubMed search | |
159 | + $startNo = $retstart*$retmax; | |
160 | + $esearch = $url."/esearch.fcgi?db=Pubmed&usehistory=y&retmode=xml&". | |
161 | + "retmax=$retmax&retstart=$retstart&term=".$keywords; | |
162 | + | |
163 | + # Proxy mode | |
164 | + if($proxy){ | |
165 | + $proxy->fetch($esearch); | |
166 | + $pubmed_xml = $proxy->results ; | |
167 | + | |
168 | + # non Proxy mode | |
169 | + }else{ | |
170 | + // change to Snoopy by H.Ikeno 2005/04/18 | |
171 | + $snoopy->fetch($esearch); | |
172 | + $pubmed_xml = $snoopy->results; | |
173 | + } | |
174 | + | |
175 | + #special char replace | |
176 | + $pubmed_xml = special_char_conv($pubmed_xml); | |
177 | + | |
178 | + # Analysis xml data | |
179 | + $pm_data = array(); | |
180 | + $dom = domxml_open_mem($pubmed_xml); | |
181 | + $ctx = xpath_new_context($dom); | |
182 | + $xpath_base = "/eSearchResult"; | |
183 | + | |
184 | + # Number of contents | |
185 | + $xpath = $xpath_base."/Count"; | |
186 | + $x_array = $ctx->xpath_eval($xpath); | |
187 | + if($node = $x_array->nodeset[0]){ | |
188 | + $count = $node->get_content(); | |
189 | + }else{ | |
190 | + $count = 0; | |
191 | + } | |
192 | + $pm_data['n'] = $count; | |
193 | + | |
194 | + # Number of contents in this page | |
195 | + $xpath = $xpath_base."/RetMax"; | |
196 | + $x_array = $ctx->xpath_eval($xpath); | |
197 | + if($node = $x_array->nodeset[0]){ | |
198 | + $retmax = $node->get_content(); | |
199 | + }else{ | |
200 | + $retmax = 0; | |
201 | + } | |
202 | + $pm_data['r'] = $retmax; | |
203 | + | |
204 | + # Start number of contents in this page | |
205 | + $xpath = $xpath_base."/RetStart"; | |
206 | + $x_array = $ctx->xpath_eval($xpath); | |
207 | + if($node = $x_array->nodeset[0]){ | |
208 | + $retstart = $node->get_content(); | |
209 | + }else{ | |
210 | + $retstart = 0; | |
211 | + } | |
212 | + $pm_data['s'] = $retstart; | |
213 | + | |
214 | + # PMID | |
215 | + $array = $dom->get_elements_by_tagname("Id"); | |
216 | + | |
217 | + $pmid = ""; | |
218 | + if(isset($array[0])){ | |
219 | + for($i=0; $i<count($array); $i++){ | |
220 | + $parent = $array[$i]->parent_node(); | |
221 | + $array2 = $parent->get_elements_by_tagname("Id"); | |
222 | + if ( $i != 0 ) $pmid .= ","; | |
223 | + $pmid .= $array2[$i]->get_content(); | |
224 | + } | |
225 | + }else{ | |
226 | + $pmid = ""; | |
227 | + } | |
228 | + $pm_data['p'] = $pmid; | |
229 | + | |
230 | +/* | |
231 | + # Search term | |
232 | + $array = $dom->get_elements_by_tagname("Term"); | |
233 | + | |
234 | + $term = ""; | |
235 | + if($array[0]){ | |
236 | + for($i=0; $i<count($array); $i++){ | |
237 | + $parent = $array[$i]->parent_node(); | |
238 | + $array2 = $parent->get_elements_by_tagname("Term"); | |
239 | + if ( $i != 0 ) $term .= ","; | |
240 | + $word = $array2[$i]->get_content(); | |
241 | + $word = str_replace( '[', '/', $word ); | |
242 | + $word = str_replace( ']', '', $word ); | |
243 | + $term .= $word; | |
244 | + } | |
245 | + }else{ | |
246 | + $term = ""; | |
247 | + } | |
248 | + $pm_data[t] = $term; | |
249 | +*/ | |
250 | + | |
251 | + return $pm_data; | |
252 | +} | |
253 | + | |
254 | +#-------------------------------------------------------# | |
255 | + | |
256 | +function parseXML( $PMID, $pubmed_xml ) { | |
257 | + | |
258 | + #special char replace | |
259 | + $pubmed_xml = special_char_conv($pubmed_xml); | |
260 | + | |
261 | + # Analysis xml data | |
262 | + $pm_data = array(); | |
263 | + $pm_data['id'] = $PMID; | |
264 | + $dom = domxml_open_mem($pubmed_xml); | |
265 | + $ctx = xpath_new_context($dom); | |
266 | + $xpath_base = "/PubmedArticleSet/PubmedArticle/MedlineCitation"; | |
267 | + | |
268 | + # Journal | |
269 | + $xpath = $xpath_base."/MedlineJournalInfo/MedlineTA"; | |
270 | + $x_array = $ctx->xpath_eval($xpath); | |
271 | + if(isset($x_array->nodeset[0])){ | |
272 | + $node = $x_array->nodeset[0]; | |
273 | + $Journal = $node->get_content(); | |
274 | + $Journal = mb_convert_encoding($Journal,"euc-jp","UTF-8"); | |
275 | + }else{ | |
276 | + $Journal = "- unknown - "; | |
277 | + } | |
278 | + $pm_data['j'] = $Journal; | |
279 | + | |
280 | + # Year | |
281 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/PubDate/Year"; | |
282 | + $x_array = $ctx->xpath_eval($xpath); | |
283 | + if(isset($x_array->nodeset[0])){ | |
284 | + $node = $x_array->nodeset[0]; | |
285 | + $Year = $node->get_content(); | |
286 | + $Year = mb_convert_encoding($Year,"euc-jp","UTF-8"); | |
287 | + }else{ | |
288 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/PubDate/MedlineDate"; | |
289 | + $x_array = $ctx->xpath_eval($xpath); | |
290 | + if(isset($x_array->nodeset[0])){ | |
291 | + $node = $x_array->nodeset[0]; | |
292 | + $Year = $node->get_content(); | |
293 | + $Year = mb_convert_encoding($Year,"euc-jp","UTF-8"); | |
294 | + $Year = substr($Year, 0,4); | |
295 | + }else{ | |
296 | + $Year = "0000"; | |
297 | + } | |
298 | + } | |
299 | + $pm_data['y'] = $Year; | |
300 | + | |
301 | + # Volume | |
302 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/Volume"; | |
303 | + $x_array = $ctx->xpath_eval($xpath); | |
304 | + if(isset($x_array->nodeset[0])){ | |
305 | + $node = $x_array->nodeset[0]; | |
306 | + $Volume = $node->get_content(); | |
307 | + $Volume = mb_convert_encoding($Volume,"euc-jp","UTF-8"); | |
308 | + }else{ | |
309 | + $Volume = ""; | |
310 | + } | |
311 | + $pm_data['v'] = $Volume; | |
312 | + | |
313 | + # Page | |
314 | + $xpath = $xpath_base."/Article/Pagination/MedlinePgn"; | |
315 | + $x_array = $ctx->xpath_eval($xpath); | |
316 | + if(isset($x_array->nodeset[0])){ | |
317 | + $node = $x_array->nodeset[0]; | |
318 | + $Page = $node->get_content(); | |
319 | + $Page = mb_convert_encoding($Page,"euc-jp","UTF-8"); | |
320 | + }else{ | |
321 | + $Page = ""; | |
322 | + } | |
323 | + $pm_data['p'] = $Page; | |
324 | + | |
325 | + # Abstract | |
326 | + $array = $dom->get_elements_by_tagname("AbstractText"); | |
327 | + if(isset($array[0])){ | |
328 | + $Abst = $array[0]->get_content(); | |
329 | + $Abst = mb_convert_encoding($Abst,"euc-jp","UTF-8"); | |
330 | + }else{ | |
331 | + $Abst = ""; | |
332 | + } | |
333 | + $pm_data['ab'] = $Abst; | |
334 | + | |
335 | + # Title | |
336 | + $array = $dom->get_elements_by_tagname("ArticleTitle"); | |
337 | + if($array[0]){ | |
338 | + $Title = $array[0]->get_content(); | |
339 | + $Title = mb_convert_encoding($Title,"euc-jp","UTF-8"); | |
340 | + }else{ | |
341 | + $Title = "- unknown -"; | |
342 | + } | |
343 | + $pm_data['t'] = $Title; | |
344 | + | |
345 | + | |
346 | + # Authors | |
347 | + $array = $dom->get_elements_by_tagname("Author"); | |
348 | + $Authors = ''; | |
349 | + if($array[0]){ | |
350 | + for($i=0; $i<count($array); $i++){ | |
351 | + $parent = $array[$i]->parent_node(); | |
352 | + | |
353 | + $array2 = $parent->get_elements_by_tagname("LastName"); | |
354 | + if($array2[$i]){ | |
355 | + $LastName = $array2[$i]->get_content(); | |
356 | + | |
357 | + $array2 = $parent->get_elements_by_tagname("Initials"); | |
358 | + if($array2[$i]){ | |
359 | + $Initials = $array2[$i]->get_content(); | |
360 | + }else{ | |
361 | + $array2 = $parent->get_elements_by_tagname("ForeName"); | |
362 | + if($array2[$i]){ | |
363 | + $Initials = $array2[$i]->get_content(); | |
364 | + } | |
365 | + } | |
366 | + $Authors .= $LastName." ".$Initials.", "; | |
367 | + $Authors = mb_convert_encoding($Authors,"euc-jp","UTF-8"); | |
368 | + } | |
369 | + } | |
370 | + $Authors = substr($Authors, 0, strlen($Authors)-2); | |
371 | + }else{ | |
372 | + $Authors = ""; | |
373 | + } | |
374 | + $pm_data['a'] = $Authors; | |
375 | + | |
376 | + return $pm_data; | |
377 | +} | |
378 | + | |
379 | + | |
380 | +function special_char_conv($str){ | |
381 | + | |
382 | + require_once 'class/functions.php'; | |
383 | + $fn = new functions(); | |
384 | + return $fn->special_char_conv($str); | |
385 | +} | |
386 | + | |
387 | +?> |
@@ -0,0 +1,37 @@ | ||
1 | +<?php | |
2 | +# お気に入り登録用スクリプト created by n_takuto | |
3 | + | |
4 | + include '../../../mainfile.php'; | |
5 | + if(is_object($xoopsUser)){ | |
6 | + $user = $xoopsUser->getVar('uname'); | |
7 | + }else{ | |
8 | + $user = 'guest'; | |
9 | + } | |
10 | + | |
11 | + # 文献IDのチェック | |
12 | + if(isset($_GET['id'])){ | |
13 | + $id = intval($_GET['id']); | |
14 | + | |
15 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_id')." WHERE id='".$id."'"; | |
16 | + $res = $xoopsDB->query($sql); | |
17 | + if(!$xoopsDB->getRowsNum($res)){ | |
18 | + redirect_header(MOD_URL, 2, _MD_DOSENTEXIST); | |
19 | + } | |
20 | + | |
21 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_favorite_data'); | |
22 | + $sql.= " VALUES('','".$id."','0','".$user."','')"; | |
23 | + $res = $xoopsDB->queryF($sql); | |
24 | + | |
25 | + # favorite counter | |
26 | + $sql = "SELECT F_num FROM ".$xoopsDB->prefix('pmid_id')." WHERE id='".$id."'"; | |
27 | + $res = $xoopsDB->query($sql); | |
28 | + $row = $xoopsDB->fetchArray($res); | |
29 | + $n = $row['F_num'] + 1; | |
30 | + $sql = "UPDATE ".$xoopsDB->prefix('pmid_id')." SET F_num='".$n."' WHERE id='".$id."'"; | |
31 | + $res = $xoopsDB->queryF($sql); | |
32 | + } | |
33 | + | |
34 | + include XOOPS_ROOT_PATH.'/header.php'; | |
35 | + echo "<script>window.history.back();</script>"; | |
36 | + include XOOPS_ROOT_PATH.'/footer.php'; | |
37 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,67 @@ | ||
1 | +<?php | |
2 | +# コメントフォーム表示用スクリプト created by n_takuto | |
3 | + | |
4 | + if (!defined('XOOPS_ROOT_PATH')) { exit(); } | |
5 | + | |
6 | + include_once XOOPS_ROOT_PATH.'/include/xoopscodes.php'; | |
7 | + $pub = _MD_NOTE_PUB; | |
8 | + $pri = _MD_NOTE_PRI; | |
9 | + $message = _MD_NOTE_MES; | |
10 | + if($nid){ | |
11 | + $nattach = _MD_NOTE_ATTACHED_EDIT; | |
12 | + }else{ | |
13 | + $nattach = _MD_NOTE_ATTACHED; | |
14 | + } | |
15 | + | |
16 | + echo "<form enctype='multipart/form-data' action='note.php' method='POST'>"; | |
17 | + echo <<<E | |
18 | + <table class='outer'> | |
19 | + <tr> | |
20 | + <td class='head'><b>$message</b></td> | |
21 | + <td class='even'> | |
22 | +E; | |
23 | + xoopsCodeTarea('note'); | |
24 | + xoopsSmilies('note'); | |
25 | + echo <<<E | |
26 | + </td> | |
27 | + </tr> | |
28 | + <tr> | |
29 | + <td class='head'><b>$nattach</b></td> | |
30 | + <td class='even'><input type='file' name='userfile'> | |
31 | +E; | |
32 | + if($nid){ | |
33 | + echo " <input type='checkbox' name='del_file'>"._MD_NOTE_ATTACHED_DEL; | |
34 | + } | |
35 | + echo <<<E | |
36 | + </td> | |
37 | + </tr> | |
38 | + <tr> | |
39 | + <td class='head'><b>$pub/$pri</b></td> | |
40 | + <td class='even'> | |
41 | +E; | |
42 | + if(isset($pflg) && $pflg == 1){ | |
43 | + echo "<input type='radio' value='1' name='pflg' checked>".$pub; | |
44 | + echo "<input type='radio' value='0' name='pflg'>".$pri; | |
45 | + }else{ | |
46 | + echo "<input type='radio' value='1' name='pflg'>".$pub; | |
47 | + echo "<input type='radio' value='0' name='pflg' checked>".$pri; | |
48 | + } | |
49 | + echo <<<E | |
50 | + </td> | |
51 | + </tr> | |
52 | + <tr> | |
53 | + <td class='head'> </td> | |
54 | + <td class='even'> | |
55 | + <input type='submit' class='button' name='submit' value='submit'> | |
56 | + </td> | |
57 | + </tr> | |
58 | + </table> | |
59 | + <input type='hidden' name='mode' value='$mode'> | |
60 | + <input type='hidden' name='mid' value='$mid'> | |
61 | +E; | |
62 | + if($nid){ | |
63 | + echo "<input type='hidden' name='nid' value='".$nid."'>"; | |
64 | + } | |
65 | + echo "</form>"; | |
66 | + | |
67 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,47 @@ | ||
1 | +<?php | |
2 | +# ジャーナル、著者の排除用スクリプト created by n_takuto | |
3 | + | |
4 | + # $j = journal name | |
5 | + function rmJournal($j){ | |
6 | + global $xoopsDB; | |
7 | + | |
8 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_id')." WHERE Journal='".$j."'"; | |
9 | + $res = $xoopsDB->query($sql); | |
10 | + if(!$xoopsDB->getRowsNum($res)){ | |
11 | + $sql = "DELETE FROM ".$xoopsDB->prefix('pmid_journal')." WHERE id='".$j."'"; | |
12 | + $res = $xoopsDB->query($sql); | |
13 | + if($res) return true; | |
14 | + } | |
15 | + return false; | |
16 | + } | |
17 | + | |
18 | + | |
19 | + # $a = [1], [2], ... | |
20 | + function rmAuthor($a){ | |
21 | + global $xoopsDB; | |
22 | + $ret = ''; | |
23 | + $a = explode(',', substr($a, 0, -1)); | |
24 | + for($k=0; $k<count($a); $k++){ | |
25 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_id')." WHERE Author LIKE '%".$a[$k]."%'"; | |
26 | + $res = $xoopsDB->query($sql); | |
27 | + if(!$xoopsDB->getRowsNum($res)){ | |
28 | + $a[$k] = str_replace('[', '', $a[$k]); | |
29 | + $a[$k] = str_replace(']', '', $a[$k]); | |
30 | + $sql = "SELECT Author FROM ".$xoopsDB->prefix('pmid_author')." WHERE id='".$a[$k]."'"; | |
31 | + $res = $xoopsDB->query($sql); | |
32 | + $row = $xoopsDB->fetchArray($res); | |
33 | + $author = $row['Author']; | |
34 | + | |
35 | + $sql = "DELETE FROM ".$xoopsDB->prefix('pmid_author')." WHERE id='".$a[$k]."'"; | |
36 | + $res = $xoopsDB->query($sql); | |
37 | + if($res) $ret.= $author.", "; | |
38 | + } | |
39 | + } | |
40 | + if($ret){ | |
41 | + return $ret; | |
42 | + }else{ | |
43 | + return false; | |
44 | + } | |
45 | + } | |
46 | + | |
47 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,27 @@ | ||
1 | +<?php | |
2 | +# PMIDなし用XMLファイル名生成スクリプト created by h_ikeno | |
3 | + | |
4 | +function wopmid($year, $author, $journal, $volume, $pages, $title){ | |
5 | + | |
6 | + $title = substr( trim($title), 0, 10 ); | |
7 | + | |
8 | + if($year == '0') $year = '0000'; | |
9 | + $wopmid_id = $year."_".$author."_" | |
10 | + .$journal."_".$volume."_".$pages."_".$title; | |
11 | + | |
12 | + // echo "before: $wopmid_id"."<br>"; | |
13 | + | |
14 | + $wopmid_id = htmlspecialchars( $wopmid_id, ENT_NOQUOTES ); | |
15 | + $wopmid_id = str_replace( | |
16 | + array(' ', ',', '&', '\'', ':', ';', '%', '?', '!', '#', '\\', | |
17 | + '/', '"', '*', '|', '>', '<'), | |
18 | + array('_', '~', 'A', 'D' , 'C', 'S', 'P', 'Q', 'X', 'S', 'I' , | |
19 | + 'L', 'B', 'M', 'O', 'G', 'L'), | |
20 | + $wopmid_id ); | |
21 | + | |
22 | + // echo "after: $wopmid_id"."<br>"; | |
23 | + | |
24 | + return $wopmid_id; | |
25 | +} | |
26 | + | |
27 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,307 @@ | ||
1 | +<?php | |
2 | +# PMIDなし用XML生成スクリプト created by h_ikeno | |
3 | + | |
4 | +if (version_compare(PHP_VERSION,'5','>=')) require_once(MOD_PATH.'/include/domxml-php4-to-php5.php'); | |
5 | + | |
6 | +# GENERATE_XML() | |
7 | +#------------------------------------------------------------------ | |
8 | +# Generating XML file for registered bibliography | |
9 | +# | |
10 | +# arguments: | |
11 | +#------------------------------------------------------------------- | |
12 | + | |
13 | +function GENERATE_XML($data){ | |
14 | + global $xoopsDB; | |
15 | + | |
16 | + $t = $data['t']; // Title | |
17 | + $t_jp = $data['t_jp']; // Title(jp) | |
18 | + $y = $data['y']; // Year | |
19 | + $a = $data['a']; // Authors | |
20 | + $a_jp = $data['a_jp']; // Authors(jp) | |
21 | + $j = $data['j']; // Journal | |
22 | + $jb = $data['jb']; // Journal or Book | |
23 | + $v = $data['v']; // Volume | |
24 | + $p = $data['p']; // Pages | |
25 | + $ab = $data['ab']; // Abstract | |
26 | + $c_t1 = $data['c_t1']; // ID text | |
27 | + | |
28 | + $sql = "select * from ".$xoopsDB->prefix('pmid_journal')." where Journal='".$j."'"; | |
29 | + $res = $xoopsDB->query($sql); | |
30 | + $row = $xoopsDB->fetchArray($res); | |
31 | + $j_JP = $row["Journal_JP"]; | |
32 | + | |
33 | + $dir = MOD_PATH.'/'.UPXML; | |
34 | + $file_name = $c_t1.".xml"; | |
35 | + $file= fopen( $dir.'/'.$file_name, "w" ); | |
36 | + | |
37 | + $fileDTD = fopen( MOD_PATH."/include/PubmedPDF.dtd", "r" ); | |
38 | + | |
39 | + while(!feof($fileDTD)){ | |
40 | + $lineDTD = fgets($fileDTD,1000); | |
41 | + fwrite( $file, $lineDTD ); | |
42 | + } | |
43 | + | |
44 | +// start to generate XML file | |
45 | + | |
46 | + fwrite( $file, "<ppdfArticleSet>\n" ); | |
47 | + fwrite( $file, "<ppdfArticle>\n" ); | |
48 | + | |
49 | +// Index | |
50 | + fwrite( $file, "<ppdfIndex>" ); | |
51 | + fwrite( $file, $c_t1 ); | |
52 | + fwrite( $file, "</ppdfIndex>" ); | |
53 | + | |
54 | +// Date | |
55 | + $date_array = getdate(); | |
56 | + fwrite( $file, "<DateCreated>\n" ); | |
57 | + fwrite( $file, "<Year>".$date_array["year"]."</Year>" ); | |
58 | + fwrite( $file, "<Month>".$date_array["mon"]."</Month>" ); | |
59 | + fwrite( $file, "<Day>".$date_array["mday"]."</Day>" ); | |
60 | + fwrite( $file, "</DateCreated>\n" ); | |
61 | + fwrite( $file, "<Article PubModel=\"Print\">" ); | |
62 | + | |
63 | +// Journal | |
64 | + fwrite( $file, "<Journal>\n" ); | |
65 | + fwrite( $file, "<JournalIssue PrintYN=\"Y\">\n" ); | |
66 | + fwrite( $file, "<Volume>$v</Volume>\n" ); | |
67 | + fwrite( $file, "<PubDate>\n" ); | |
68 | + fwrite( $file, "<Year>$y</Year>\n" ); | |
69 | + fwrite( $file, "</PubDate>\n" ); | |
70 | + fwrite( $file, "</JournalIssue>\n" ); | |
71 | + fwrite( $file, "</Journal>\n" ); | |
72 | + | |
73 | +// Article | |
74 | + fwrite( $file, "<ArticleTitle>$t</ArticleTitle>\n" ); | |
75 | + fwrite( $file, "<ArticleTitleJP>$t_jp</ArticleTitleJP>\n" ); | |
76 | + fwrite( $file, "<Pagination>\n" ); | |
77 | + fwrite( $file, "<MedlinePgn>$p</MedlinePgn>\n" ); | |
78 | + fwrite( $file, "</Pagination>\n" ); | |
79 | + fwrite( $file, "<Abstract>$ab</Abstract>\n" ); | |
80 | + | |
81 | +// Author | |
82 | + fwrite( $file, "<AuthorList CompleteYN=\"Y\">\n" ); | |
83 | + $Authors = explode(",",$a); | |
84 | + foreach($Authors as $Author){ | |
85 | + $Author = trim($Author); | |
86 | + $i = explode(" ", $Author); | |
87 | + $Lname = $i[0]; | |
88 | + $Fname = $i[1]; | |
89 | + fwrite( $file, "<Author>\n" ); | |
90 | + fwrite( $file, "<LastName>$Lname</LastName>\n" ); | |
91 | + fwrite( $file, "<ForeName>$Fname</ForeName>\n" ); | |
92 | + fwrite( $file, "<Initials>$Fname</Initials>\n" ); | |
93 | + fwrite( $file, "</Author>\n" ); | |
94 | + } | |
95 | + fwrite( $file, "</AuthorList>\n" ); | |
96 | + fwrite( $file, "<AuthorListJP>$a_jp</AuthorListJP>\n" ); | |
97 | + | |
98 | +// Language | |
99 | + if (strlen($t_jp) != 0) { | |
100 | + fwrite( $file, "<Language>jp</Language>\n" ); | |
101 | + } else { | |
102 | + fwrite( $file, "<Language>eng</Language>\n" ); | |
103 | + } | |
104 | + fwrite( $file, "<PublicationTypeList>\n" ); | |
105 | + | |
106 | + if ($jb == "j" ) { | |
107 | + fwrite( $file, "<PublicationType>Journal Article</PublicationType>\n" ); | |
108 | + } else { | |
109 | + fwrite( $file, "<PublicationType>Book</PublicationType>\n" ); | |
110 | + } | |
111 | + fwrite( $file, "</PublicationTypeList>\n" ); | |
112 | + fwrite( $file, "</Article>" ); | |
113 | + | |
114 | +// Journal | |
115 | + fwrite( $file, "<MedlineJournalInfo>\n" ); | |
116 | + fwrite( $file, "<MedlineTA>$j</MedlineTA>\n" ); | |
117 | + fwrite( $file, "</MedlineJournalInfo>\n" ); | |
118 | + | |
119 | +// Journal JP | |
120 | + fwrite( $file, "<JournalJPInfo>\n" ); | |
121 | + fwrite( $file, "<JournalJP>$j_JP</JournalJP>\n" ); | |
122 | + fwrite( $file, "</JournalJPInfo>\n" ); | |
123 | + fwrite( $file, "</ppdfArticle>\n" ); | |
124 | + fwrite( $file, "</ppdfArticleSet>\n" ); | |
125 | + | |
126 | + fclose($file); | |
127 | + fclose($fileDTD); | |
128 | +} | |
129 | + | |
130 | + | |
131 | +function RETRIEVE_XML($dir, $file) { | |
132 | + | |
133 | + $file_name = $dir.'/'.$file; | |
134 | + if(!file_exists($file_name)) return false; | |
135 | + $wopmid_xml = ''; | |
136 | + | |
137 | + $file= fopen($file_name, "r"); | |
138 | + while(!feof($file)){ | |
139 | + $wopmid_xml .= fgets($file,1000); | |
140 | + } | |
141 | + fclose($file); | |
142 | + | |
143 | + # Analysis xml data | |
144 | + $pm_data = array(); | |
145 | + $dom = domxml_open_mem($wopmid_xml); | |
146 | + $ctx = xpath_new_context($dom); | |
147 | + $xpath_base = "/ppdfArticleSet/ppdfArticle"; | |
148 | + | |
149 | + # Journal | |
150 | + $xpath = $xpath_base."/MedlineJournalInfo/MedlineTA"; | |
151 | + $x_array = $ctx->xpath_eval($xpath); | |
152 | + if($node = $x_array->nodeset[0]){ | |
153 | + $Journal = $node->get_content(); | |
154 | + $Journal = mb_convert_encoding($Journal,"euc-jp","UTF-8"); | |
155 | + $Journal = special_char_conv($Journal); | |
156 | + }else{ | |
157 | + $Journal = "- unknown - "; | |
158 | + } | |
159 | + $pm_data['j'] = $Journal; | |
160 | + | |
161 | + # Year | |
162 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/PubDate/Year"; | |
163 | + $x_array = $ctx->xpath_eval($xpath); | |
164 | + if($node = $x_array->nodeset[0]){ | |
165 | + $Year = $node->get_content(); | |
166 | + $Year = mb_convert_encoding($Year,"euc-jp","UTF-8"); | |
167 | + }else{ | |
168 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/PubDate/MedlineDate"; | |
169 | + $x_array = $ctx->xpath_eval($xpath); | |
170 | + if($node = $x_array->nodeset[0]){ | |
171 | + $Year = $node->get_content(); | |
172 | + $Year = mb_convert_encoding($Year,"euc-jp","UTF-8"); | |
173 | + $Year = substr($Year, 0,4); | |
174 | + }else{ | |
175 | + $Year = "0000"; | |
176 | + } | |
177 | + } | |
178 | + $pm_data['y'] = $Year; | |
179 | + | |
180 | + # Volume | |
181 | + $xpath = $xpath_base."/Article/Journal/JournalIssue/Volume"; | |
182 | + $x_array = $ctx->xpath_eval($xpath); | |
183 | + if($node = $x_array->nodeset[0]){ | |
184 | + $Volume = $node->get_content(); | |
185 | + $Volume = mb_convert_encoding($Volume,"euc-jp","UTF-8"); | |
186 | + }else{ | |
187 | + $Volume = ""; | |
188 | + } | |
189 | + $pm_data['v'] = $Volume; | |
190 | + | |
191 | + # Page | |
192 | + $xpath = $xpath_base."/Article/Pagination/MedlinePgn"; | |
193 | + $x_array = $ctx->xpath_eval($xpath); | |
194 | + if($node = $x_array->nodeset[0]){ | |
195 | + $Page = $node->get_content(); | |
196 | + $Page = mb_convert_encoding($Page,"euc-jp","UTF-8"); | |
197 | + }else{ | |
198 | + $Page = ""; | |
199 | + } | |
200 | + $pm_data['p'] = $Page; | |
201 | + | |
202 | + # Abstract | |
203 | + $array = $dom->get_elements_by_tagname("AbstractText"); | |
204 | + if($array[0]){ | |
205 | + $Abst = $array[0]->get_content(); | |
206 | + $Abst = mb_convert_encoding($Abst,"euc-jp","UTF-8"); | |
207 | + $Abst = special_char_conv($Abst); | |
208 | + }else{ | |
209 | + $Abst = ""; | |
210 | + } | |
211 | + $pm_data['ab'] = $Abst; | |
212 | + | |
213 | + # Title | |
214 | + $array = $dom->get_elements_by_tagname("ArticleTitle"); | |
215 | + if($array[0]){ | |
216 | + $Title = $array[0]->get_content(); | |
217 | + $Title = mb_convert_encoding($Title,"euc-jp","UTF-8"); | |
218 | + $Title = special_char_conv($Title); | |
219 | + }else{ | |
220 | + $Title = "- unknown -"; | |
221 | + } | |
222 | + $pm_data['t'] = $Title; | |
223 | + | |
224 | + # Authors | |
225 | + $Authors =''; | |
226 | + $array = $dom->get_elements_by_tagname("Author"); | |
227 | + if($array[0]){ | |
228 | + for($i=0; $i<count($array); $i++){ | |
229 | + $parent = $array[$i]->parent_node(); | |
230 | + $array2 = $parent->get_elements_by_tagname("LastName"); | |
231 | + $LastName = $array2[$i]->get_content(); | |
232 | + $array2 = $parent->get_elements_by_tagname("Initials"); | |
233 | + | |
234 | + if($array2[$i]){ | |
235 | + $Initials = $array2[$i]->get_content(); | |
236 | + }else{ | |
237 | + $array2 = $parent->get_elements_by_tagname("ForeName"); | |
238 | + if($array2[$i]){ | |
239 | + $Initials = $array2[$i]->get_content(); | |
240 | + } | |
241 | + } | |
242 | + $Authors .= $LastName." ".$Initials.", "; | |
243 | + $Authors = mb_convert_encoding($Authors,"euc-jp","UTF-8"); | |
244 | + $Authors = special_char_conv($Authors); | |
245 | + } | |
246 | + $Authors = substr($Authors, 0, strlen($Authors)-2); | |
247 | + } | |
248 | + $pm_data['a'] = $Authors; | |
249 | + | |
250 | + # title JP | |
251 | + $xpath = $xpath_base."/Article/ArticleTitleJP"; | |
252 | + $x_array = $ctx->xpath_eval($xpath); | |
253 | + if($node = $x_array->nodeset[0]){ | |
254 | + $titleJP = $node->get_content(); | |
255 | + $titleJP = mb_convert_encoding($titleJP,"euc-jp","UTF-8"); | |
256 | + $titleJP = special_char_conv($titleJP); | |
257 | + }else{ | |
258 | + $titleJP = ""; | |
259 | + } | |
260 | + $pm_data['t_jp'] = $titleJP; | |
261 | + | |
262 | + # Author JP | |
263 | + $xpath = $xpath_base."/Article/AuthorListJP"; | |
264 | + $x_array = $ctx->xpath_eval($xpath); | |
265 | + if($node = $x_array->nodeset[0]){ | |
266 | + $authorJP = $node->get_content(); | |
267 | + $authorJP = mb_convert_encoding($authorJP,"euc-jp","UTF-8"); | |
268 | + $authorJP = special_char_conv($authorJP); | |
269 | + }else{ | |
270 | + $authorJP = ""; | |
271 | + } | |
272 | + $pm_data['a_jp'] = $authorJP; | |
273 | + | |
274 | + # Journal JP | |
275 | + $xpath = $xpath_base."/JournalJPInfo/JournalJP"; | |
276 | + $x_array = $ctx->xpath_eval($xpath); | |
277 | + if($node = $x_array->nodeset[0]){ | |
278 | + $journalJP = $node->get_content(); | |
279 | + $journalJP = mb_convert_encoding($journalJP,"euc-jp","UTF-8"); | |
280 | + $journalJP = special_char_conv($journalJP); | |
281 | + }else{ | |
282 | + $journalJP = ""; | |
283 | + } | |
284 | + $pm_data['j_jp'] = $journalJP; | |
285 | + | |
286 | + # ID | |
287 | + $xpath = $xpath_base."/ppdfIndex"; | |
288 | + $x_array = $ctx->xpath_eval($xpath); | |
289 | + if($node = $x_array->nodeset[0]){ | |
290 | + $c_t1 = $node->get_content(); | |
291 | + $c_t1 = mb_convert_encoding($c_t1,"euc-jp","UTF-8"); | |
292 | + $c_t1 = special_char_conv($c_t1); | |
293 | + }else{ | |
294 | + $journalJP = ""; | |
295 | + } | |
296 | + $pm_data['c_t1'] = $c_t1; | |
297 | + | |
298 | + return $pm_data; | |
299 | +} | |
300 | + | |
301 | + | |
302 | +function special_char_conv($str){ | |
303 | + | |
304 | + require_once 'class/functions.php'; | |
305 | + $fn = new functions(); | |
306 | + return $fn->special_char_conv($str); | |
307 | +} | |
\ No newline at end of file |
@@ -0,0 +1,16 @@ | ||
1 | +<?php | |
2 | +# 登録された文献リスト取得用スクリプト created by n_takuto | |
3 | + | |
4 | + header("Content-disposition:attachment;filename=data.txt"); | |
5 | + header("Content-type:application/octet-stream;name=data.txt"); | |
6 | + | |
7 | + if(file_exists("../datalist.txt")){ | |
8 | + $fp = fopen("../datalist.txt", "r"); | |
9 | + while(!feof($fp)){ | |
10 | + echo fgets($fp); | |
11 | + } | |
12 | + fclose($fp); | |
13 | + unlink("../datalist.txt"); | |
14 | + } | |
15 | + | |
16 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,318 @@ | ||
1 | +<?php | |
2 | +/* | |
3 | + Require PHP5, uses built-in DOM extension. | |
4 | + To be used in PHP4 scripts using DOMXML extension. | |
5 | + Allows PHP4/DOMXML scripts to run on PHP5/DOM. | |
6 | + (Requires PHP5/XSL extension for domxml_xslt functions) | |
7 | + | |
8 | + Typical use: | |
9 | + { | |
10 | + if (version_compare(PHP_VERSION,'5','>=')) | |
11 | + require_once('domxml-php4-to-php5.php'); | |
12 | + } | |
13 | + | |
14 | + Version 1.7.2, 2005-09-08, http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ | |
15 | + | |
16 | + ------------------------------------------------------------------ | |
17 | + Written by Alexandre Alapetite, http://alexandre.alapetite.net/cv/ | |
18 | + | |
19 | + Copyright 2004-2005, Licence: Creative Commons "Attribution-ShareAlike 2.0 France" BY-SA (FR), | |
20 | + http://creativecommons.org/licenses/by-sa/2.0/fr/ | |
21 | + http://alexandre.alapetite.net/divers/apropos/#by-sa | |
22 | + - Attribution. You must give the original author credit | |
23 | + - Share Alike. If you alter, transform, or build upon this work, | |
24 | + you may distribute the resulting work only under a license identical to this one | |
25 | + - The French law is authoritative | |
26 | + - Any of these conditions can be waived if you get permission from Alexandre Alapetite | |
27 | + - Please send to Alexandre Alapetite the modifications you make, | |
28 | + in order to improve this file for the benefit of everybody | |
29 | + | |
30 | + If you want to distribute this code, please do it as a link to: | |
31 | + http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/ | |
32 | +*/ | |
33 | + | |
34 | +function domxml_new_doc($version) {return new php4DOMDocument('');} | |
35 | +function domxml_open_file($filename) {return new php4DOMDocument($filename);} | |
36 | +function domxml_open_mem($str) | |
37 | +{ | |
38 | + $dom=new php4DOMDocument(''); | |
39 | + $dom->myDOMNode->loadXML($str); | |
40 | + return $dom; | |
41 | +} | |
42 | +function xpath_eval($xpath_context,$eval_str,$contextnode=null) {return $xpath_context->xpath_eval($eval_str,$contextnode);} | |
43 | +function xpath_new_context($dom_document) {return new php4DOMXPath($dom_document);} | |
44 | +function xpath_register_ns($xpath_context,$prefix,$namespaceURI) {return $xpath_context->myDOMXPath->registerNamespace($prefix,$namespaceURI);} | |
45 | + | |
46 | +class php4DOMAttr extends php4DOMNode | |
47 | +{ | |
48 | + function php4DOMAttr($aDOMAttr) {$this->myDOMNode=$aDOMAttr;} | |
49 | + function __get($name) | |
50 | + { | |
51 | + if ($name=='name') return $this->myDOMNode->name; | |
52 | + elseif ($name=='value') return $this->myDOMNode->value; | |
53 | + return parent::__get($name); | |
54 | + } | |
55 | + function name() {return $this->myDOMNode->name;} | |
56 | + function set_value($content) {return $this->myDOMNode->value=$content;} | |
57 | + function specified() {return $this->myDOMNode->specified;} | |
58 | + function value() {return $this->myDOMNode->value;} | |
59 | +} | |
60 | + | |
61 | +class php4DOMDocument extends php4DOMNode | |
62 | +{ | |
63 | + function php4DOMDocument($filename='') | |
64 | + { | |
65 | + $this->myDOMNode=new DOMDocument(); | |
66 | + $this->myOwnerDocument=$this; | |
67 | + if ($filename!='') $this->myDOMNode->load($filename); | |
68 | + } | |
69 | + function add_root($name) | |
70 | + { | |
71 | + if ($this->myDOMNode->hasChildNodes()) $this->myDOMNode->removeChild($this->myDOMNode->firstChild); | |
72 | + return new php4DOMElement($this->myDOMNode->appendChild($this->myDOMNode->createElement($name)),$this->myOwnerDocument); | |
73 | + } | |
74 | + function create_attribute($name,$value) | |
75 | + { | |
76 | + $myAttr=$this->myDOMNode->createAttribute($name); | |
77 | + $myAttr->value=$value; | |
78 | + return new php4DOMAttr($myAttr,$this); | |
79 | + } | |
80 | + function create_cdata_section($content) {return new php4DOMNode($this->myDOMNode->createCDATASection($content),$this);} | |
81 | + function create_comment($data) {return new php4DOMNode($this->myDOMNode->createComment($data),$this);} | |
82 | + function create_element($name) {return new php4DOMElement($this->myDOMNode->createElement($name),$this);} | |
83 | + function create_text_node($content) {return new php4DOMNode($this->myDOMNode->createTextNode($content),$this);} | |
84 | + function document_element() {return $this->_newDOMElement($this->myDOMNode->documentElement,$this);} | |
85 | + function dump_file($filename,$compressionmode=false,$format=false) | |
86 | + { | |
87 | + $format0=$this->myDOMNode->formatOutput; | |
88 | + $this->myDOMNode->formatOutput=$format; | |
89 | + $res=$this->myDOMNode->save($filename); | |
90 | + $this->myDOMNode->formatOutput=$format0; | |
91 | + return $res; | |
92 | + } | |
93 | + function dump_mem($format=false,$encoding=false) | |
94 | + { | |
95 | + $format0=$this->myDOMNode->formatOutput; | |
96 | + $this->myDOMNode->formatOutput=$format; | |
97 | + $encoding0=$this->myDOMNode->encoding; | |
98 | + if ($encoding) $this->myDOMNode->encoding=$encoding; | |
99 | + $dump=$this->myDOMNode->saveXML(); | |
100 | + $this->myDOMNode->formatOutput=$format0; | |
101 | + if ($encoding) $this->myDOMNode->encoding= $encoding0=='' ? 'UTF-8' : $encoding0; //UTF-8 is XML default encoding | |
102 | + return $dump; | |
103 | + } | |
104 | + function dump_node($node) {return $this->myDOMNode->saveXML($node->myDOMNode);} | |
105 | + function free() | |
106 | + { | |
107 | + if ($this->myDOMNode->hasChildNodes()) $this->myDOMNode->removeChild($this->myDOMNode->firstChild); | |
108 | + $this->myDOMNode=null; | |
109 | + $this->myOwnerDocument=null; | |
110 | + } | |
111 | + function get_element_by_id($id) {return $this->_newDOMElement($this->myDOMNode->getElementById($id),$this);} | |
112 | + function get_elements_by_tagname($name) | |
113 | + { | |
114 | + $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name); | |
115 | + $nodeSet=array(); | |
116 | + $i=0; | |
117 | + if (isset($myDOMNodeList)) | |
118 | + while ($node=$myDOMNodeList->item($i)) | |
119 | + { | |
120 | + $nodeSet[]=new php4DOMElement($node,$this); | |
121 | + $i++; | |
122 | + } | |
123 | + return $nodeSet; | |
124 | + } | |
125 | + function html_dump_mem() {return $this->myDOMNode->saveHTML();} | |
126 | + function root() {return $this->_newDOMElement($this->myDOMNode->documentElement,$this);} | |
127 | + function xpath_new_context() {return new php4DOMXPath($this);} | |
128 | +} | |
129 | + | |
130 | +class php4DOMElement extends php4DOMNode | |
131 | +{ | |
132 | + function get_attribute($name) {return $this->myDOMNode->getAttribute($name);} | |
133 | + function get_elements_by_tagname($name) | |
134 | + { | |
135 | + $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name); | |
136 | + $nodeSet=array(); | |
137 | + $i=0; | |
138 | + if (isset($myDOMNodeList)) | |
139 | + while ($node=$myDOMNodeList->item($i)) | |
140 | + { | |
141 | + $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument); | |
142 | + $i++; | |
143 | + } | |
144 | + return $nodeSet; | |
145 | + } | |
146 | + function has_attribute($name) {return $this->myDOMNode->hasAttribute($name);} | |
147 | + function remove_attribute($name) {return $this->myDOMNode->removeAttribute($name);} | |
148 | + function set_attribute($name,$value) {return $this->myDOMNode->setAttribute($name,$value);} | |
149 | + function tagname() {return $this->myDOMNode->tagName;} | |
150 | +} | |
151 | + | |
152 | +class php4DOMNode | |
153 | +{ | |
154 | + var $myDOMNode; | |
155 | + var $myOwnerDocument; | |
156 | + function php4DOMNode($aDomNode,$aOwnerDocument) | |
157 | + { | |
158 | + $this->myDOMNode=$aDomNode; | |
159 | + $this->myOwnerDocument=$aOwnerDocument; | |
160 | + } | |
161 | + function __get($name) | |
162 | + { | |
163 | + if ($name=='type') return $this->myDOMNode->nodeType; | |
164 | + elseif ($name=='tagname') return $this->myDOMNode->tagName; | |
165 | + elseif ($name=='content') return $this->myDOMNode->textContent; | |
166 | + else | |
167 | + { | |
168 | + $myErrors=debug_backtrace(); | |
169 | + trigger_error('Undefined property: '.get_class($this).'::$'.$name.' ['.$myErrors[0]['file'].':'.$myErrors[0]['line'].']',E_USER_NOTICE); | |
170 | + return false; | |
171 | + } | |
172 | + } | |
173 | + function append_child($newnode) {return new php4DOMElement($this->myDOMNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);} | |
174 | + function append_sibling($newnode) {return new php4DOMElement($this->myDOMNode->parentNode->appendChild($this->_importNode($newnode)),$this->myOwnerDocument);} | |
175 | + function attributes() | |
176 | + { | |
177 | + $myDOMNodeList=$this->myDOMNode->attributes; | |
178 | + $nodeSet=array(); | |
179 | + $i=0; | |
180 | + if (isset($myDOMNodeList)) | |
181 | + while ($node=$myDOMNodeList->item($i)) | |
182 | + { | |
183 | + $nodeSet[]=new php4DOMAttr($node,$this->myOwnerDocument); | |
184 | + $i++; | |
185 | + } | |
186 | + return $nodeSet; | |
187 | + } | |
188 | + function child_nodes() | |
189 | + { | |
190 | + $myDOMNodeList=$this->myDOMNode->childNodes; | |
191 | + $nodeSet=array(); | |
192 | + $i=0; | |
193 | + if (isset($myDOMNodeList)) | |
194 | + while ($node=$myDOMNodeList->item($i)) | |
195 | + { | |
196 | + $nodeSet[]=new php4DOMElement($node,$this->myOwnerDocument); | |
197 | + $i++; | |
198 | + } | |
199 | + return $nodeSet; | |
200 | + } | |
201 | + function children() {return $this->child_nodes();} | |
202 | + function clone_node($deep=false) {return new php4DOMElement($this->myDOMNode->cloneNode($deep),$this->myOwnerDocument);} | |
203 | + function dump_node() {return $this->myOwnerDocument->myDOMNode->saveXML($this->myDOMNode);} | |
204 | + function first_child() {return $this->_newDOMElement($this->myDOMNode->firstChild,$this->myOwnerDocument);} | |
205 | + function get_content() {return $this->myDOMNode->textContent;} | |
206 | + function has_attributes() {return $this->myDOMNode->hasAttributes();} | |
207 | + function has_child_nodes() {return $this->myDOMNode->hasChildNodes();} | |
208 | + function insert_before($newnode,$refnode) {return new php4DOMElement($this->myDOMNode->insertBefore($newnode->myDOMNode,$refnode->myDOMNode),$this->myOwnerDocument);} | |
209 | + function is_blank_node() {return ($this->myDOMNode->nodeType==XML_TEXT_NODE)&&ereg('^([[:cntrl:]]|[[:space:]])*$',$this->myDOMNode->nodeValue);} | |
210 | + function last_child() {return $this->_newDOMElement($this->myDOMNode->lastChild,$this->myOwnerDocument);} | |
211 | + function new_child($name,$content) | |
212 | + { | |
213 | + $mySubNode=$this->myDOMNode->ownerDocument->createElement($name); | |
214 | + $mySubNode->appendChild($this->myDOMNode->ownerDocument->createTextNode(html_entity_decode($content,ENT_QUOTES))); | |
215 | + $this->myDOMNode->appendChild($mySubNode); | |
216 | + return new php4DOMElement($mySubNode,$this->myOwnerDocument); | |
217 | + } | |
218 | + function next_sibling() {return $this->_newDOMElement($this->myDOMNode->nextSibling,$this->myOwnerDocument);} | |
219 | + function node_name() | |
220 | + { | |
221 | + if ($this->myDOMNode->nodeType==XML_ELEMENT_NODE) | |
222 | + return $this->myDOMNode->localName; //avoid namespace prefix | |
223 | + else return $this->myDOMNode->nodeName; | |
224 | + } | |
225 | + function node_type() {return $this->myDOMNode->nodeType;} | |
226 | + function node_value() {return $this->myDOMNode->nodeValue;} | |
227 | + function owner_document() {return $this->myOwnerDocument;} | |
228 | + function parent_node() {return $this->_newDOMElement($this->myDOMNode->parentNode,$this->myOwnerDocument);} | |
229 | + function prefix() {return $this->myDOMNode->prefix;} | |
230 | + function previous_sibling() {return $this->_newDOMElement($this->myDOMNode->previousSibling,$this->myOwnerDocument);} | |
231 | + function remove_child($oldchild) {return $this->_newDOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode),$this->myOwnerDocument);} | |
232 | + function replace_child($oldnode,$newnode) {return $this->_newDOMElement($this->myDOMNode->replaceChild($oldnode->myDOMNode,$this->_importNode($newnode)),$this->myOwnerDocument);} | |
233 | + function set_content($text) {return $this->myDOMNode->appendChild($this->myDOMNode->ownerDocument->createTextNode($text));} | |
234 | + function _importNode($newnode) | |
235 | + {//Private function to import DOMNode from another DOMDocument | |
236 | + if ($this->myOwnerDocument===$newnode->myOwnerDocument) return $newnode->myDOMNode; | |
237 | + else return $this->myOwnerDocument->myDOMNode->importNode($newnode->myDOMNode,true); | |
238 | + } | |
239 | + function _newDOMElement($aDOMNode,$aOwnerDocument) | |
240 | + {//Private function to check the PHP5 DOMNode before creating a new associated PHP4 DOMNode wrapper | |
241 | + if ($aDOMNode==null) return null; | |
242 | + elseif ($aDOMNode->nodeType==XML_ELEMENT_NODE) return new php4DOMElement($aDOMNode,$aOwnerDocument); | |
243 | + elseif ($aDOMNode->nodeType==XML_ATTRIBUTE_NODE) return new php4DOMAttr($aDOMNode,$aOwnerDocument); | |
244 | + else return new php4DOMNode($aDOMNode,$aOwnerDocument); | |
245 | + } | |
246 | +} | |
247 | + | |
248 | +class php4DOMNodelist | |
249 | +{ | |
250 | + var $myDOMNodelist; | |
251 | + var $nodeset; | |
252 | + function php4DOMNodelist($aDOMNodelist,$aOwnerDocument) | |
253 | + { | |
254 | + $this->myDOMNodelist=$aDOMNodelist; | |
255 | + $this->nodeset=array(); | |
256 | + $i=0; | |
257 | + if (isset($this->myDOMNodelist)) | |
258 | + while ($node=$this->myDOMNodelist->item($i)) | |
259 | + { | |
260 | + switch($node->nodeType) | |
261 | + { | |
262 | + case XML_ATTRIBUTE_NODE: $this->nodeset[]=new php4DOMAttr($node,$aOwnerDocument); break; | |
263 | + case XML_ELEMENT_NODE: | |
264 | + default: $this->nodeset[]=new php4DOMElement($node,$aOwnerDocument); | |
265 | + } | |
266 | + $i++; | |
267 | + } | |
268 | + } | |
269 | +} | |
270 | + | |
271 | +class php4DOMXPath | |
272 | +{ | |
273 | + var $myDOMXPath; | |
274 | + var $myOwnerDocument; | |
275 | + function php4DOMXPath($dom_document) | |
276 | + { | |
277 | + $this->myOwnerDocument=$dom_document; | |
278 | + $this->myDOMXPath=new DOMXPath($dom_document->myDOMNode); | |
279 | + } | |
280 | + function xpath_eval($eval_str,$contextnode=null) | |
281 | + { | |
282 | + if (isset($contextnode)) return new php4DOMNodelist($this->myDOMXPath->query($eval_str,$contextnode->myDOMNode),$this->myOwnerDocument); | |
283 | + else return new php4DOMNodelist($this->myDOMXPath->query($eval_str),$this->myOwnerDocument); | |
284 | + } | |
285 | + function xpath_register_ns($prefix,$namespaceURI) {return $this->myDOMXPath->registerNamespace($prefix,$namespaceURI);} | |
286 | +} | |
287 | + | |
288 | +if (extension_loaded('xsl')) | |
289 | +{//See also: http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/ | |
290 | + function domxml_xslt_stylesheet($xslstring) {return new php4DomXsltStylesheet(DOMDocument::loadXML($xslstring));} | |
291 | + function domxml_xslt_stylesheet_doc($dom_document) {return new php4DomXsltStylesheet($dom_document);} | |
292 | + function domxml_xslt_stylesheet_file($xslfile) {return new php4DomXsltStylesheet(DOMDocument::load($xslfile));} | |
293 | + class php4DomXsltStylesheet | |
294 | + { | |
295 | + var $myxsltProcessor; | |
296 | + function php4DomXsltStylesheet($dom_document) | |
297 | + { | |
298 | + $this->myxsltProcessor=new xsltProcessor(); | |
299 | + $this->myxsltProcessor->importStyleSheet($dom_document); | |
300 | + } | |
301 | + function process($dom_document,$xslt_parameters=array(),$param_is_xpath=false) | |
302 | + { | |
303 | + foreach ($xslt_parameters as $param=>$value) | |
304 | + $this->myxsltProcessor->setParameter('',$param,$value); | |
305 | + $myphp4DOMDocument=new php4DOMDocument(); | |
306 | + $myphp4DOMDocument->myDOMNode=$this->myxsltProcessor->transformToDoc($dom_document->myDOMNode); | |
307 | + return $myphp4DOMDocument; | |
308 | + } | |
309 | + function result_dump_file($dom_document,$filename) | |
310 | + { | |
311 | + $html=$dom_document->myDOMNode->saveHTML(); | |
312 | + file_put_contents($filename,$html); | |
313 | + return $html; | |
314 | + } | |
315 | + function result_dump_mem($dom_document) {return $dom_document->myDOMNode->saveHTML();} | |
316 | + } | |
317 | +} | |
318 | +?> |
@@ -0,0 +1,158 @@ | ||
1 | +<?php | |
2 | +# データベース登録用スクリプト created by n_takuto | |
3 | + | |
4 | +# 新規登録を行う | |
5 | +# DB(文献情報の配列, XOOPSユーザー名) | |
6 | + | |
7 | +# $ 文献情報の配列 | |
8 | +# [id, j(journal), y(year), v(vol), p(page), ab(abstract), t(title), a(author), | |
9 | +# t_jp(title_jp), j_jp(journal_jp), a_jp(author_jp)] | |
10 | + | |
11 | +function DB($data, $user){ | |
12 | + global $xoopsDB; | |
13 | + | |
14 | + $day = getdate(); | |
15 | + $date = $day["year"] ."-". $day["mon"] ."-". $day["mday"]; | |
16 | + | |
17 | + foreach($data as $key => $value){ | |
18 | + $data[$key] = addslashes($data[$key]); | |
19 | + } | |
20 | + | |
21 | + # Journal | |
22 | + $sql = "SELECT id FROM ".$xoopsDB->prefix('pmid_journal')." WHERE Journal='".$data['j']."'"; | |
23 | + $res = $xoopsDB->query($sql); | |
24 | + if(!$xoopsDB->getRowsNum($res)){ | |
25 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_journal'); | |
26 | + $sql.= " VALUES('','".$data['j']."','','','0','','','','')"; | |
27 | + $res = $xoopsDB->query($sql); | |
28 | + $jid = $xoopsDB->getInsertId($res); | |
29 | + | |
30 | + }else{ | |
31 | + $row = $xoopsDB->fetchArray($res); | |
32 | + $jid = $row['id']; | |
33 | + } | |
34 | + | |
35 | + # Author | |
36 | + $Author = explode(', ', $data['a']); | |
37 | + $aid = ""; | |
38 | + for($i=0; $i<count($Author); $i++){ | |
39 | + $sql = "SELECT id FROM ".$xoopsDB->prefix('pmid_author')." WHERE Author='".$Author[$i]."'"; | |
40 | + $res = $xoopsDB->query($sql); | |
41 | + if(!$xoopsDB->getRowsNum($res)){ | |
42 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_author')." VALUES('','".$Author[$i]."','','')"; | |
43 | + $res = $xoopsDB->query($sql); | |
44 | + $aid.= "[".$xoopsDB->getInsertId($res)."],"; | |
45 | + | |
46 | + }else{ | |
47 | + $row = $xoopsDB->fetchArray($res); | |
48 | + $aid.="[".$row["id"]."],"; | |
49 | + } | |
50 | + } | |
51 | + | |
52 | + # Year | |
53 | + if($data['y'] == '0') $data['y'] = '0000'; | |
54 | + | |
55 | + # with PMID | |
56 | + if(!isset($data['c_t1'])){ | |
57 | + $data['t_jp'] = ''; $data['a_jp'] = ''; $data['c_t1'] = ''; | |
58 | + } | |
59 | + | |
60 | + # Pmid | |
61 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_id')." VALUES("; | |
62 | + $sql.= "'','".$data['id']."','".$jid."','".$data['y']."','".$data['v']."','".$data['p']."',"; | |
63 | + $sql.= "'".$aid."','".$data['t']."','".$data['ab']."','".$user."','".$date."',"; | |
64 | + $sql.= "'','','".$data['t_jp']."','".$data['a_jp']."','".$data['c_t1']."','','','','','')"; | |
65 | + $res = $xoopsDB->query($sql); | |
66 | + | |
67 | + return $xoopsDB->getInsertId($res); | |
68 | +} | |
69 | + | |
70 | + # 情報の編集を行う | |
71 | + # MOD_DB(文献ID, 文献情報の配列) | |
72 | + | |
73 | + function MOD_DB($id, $data){ | |
74 | + | |
75 | + global $xoopsDB; | |
76 | + | |
77 | + foreach($data as $key => $value){ | |
78 | + $data[$key] = addslashes($value); | |
79 | + } | |
80 | + | |
81 | + # Journal | |
82 | + $sql = "SELECT id FROM ".$xoopsDB->prefix('pmid_journal')." WHERE Journal='".$data['j']."'"; | |
83 | + $res = $xoopsDB->query($sql); | |
84 | + $row = $xoopsDB->fetchArray($res); | |
85 | + $jid = $row['id']; | |
86 | + | |
87 | + # Author | |
88 | + $Author = explode(', ', $data['a']); | |
89 | + $aid = ""; | |
90 | + for($i=0; $i<count($Author); $i++){ | |
91 | + $sql = "SELECT id FROM ".$xoopsDB->prefix('pmid_author')." WHERE Author='".$Author[$i]."'"; | |
92 | + $res = $xoopsDB->query($sql); | |
93 | + if(!$xoopsDB->getRowsNum($res)){ | |
94 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_author')." VALUES('','".$Author[$i]."','','')"; | |
95 | + $res = $xoopsDB->query($sql); | |
96 | + $aid.= "[".$xoopsDB->getInsertId($res)."],"; | |
97 | + | |
98 | + }else{ | |
99 | + $row = $xoopsDB->fetchArray($res); | |
100 | + $aid.="[".$row["id"]."],"; | |
101 | + } | |
102 | + } | |
103 | + | |
104 | + # Year | |
105 | + if($data['y'] == '0') $data['y'] = '0000'; | |
106 | + | |
107 | + # Pmid | |
108 | + $sql = "UPDATE ".$xoopsDB->prefix('pmid_id')." SET "; | |
109 | + $sql.= "Journal='".$jid."', Year='".$data['y']."', Volume='".$data['v']."',"; | |
110 | + $sql.= "Page='".$data['p']."', Author='".$aid."', Title='".$data['t']."',"; | |
111 | + $sql.= "Abstract='".$data['ab']."', Title_JP='".$data['t_jp']. | |
112 | + "', Author_JP='".$data['a_jp']."', Custom_t1='".$data['c_t1']."' "; | |
113 | + $sql.="WHERE id='".$id."'"; | |
114 | + $res = $xoopsDB->query($sql); | |
115 | + | |
116 | + if($res){ | |
117 | + return true; | |
118 | + }else{ | |
119 | + return false; | |
120 | + } | |
121 | + } | |
122 | + | |
123 | + | |
124 | + # ジャーナルの新規登録を行う | |
125 | + # REG_JOURNAL(ジャーナル情報の配列) | |
126 | + | |
127 | + # [j(journal), j_jp(journal_jp), j_url(journal_url), | |
128 | + # bk(book flg), act(active flg), e(editor), pub(publisher)] | |
129 | + | |
130 | + function REG_JOURNAL($data){ | |
131 | + global $xoopsDB; | |
132 | + | |
133 | + foreach($data as $key => $value){ | |
134 | + $data[$key] = addslashes($data[$key]); | |
135 | + } | |
136 | + | |
137 | + $sql = "INSERT INTO ".$xoopsDB->prefix('pmid_journal')." VALUES("; | |
138 | + $sql.= "'','".$data['j']."','".$data['j_jp']."','".$data['j_url']."','".$data['bk']."','".$data['e']."','".$data['pub']."','','')"; | |
139 | + $res = $xoopsDB->query($sql); | |
140 | + return $xoopsDB->getInsertId($res); | |
141 | + } | |
142 | + | |
143 | + # ジャーナルの編集を行う | |
144 | + # EDIT_JOURNAL(ジャーナル情報の配列) | |
145 | + | |
146 | + function EDIT_JOURNAL($data){ | |
147 | + global $xoopsDB; | |
148 | + | |
149 | + foreach($data as $key => $value){ | |
150 | + $data[$key] = addslashes($data[$key]); | |
151 | + } | |
152 | + | |
153 | + $sql = "UPDATE ".$xoopsDB->prefix('pmid_journal')." SET Journal='".$data['j']."',Journal_JP='".$data['j_jp']."',"; | |
154 | + $sql.="URL='".$data['j_url']."',Book='".$data['bk']."',Editor='".$data['e']."', Publisher='".$data['pub']."'"; | |
155 | + $sql.=" WHERE id='".$data['id']."'"; | |
156 | + $res = $xoopsDB->query($sql); | |
157 | + } | |
158 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,103 @@ | ||
1 | +<?php | |
2 | +# PMIDなし登録フォーム表示用スクリプト created by n_takuto | |
3 | + | |
4 | + if (!defined('XOOPS_ROOT_PATH')) { exit(); } | |
5 | + | |
6 | + include 'class/functions.php'; | |
7 | + $fn = new functions(); | |
8 | + | |
9 | + if($mode == 'edit'){ | |
10 | + foreach($data as $k => $v){ | |
11 | + $data[$k] = $myts->makeTboxData4Show($v); | |
12 | + } | |
13 | + | |
14 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_journal')." WHERE id='".$data['journal_id']."'"; | |
15 | + $res = $xoopsDB->query($sql); | |
16 | + $row = $xoopsDB->fetchArray($res); | |
17 | + $book = $row['Book']; | |
18 | + | |
19 | + }else{ | |
20 | + $data['title'] = ''; | |
21 | + $data['title_jp'] = ''; | |
22 | + $data['author'] = ''; | |
23 | + $data['author_jp'] = ''; | |
24 | + $data['journal'] = ''; | |
25 | + $data['v'] = ''; | |
26 | + $data['pp'] = ''; | |
27 | + $data['year'] = ''; | |
28 | + $data['abst'] = ''; | |
29 | + $book = 0; | |
30 | + } | |
31 | + | |
32 | + # Title | |
33 | + echo "<tr><td colspan='2' style='text-align:left'><b>Title</b></td></tr>"; | |
34 | + echo "<tr><td style='width:140px' > *in English</td>"; | |
35 | + echo "<td><input type='text' style='width:90%' name='title_e' value='".$data['title']."'></td></tr>"; | |
36 | + echo "<tr><td> in other Language</td>"; | |
37 | + echo "<td><input type='text' style='width:90%' name='title_o' value='".$data['title_jp']."'></td></tr>"; | |
38 | + | |
39 | + # author | |
40 | + echo "<tr><td colspan='2' style='text-align:left'><b>"; | |
41 | + echo "<span title='eg Ikeno H, Nishioka T, ...'>Authors</span></b></td></tr>"; | |
42 | + echo "<tr><td> *in English</td>"; | |
43 | + echo "<td><input type='text' style='width:90%' name='author_e' value='".$data['author']."'></td></tr>"; | |
44 | + echo "<tr><td> in other Language</td>"; | |
45 | + echo "<td><input type='text' style='width:90%' name='author_o' value='".$data['author_jp']."'></td>"; | |
46 | + echo "</tr>"; | |
47 | + | |
48 | + # journal | |
49 | + echo "<tr><td colspan='2' style='text-align:left\;'><b>Journal/Book</b></td></tr>"; | |
50 | + echo "<tr><td> </td>"; | |
51 | + | |
52 | + echo "<td><input type='radio' name='jb' value='j'"; | |
53 | + if($book == 0) echo "checked"; | |
54 | + echo ">"; | |
55 | + echo $fn->getJournal(0, $data['journal']); | |
56 | + | |
57 | + echo "<br><input type='radio' name='jb' value='b'"; | |
58 | + if($book == 1) echo "checked"; | |
59 | + echo ">"; | |
60 | + echo $fn->getJournal(1, $data['journal']); | |
61 | + echo "<br><br></td></tr>"; | |
62 | + | |
63 | + # volume | |
64 | + echo "<tr><td><b>Volume</b></td>"; | |
65 | + echo "<td><input type='text' size='24' name='volume' value='".$data['v']."'></td>"; | |
66 | + echo "</tr>"; | |
67 | + | |
68 | + # page | |
69 | + echo "<tr><td><b>Pages</b></td>"; | |
70 | + echo "<td><input type='text' size='24' name='page' value='".$data['pp']."'></td>"; | |
71 | + echo "</tr>"; | |
72 | + | |
73 | + # year | |
74 | + if($data['year'] > 0){ | |
75 | + echo "<tr><td><b>Year</b></td>"; | |
76 | + if ( $data['year'] != "0000" ) { | |
77 | + echo "<td><input type='text' size='24' name='year' value='".$data['year']."'>"; | |
78 | + } else { | |
79 | + echo "<td><input type='text' size='24' name='year'>"; | |
80 | + } | |
81 | + echo "</td>"; | |
82 | + echo "</tr>"; | |
83 | + | |
84 | + }else{ | |
85 | + echo "<tr><td colspan='2' style='text-align:left'><b>Year</b></td></tr>"; | |
86 | + echo "<tr><td> select year</td><td>"; | |
87 | + echo "<select name='selectedYear'>"; | |
88 | + echo "<option value='0' selected>(unkown)"; | |
89 | + for ( $i = 2006; $i > 1980; $i-- ) { | |
90 | + echo "<option value='".$i."'>".$i; | |
91 | + } | |
92 | + echo "</select></td></tr>"; | |
93 | + echo "<tr><td> other year</td><td>"; | |
94 | + echo "<input type='text' size='14' name='year'>"; | |
95 | + echo "</td></tr>"; | |
96 | + } | |
97 | + | |
98 | + # abst | |
99 | + echo "<tr><td><b>Abstract</b></td>"; | |
100 | + echo "<td><textarea name='abstract' rows='10' style='width:90%' >".$data['abst']."</textarea></td>"; | |
101 | + echo "</tr>"; | |
102 | + | |
103 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,135 @@ | ||
1 | +<?php | |
2 | +# XML、PDF照合用スクリプト created by n_takuto | |
3 | + | |
4 | + echo "<b>"._PA_CHECKXML."</b><br>"; | |
5 | + $deleted = ''; | |
6 | + $undeleted = ''; | |
7 | + $d = MOD_PATH.'/'.UPXML; | |
8 | + if($handle = opendir($d)){ | |
9 | + while(false !== $file = readdir($handle)){ | |
10 | + if($file != '.' && $file != '..'){ | |
11 | + | |
12 | + if(preg_match("/.*(\.xml)$/i", $file)){ | |
13 | + $f = str_replace('.xml', '', $file); | |
14 | + $sql = "select * from ".$xoopsDB->prefix('pmid_id')." where Custom_t1='".$f."'"; | |
15 | + $rs = $xoopsDB->query($sql); | |
16 | + if(!$xoopsDB->getRowsNum($rs)){ | |
17 | + if(unlink($d.'/'.$file)){ | |
18 | + $deleted.= $file."<br>"; | |
19 | + }else{ | |
20 | + $undeleted.="<span style='color:red'>"._PA_FALSE."</span> ".$file."<br>"; | |
21 | + } | |
22 | + } | |
23 | + }else{ | |
24 | + if(unlink($d.'/'.$file)){ | |
25 | + $deleted.= $file."<br>"; | |
26 | + }else{ | |
27 | + $undeleted.="<span style='color:red'>"._PA_FALSE."</span> ".$file."<br>"; | |
28 | + } | |
29 | + } | |
30 | + } | |
31 | + } | |
32 | + closedir($handle); | |
33 | + } | |
34 | + | |
35 | + if(!empty($deleted)){ | |
36 | + echo "<u>"._PA_DELETEDXML."</u><br>"; | |
37 | + echo $deleted."<br>"; | |
38 | + } | |
39 | + | |
40 | + if(!empty($undeleted)){ | |
41 | + echo $undeleted."<br>"; | |
42 | + } | |
43 | + | |
44 | + if(empty($deleted) && empty($undeleted)){ | |
45 | + echo _PA_NOPROBLEM."<br><br>"; | |
46 | + } | |
47 | + | |
48 | + $make = ''; | |
49 | + echo "<b>"._PA_CHECKXML."2</b><br>"; | |
50 | + $rs = $xoopsDB->query("select * from ".$xoopsDB->prefix('pmid_id')." where pmid<0"); | |
51 | + while($row = $xoopsDB->fetchArray($rs)){ | |
52 | + if(!file_exists(MOD_PATH.'/'.UPXML.'/'.$row['Custom_t1'].'.xml')){ | |
53 | + | |
54 | + $data = array(); | |
55 | + $data['t'] = $row['Title']; | |
56 | + $data['t_jp'] = $row['Title_JP']; | |
57 | + $data['y'] = $row['Year']; | |
58 | + $data['a_jp'] = $row['Author_JP']; | |
59 | + $data['j'] = $row['Journal']; | |
60 | + $data['v'] = $row['Volume']; | |
61 | + $data['p'] = $row['Page']; | |
62 | + $data['ab'] = $row['Abstract']; | |
63 | + $data['c_t1'] = $row['Custom_t1']; | |
64 | + | |
65 | + $data['a']=''; | |
66 | + $a = explode(',', substr($row['Author'], 0, -1)); | |
67 | + for($k=0; $k<count($a); $k++){ | |
68 | + $a[$k] = str_replace('[', '', $a[$k]); | |
69 | + $a[$k] = str_replace(']', '', $a[$k]); | |
70 | + $sql = "SELECT Author FROM ".$xoopsDB->prefix('pmid_author')." WHERE id='".$a[$k]."'"; | |
71 | + $res2 = $xoopsDB->query($sql); | |
72 | + $row2 = $xoopsDB->fetchArray($res2); | |
73 | + $data['a'].=$row2["Author"].", "; | |
74 | + } | |
75 | + $data['a'] = substr($data['a'], 0, -2); | |
76 | + | |
77 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_journal')." WHERE id='".$data['j']."'"; | |
78 | + $res2 = $xoopsDB->query($sql); | |
79 | + $row2 = $xoopsDB->fetchArray($res2); | |
80 | + $data['j'] = $row2['Journal']; | |
81 | + ($row2['Book'] == 1) ? $data['jb'] = 'b' : $data['jb'] = 'j'; | |
82 | + | |
83 | + foreach($data as $key => $value){ | |
84 | + $data[$key] = str_replace("\"", """, $data[$key]); | |
85 | + } | |
86 | + | |
87 | + GENERATE_XML($data); | |
88 | + $make.= $row['Custom_t1'].".xml<br>"; | |
89 | + } | |
90 | + } | |
91 | + | |
92 | + if(!empty($make)){ | |
93 | + echo "<u>"._PA_GENERATEDXML."</u><br>"; | |
94 | + echo $make."<br>"; | |
95 | + | |
96 | + }else{ | |
97 | + echo _PA_NOPROBLEM."<br><br>"; | |
98 | + } | |
99 | + | |
100 | + echo "<b>"._PA_CHECKPDF."</b><br>"; | |
101 | + $pdfs = ''; $nonpdf = ''; | |
102 | + if($handle = opendir(WOPDFDIR)){ | |
103 | + while(false !== $file = readdir($handle)){ | |
104 | + if($file != '.' && $file != '..'){ | |
105 | + if(preg_match("/.*(\.pdf)$/i", $file)){ | |
106 | + $f = str_replace('.pdf', '', $file); | |
107 | + $sql = "select * from ".$xoopsDB->prefix('pmid_id')." where Custom_t1='".$f."'"; | |
108 | + $rs = $xoopsDB->query($sql); | |
109 | + if(!$xoopsDB->getRowsNum($rs)){ | |
110 | + $pdfs.= "[<a href='index.php?mode=pdfdel&pdf=".$file."'>"._PA_DELETE."</a>] "; | |
111 | + $pdfs.= "<a href='".MOD_URL."/".PDFDIR2."/wopmid/".$file."'>".$file."</a><br>"; | |
112 | + } | |
113 | + }else{ | |
114 | + if(unlink(WOPDFDIR.'/'.$file)){ | |
115 | + $nonpdf.= $file."<br>"; | |
116 | + } | |
117 | + } | |
118 | + } | |
119 | + } | |
120 | + closedir($handle); | |
121 | + } | |
122 | + | |
123 | + if(!empty($pdfs)){ | |
124 | + echo "<u>"._PA_NOTICEPDF."</u><br>"; | |
125 | + echo $pdfs."<br>"; | |
126 | + }else{ | |
127 | + echo _PA_NOPROBLEM."<br>"; | |
128 | + } | |
129 | + | |
130 | + if(!empty($nonpdf)){ | |
131 | + echo "<u>"._PA_DELTEDUNKNOWN."</u><br>"; | |
132 | + echo $nonpdf."<br>"; | |
133 | + } | |
134 | + | |
135 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,6 @@ | ||
1 | +<?php | |
2 | + | |
3 | +$adminmenu[1]['title'] = _PA_CHECK; | |
4 | +$adminmenu[1]['link'] = "admin/index.php?mode=check"; | |
5 | + | |
6 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,50 @@ | ||
1 | +<?php | |
2 | +# 管理画面トップ用スクリプト created by n_takuto | |
3 | + | |
4 | + include '../../../include/cp_header.php'; | |
5 | + | |
6 | + define('MOD_PATH', XOOPS_ROOT_PATH.'/modules/PubMedPDF'); | |
7 | + define('MOD_URL', XOOPS_URL.'/modules/PubMedPDF'); | |
8 | + define('UPXML', 'uploads_xml'); | |
9 | + | |
10 | + $pdfdir = $xoopsModuleConfig['updir']; | |
11 | + if(substr($pdfdir, -1) == '/') $pdfdir = substr($pdfdir, 0, -1); | |
12 | + $pdfdir2 = $xoopsModuleConfig['updir2']; | |
13 | + if(substr($pdfdir2, -1) == '/') $pdfdir2 = substr($pdfdir2, 0, -1); | |
14 | + | |
15 | + define('PDFDIR', $pdfdir); | |
16 | + define('PDFDIR2', $pdfdir2); | |
17 | + define('WOPDFDIR', PDFDIR.'/wopmid'); | |
18 | + | |
19 | + $mode = ''; | |
20 | + if(isset($_GET['mode'])){ | |
21 | + $mode = $_GET['mode']; | |
22 | + } | |
23 | + | |
24 | + xoops_cp_header(); | |
25 | + switch($mode){ | |
26 | + case 'pdfdel': | |
27 | + $pdf = $_GET['pdf']; | |
28 | + echo "<b>"._PA_DELPDF."</b><br>"; | |
29 | + if(file_exists(WOPDFDIR.'/'.$pdf)){ | |
30 | + if(unlink(WOPDFDIR.'/'.$pdf)){ | |
31 | + echo $pdf." "._PA_DELETEDPDF."<br><br>"; | |
32 | + }else{ | |
33 | + echo "<span style='color:red'>"._PA_FALSE."</span> ".$pdf." "._PA_DELETEDPDF."<br><br>"; | |
34 | + } | |
35 | + }else{ | |
36 | + echo _PA_NOEXIST."<br><br>"; | |
37 | + } | |
38 | + | |
39 | + case 'check': | |
40 | + include '../include/xml.php'; | |
41 | + include 'checkfiles.php'; | |
42 | + break; | |
43 | + | |
44 | + default: | |
45 | + $url = XOOPS_URL."/modules/system/admin.php?"; | |
46 | + echo "<b><a href='".$url."fct=preferences&op=showmod&mod=".$xoopsModule->getVar('mid')."'>"._PA_CONFIG."</a></b><br>"; | |
47 | + echo "<b><a href='?mode=check'>"._PA_CHECK."</a></b>"; | |
48 | + } | |
49 | + xoops_cp_footer(); | |
50 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,95 @@ | ||
1 | +CREATE TABLE pmid_id( | |
2 | + id int(30) not null auto_increment, | |
3 | + PMID int(30), | |
4 | + Journal int(30) not null, | |
5 | + Year char(30) not null, | |
6 | + Volume char(30), | |
7 | + Page char(30), | |
8 | + Author text not null, | |
9 | + Title text, | |
10 | + Abstract text, | |
11 | + R_usr char(30), | |
12 | + R_date date not null default'0000-00-00', | |
13 | + F_usr text, | |
14 | + F_num int(30), | |
15 | + Title_JP text, | |
16 | + Author_JP text, | |
17 | + Custom_t1 text, | |
18 | + Custom_t2 text, | |
19 | + Custom_t3 text, | |
20 | + Custom_i1 int(30), | |
21 | + Custom_i2 int(30), | |
22 | + Custom_i3 int(30), | |
23 | + primary key (id) | |
24 | + ); | |
25 | + | |
26 | +CREATE TABLE pmid_journal( | |
27 | + id int(30) not null auto_increment, | |
28 | + Journal text not null, | |
29 | + Journal_JP text, | |
30 | + URL text, | |
31 | + Book int(2) default'0', | |
32 | + Editor text, | |
33 | + Publisher char(30), | |
34 | + Custom1 text, | |
35 | + Custom2 text, | |
36 | + primary key (id) | |
37 | + ); | |
38 | + | |
39 | +CREATE TABLE pmid_author( | |
40 | + id int(30) not null auto_increment, | |
41 | + Author char (100) not null, | |
42 | + Custom1 text, | |
43 | + Custom2 text, | |
44 | + primary key (id) | |
45 | + ); | |
46 | + | |
47 | +CREATE TABLE pmid_favorite_dir( | |
48 | + id int(30) not null auto_increment, | |
49 | + Usr char(30) not null, | |
50 | + Name char(30) not null, | |
51 | + Pass text, | |
52 | + Public_flg int(1) not null default'0', | |
53 | + primary key (id) | |
54 | + ); | |
55 | + | |
56 | +CREATE TABLE pmid_favorite_data( | |
57 | + id int(30) not null auto_increment, | |
58 | + data_id int(30) not null, | |
59 | + dir_id int(30), | |
60 | + Usr char(30) not null, | |
61 | + Comment text, | |
62 | + primary key (id) | |
63 | + ); | |
64 | + | |
65 | +CREATE TABLE pmid_template( | |
66 | + id int(30) not null auto_increment, | |
67 | + name char(30) not null, | |
68 | + template text, | |
69 | + primary key (id) | |
70 | + ); | |
71 | + | |
72 | +CREATE TABLE pmid_shortcut( | |
73 | + id int(30) not null auto_increment, | |
74 | + Usr char(30) not null, | |
75 | + Name char(30) not null, | |
76 | + Target text not null, | |
77 | + primary key (id) | |
78 | + ); | |
79 | + | |
80 | +CREATE TABLE pmid_memo( | |
81 | + id int(30) not null auto_increment, | |
82 | + data_id int(30) not null, | |
83 | + R_usr char(30) not null, | |
84 | + R_date date not null default'0000-00-00', | |
85 | + Comment text, | |
86 | + Public_flg int(1) not null default'0', | |
87 | + primary key(id) | |
88 | + ); | |
89 | + | |
90 | +CREATE TABLE pmid_tmp( | |
91 | + tmp1 text, | |
92 | + tmp2 text, | |
93 | + tmp3 text, | |
94 | + tmp4 text | |
95 | + ); |
@@ -0,0 +1,238 @@ | ||
1 | +<?php | |
2 | +# お気に入り用クラス created by n_takuto | |
3 | + | |
4 | +class favorite{ | |
5 | + | |
6 | + var $db; | |
7 | + var $myts; | |
8 | + var $user; | |
9 | + var $option; | |
10 | + | |
11 | + function favorite($user='guest'){ | |
12 | + $this->db =& Database::getInstance(); | |
13 | + $this->myts =& MyTextSanitizer::getInstance(); | |
14 | + $this->user = $user; | |
15 | + } | |
16 | + | |
17 | + # 移動先選択用<option>作成 | |
18 | + | |
19 | + function getDirList($data_id=0){ | |
20 | + | |
21 | + $item_num = ''; | |
22 | + if($data_id){ | |
23 | + if($n = $this->__getItemNum($data_id, 0)){ | |
24 | + $item_num = '('.$n.')'; | |
25 | + } | |
26 | + } | |
27 | + $this->option = "<option value='0'>Top directory ".$item_num."</option>"; | |
28 | + | |
29 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
30 | + $sql.= " WHERE Usr='".$this->user."' AND Pass=''"; | |
31 | + $res = $this->db->query($sql); | |
32 | + while($row = $this->db->fetchArray($res)){ | |
33 | + | |
34 | + $item_num = ''; | |
35 | + if($data_id){ | |
36 | + if($n = $this->__getItemNum($data_id, $row['id'])){ | |
37 | + $item_num = '('.$n.')'; | |
38 | + } | |
39 | + } | |
40 | + ($row['Public_flg'] == 1) ? $p = "(P)" : $p=""; | |
41 | + $this->option.= "<option value='".$row['id']."'>".$row['Name']." ".$p." ".$item_num."</option>"; | |
42 | + $this->__getDirList($row['Pass'].'['.$row['id'].']', 1, $data_id); | |
43 | + } | |
44 | + return $this->option; | |
45 | + } | |
46 | + | |
47 | + function __getDirList($path, $n, $data_id){ | |
48 | + | |
49 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
50 | + $sql.= " WHERE Pass='".$path."' AND Usr='".$this->user."'"; | |
51 | + $rs = $this->db->query($sql); | |
52 | + while ($row = $this->db->fetchArray($rs)){ | |
53 | + | |
54 | + $item_num = ''; | |
55 | + if($data_id){ | |
56 | + if($n = $this->__getItemNum($data_id, $row['id'])){ | |
57 | + $item_num = '('.$n.')'; | |
58 | + } | |
59 | + } | |
60 | + $this->option.= "<option value='".$row['id']."'>"; | |
61 | + for($i=0; $i<$n; $i++) $this->option.= "--"; | |
62 | + ($row['Public_flg'] == 1) ? $p = "(P)" : $p=""; | |
63 | + $this->option.= $row['Name']." ".$p." ".$item_num."</option>"; | |
64 | + | |
65 | + $n++; | |
66 | + $this->option.= $this->__getDirList($row['Pass'].'['.$row['id'].']', $n, $data_id); | |
67 | + $n--; | |
68 | + } | |
69 | + } | |
70 | + | |
71 | + function __getItemNum($data_id, $dir_id){ | |
72 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_data'); | |
73 | + $sql.= " WHERE data_id='".$data_id."' AND dir_id='".$dir_id."' AND Usr='".$this->user."'"; | |
74 | + $res = $this->db->query($sql); | |
75 | + return $this->db->getRowsNum($res); | |
76 | + } | |
77 | + | |
78 | + | |
79 | + # ディレクトリ一覧作成 | |
80 | + function getDir($dir_id=0){ | |
81 | + | |
82 | + $ret = ''; | |
83 | + $path = ''; | |
84 | + if($dir_id != 0){ | |
85 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir')." WHERE id='".$dir_id."'"; | |
86 | + $res = $this->db->query($sql); | |
87 | + $row = $this->db->fetchArray($res); | |
88 | + $path = $row['Pass'].'['.$dir_id.']'; | |
89 | + } | |
90 | + | |
91 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
92 | + $sql.=" WHERE Usr='".$this->user."' AND Pass='".$path."'"; | |
93 | + $res = $this->db->query($sql); | |
94 | + while($row = $this->db->fetchArray($res)){ | |
95 | + | |
96 | + $dir_id = $row['id']; | |
97 | + $dirname = $this->myts->makeTboxData4Show($row['Name']); | |
98 | + $datanum = $this->getDataNum($dir_id); | |
99 | + ($row['Public_flg'] == 1) ? $p=" (P)" : $p=""; | |
100 | + | |
101 | + $ret.= "[<a href='favorite.php?del_id=".$dir_id."'><img src='images/delete.png'></a>] "; | |
102 | + $ret.= "<a href='favorite.php?dir_id=".$dir_id."'>".$dirname."</a> (".$datanum.")".$p; | |
103 | + | |
104 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
105 | + $sql.= " WHERE Usr='".$this->user."' AND Pass like '%[".$dir_id."]%'"; | |
106 | + $res2 = $this->db->query($sql); | |
107 | + if($this->db->getRowsNum($res2)){ | |
108 | + | |
109 | + $ret.= "<table style='margin-left:20px'><tr>"; | |
110 | + $i=0; | |
111 | + while($row2 = $this->db->fetchArray($res2)){ | |
112 | + $i++; | |
113 | + $dir_id = $row2['id']; | |
114 | + $dirname = $this->myts->makeTboxData4Show($row2['Name']); | |
115 | + $datanum = $this->getDataNum($dir_id); | |
116 | + ($row2['Public_flg'] == 1) ? $p=" (P)" : $p=""; | |
117 | + | |
118 | + $ret.= "<td style='width:20%'>"; | |
119 | + $ret.= "[<a href='favorite.php?del_id=".$dir_id."'><img src='images/delete.png'></a>] "; | |
120 | + $ret.= "<a href='favorite.php?dir_id=".$dir_id."'>".$dirname."</a> (".$datanum.")".$p; | |
121 | + $ret.= "</td>"; | |
122 | + | |
123 | + if(!($i % 4)) $ret.= "</tr><tr>"; | |
124 | + } | |
125 | + $ret.= "</tr></table><br>"; | |
126 | + }else{ | |
127 | + $ret.= "<br>"; | |
128 | + } | |
129 | + } | |
130 | + return $ret; | |
131 | + } | |
132 | + | |
133 | + | |
134 | + # ディレクトリ一覧(公開)作成 | |
135 | + function getPublicDir(){ | |
136 | + | |
137 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
138 | + $sql.= " WHERE Public_flg='1' ORDER BY Usr"; | |
139 | + $res = $this->db->query($sql); | |
140 | + $ret = "<table style='margin-left:20px'><tr>"; | |
141 | + $i=0; | |
142 | + while($row = $this->db->fetchArray($res)){ | |
143 | + $i++; | |
144 | + $ret.= "<td style='width:33%'>[".$row['Usr']."] "; | |
145 | + $ret.= "<a href='favorite_pub.php?dir_id=".$row['id']."'>".$row['Name']."</a> "; | |
146 | + $ret.= "(".$this->getDataNum($row['id']).")"; | |
147 | + $ret.= "</td>"; | |
148 | + if(!($i % 3)) $ret.= "</tr><tr>"; | |
149 | + } | |
150 | + $ret.= "</tr></table><br>"; | |
151 | + | |
152 | + return $ret; | |
153 | + } | |
154 | + | |
155 | + | |
156 | + # ディレクトリに含まれるデータ個数取得 | |
157 | + function getDataNum($dir_id=0){ | |
158 | + | |
159 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_data'); | |
160 | + $sql.=" WHERE dir_id='".$dir_id."'"; | |
161 | + $res = $this->db->query($sql); | |
162 | + return $this->db->getRowsNum($res); | |
163 | + } | |
164 | + | |
165 | + | |
166 | + # ディレクトリのパンくずリストを作成 | |
167 | + function getDirNavi($dir_id=0){ | |
168 | + | |
169 | + $ret = "<a href='favorite.php?dir_id=0'>"._MD_FAVORITE_DIRTOP."</a>"; | |
170 | + if($dir_id == 0) return $ret; | |
171 | + | |
172 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir')." WHERE id='".$dir_id."'"; | |
173 | + $res = $this->db->query($sql); | |
174 | + $row = $this->db->fetchArray($res); | |
175 | + $path = $row['Pass'].'['.$dir_id.']'; | |
176 | + | |
177 | + $token = explode('][', $path); | |
178 | + for($i=0; $i<count($token); $i++){ | |
179 | + $token[$i] = str_replace('[', '', $token[$i]); | |
180 | + $token[$i] = str_replace(']', '', $token[$i]); | |
181 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir')." WHERE id='".$token[$i]."'"; | |
182 | + $res = $this->db->query($sql); | |
183 | + $row = $this->db->fetchArray($res); | |
184 | + $dirname = $this->myts->makeTboxData4Show($row['Name']); | |
185 | + $ret .= "/<a href='favorite.php?dir_id=".$row['id']."'>".$dirname."</a>"; | |
186 | + } | |
187 | + | |
188 | + return $ret; | |
189 | + } | |
190 | + | |
191 | + | |
192 | + # ディレクトリに含まれるデータIDを取得 | |
193 | + function getData($dir_id=0, $pub=''){ | |
194 | + | |
195 | + $dir_id = intval($dir_id); | |
196 | + $data_id = array(); | |
197 | + $fdata_id = array(); | |
198 | + | |
199 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_data'); | |
200 | + $sql.= " WHERE dir_id='".$dir_id."'"; | |
201 | + if($pub != 'pub'){ | |
202 | + $sql.= " AND Usr='".$this->user."'"; | |
203 | + } | |
204 | + $res = $this->db->query($sql); | |
205 | + while($row = $this->db->fetchArray($res)){ | |
206 | + $data_id[] = $row['data_id']; | |
207 | + $fdata_id[] = $row['id']; | |
208 | + } | |
209 | + | |
210 | + return array($data_id, $fdata_id); | |
211 | + } | |
212 | + | |
213 | + | |
214 | + # ディレクトリ(公開)に含まれる全てのデータIDを取得 | |
215 | + function getPublicData(){ | |
216 | + | |
217 | + $data_id = array(); | |
218 | + $fdata_id = array(); | |
219 | + | |
220 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_dir'); | |
221 | + $sql.= " WHERE Public_flg='1' ORDER BY Usr"; | |
222 | + $res = $this->db->query($sql); | |
223 | + while($row = $this->db->fetchArray($res)){ | |
224 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_favorite_data'); | |
225 | + $sql.= " WHERE dir_id='".$row['id']."'"; | |
226 | + $res2 = $this->db->query($sql); | |
227 | + while($row2 = $this->db->fetchArray($res2)){ | |
228 | + $data_id[] = $row2['data_id']; | |
229 | + $fdata_id[] = $row2['id']; | |
230 | + } | |
231 | + } | |
232 | + | |
233 | + return array($data_id, $fdata_id); | |
234 | + } | |
235 | + | |
236 | + | |
237 | +} | |
238 | +?> | |
\ No newline at end of file |
@@ -0,0 +1,225 @@ | ||
1 | +<?php | |
2 | +# 一覧画面などに表示する文献情報取得用スクリプト created by n_takuto | |
3 | + | |
4 | +class description{ | |
5 | + | |
6 | + var $db; | |
7 | + var $user; | |
8 | + | |
9 | + function description($user='guest'){ | |
10 | + $this->db =& Database::getInstance(); | |
11 | + $this->user = $user; | |
12 | + } | |
13 | + | |
14 | + # 文献の情報を返す | |
15 | + # PMIDで取得する場合は(PMID, 'pmid') | |
16 | + # IDで取得する場合は(ID) | |
17 | + | |
18 | + function getPaperInfo($id, $mode='id'){ | |
19 | + | |
20 | + $data = array(); | |
21 | + if($mode=='id'){ | |
22 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_id')." WHERE id='".$id."'"; | |
23 | + $res = $this->db->query($sql); | |
24 | + if(!$this->db->getRowsNum($res)) return false; | |
25 | + $row = $this->db->fetchArray($res); | |
26 | + | |
27 | + $data['id'] = $id; | |
28 | + $data['pmid'] = $row['PMID']; | |
29 | + | |
30 | + }else{ | |
31 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_id')." WHERE PMID='".$id."'"; | |
32 | + $res = $this->db->query($sql); | |
33 | + if(!$this->db->getRowsNum($res)) return false; | |
34 | + $row = $this->db->fetchArray($res); | |
35 | + | |
36 | + $data['id'] = $row['id']; | |
37 | + $data['pmid'] = $id; | |
38 | + } | |
39 | + | |
40 | + $data['author'] = $this->getAuthorName($row['Author']); | |
41 | + $data['author_jp'] = $row["Author_JP"]; | |
42 | + $data['author_id'] = $row['Author']; | |
43 | + $data['journal'] = $this->getJournalName($row['Journal']); | |
44 | + $data['journal_jp'] = $this->getJournalName($row['Journal'], 'jp'); | |
45 | + $data['journal_id'] = $row['Journal']; | |
46 | + $data['title'] = $row['Title']; | |
47 | + $data['title_jp'] = $row['Title_JP']; | |
48 | + $data['v'] = $row['Volume']; | |
49 | + $data['pp'] = $row['Page']; | |
50 | + $data['year'] = $row['Year']; | |
51 | + $data['f_num'] = $row['F_num']; | |
52 | + $data['abst'] = $row['Abstract']; | |
53 | + $data['reg_usr'] = $row['R_usr']; | |
54 | + $data['reg_date'] = $row['R_date']; | |
55 | + $data['c_t1'] = $row['Custom_t1']; | |
56 | + return $data; | |
57 | + } | |
58 | + | |
59 | + # 著者名を取得 | |
60 | + | |
61 | + function getAuthorName($aid){ | |
62 | + | |
63 | + $author=""; | |
64 | + $a = explode(',', substr($aid, 0, -1)); | |
65 | + for($k=0; $k<count($a); $k++){ | |
66 | + $a[$k] = str_replace('[', '', $a[$k]); | |
67 | + $a[$k] = str_replace(']', '', $a[$k]); | |
68 | + $sql = "SELECT Author FROM ".$this->db->prefix('pmid_author')." WHERE id='".$a[$k]."'"; | |
69 | + $res = $this->db->query($sql); | |
70 | + $row = $this->db->fetchArray($res); | |
71 | + $author.=$row["Author"].", "; | |
72 | + } | |
73 | + return substr($author,0,-2); | |
74 | + } | |
75 | + | |
76 | + # ジャーナル名を取得 | |
77 | + | |
78 | + function getJournalName($jid, $type=''){ | |
79 | + | |
80 | + $sql = "SELECT Journal,Journal_JP FROM ".$this->db->prefix('pmid_journal')." WHERE id='".$jid."'"; | |
81 | + $res = $this->db->query($sql); | |
82 | + $row = $this->db->fetchArray($res); | |
83 | + | |
84 | + if($type == 'jp'){ | |
85 | + return $row['Journal_JP']; | |
86 | + }else{ | |
87 | + return $row['Journal']; | |
88 | + } | |
89 | + } | |
90 | + | |
91 | + | |
92 | + # 論文一覧画面に表示する文献情報を取得 | |
93 | + | |
94 | + # $id = 論文IDの配列 | |
95 | + # $pdfdir = PDFディレクトリへの相対パス | |
96 | + # $check_id = チェックボックスのID配列(お気に入りなどで使用する) | |
97 | + | |
98 | + function getPaper($id, $pdfdir, $check_id=''){ | |
99 | + $myts =& MyTextSanitizer::getInstance(); | |
100 | + $ret = ''; | |
101 | + for($i=0; $i<count($id); $i++){ | |
102 | + | |
103 | + if(!$data = $this->getPaperInfo($id[$i])) continue; | |
104 | + | |
105 | + if(!empty($data['author_jp'])){ | |
106 | + $a4show = $myts->makeTboxData4Show($data['author_jp']); | |
107 | + }else{ | |
108 | + $a4show = $myts->makeTboxData4Show($data['author']); | |
109 | + } | |
110 | + | |
111 | + if(!empty($data['journal_jp'])){ | |
112 | + $j4show = $myts->makeTboxData4Show($data['journal_jp']); | |
113 | + }else{ | |
114 | + $j4show = $myts->makeTboxData4Show($data['journal']); | |
115 | + } | |
116 | + | |
117 | + if(!empty($data['title_jp'])){ | |
118 | + $t4show = $myts->makeTboxData4Show($data['title_jp']); | |
119 | + }else{ | |
120 | + $t4show = $myts->makeTboxData4Show($data['title']); | |
121 | + } | |
122 | + | |
123 | + $info = $myts->makeTboxData4Show($data['year'].'-v'.$data['v'].'-pp'.$data['pp']); | |
124 | + | |
125 | + # download | |
126 | + if ($this->user != 'guest') { | |
127 | + $show_dl = "[<a href='paper_desc.php?id=".$id[$i]."'>"._MD_DESCRIPTION."</a>] "; | |
128 | + } else { | |
129 | + $show_dl = ""; | |
130 | + } | |
131 | + $class = 'even'; | |
132 | + if($data['pmid'] > 0){ | |
133 | + if(file_exists($pdfdir.'/'.$data['pmid'].'.pdf')){ | |
134 | + if ($this->user != 'guest') { | |
135 | + $show_dl .= "[<a href='".$pdfdir.'/'.$data['pmid'].".pdf' target='_blank'>PDF</a>]"; | |
136 | + } | |
137 | + $class = "head"; | |
138 | + } | |
139 | + }else{ | |
140 | + require_once 'include/wopmid.php'; | |
141 | + $file_name = wopmid($data['year'], $data['author'], $data['journal'], $data['v'], $data['pp'], $data['title']).'.pdf'; | |
142 | + if(file_exists($pdfdir.'/wopmid/'.$file_name)){ | |
143 | + if ($this->user != 'guest') { | |
144 | + $show_dl .= "[<a href='".$pdfdir.'/wopmid/'.$file_name."' target='_blank'>PDF</a>]"; | |
145 | + } | |
146 | + $class = "head"; | |
147 | + } | |
148 | + } | |
149 | + | |
150 | + #note | |
151 | + $memo = "[<a href='note.php?mid=".$data['pmid']."' target='_blank'>note "; | |
152 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_memo'); | |
153 | + #private note num | |
154 | + $res = $this->db->query($sql." WHERE data_id='".$data['pmid']."' AND Public_flg='0' AND R_usr='".$this->user."'"); | |
155 | + $memo.= " - ".$this->db->getRowsNum($res); | |
156 | + #public note num | |
157 | + $res = $this->db->query($sql." WHERE data_id='".$data['pmid']."' AND Public_flg='1'"); | |
158 | + $memo.= "/".$this->db->getRowsNum($res).""; | |
159 | + $memo.= "</a>]"; | |
160 | + | |
161 | + # favorite | |
162 | + $favorite = "[<a href='include/reg_favorite.php?id=".$id[$i]."'>favorite - ".$data['f_num']."</a>]"; | |
163 | + | |
164 | + | |
165 | + $ret.= "<table class='outer' style='width:100%'><tr>"; | |
166 | + | |
167 | + # for favorite | |
168 | + if(!empty($check_id)){ | |
169 | + $ret.= "<td rowspan='4' class='head' style='width:20px'>"; | |
170 | + $ret.= "<input type='checkbox' name='data[]' id='data".$i."' value='".$check_id[$i]."'></td>"; | |
171 | + $favorite = ''; | |
172 | + } | |
173 | + | |
174 | + $ret.= "<td colspan='2' class='".$class."'>".$t4show."</td></tr>"; | |
175 | + $ret.= "<tr><td colspan='2' class='even'>".$a4show."</td></tr>"; | |
176 | + $ret.= "<tr><td colspan='2' class='even' style='text-align:right'>".$j4show." ".$info."</td></tr>"; | |
177 | + $ret.= "<tr><td>".$favorite." ".$memo."</td><td style='text-align:right'>".$show_dl."</td></tr>"; | |
178 | + $ret.= "</table><br>"; | |
179 | + } | |
180 | + return $ret; | |
181 | + } | |
182 | + | |
183 | + | |
184 | + # PubMed検索用の一覧表示 | |
185 | + # 上の関数と似たような感じ | |
186 | + | |
187 | + function getPaper4PS($data, $pdfdir, $type, $color){ | |
188 | + | |
189 | + $myts =& MyTextSanitizer::getInstance(); | |
190 | + $a4show = $myts->makeTboxData4Show($data['author']); | |
191 | + $j4show = $myts->makeTboxData4Show($data['journal']); | |
192 | + $t4show = $myts->makeTboxData4Show($data['title']); | |
193 | + $info = $myts->makeTboxData4Show($data['year'].'-v'.$data['v'].'-pp'.$data['pp']); | |
194 | + | |
195 | + $ret = ''; | |
196 | + $show_dl=''; | |
197 | + $class = 'even'; | |
198 | + $pmidlink = "<a href='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=search&term=".$data['pmid']."' target='_blank'>".$data['pmid']."</a>"; | |
199 | + | |
200 | + if($type=='reg'){ | |
201 | + $show_dl = "[<a href='paper_desc.php?id=".$data['id']."'>"._MD_DESCRIPTION."</a>] "; | |
202 | + if(file_exists($pdfdir.'/'.$data['pmid'].'.pdf')){ | |
203 | + $show_dl .= "[<a href='".$pdfdir.'/'.$data['pmid'].".pdf' target='_blank'>PDF</a>]"; | |
204 | + $class = "head"; | |
205 | + } | |
206 | + } | |
207 | + | |
208 | + $ret.= "<table class='outer' style='width:100%'><tr>"; | |
209 | + $ret.= "<td rowspan='4' class='head' style='width:20px'>"; | |
210 | + if($type=='nonreg'){ | |
211 | + $ret.= "<input type='checkbox' name='uninterest[]' value='".$data['pmid']."'>"; | |
212 | + } | |
213 | + $ret.= "</td>"; | |
214 | + | |
215 | + $ret.= "<td colspan='2' class='".$class."' style='color:".$color."'>".$t4show."</td></tr>"; | |
216 | + $ret.= "<tr><td colspan='2' class='even'>".$a4show."</td></tr>"; | |
217 | + $ret.= "<tr><td colspan='2' class='even' style='text-align:right'>".$j4show." ".$info."</td></tr>"; | |
218 | + $ret.= "<tr><td>PMID[".$pmidlink."]</td><td style='text-align:right'>".$show_dl."</td></tr>"; | |
219 | + $ret.= "</table><br>"; | |
220 | + | |
221 | + return $ret; | |
222 | + } | |
223 | + | |
224 | +} | |
225 | +?> |
@@ -0,0 +1,70 @@ | ||
1 | +¿,?, | |
2 | +Ø,O, | |
3 | +à,a, | |
4 | +á,a, | |
5 | +â,a, | |
6 | +ã,a, | |
7 | +ä,a, | |
8 | +å,a, | |
9 | +ç,c, | |
10 | +è,e, | |
11 | +é,e, | |
12 | +ê,e, | |
13 | +ë,e, | |
14 | +ì,i, | |
15 | +í,i, | |
16 | +î,i, | |
17 | +ï,i, | |
18 | +ñ,n, | |
19 | +ò,o, | |
20 | +ó,o, | |
21 | +ô,o, | |
22 | +õ,o, | |
23 | +ö,o, | |
24 | +ø,o, | |
25 | +ù,u, | |
26 | +ú,u, | |
27 | +û,u, | |
28 | +ü,u, | |
29 | +ý,y, | |
30 | +ÿ,y, | |
31 | +ā,a, | |
32 | +ă,a, | |
33 | +ć,c, | |
34 | +ĉ,c, | |
35 | +ē,e, | |
36 | +ĕ,e, | |
37 | +ĝ,g, | |
38 | +ğ,g, | |
39 | +ģ,g, | |
40 | +ĥ,h, | |
41 | +ĩ,i, | |
42 | +ī,i, | |
43 | +ĭ,i, | |
44 | +ĵ,j, | |
45 | +ķ,k, | |
46 | +ĺ,l, | |
47 | +ļ,l, | |
48 | +Ł,L, | |
49 | +ł,l, | |
50 | +ń,n, | |
51 | +ņ,n, | |
52 | +ō,o, | |
53 | +ŏ,o, | |
54 | +ŕ,r, | |
55 | +ŗ,r, | |
56 | +ś,s, | |
57 | +ŝ,s, | |
58 | +ş,s, | |
59 | +ţ,t, | |
60 | +ũ,u, | |
61 | +ū,u, | |
62 | +ŭ,u, | |
63 | +ů,u, | |
64 | +ŵ,w, | |
65 | +ŷ,y, | |
66 | +ź,z, | |
67 | +ẁ,w, | |
68 | +ẃ,w, | |
69 | +ẅ,w, | |
70 | +ỳ,y, |
@@ -0,0 +1,110 @@ | ||
1 | +<?php | |
2 | +# 共通機能をまとめたクラス created by n_takuto | |
3 | + | |
4 | +class functions{ | |
5 | + | |
6 | + var $db; | |
7 | + var $myts; | |
8 | + var $user; | |
9 | + | |
10 | + function functions($user='guest'){ | |
11 | + $this->db =& Database::getInstance(); | |
12 | + $this->myts =& MyTextSanitizer::getInstance(); | |
13 | + $this->user = $user; | |
14 | + } | |
15 | + | |
16 | + # ショートカット作成 | |
17 | + # ?,&はGETで上手く渡せないため~~,^^に置換してDBに保存している | |
18 | + | |
19 | + function makeShortcut($pass, $name){ | |
20 | + $name = $this->myts->stripSlashesGPC($name); | |
21 | + $pass = $this->myts->stripSlashesGPC($pass); | |
22 | + $pass = str_replace("~~","?",$pass); | |
23 | + $pass = str_replace("^^","&",$pass); | |
24 | + | |
25 | + $sql = "SELECT * FROM ".$this->db->prefix('pmid_shortcut'); | |
26 | + $sql.= " WHERE Usr='".$this->user."' AND Target='".$pass."'"; | |
27 | + $res = $this->db->query($sql); | |
28 | + if($this->db->getRowsNum($res) <= 0){ | |
29 | + $name = addslashes($name); | |
30 | + $pass = addslashes($pass); | |
31 | + $sql = "INSERT INTO ".$this->db->prefix('pmid_shortcut'); | |
32 | + $sql.= " VALUES('','".$this->user."','".$name."','".$pass."')"; | |
33 | + $res = $this->db->queryF($sql); | |
34 | + } | |
35 | + return $pass; | |
36 | + } | |
37 | + | |
38 | + | |
39 | + # PubMedから取得したXMLに含まれる特殊文字対策 | |
40 | + # Substitute special chars (diacriticals) with closest standard ASCII equivalent | |
41 | + | |
42 | + function special_char_conv($str){ | |
43 | + | |
44 | + $char = array(); | |
45 | + if(file_exists("class/special_char.txt")){ | |
46 | + $file= fopen("class/special_char.txt", "r"); | |
47 | + while(!feof($file)){ | |
48 | + $char[] = fgets($file,1000); | |
49 | + } | |
50 | + fclose($file); | |
51 | + | |
52 | + for($i=0; $i<count($char); $i++){ | |
53 | + $char2 = explode(',' ,$char[$i]); | |
54 | + if(isset($char2[0]) && isset($char2[1])){ | |
55 | + $str = str_replace($char2[0], $char2[1], $str); | |
56 | + } | |
57 | + } | |
58 | + } | |
59 | + return $str; | |
60 | + } | |
61 | + | |
62 | + | |
63 | + # Journal / Book の選択ボックスを表示する | |
64 | + # $flg=1 でBookフォーム、$flg=0 でJournalフォーム | |
65 | + # | |
66 | + # 使用するときはセレクトボックスの名前に注意! | |
67 | + # selectedJournal0 -> journal | |
68 | + # selectedJournal1 -> book | |
69 | + | |
70 | + function getJournal($flg, $journal=''){ | |
71 | + global $xoopsDB; | |
72 | + | |
73 | + $form = "<select name='selectedJournal".$flg."'>"; | |
74 | + $form.= "<option label='(unknown)' value='(unknown)'>unknown "; | |
75 | + ($flg == 1) ? $form.= "book" : $form.= "journal"; | |
76 | + $form.= "</option>"; | |
77 | + | |
78 | + $label = "("; | |
79 | + $sql = "SELECT * FROM ".$xoopsDB->prefix('pmid_journal')." WHERE Book='".$flg."' ORDER BY Journal;"; | |
80 | + $res = $xoopsDB->query($sql); | |
81 | + while($row = $xoopsDB->fetchArray($res)){ | |
82 | + $j = $row["Journal"]; | |
83 | + $l = substr( $j, 0, 1 ); | |
84 | + if ( $l != $label ) { | |
85 | + if ($label != "(") $form.= "</optgroup>"; | |
86 | + $label = $l; | |
87 | + $form.= "<optgroup label='".$label."'>"; | |
88 | + } | |
89 | + if ($label != "(") { | |
90 | + $form.= "<option label='".$j."' value='".$j."'"; | |
91 | + if($j == $journal) $form.= " selected"; | |
92 | + $form.= ">"; | |
93 | + | |
94 | + if(strlen($j) > 20) $j = substr($j,0,20).".."; | |
95 | + $form.= $j; | |
96 | + | |
97 | + if($jp = $row["Journal_JP"]){ | |
98 | + if(strlen($jp) > 20) $jp = substr($jp,0,20).".."; | |
99 | + $form.= " / ".$jp; | |
100 | + } | |
101 | + $form.= "</option>"; | |
102 | + } | |
103 | + } | |
104 | + $form.= "</select>"; | |
105 | + return $form; | |
106 | + } | |
107 | + | |
108 | +} | |
109 | + | |
110 | +?> | |
\ No newline at end of file |