• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

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


Commit MetaInfo

Revision3a9d15c48ea96e76fa6340f289f5c0387f438edc (tree)
Time2008-06-10 11:23:04
Authorkmorimatsu <kmorimatsu@1ca2...>
Commiterkmorimatsu

Log Message

ver 0.3.0.0
Supports the redirection to forum page after editting.
Note that refresh of plugin event is required.

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

Change Summary

Incremental Difference

--- a/trunk/NP_SubSilver/plugins/NP_subSilver.php
+++ b/trunk/NP_SubSilver/plugins/NP_subSilver.php
@@ -3,12 +3,12 @@ class NP_subSilver extends NucleusPlugin {
33 function getName() { return 'NP_subSilver'; }
44 function getMinNucleusVersion() { return 330; }
55 function getAuthor() { return 'Katsumi'; }
6- function getVersion() { return '0.2.9.7'; }
6+ function getVersion() { return '0.3.0.0'; }
77 function getURL() {return 'http://japan.nucleuscms.org/bb/viewtopic.php?t=3257';}
88 function getDescription() { return $this->getName().' plugin'; }
99 function supportsFeature($what) { return (int)($what=='SqlTablePrefix'); }
1010 function getEventList() {
11- return array('QuickMenu','InitSkinParse','PostAuthentication',
11+ return array('QuickMenu','InitSkinParse','PostAuthentication','AdminPrePageHead',
1212 'SpamCheck','PostAddComment','ValidateForm',
1313 'PreDeleteComment','PostDeleteComment','PreUpdateComment','PrepareCommentForEdit',
1414 'PostAddItem','PostAddCategory');
@@ -64,9 +64,23 @@ try {
6464 /*]]>*/
6565 </script><?php
6666 }
67-/* Following event is used to check the values of blog/category settings */
67+/* Following event is used to check the values of blog/category settings as well as to redirect to another page */
6868 var $noblogid=false;
69+ var $returntoforum='';
6970 function event_PostAuthentication(){
71+ // Remember forum URI
72+ global $member,$CONF,$itemid;
73+ if ($member->isLoggedIn()) {
74+ if (@$CONF['UsingAdminArea']) {
75+ if (requestVar('subsilver_action')!='returntoforum') {
76+ // Set the redirect URI and forget cookie URI
77+ if (serverVar('REQUEST_METHOD')=='POST') $this->returntoforum=cookieVar($CONF['CookiePrefix'] . 'subsilver_uri');
78+ setcookie($CONF['CookiePrefix'] . 'subsilver_uri', '', 0, $CONF['CookiePath'], $CONF['CookieDomain'], $CONF['CookieSecure']);
79+ } // else the cookie remains.
80+ } elseif ($itemid) {// Set the redirect URI to cookie when not in admin page.
81+ setcookie($CONF['CookiePrefix'] . 'subsilver_uri', serverVar('REQUEST_URI'), 0, $CONF['CookiePath'], $CONF['CookieDomain'], $CONF['CookieSecure']);
82+ }
83+ }
7084 // Set blogid for the search page.
7185 global $blogid,$query,$DIR_NUCLEUS;
7286 if (strpos(realpath('./'),realpath($DIR_NUCLEUS))!==0 && ($query || getVar('search_author')) && !$blogid) {
@@ -74,7 +88,7 @@ try {
7488 $this->noblogid=true;
7589 }
7690 // Restrict member's admin area.
77- global $member,$DIR_PLUGINS,$HTTP_POST_VARS,$action;
91+ global $DIR_PLUGINS,$action;
7892 if ($member->isAdmin()) return;
7993 if (strpos(realpath('./'),realpath($DIR_PLUGINS))===0) return;
8094 if (strpos(realpath('./'),realpath($DIR_NUCLEUS))!==0) return;
@@ -83,6 +97,14 @@ try {
8397 $obj=&$this->loadClass('member');
8498 return $obj->event_PostAuthentication();
8599 }
100+ function event_AdminPrePageHead(&$data){
101+ if ($this->returntoforum){
102+ // Note that this occurs when cookie is set in POST mode
103+ // but requestVar('subsilver_action') isn't 'returntoforum'
104+ redirect($this->returntoforum);
105+ exit;
106+ }
107+ }
86108 /* General stuffs when the skin parse */
87109 function event_InitSkinParse(&$data){
88110 // Reset global $blogid if it's set in event_PostAuthentication.
@@ -199,7 +221,7 @@ try {
199221 return $obj->posting('PostAddComment',$data);
200222 } else {
201223 $obj=&$this->loadClass('comments');
202- return $obj->event_PostAddComment(&$data);
224+ return $obj->event_PostAddComment($data);
203225 }
204226 }
205227 // PostAddItem event occurs when a new blog is created.
@@ -214,19 +236,19 @@ try {
214236 /* Following events are used when the comment is modified */
215237 function event_PreDeleteComment(&$data){
216238 $obj=&$this->loadClass('comments');
217- return $obj->event_PreDeleteComment(&$data);
239+ return $obj->event_PreDeleteComment($data);
218240 }
219241 function event_PostDeleteComment(&$data){
220242 $obj=&$this->loadClass('comments');
221- return $obj->event_PostDeleteComment(&$data);
243+ return $obj->event_PostDeleteComment($data);
222244 }
223245 function event_PrepareCommentForEdit(&$data){
224246 $obj=&$this->loadClass('comments');
225- return $obj->event_PrepareCommentForEdit(&$data);
247+ return $obj->event_PrepareCommentForEdit($data);
226248 }
227249 function event_PreUpdateComment(&$data){
228250 $obj=&$this->loadClass('comments');
229- return $obj->event_PreUpdateComment(&$data);
251+ return $obj->event_PreUpdateComment($data);
230252 }
231253 /* General class object manager */
232254 var $classobjects=array();
--- a/trunk/NP_SubSilver/skins/subsilver/category.inc
+++ b/trunk/NP_SubSilver/skins/subsilver/category.inc
@@ -5,10 +5,12 @@
55 </tr>
66 <tr>
77 <td align="left" valign="middle" width="50">
8+ <%if(subSilver,member,can=postnew)%>
89 <form method="post" action="#nucleus_cf" style="position:absolute;">
910 <input type="hidden" name="subSilver_action" value="posting" />
1011 <input type="image" src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" />
1112 </form><img src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" />
13+ <%endif%>
1214 </td>
1315 <td class="nav" align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="<%sitevar(url)%>" class="nav"><%sitevar(name)%> フォーラム一覧</a> -&gt; <a class="nav" href="?catid=<%category(id)%>&amp;blogid=<%blogsetting(id)%>"><%category(name)%></a></span></td>
1416 <td class="nav" align="right" nowrap="nowrap" valign="bottom">
@@ -72,10 +74,12 @@
7274 <table align="center" border="0" cellpadding="2" cellspacing="2" width="100%">
7375 <tbody><tr>
7476 <td align="left" valign="middle" width="50">
77+ <%if(subSilver,member,can=postnew)%>
7578 <form method="post" action="#nucleus_cf" style="position:absolute;">
7679 <input type="hidden" name="subSilver_action" value="posting" />
7780 <input type="image" src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" />
7881 </form><img src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" />
82+ <%endif%>
7983 </td>
8084 <td align="left" valign="middle" width="100%"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="<%sitevar(url)%>" class="nav"><%sitevar(name)%> フォーラム一覧</a> -&gt; <a class="nav" href="?catid=<%category(id)%>&amp;blogid=<%blogsetting(id)%>"><%category(name)%></a></span></td>
8185 <td align="right" nowrap="nowrap" valign="middle"><br /><span class="nav"></span>
--- a/trunk/NP_SubSilver/skins/subsilver/faq.inc
+++ b/trunk/NP_SubSilver/skins/subsilver/faq.inc
@@ -6,6 +6,7 @@
66 </tr>
77 </table>
88
9+<%if(admin)%>
910 <%subSilver(includelanguage,faq.inc)%><br />
1011 <%subSilver(includelanguage,faq1.inc)%><br />
1112 <%subSilver(includelanguage,faq2.inc)%><br />
@@ -14,3 +15,6 @@
1415 <%subSilver(includelanguage,faq5.inc)%><br />
1516 <%subSilver(includelanguage,faq6.inc)%><br />
1617 <%subSilver(includelanguage,faq7.inc)%><br />
18+<%else%>
19+FAQは現在準備中です。
20+<%endif%>
\ No newline at end of file
--- a/trunk/NP_SubSilver/skins/subsilver/item.inc
+++ b/trunk/NP_SubSilver/skins/subsilver/item.inc
@@ -5,7 +5,7 @@
55 <table border="0" cellpadding="2" cellspacing="2" width="100%">
66 <tbody><tr>
77 <td colspan="2" align="left" valign="bottom"><a class="maintitle" href="?itemid=<%itemid%>"><%itemtitle%></a>
8- <%if(admin)%><a href="<%adminurl%>?action=itemedit&itemid=<%itemid%>"><img src="<%skinfile(images/lang_english/icon_edit.gif)%>"/ alt="edit" title="edit" /></a><%endif%>
8+ <%if(admin)%><a href="<%adminurl%>?action=itemedit&amp;itemid=<%itemid%>&amp;subsilver_action=returntoforum"><img src="<%skinfile(images/lang_english/icon_edit.gif)%>"/ alt="edit" title="edit" /></a><%endif%>
99 <br /><span class="gensmall"><b></b><br />
1010 &nbsp; </span></td>
1111 </tr>
@@ -15,6 +15,7 @@
1515 <tbody><tr>
1616 <td align="left" nowrap="nowrap" valign="bottom">
1717 <span class="nav">
18+ <%if(subSilver,member,can=postnew)%>
1819 <input type="image" name="subSilver_action" value="posting" src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" onclick="
1920 document.getElementById('subsilver_form_body').value='';
2021 document.getElementById('subsilver_form_dummy').name=this.name;
@@ -22,12 +23,15 @@ document.getElementById('subsilver_form_dummy').value=this.value;
2223 return true;
2324 " />
2425 &nbsp;&nbsp;
26+ <%endif%>
27+ <%if(subSilver,member,can=reply)%>
2528 <input type="image" name="subSilver_action" value="commentform" src="<%skinfile(images/lang_english/reply.gif)%>" alt="返信" title="返信" onclick="
2629 document.getElementById('subsilver_form_body').value='';
2730 document.getElementById('subsilver_form_dummy').name=this.name;
2831 document.getElementById('subsilver_form_dummy').value=this.value;
2932 return true;
3033 " />
34+ <%endif%>
3135 </span>
3236 </td>
3337 <td align="left" valign="middle"><span class="nav">&nbsp;&nbsp;&nbsp;<a href="<%sitevar(url)%>" class="nav"><%sitevar(name)%> フォーラム一覧</a> -&gt; <a class="nav" href="<%self%>?catid=<%category(id)%>&amp;blogid=<%blogsetting(id)%>"><%category(name)%></a></span></td>
@@ -60,6 +64,7 @@ return true;
6064 <tbody><tr>
6165 <td align="left" nowrap="nowrap" valign="bottom">
6266 <span class="nav">
67+ <%if(subSilver,member,can=postnew)%>
6368 <input type="image" name="subSilver_action" value="posting" src="<%skinfile(images/lang_english/post.gif)%>" alt="トピックの新規投稿" title="トピックの新規投稿" onclick="
6469 document.getElementById('subsilver_form_body').value='';
6570 document.getElementById('subsilver_form_dummy').name=this.name;
@@ -67,12 +72,15 @@ document.getElementById('subsilver_form_dummy').value=this.value;
6772 return true;
6873 " />
6974 &nbsp;&nbsp;
75+ <%endif%>
76+ <%if(subSilver,member,can=reply)%>
7077 <input type="image" name="subSilver_action" value="commentform" src="<%skinfile(images/lang_english/reply.gif)%>" alt="返信" title="返信" onclick="
7178 document.getElementById('subsilver_form_body').value='';
7279 document.getElementById('subsilver_form_dummy').name=this.name;
7380 document.getElementById('subsilver_form_dummy').value=this.value;
7481 return true;
7582 " />
83+ <%endif%>
7684 </span>
7785 </td>
7886 <td align="right" nowrap="nowrap" valign="top">
--- a/trunk/NP_SubSilver/skins/subsilver/onlinedata.inc
+++ b/trunk/NP_SubSilver/skins/subsilver/onlinedata.inc
@@ -2,7 +2,7 @@
22
33 <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
44 <tr>
5- <td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="viewonline.php?sid=10078eb7dbbadbd85d2f386ceb800a0a" class="cattitle">オンライン管理</a></span></td>
5+ <td class="catHead" colspan="2" height="28"><span class="cattitle">オンライン管理</span></td>
66 </tr>
77 <tr>
88 <td class="row1" align="center" valign="middle" rowspan="2"><img src="<%skinfile(images/whosonline.gif)%>" alt="オンライン管理" /></td>
--- a/trunk/NP_SubSilver/skins/subsilver/skinbackup.xml
+++ b/trunk/NP_SubSilver/skins/subsilver/skinbackup.xml
@@ -147,12 +147,10 @@ title="<:categoryicon:<%catid%>:新しい記事有り:新しい記事無し:ロ
147147 <td nowrap="nowrap" valign="top"><input type="image" name="subSilver_action" value="commentform" src="<%skinfile(images/lang_english/icon_quote.gif)%>" alt="引用" title="引用" onclick="
148148 document.getElementById('subsilver_form_body').value=
149149 '[quote=<%user(realname)%>]' + document.getElementById('commentbody_<%commentid%>').innerHTML + '[/quote]';
150-document.getElementById('subsilver_form_dummy').name=this.name;
151-document.getElementById('subsilver_form_dummy').value=this.value;
152150 return true;
153151 " />
154152 <%subSilver(if,caneditcomment)%>
155- <a href="<%subSilver(adminurl)%>?action=commentedit&commentid=<%commentid%>" ><img src="<%skinfile(images/lang_english/icon_edit.gif)%>" alt="edit" title="edit" border="0" /></a>
153+ <a href="<%subSilver(adminurl)%>?action=commentedit&amp;commentid=<%commentid%>&amp;subsilver_action=returntoforum" ><img src="<%skinfile(images/lang_english/icon_edit.gif)%>" alt="edit" title="edit" border="0" /></a>
156154 <%subSilver(endif)%>
157155 </td>
158156 </tr>
Show on old repository browser