• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの


Commit MetaInfo

Revision12f0e5defdd3718cf913f40eb96417d49f468377 (tree)
Time2008-12-20 11:42:56
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

NP_PubMed v0.1.7
bugfix: PMID wasn't shown in search result page
add: manuscript listing feature
add: support non-NP_PageSwitch environment

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@755 1ca29b6e-896d-4ea0-84a5-967f57386b96

Change Summary

Incremental Difference

--- a/NP_PubMed/trunk/NP_PubMed.php
+++ b/NP_PubMed/trunk/NP_PubMed.php
@@ -3,7 +3,7 @@ class NP_PubMed extends NucleusPlugin {
33 function getName() { return 'NP_PubMed'; }
44 function getMinNucleusVersion() { return 330; }
55 function getAuthor() { return 'Katsumi'; }
6- function getVersion() { return '0.1.6'; }
6+ function getVersion() { return '0.1.7'; }
77 function getURL() {return 'http://hp.vector.co.jp/authors/VA016157/';}
88 function getDescription() {
99 return $this->getName().' plugin<br />'.
@@ -185,7 +185,8 @@ class NP_PubMed extends NucleusPlugin {
185185 }
186186 }
187187 function doSkinVar($skintype,$mode,$p1='',$p2=''){
188- global $CONF,$manager,$blog;
188+ global $CONF,$manager,$blog,$member;
189+ $mid=$member->getID();
189190 switch($mode=strtolower($mode)){
190191 case 'searchlink':
191192 if (!$this->isAdmin()) return;
@@ -248,6 +249,24 @@ class NP_PubMed extends NucleusPlugin {
248249 $blog->showUsingQuery($template, $query.' LIMIT '.$startpos.','.$limit, '', 1, 1);
249250 break;
250251 }
252+ case 'manuscriptlist':
253+ if (!$mid) return;
254+ if (!$blog) return;
255+ $blogid=$blog->getID();
256+ $template =& $manager->getTemplate($p1);
257+ //print_r($template['CATLIST_LISTITEM']);exit;
258+ $res=sql_query('SELECT manuscriptname as name, manuscriptid as id'.
259+ ' FROM '.sql_table('plugin_pubmed_manuscripts').
260+ ' WHERE userid='.(int)$mid);
261+ while($row=mysql_fetch_assoc($res)){
262+ $values=array(
263+ 'catlink'=>$CONF['IndexURL'].'?special=references&amp;blogid='.(int)$blogid.'&amp;manuscriptid='.(int)$row['id'],
264+ 'catid'=>(int)$row['id'],
265+ 'catname'=>htmlspecialchars($row['name'],ENT_QUOTES)
266+ );
267+ echo TEMPLATE::fill($template['CATLIST_LISTITEM'],$values);
268+ }
269+ break;
251270 default:
252271 break;
253272 }
--- a/NP_PubMed/trunk/pubmed/index.php
+++ b/NP_PubMed/trunk/pubmed/index.php
@@ -1,21 +1,28 @@
11 <?php
22
33 $strRel = '../../../';
4+$DIR_LIBS='';
45 require($strRel . 'config.php');
56 $pbadmin=new PubMedAdmin;
67 exit;
78
89 class PubMedAdmin {
9- var $oPluginAdmin;
10+ var $oPluginAdmin,$plugin;
1011 var $blogid;
1112 function PubMedAdmin(){
12- global $DIR_LIBS,$manager,$member,$CONF;
13+ return $this->__construct();
14+ }
15+ function __construct(){
16+ global $DIR_LIBS,$manager,$member,$CONF, $HTTP_POST_VARS;
1317 include($DIR_LIBS . 'PLUGINADMIN.php');
1418
19+ // Initialize
1520 $this->oPluginAdmin = new PluginAdmin('PubMed');
21+ $this->plugin=&$this->oPluginAdmin->plugin;
1622 if (!($this->blogid=intPostVar('blogid'))) $this->blogid=intGetVar('blogid');
1723 $CONF['ItemURL']=quickQuery('SELECT burl as result FROM '.sql_table('blog'). ' WHERE bnumber='.(int)$this->blogid);
1824
25+ // Check if there is right to maintain the blog by member.
1926 if (!$member->isLoggedIn() || !$member->teamRights($this->blogid) || !$manager->existsBlogID($this->blogid))
2027 {
2128 $this->oPluginAdmin->start();
@@ -24,6 +31,7 @@ class PubMedAdmin {
2431 exit;
2532 }
2633
34+ // If some data is/are posted, check the ticket.
2735 if (!isset($_POST)) $_POST=&$HTTP_POST_VARS;
2836 if (count($_POST) && !$manager->checkTicket()) {
2937 $this->oPluginAdmin->start();
@@ -31,20 +39,27 @@ class PubMedAdmin {
3139 $this->oPluginAdmin->end();
3240 exit;
3341 }
34-
42+
43+ // Resolve action
3544 if (!($action=postVar('action'))) {
3645 if (!($action=getVar('action'))) $action='searchform';
3746 }
3847
48+ // The functions whose name start from '_' are not actions, but private ones.
3949 if (substr($action,0,1)=='_' || !method_exists($this,$action)) exit('Error: '.__LINE__);
40-
50+
51+ // There are two modes, so far.
4152 $this->oPluginAdmin->start();
4253 switch(getVar('action')) {
43- case 'manuscriptlist':
44- echo "<h2>" . 'Manuscript management' . "</h2>\n";
45- break;
46- default:
47- echo "<h2>" . 'PubMed search' . "</h2>\n";
54+ case 'manuscriptlist':
55+ echo '<h2><a href="'.$this->plugin->getAdminURL().'?blogid='.
56+ (int)$this->blogid.'&amp;action=manuscriptlist">' .
57+ 'Manuscript management' . "</a></h2>\n";
58+ break;
59+ default:
60+ echo '<h2><a href="'.$this->plugin->getAdminURL().'?blogid='.
61+ (int)$this->blogid.'">' .
62+ 'PubMed search' . "</a></h2>\n";
4863 }
4964 call_user_func(array(&$this,$action));
5065 $this->oPluginAdmin->end();
@@ -57,7 +72,7 @@ class PubMedAdmin {
5772 <?php $manager->addTicketHidden(); ?>
5873 <input type="hidden" name="action" value="searchquery" />
5974 <input type="hidden" name="blogid" value="<?php echo (int)$this->blogid; ?>" />
60-<input type="text" name="query" value="<?php htmlspecialchars(postVar('query')); ?>" size="60" />
75+<input type="text" name="query" value="<?php echo htmlspecialchars(postVar('query')); ?>" size="60" />
6176 <input type="submit" value="Search" /><br />
6277 <a href="http://www.ncbi.nlm.nih.gov/sites/entrez?db=PubMed" onclick="window.open(this.href);return false;">Goto the NIH PubMed site</a>
6378 </form>
--- a/NP_PubMed/trunk/spring/navigation.inc
+++ b/NP_PubMed/trunk/spring/navigation.inc
@@ -1,56 +1,61 @@
1-<!-- archive: page title and extra navigational links -->
2-<%if(skintype,archive)%>
3-<title><%blogsetting(name)%> &raquo; Archive</title>
4-<link rel="archives" title="Archives" href="<%archivelink%>" />
5-<link rel="top" title="Today" href="<%sitevar(url)%>" />
6-<link rel="up" href="<%todaylink%>" title="Today" />
7-<%endif%>
8-
9-<!-- archivelist: page title and extra navigational links -->
10-<%if(skintype,archivelist)%>
11-<title><%blogsetting(name)%> &raquo; Archive List</title>
12-<link rel="archives" title="Archives" href="<%archivelink%>" />
13-<link rel="top" title="Today" href="<%sitevar(url)%>" />
14-<link rel="up" href="<%todaylink%>" title="Today" />
15-<%endif%>
16-
17-<!-- error: page title and extra navigational links -->
18-<%if(skintype,error)%>
19-<title><%sitevar(name)%> &raquo; Error!</title>
20-<link rel="top" title="Today" href="<%todaylink%>" />
21-<link rel="up" href="<%todaylink%>" title="Today" />
22-<%endif%>
23-
24-<!-- index: page title and extra navigational links -->
25-<%if(skintype,index)%>
26-<title><%blogsetting(name)%></title>
27-<link rel="bookmark" title="Nucleus" href="http://nucleuscms.org/" />
28-<link rel="archives" title="Archives" href="<%archivelink%>" />
29-<link rel="top" title="Today" href="<%todaylink%>" />
30-<%endif%>
31-
32-<!-- item: page title and extra navigational links -->
33-<%if(skintype,item)%>
34-<title><%blogsetting(name)%> &raquo; <%itemtitle(attribute)%></title>
35-<link rel="archives" title="Archives" href="<%archivelink%>" />
36-<link rel="top" title="Today" href="<%sitevar(url)%>" />
37-<link rel="next" href="<%nextlink%>" title="Next Item" />
38-<link rel="prev" href="<%prevlink%>" title="Previous Item" />
39-<link rel="up" href="<%todaylink%>" title="Today" />
40-<%endif%>
41-
42-<!-- member: page title and extra navigational links -->
43-<%if(skintype,member)%>
44-<title><%blogsetting(name)%> &raquo; Member Details</title>
45-<link rel="top" title="Today" href="<%todaylink%>" />
46-<link rel="up" href="<%todaylink%>" title="Today" />
47-<%endif%>
48-
49-<!-- search: page title and extra navigational links -->
50-<%if(skintype,search)%>
51-<title><%blogsetting(name)%> &raquo; Search</title>
52-<link rel="archives" title="Archives" href="<%archivelink%>" />
53-<link rel="top" title="Today" href="<%sitevar(url)%>" />
54-<link rel="up" href="<%todaylink%>" title="Today" />
55-<%endif%>
1+<!-- archive: page title and extra navigational links -->
2+<%if(skintype,archive)%>
3+<title><%blogsetting(name)%> &raquo; Archive</title>
4+<link rel="archives" title="Archives" href="<%archivelink%>" />
5+<link rel="top" title="Today" href="<%sitevar(url)%>" />
6+<link rel="up" href="<%todaylink%>" title="Today" />
7+<%endif%>
8+
9+<!-- archivelist: page title and extra navigational links -->
10+<%if(skintype,archivelist)%>
11+<title><%blogsetting(name)%> &raquo; Archive List</title>
12+<link rel="archives" title="Archives" href="<%archivelink%>" />
13+<link rel="top" title="Today" href="<%sitevar(url)%>" />
14+<link rel="up" href="<%todaylink%>" title="Today" />
15+<%endif%>
16+
17+<!-- error: page title and extra navigational links -->
18+<%if(skintype,error)%>
19+<title><%sitevar(name)%> &raquo; Error!</title>
20+<link rel="top" title="Today" href="<%todaylink%>" />
21+<link rel="up" href="<%todaylink%>" title="Today" />
22+<%endif%>
23+
24+<!-- index: page title and extra navigational links -->
25+<%if(skintype,index)%>
26+<title><%blogsetting(name)%></title>
27+<link rel="bookmark" title="Nucleus" href="http://nucleuscms.org/" />
28+<link rel="archives" title="Archives" href="<%archivelink%>" />
29+<link rel="top" title="Today" href="<%todaylink%>" />
30+<%endif%>
31+
32+<!-- References: page title (TODO: insert manuscript name here)-->
33+<%if(skintype,references)%>
34+<title><%blogsetting(name)%></title>
35+<%endif%>
36+
37+<!-- item: page title and extra navigational links -->
38+<%if(skintype,item)%>
39+<title><%blogsetting(name)%> &raquo; <%itemtitle(attribute)%></title>
40+<link rel="archives" title="Archives" href="<%archivelink%>" />
41+<link rel="top" title="Today" href="<%sitevar(url)%>" />
42+<link rel="next" href="<%nextlink%>" title="Next Item" />
43+<link rel="prev" href="<%prevlink%>" title="Previous Item" />
44+<link rel="up" href="<%todaylink%>" title="Today" />
45+<%endif%>
46+
47+<!-- member: page title and extra navigational links -->
48+<%if(skintype,member)%>
49+<title><%blogsetting(name)%> &raquo; Member Details</title>
50+<link rel="top" title="Today" href="<%todaylink%>" />
51+<link rel="up" href="<%todaylink%>" title="Today" />
52+<%endif%>
53+
54+<!-- search: page title and extra navigational links -->
55+<%if(skintype,search)%>
56+<title><%blogsetting(name)%> &raquo; Search</title>
57+<link rel="archives" title="Archives" href="<%archivelink%>" />
58+<link rel="top" title="Today" href="<%sitevar(url)%>" />
59+<link rel="up" href="<%todaylink%>" title="Today" />
60+<%endif%>
5661 </head>
\ No newline at end of file
--- /dev/null
+++ b/NP_PubMed/trunk/spring/paging.inc
@@ -0,0 +1,20 @@
1+<%if(hasplugin,PageSwitch)%>
2+
3+<%if(PageSwitch,limit,10)%>
4+<div style="text-align:right;">Pages:
5+<%PageSwitch(prev,prev)%>
6+<%PageSwitch(index,2)%>
7+<%PageSwitch(next,next)%>
8+Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
9+</div>
10+<%endif%>
11+
12+<%else%>
13+
14+<div style="text-align:right">
15+<%prevlink(<<< prev page,10)%>
16+&nbsp;&nbsp;&nbsp;
17+<%nextlink(next page >>>,10)%>
18+</div>
19+
20+<%endif%>
\ No newline at end of file
--- a/NP_PubMed/trunk/spring/sidebar.inc
+++ b/NP_PubMed/trunk/spring/sidebar.inc
@@ -19,6 +19,17 @@
1919 </dl>
2020 </div>
2121
22+<!-- manuscript list -->
23+<%if(loggedin)%>
24+<div class="sidebar">
25+<dl class="sidebardl">
26+<dt>Manuscripts</dt>
27+<dd><a href="<%adminurl%>plugins/pubmed/?blogid=<%blogsetting(id)%>&amp;action=manuscriptlist">(manegement)</a></dd>
28+<%PubMed(manuscriptlist,spring/item)%>
29+</dl>
30+</div>
31+<%endif%>
32+
2233 <!-- category list, not on error or member page -->
2334 <%if(skintype,error)%><%else%>
2435 <%if(skintype,member)%><%else%>
--- a/NP_PubMed/trunk/spring/skinbackup.xml
+++ b/NP_PubMed/trunk/spring/skinbackup.xml
@@ -116,41 +116,11 @@ body { margin: 0px; }
116116 <%PubMed(SearchLink)%><br /><br />
117117 <%PubMed(CreateNew)%>
118118
119-<%if(PubMed,getVar,manuscriptid=)%>
119+<%parsedinclude(paging.inc)%>
120120
121-<%if(PageSwitch,limit,10)%>
122-<div style="text-align:right;">Pages:
123-<%PageSwitch(prev,prev)%>
124-<%PageSwitch(index,2)%>
125-<%PageSwitch(next,next)%>
126-Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
127-</div>
128-<%endif%>
121+<%blog(spring/index,10)%>
129122
130-<%MultipleCategories(spring/index,10)%>
131-
132-<%if(PageSwitch,limit,10)%>
133-<div style="text-align:right;">Pages:
134-<%PageSwitch(prev,prev)%>
135-<%PageSwitch(index,2)%>
136-<%PageSwitch(next,next)%>
137-Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
138-</div>
139-<%endif%>
140-
141-<%else%>
142-<%PubMed(PageSwitch,,50)%>
143-<%if(PageSwitch,limit,50)%>
144-<div style="text-align:right;">Pages:
145-<%PageSwitch(prev,prev)%>
146-<%PageSwitch(index,2)%>
147-<%PageSwitch(next,next)%>
148-Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
149-</div>
150-<%endif%>
151-
152-<%PubMed(parse,spring/index,50)%>
153-<%endif%>
123+<%parsedinclude(paging.inc)%>
154124
155125 </div>
156126 </div>
@@ -230,6 +200,39 @@ Website: <a href="<%member(url)%>"><%member(url)%></a>
230200 <!-- page footer -->
231201 <%parsedinclude(footer.inc)%>]]></part>
232202
203+ <part name="references"><![CDATA[<%parsedinclude(head.inc)%>
204+
205+<!-- page header -->
206+<%parsedinclude(header.inc)%>
207+
208+<!-- page content -->
209+<div id="container">
210+<div class="content">
211+
212+<%PubMed(PageSwitch,,50)%>
213+<%if(PageSwitch,limit,50)%>
214+<div style="text-align:right;">Pages:
215+<%PageSwitch(prev,prev)%>
216+<%PageSwitch(index,2)%>
217+<%PageSwitch(next,next)%>
218+Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
219+</div>
220+<%endif%>
221+
222+<%PubMed(parse,spring/index,50)%>
223+
224+</div>
225+</div>
226+
227+<!-- page menu -->
228+<h2 class="hidden">Sidebar</h2>
229+<div id="sidebarcontainer">
230+<%parsedinclude(sidebar.inc)%>
231+</div>
232+
233+<!-- page footer -->
234+<%parsedinclude(footer.inc)%>]]></part>
235+
233236 <part name="search"><![CDATA[<%parsedinclude(head.inc)%>
234237
235238 <!-- page header -->
@@ -249,25 +252,11 @@ onclick="window.open(this.href);return false;"
249252 </div>
250253 <div class="content">
251254
252-<%if(PageSwitch,limit,10)%>
253-<div style="text-align:right;">Pages:
254-<%PageSwitch(prev,prev)%>
255-<%PageSwitch(index,2)%>
256-<%PageSwitch(next,next)%>
257-Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
258-</div>
259-<%endif%>
255+<%parsedinclude(paging.inc)%>
260256
261257 <%searchresults(spring/index,10)%>
262258
263-<%if(PageSwitch,limit,10)%>
264-<div style="text-align:right;">Pages:
265-<%PageSwitch(prev,prev)%>
266-<%PageSwitch(index,2)%>
267-<%PageSwitch(next,next)%>
268-Page <%PageSwitch(num)%> of <%PageSwitch(total)%>
269-</div>
270-<%endif%>
259+<%parsedinclude(paging.inc)%>
271260
272261 </div>
273262 </div>
@@ -370,8 +359,6 @@ return false;
370359
371360 <part name="POPUP_CODE"><![CDATA[<%popuplink%>]]></part>
372361
373- <part name="SEARCH_HIGHLIGHT"><![CDATA[<span class=highlight>\0</span>]]></part>
374-
375362 <part name="SEARCH_NOTHINGFOUND"><![CDATA[No search results found for <b><%query%></b>]]></part>
376363
377364 </template>
@@ -379,6 +366,10 @@ return false;
379366
380367 <template name="spring/item">
381368 <description>Nucleus CMS spring item template</description>
369+ <part name="CATLIST_LISTITEM"><![CDATA[<dd>
370+<a href="<%catlink%>" title="Manuscript: <%catname%>"><%catname%></a>
371+</dd>]]></part>
372+
382373 <part name="COMMENTS_BODY"><![CDATA[<div class="itemcomment id<%memberid%>">
383374 <h3><a href="<%userlinkraw%>"
384375 title="<%ip%> | Click to visit <%user%>'s website or send an email">
Show on old repository browser