• R/O
  • SSH
  • HTTPS

jeanscms: コミット


コミットメタ情報

リビジョン349 (tree)
日時2014-10-19 13:50:15
作者kmorimatsu

ログメッセージ

(メッセージはありません)

変更サマリ

差分

--- plugins/Nucleus/tags/v021/jp_Nucleus.php (nonexistent)
+++ plugins/Nucleus/tags/v021/jp_Nucleus.php (revision 349)
@@ -0,0 +1,33 @@
1+<?php
2+/*
3+ * Jeans CMS (GPL license)
4+ * $Id$
5+ */
6+
7+class jp_Nucleus extends plugin{
8+ static public function name(){
9+ return 'Nucleus skin Plugin';
10+ }
11+ static public function author(){
12+ return 'Jeans CMS developping team';
13+ }
14+ static public function url(){
15+ return 'http://jeanscms.sourceforge.jp/';
16+ }
17+ static public function desc(){
18+ return '_JP_NUCLEUS_DESC';
19+ }
20+ static public function version(){
21+ return '0.2.1';
22+ }
23+ static public function if_skin(&$data,$type,$p1=false,$p2=false){
24+ $args=array(&$data,$p1,$p2);
25+ $method=array('jp_Nucleus_skin','if_'.$type);
26+ return call_user_func_array($method,$args);
27+ }
28+ static public function if_template(&$data,$type,$p1=false,$p2=false){
29+ $args=array(&$data,$p1,$p2);
30+ $method=array('jp_Nucleus_template','if_'.$type);
31+ return call_user_func_array($method,$args);
32+ }
33+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_template.php (nonexistent)
+++ plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_template.php (revision 349)
@@ -0,0 +1,306 @@
1+<?php
2+/*
3+ * Following templatevars are not supported
4+ * karma, daylink, karmaposlink, karmaneglink, new, popup, relevance
5+ */
6+class jp_Nucleus_template extends jeans {
7+/*
8+ * Templates: Category Lists
9+
10+The category lists are formatted as listed below:
11+
12+categorylist header
13+ categorylist listitem (repeated)
14+categorylist footer
15+
16+Available variables: (in the header and footer, only blogid, blogurl and self are allowed)
17+Name Description
18+blogid ID of the weblog
19+blogurl URL of the blog (as defined in blogsettings)
20+self Current page, without parameters (e.g. index.php)
21+catlink a link to the most recent items for a category, which you can embed in a <a href=".."> tag.
22+catid Category ID
23+catname Category name
24+catdesc Category description
25+catiscurrent yes if category is currently selected, no if it is not. Useful to style current category.
26+currentcat Synonym of catiscurrent
27+ */
28+ static private function select_template(&$data){
29+ if (preg_match('/([a-zA-Z0-9]+)\.inc$/',$data['skin'],$m)) return $m[1];
30+ else return 'unknown';
31+ }
32+ static public function tag_blogid(&$data){
33+ self::p($data['jp']['nucleus']['blogid']);
34+ }
35+ static public function tag_blogurl(&$data){
36+ switch(self::select_template($data)){
37+ case 'catlist':
38+ return self::p(blog::setting('url',$data['jp']['nucleus']['blogid']));
39+ case 'bloglist':
40+ return self::p($data['link']);
41+ }
42+ }
43+ static public function tag_self(&$data){
44+ self::p(_CONF_SELF);
45+ }
46+ static public function tag_catlink(&$data){
47+ self::p($data['link']);
48+ }
49+ static public function tag_catid(&$data){
50+ self::p($data['id']);
51+ }
52+ static public function tag_catname(&$data){
53+ self::p($data['name']);
54+ }
55+ static public function tag_catdesc(&$data){
56+ self::p($data['desc']);
57+ }
58+ static public function if_catiscurrent(&$data){
59+ return $_GET['sgid']==$data['id'];
60+ }
61+ static public function if_currentcat(&$data){
62+ return self::if_catiscurrent($data);
63+ }
64+/*
65+ * Templates: Blog Lists
66+
67+The blog lists are formatted as listed below:
68+
69+bloglist header
70+ bloglist listitem (repeated)
71+bloglist footer
72+
73+Available variables in list item field:
74+Name Description
75+bloglink URL of the blog (as generated by createBlogIdLink() function)
76+blogurl URL of the blog (as defined in blogsettings)
77+blogdesc Description of the blog
78+blogname Name of the blog (either full or short, depending on skinvar parameter).
79+
80+Available variables in header and footer fields:
81+Name Description
82+siteurl URL of the site (as defined in global settings)
83+sitename Name of the site (as defined in global settings).
84+ */
85+ static public function tag_bloglink(&$data){
86+ self::p($data['link']);
87+ }
88+ /*static public function tag_blogurl(&$data){
89+ * see above;
90+ }*/
91+ static public function tag_blogdesc(&$data){
92+ self::p($data['desc']);
93+ }
94+ static public function tag_blogname(&$data){
95+ self::p($data['name']);
96+ }
97+ static public function tag_siteurl(&$data){
98+ self::p(_CONF_URL_INDEX);
99+ }
100+ static public function tag_sitename(&$data){
101+ self::p(_CONF_SITE_NAME);
102+ }
103+/*
104+ * Template variables: Basic variables
105+
106+All these variables concern the item that's currently being parsed.
107+Name Description
108+title item title
109+body body text
110+more extended text
111+category name of the category
112+categorylink raw link to the category
113+karma karma score
114+authorlink raw link to the author
115+itemlink raw permanent link for the item
116+author name of the author
117+smartbody either the body text or the extended text
118+morelink 'read more'-link
119+date Formatted date
120+time Formatted time
121+daylink raw link to the daily archive
122+comments comments block or commentcount
123+itemid ID of the item
124+blogurl URL of the blog
125+
126+Template variables: Advanced variables
127+Name Description
128+authorid ID of the current items author
129+blogid ID of the blog
130+catid ID of the category for the current item
131+query search query (if there is one)
132+syndicate_title Syndicated title
133+syndicate_description Syndicated body text
134+karmaposlink raw vote link
135+karmaneglink raw vote link
136+new 'New Item!'-text
137+include includes a file, whithout parsing
138+parsedinclude includes a file, parsing it
139+phpinclude includes a file, parsing by PHP
140+plugin executes a plugin
141+edit inserts an 'edit this item' link
142+editlink raw 'edit item' link (links to bookmarklet)
143+editpopupcode javascript code to open a popup window for editlink
144+skinfile includes the correct URL for a file belonging to an imported skin
145+set sets a parser property
146+image inline image from media library
147+popup popup image from media dir
148+media other media object from media dir
149+relevance Includes the 'search hit relevance' in templates that display search results
150+ */
151+ public static function tag_more(&$data){
152+ self::echo_html($data['more']);
153+ }
154+ public static function tag_editlink(&$data){
155+ self::p(_CONF_URL_ADMIN.'?page=edititem&itemid='.$data['id']);
156+ }
157+ public static function tag_editpopupcode(&$data){
158+ self::p('window.open(this.href);return false;');
159+ }
160+ public static function tag_morelink(&$data){
161+ if (0<strlen($data['more'])) view::tag_template($data,'more');
162+ }
163+ public static function tag_comments(&$data,$maxtoshow=0){
164+ $skin=preg_replace('/_item\.inc$/','_comment.inc',$data['skin']);
165+ if ($data['comments']==0) {
166+ view::tag_template($data,'none',$skin);
167+ } elseif ($maxtoshow<$data['comments']) {
168+ view::tag_template($data,'many',$skin);
169+ } else {
170+ comments::tag_comments($data,$skin);
171+ }
172+ }
173+ public static function tag_body(&$data){
174+ self::echo_html($data['body']);
175+ }
176+ public static function tag_smartbody(&$data){
177+ if (0<strlen($data['more'])) self::echo_html($data['more']);
178+ else self::echo_html($data['body']);
179+ }
180+ public static function tag_itemid(&$data){
181+ self::p($data['id']);
182+ }
183+ public static function tag_authorid(&$data){
184+ self::p($data['author']);
185+ }
186+ public static function tag_edit(&$data){
187+ if (!member::is_admin()) return;
188+ view::tag_template($data,'edit');
189+ }
190+ public static function tag_author(&$data){
191+ self::p($data['aname']);
192+ }
193+ public static function tag_authorlink(&$data){
194+ self::p($data['alink']);
195+ }
196+ public static function tag_category(&$data){
197+ self::p($data['cname']);
198+ }
199+ public static function tag_categorylink(&$data){
200+ self::p($data['clink']);
201+ }
202+ public static function tag_itemlink(&$data){
203+ self::p($data['link']);
204+ }
205+ public static function tag_date(&$data){
206+ view::tag_strftime($data,'date');
207+ }
208+ public static function tag_time(&$data){
209+ view::tag_strftime($data,'time');
210+ }
211+ public static function tag_title(&$data,$format = ''){
212+ switch($format){
213+ case 'raw':
214+ return self::echo_html($data['title']);
215+ case 'xml':
216+ case 'attribute':
217+ default:
218+ return self::p($data['title']);
219+ }
220+ }
221+/*
222+ * Template variables: Comments
223+Name Description
224+body comment body
225+user user name
226+userid users URL or e-mail address
227+userlink a smart link to either the e-mail or URL for non members, or the member detail page for members. Note: this link already includes the <a href="..."> and </a> tags ! (when no valid URL or e-mail is available, only the name of the member will be shown)
228+userlinkraw same as above, but without the <a href.., empty when no valid URL or e-mail available
229+useremail the e-mail address of the user, empty if the e-mail address was not provided by the user
230+userwebsite the URL of the users website, empty if the URL was not provided by the user
231+userwebsitelink a smart link to URL for non members, or the member detail page for members. Note: this link already includes the <a href="..."> and </a> tags ! (when no valid URL, only the name of the member will be shown)
232+memberid ID of the member (0 for non-members)
233+commentcount total amount of comments for the item
234+commentword 1 'comment', 2 'comments'
235+date date on which comment was added
236+time time at which comment was added
237+host host from where comment was added
238+ip IP-address from where comment was added
239+commentid ID of the current comment
240+itemid ID of the current item
241+itemlink link to the detailed item page
242+itemtitle Title of the current item
243+blogid ID of the weblog
244+blogurl URL of the weblog
245+authtext the extra text for members, empty for non members
246+short a cut off version of the body, which truncates after the first line break. A link is added at the end according to the template
247+excerpt the body of the comment, cut at 60 characters and appended with '...'
248+timestamp time at which comment was added
249+include includes a file, whithout parsing
250+parsedinclude includes a file, parsing it
251+phpinclude includes a file, parsing by PHP
252+plugin executes a plugin
253+skinfile includes the correct URL for a file belonging to an imported skin
254+set sets a parser property
255+ */
256+ /*
257+ *
258+ */
259+ static public function tag_memberid(&$data){
260+ self::p($data['author']);
261+ }
262+ static public function tag_userlinkraw(&$data){
263+ self::p($data['link']);
264+ }
265+ static public function tag_ip(&$data){
266+ self::p($data['ip']);
267+ }
268+ static public function tag_user(&$data){
269+ self::p($data['user']);
270+ }
271+ static public function tag_commentcount(&$data){
272+ self::p($data['comments']);
273+ }
274+ static public function tag_commentword(&$data){
275+ switch($data['comments']){
276+ case 0:
277+ case 1:
278+ return view::tag_template($data,'one');
279+ default:
280+ return view::tag_template($data,'two');
281+ }
282+ }
283+ static public function tag_itemtitle(&$data){
284+ self::p($data['title']);
285+ }
286+/*
287+ * Templates: Archive Lists
288+
289+The archive lists are formatted as listed below:
290+
291+archivelist header
292+ archivelist listitem (repeated for each archive)
293+archivelist footer
294+
295+Available variables: (in the header and footer, only blogid is allowed)
296+Name Description
297+blogid ID of the weblog
298+archivelink link to the archive, which you can embed in a <a href=".."> tag.
299+month Number of the month (2 digits: 01-12)
300+year Year (4 digits)
301+day Day of month (2 digits; only when in day mode)
302+ */
303+ static public function tag_archivelink(&$data){
304+ self::p($data['link']);
305+ }
306+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_skin.php (nonexistent)
+++ plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_skin.php (revision 349)
@@ -0,0 +1,475 @@
1+<?php
2+/*
3+ * Jeans CMS (GPL license)
4+ * $Id$
5+ */
6+/*
7+ * Notes:
8+ *
9+ * The template must be stored in skin directry as follows.
10+ * For example, 'default/index' will be changed to 'templates/default_index_item.inc' etc.
11+ */
12+
13+class jp_Nucleus_skin extends jeans {
14+ static private function convert_template($skin,$type){
15+ if (substr($skin,-4)=='.inc') return $skin;
16+ return 'templates/'.preg_replace('/[^a-zA-Z0-9]/','_',$skin)."_$type.inc";
17+ }
18+ static public function tag_additemform(&$data){
19+ view::tag_parse($data,'/jp/nucleus/forms/additemform.inc');
20+ }
21+ static public function tag_addlink(&$data){
22+ if (!member::is_admin()) return;
23+ self::p(_CONF_URL_ADMIN.'?page=edititem&itemid=0&sgid='.group::setting('id'));
24+ }
25+ static public function tag_addpopupcode(&$data){
26+ ?>
27+ if (event &amp;&amp; event.preventDefault) event.preventDefault();
28+ winbm=window.open(this.href,&amp;jeansbm&amp;,&amp;scrollbars=yes,width=600,height=500,left=10,top=10,status=yes,resizable=yes&amp;);
29+ winbm.focus();
30+ return false;
31+ <?php
32+ }
33+ static public function tag_adminurl(&$data){
34+ self::p(_CONF_URL_ADMIN);
35+ }
36+ static public function tag_archive(&$data,$skin,$category=false,$blogid=false){
37+ $skin=self::convert_template($skin,'item');
38+ if ($category) {
39+ $temp_globals=new jp_Nucleus_temp_global('_GET','sgid',$category);
40+ }
41+ blog::tag_narrowby($data,'archive');
42+ self::blog($data,$skin,$blogid);
43+ }
44+ static public function tag_archivedate(&$data,$locale=false,$format=false){
45+ if (!$format) {
46+ switch(strlen($_GET['archive'])){
47+ case 4:
48+ $format='%Y';
49+ break;
50+ case 7:
51+ $format='%m/%Y';
52+ break;
53+ case 10:
54+ $format='%m/%d/%Y';
55+ }
56+ }
57+ blog::tag_archivedate($data,$format);
58+ }
59+ static public function tag_archivedaylist(&$data){
60+ self::tag_archivelist($data,$template,false,'day');
61+ }
62+ static public function tag_archivelink(&$data,$linktext=false){
63+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_archivelink($data);
64+ $url=view::create_link(array('archivelist'=>blog::setting('id')));
65+ if ($linktext==false) $html='<%url%>';
66+ else $html='<a href="<%url%>"><%text%></a>';
67+ $array=array('url'=>$url,'text'=>$linktext);
68+ self::echo_html($html,$array);
69+ }
70+ static public function tag_archivelist(&$data,$template,$blogid=false,$mode='month'){
71+ $skin=self::convert_template($template,'archivelist');
72+ $ut=new jp_nucleus_use_template($data);
73+ blog::tag_archivelist($data,$skin,$blogid,$mode);
74+ }
75+ static public function tag_archivetype(&$data){
76+ /*Skinvar: archivetype
77+ Either day or month, indicating which type of archive is currently being shown
78+ Arguments
79+ None
80+ Skintypes
81+ archive*/
82+ switch(strlen($_GET['archive'])){
83+ case 4:
84+ return self::t('_JEANS_YEAR');
85+ case 7:
86+ return self::t('_JEANS_MONTH');
87+ case 10:
88+ return self::t('_JEANS_DAY');
89+ }
90+ self::p("<%archivetype%>","hsc");
91+ }
92+ static public function tag_archiveyearlist(&$data){
93+ self::tag_archivelist($data,$template,false,'year');
94+ }
95+ static public function tag_blog(&$data,$template,$amount=10,$category=false,$blogid=false){
96+ $skin=self::convert_template($template,'item');
97+ if ($category) {
98+ $temp_globals=new jp_Nucleus_temp_global('_GET','sgid',$category);
99+ }
100+ blog::tag_narrowby($data,'category');
101+ self::blog($data,$skin,$blogid,$amount);
102+ }
103+ static private function blog(&$data,$skin,$blogid=false,$amount=10){
104+ $ut=new jp_nucleus_use_template($data);
105+ blog::tag_blog($data,$skin,$amount,true,$blogid);
106+ }
107+ static private function usetemplate(&$data){
108+ return !empty($data['jp']['nucleus']['usetemplate']);
109+ }
110+ static public function tag_bloglist(&$data,$template){
111+ /*Skinvar: bloglist
112+ * Optional parameters, bnametype, orderby, and direction cannot be used.
113+ */
114+ $ut=new jp_nucleus_use_template($data);
115+ $skin=self::convert_template($template,'bloglist');
116+ blog::tag_bloglist($data,$skin);
117+ }
118+ static public function tag_blogsetting(&$data,$type){
119+ /*Skinvar: blogsetting
120+ $type: either id, url, name, or desc (short cannot be used)
121+ */
122+ self::p(blog::setting($type));
123+ }
124+ static public function tag_category(&$data,$type='name'){
125+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_category($data);
126+ blog::tag_sgsetting($data,$type);
127+ }
128+ static public function tag_categorylist(&$data,$template,$blogid=false){
129+ /*Skinvar: categorylist
130+ blogname cannot be used. Instead, use blogid.
131+ */
132+ $ut=new jp_nucleus_use_template($data);
133+ $blogid=blog::setting('id',$blogid);
134+ $data['jp']['nucleus']['blogid']=$blogid;
135+ $skin=self::convert_template($template,'catlist');
136+ blog::tag_categorylist($data,$skin,$blogid);
137+ }
138+ static public function tag_charset(&$data){
139+ self::p('UTF-8');
140+ }
141+ static public function tag_commentform(&$data){
142+ /*Skinvar: commentform
143+ * destinationurl is not supported
144+ */
145+ view::tag_parse($data,'/jp/nucleus/forms/commentform.inc');
146+ }
147+ static public function tag_comments(&$data,$skin_or_maxtoshow=false){
148+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_comments($data,$skin_or_maxtoshow);
149+ $ut=new jp_nucleus_use_template($data);
150+ comments::tag_comments($data,self::convert_template($skin_or_maxtoshow,'comment'));
151+ }
152+ static public function tag_error(&$data){
153+ return self::tag_errormessage($data);
154+ }
155+ static public function tag_errormessage(&$data){
156+ self::p(implode("\n",error::get_note()));
157+ }
158+ static public function tag_image(&$data,$type='imgtag'){
159+ /*Skinvar: image
160+ * The type is fixed to 'imgtag'.
161+ */
162+ if (showmedia::if_popupdb()) return showmedia::tag_imgdb($data);
163+ else return showmedia::tag_img($data);
164+ }
165+ static public function tag_imagepopup(&$data){
166+ }
167+ static public function tag_imagetext(&$data){
168+ showmedia::tag_popuptext();
169+ }
170+ static public function tag_include(&$data,$skin){
171+ view::tag_include($data,$skin,'html');
172+ }
173+ static public function tag_item(&$data,$template){
174+ $ut=new jp_nucleus_use_template($data);
175+ item::tag_item($data,self::convert_template($template,'item'));
176+ }
177+ static public function tag_itemid(&$data){
178+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_itemid($data);
179+ item::tag_data($data,'id');
180+ }
181+ static public function tag_itemlink(&$data){
182+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_itemlink($data);
183+ item::tag_data($data,'link');
184+ }
185+ static public function tag_itemtitle(&$data){
186+ if (self::usetemplate($data)) return jp_Nucleus_template::tag_itemtitle($data);
187+ item::tag_data($data,'title');
188+ }
189+ static public function tag_loginform(&$data){
190+ view::tag_parse($data,'/jp/nucleus/forms/loginform.inc');
191+ }
192+ static public function tag_member(&$data,$type){
193+ /*Skinvar: member
194+ * The types, yournotes and notes cannot be used.
195+ */
196+ if (preg_match('/^your([a-z]+)$/',$type,$m)) {
197+ $memberinfo=false;
198+ $type=strtolowerer($m[1]);
199+ } else {
200+ $memberinfo=true;
201+ $type=strtolower($type);
202+ }
203+ switch($type){
204+ case 'realname':
205+ $type='name';
206+ break;
207+ case 'url':
208+ $type='web';
209+ break;
210+ default:
211+ break;
212+ }
213+ if ($memberinfo) memberinfo::tag_memberinfo($data,$type);
214+ else member::tag_setting($data,$type);
215+ }
216+ static public function tag_membermailform(&$data){
217+ /*Skinvar: membermailform
218+ * The options, rows, cols, and destinaion cannot be used.
219+ */
220+ view::tag_parse($data,'/jp/nucleus/forms/membermailform.inc');
221+ }
222+ static public function tag_nextarchive(&$data){
223+ /*Skinvar: nextarchive
224+ * This skin var is not supported.
225+ * Instead, use <%nextlink%>
226+ */
227+ self::p("<%nextarchive%>","hsc");
228+ }
229+ static public function tag_nextitem(&$data){
230+ item::tag_newer($data,'id');
231+ }
232+ static public function tag_nextitemtitle(&$data){
233+ item::tag_newer($data,'title');
234+ }
235+ static public function tag_nextlink(&$data,$linktext=false){
236+ if ($linktext!==false) self::echo_html('<a href="');
237+ if (isset($_GET['itemid'])) item::tag_newer($data,'link');
238+ elseif (isset($_GET['archive'])) blog::tag_archivelink($data,'newer');
239+ if ($linktext!==false) self::echo_html('"><%0%></a>',$linktext);
240+ }
241+ static public function tag_nucleusbutton(&$data,$file='/jeans/images/jeans.gif',$width=85,$height=31){
242+ $array=array('file'=>view::skinfile($data,$file), 'width'=>$width, 'height'=>$height);
243+ $html='<a href="http://jeanscms.sourceforge.jp/">';
244+ $html.='<img src="<%file%>" alt="Jeans button" width="<%width%>" height="<%height%>" />';
245+ $html.='</a>';
246+ self::echo_html($html,$array);
247+ }
248+ static public function tag_otherarchive(&$data,$blogid,$template,$category=false){
249+ self::tag_archive($data,$template,$category,$blogid);
250+ }
251+ static public function tag_otherarchivedaylist(&$data,$blogid,$template){
252+ self::tag_archivelist($data,$template,$blogid,'day');
253+ }
254+ static public function tag_otherarchivelist(&$data,$blogid,$template){
255+ self::tag_archivelist($data,$template,$blogid);
256+ }
257+ static public function tag_otherarchiveyearlist(&$data,$blogid,$template){
258+ self::tag_archivelist($data,$template,$blogid,'year');
259+ }
260+ static public function tag_otherblog(&$data,$blogid,$template,$amount=10,$category=false){
261+ self::tag_blog($data,$template,$amount,$category,$blogid);
262+ }
263+ static public function tag_othersearchresults(&$data,$blogid,$template,$limit=10,$category=false){
264+ blog::tag_narrowby($data,'search');
265+ self::tag_blog($data,$template,$limit,$category,$blogid);
266+ }
267+ static public function tag_parsedinclude(&$data,$skin){
268+ /*Skin/Templatevar: parsedinclude
269+ Includes a file into the output. The contents of the file is parsed by the Nucleus skin/template parser, so you can use skin/templatevars. (see phpinclude and include for other include options)
270+ Arguments
271+ filename: the name of the file to be included (either relative to the position of index.php, or absolute)
272+ Notes
273+ This tag is affected by the parser settings IncludeMode and IncludePrefix
274+ From inside the included file, you can call <%parsedinclude(filename)%> again. To avoid endless loops, the maximum depth level you can go is 3.
275+ Skintypes
276+ all
277+ Examples
278+ <%parsedinclude(filename.txt)%>
279+ <%parsedinclude(/home/user/myself/filename.txt)%>*/
280+ view::tag_parse($data,$skin);
281+ }
282+ static public function tag_phpinclude(&$data,$skin){
283+ /*Skin/Templatevar: phpinclude
284+ Includes a php-file into the output. The contents of the file is parsed by the PHP parser, so be careful. Nucleus skin/templatevars are not parsed! (see parsedinclude and include for other include options).
285+ Arguments
286+ filename: the name of the file to be included (either relative to the position of index.php, or absolute)
287+ Notes
288+ This tag is affected by the parser settings IncludeMode and IncludePrefix
289+ Your file will be included using the standard php include() command. This command will be called from inside a class method, so you'll need to declare which global variables you want to access yourself. Most of the standard variables are automatically declared global by Nucleus itself.
290+ Skintypes
291+ all
292+ Examples
293+ <%phpinclude(filename.php)%>
294+ <%phpinclude(/home/user/myself/filename.php)%>*/
295+ view::tag_parse($data,$skin);
296+ }
297+ static public function tag_plugin(&$data){
298+ /*Skin/Templatevar: plugin
299+ * This skinvar is not supported.
300+ * Instead, use <%jp.xxxxx%>
301+ */
302+ self::p("<%plugin%>","hsc");
303+ }
304+ static public function tag_prevarchive(&$data){
305+ /*Skinvar: prevarchive
306+ * This skinvar is not supported.
307+ * Instead, use <%prevlink%>
308+ */
309+ self::p("<%prevarchive%>","hsc");
310+ }
311+ static public function tag_preview(&$data){
312+ /*
313+ * This skinvar is not supported
314+ */
315+ self::p("<%preview%>","hsc");
316+ }
317+ static public function tag_previtem(&$data){
318+ item::tag_older($data,'id');
319+ }
320+ static public function tag_previtemtitle(&$data){
321+ item::tag_older($data,'title');
322+ }
323+ static public function tag_prevlink(&$data,$linktext=false){
324+ if ($linktext!==false) self::echo_html('<a href="');
325+ if (isset($_GET['itemid'])) item::tag_older($data,'link');
326+ elseif (isset($_GET['archive'])) blog::tag_archivelink($data,'older');
327+ if ($linktext!==false) self::echo_html('"><%0%></a>',$linktext);
328+ }
329+ static public function tag_query(&$data){
330+ self::p($_GET['query_text'],'hsc');
331+ }
332+ static public function tag_referer(&$data){
333+ if (isset($_SERVER['HTTP_REFERER'])) self::p($_SERVER['HTTP_REFERER']);
334+ }
335+ static public function tag_searchform(&$data,$gid=0){
336+ if ($gid) view::tag_parse($data,'/jp/nucleus/forms/searchform.inc',$gid);
337+ else view::tag_parse($data,'/jp/nucleus/forms/searchform.inc');
338+ }
339+ static public function tag_searchresults(&$data,$template,$limit=10){
340+ blog::tag_narrowby($data,'search');
341+ self::tag_blog($data,$template,$limit);
342+ }
343+ static public function tag_self(&$data){
344+ self::p(_CONF_SELF);
345+ }
346+ static public function tag_set(&$data){
347+ /*
348+ * This skinvar is not supported.
349+ */
350+ self::p("<%set%>","hsc");
351+ }
352+ static public function tag_sitevar(&$data,$type){
353+ switch($type){
354+ case 'url':
355+ return self::p(_CONF_URL_INDEX);
356+ case 'name':
357+ return self::p(_CONF_SITE_NAME);
358+ case 'admin':
359+ return self::p(_CONF_ADMIN_EMAIL);
360+ }
361+ }
362+ static public function tag_skinfile(&$data,$filename){
363+ return view::tag_skinfile($data,$filename);
364+ }
365+ static public function tag_skinname(&$data){
366+ if (preg_match('#$/([^/]+)/#',$data['skin'],$m)) self::p($m[1]);
367+ }
368+ static public function tag_sticky(&$data,$itemid,$template){
369+ $ut=new jp_nucleus_use_template($data);
370+ $skin=self::convert_template($template,'item');
371+ $query=self::query_select('i.id=<%itemid%> AND NOT (i.flags & <%const:sql::FLAG_INVALID%>)');
372+ $array=array('itemid'=>$itemid);
373+ view::show_using_query($data,$query,$array,$skin,array('blog','_blog_cb'),array('blog','_blog_cb2'));
374+ }
375+ static public function tag_todaylink(&$data,$linktext=false){
376+ if ($linktext==false) $html='<%url%>';
377+ else $html='<a href="<%url%>"><%text%></a>';
378+ $array=array('url'=>blog::setting('url'),'text'=>$linktext);
379+ self::echo_html($html,$array);
380+ }
381+ static public function tag_version(&$data){
382+ self::p('Jeans CMS ver '._JEANS_VERSION);
383+ }
384+/*
385+ * Skinvars: if/ifnot/else/elseif/elseifnot/endif
386+ * hasplugin and PluginName are not supported.
387+ */
388+ static public function if_nextitem(&$data){
389+ return item::if_neweris($data);
390+ }
391+ static public function if_previtem(&$data){
392+ return item::if_olderis($data);
393+ }
394+ static public function if_blogsetting(&$data,$key,$value){
395+ return blog::setting($key)==$value;
396+ }
397+ static public function if_category(&$data,$type=false,$value=false){
398+ switch($type){
399+ case 'catid':
400+ return blog::sgsetting('id')==$value;
401+ case 'catname':
402+ return blog::sgsetting('name')==$value;
403+ case false:
404+ default:
405+ return 0<blog::sgsetting('id');
406+ }
407+ }
408+ static public function if_skintype(&$data,$type){
409+ return blog::if_skintype($data,$type);
410+ }
411+ static public function if_loggedin(){
412+ return member::logged_in();
413+ }
414+ static public function if_archiveprevexists(&$data){
415+ /*
416+ * Not yet implemented
417+ */
418+ return true;
419+ }
420+ static public function if_archivenextexists(&$data){
421+ /*
422+ * Not yet implemented
423+ */
424+ return true;
425+ }
426+ static public function if_admin(){
427+ return member::is_admin();
428+ }
429+ static public function if_onteam(){
430+ return member::is_admin();
431+ }
432+ static public function if_hasplugin(){
433+ return false;
434+ }
435+}
436+
437+class jp_Nucleus_temp_global {
438+ /*
439+ * Usage: new jp_Nucleus_temp_global(var,key,value[,var,key,value[,var,key,value ... ]]])
440+ * For example,
441+ * $temp_globals=new jp_Nucleus_temp_global('_GET','sgid',$category);
442+ */
443+ private $org_globals=array(),$args;
444+ public function __construct(){
445+ $this->args=$args=func_get_args();
446+ while(2<count($args)){
447+ $var=array_shift($args);
448+ $key=array_shift($args);
449+ $value=array_shift($args);
450+ if (!isset($this->org_globals[$var])) $this->org_globals[$var]=array();
451+ if (isset($GLOBALS[$var][$key])) $this->org_globals[$var][$key]=$GLOBALS[$var][$key];
452+ $GLOBALS[$var][$key]=$value;
453+ }
454+ }
455+ public function __destruct(){
456+ while(2<count($this->args)){
457+ $var=array_shift($this->args);
458+ $key=array_shift($this->args);
459+ $value=array_shift($this->args);
460+ if (isset($this->org_globals[$var][$key])) $GLOBALS[$var][$key]=$this->org_globals[$var][$key];
461+ else unset($GLOBALS[$var][$key]);
462+ }
463+ }
464+}
465+class jp_nucleus_use_template {
466+ private $data,$before;
467+ public function __construct(&$data){
468+ $this->data=&$data;
469+ $this->before=!empty($data['jp']['nucleus']['usetemplate']);
470+ $data['jp']['nucleus']['usetemplate']=true;
471+ }
472+ public function __destruct(){
473+ $this->data['jp']['nucleus']['usetemplate']=$this->before;
474+ }
475+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_admin.php (nonexistent)
+++ plugins/Nucleus/tags/v021/nucleus/jp_Nucleus_admin.php (revision 349)
@@ -0,0 +1,167 @@
1+<?php
2+/*
3+ * Jeans CMS (GPL license)
4+ * $Id$
5+ */
6+
7+class jp_Nucleus_admin extends jeans {
8+ static public function init(){
9+ if (!member::is_admin()) {
10+ error::quit('_ADMIN_NO_PERMISSION');
11+ }
12+ }
13+ static public function tag_nucskinlist(&$data,$skin=false){
14+ $array=array();
15+ $skins=dir(_DIR_SKINS);
16+ while($skin=$skins->read()){
17+ if (!preg_match('/^[a-z0-9]+$/',$skin)) continue;
18+ if (!self::local_file_exists(_DIR_SKINS,$skin.'/skinbackup.xml')) continue;
19+ if (self::local_file_exists(_DIR_SKINS,$skin.'/skin.inc')) continue;
20+ $array[]=array('name'=>$skin);
21+ }
22+ view::show_using_array($data,$array,$skin);
23+ }
24+ static public function action_post_convert(){
25+ $skin=$_POST['jp_nucleus_skin_name'];
26+ $xml=self::local_file_contents(_DIR_SKINS,$skin.'/skinbackup.xml');
27+ if (!$xml) {
28+ return error::note('_JP_NUCLEUS_SKINBACKUP_DOES_NOT_EXIST');
29+ }
30+ if (!is_writable(_DIR_SKINS.$skin)) {
31+ return error::note('_JP_NUCLEUS_SKIN_CHECK_PERMISSION',$skin);
32+ }
33+ $xml=new SimpleXMLElement($xml);
34+ // Convert skin scripts
35+ self::convert_skin($skin,$xml);
36+ // Convert template scripts
37+ self::convert_template($skin,$xml);
38+ // Finally, create skin.inc
39+ self::skin_inc($skin);
40+ // All done.
41+ if (self::local_file_exists(_DIR_SKINS,$skin.'/skin.inc')) {
42+ error::note('_JP_NUCLEUS_CONVERETED',$skin);
43+ } else {
44+ error::note('_JP_NUCLEUS_FAILED',$skin);
45+ }
46+ }
47+ static private function convert_skin($skin,$xml){
48+ $skins=array();
49+ foreach(array('archive','archivelist','error','imagepopup','item','member','search') as $type){
50+ $skins[$type]='<%view.include(jindex.inc)%>';
51+ }
52+ foreach($xml->skin->part as $part){
53+ $skins[(string)$part['name']]=(string)$part;
54+ }
55+ foreach($skins as $file=>$script){
56+ file_put_contents(_DIR_SKINS.$skin.'/j'.$file.'.inc',$script);
57+ }
58+ }
59+ static private function convert_template($skin,$xml){
60+ @mkdir(_DIR_SKINS.$skin.'/templates');
61+ foreach($xml->template as $template){
62+ $prefix=preg_replace('/[^a-zA-Z0-9]/','_',(string)$template['name']).'_';
63+ // Pickup all template entries
64+ self::$templates=array();
65+ foreach($template->part as $part){
66+ self::$templates[(string)$part['name']]=(string)$part;
67+ }
68+ // Just a tiny modification for archivelist template
69+ if (isset(self::$templates['ARCHIVELIST_LISTITEM'])) {
70+ self::$templates['ARCHIVELIST_LISTITEM']=preg_replace('/([^<])(%[a-zA-Z])/','$1<%date.strftime($2)%>',self::$templates['ARCHIVELIST_LISTITEM']);
71+ }
72+ // Construct template inc files.
73+ self::template_item($skin,$prefix);
74+ self::template_comment($skin,$prefix);
75+ self::template_archivelist($skin,$prefix);
76+ self::template_bloglist($skin,$prefix);
77+ self::template_catlist($skin,$prefix);
78+ }
79+ }
80+ static private $templates=array();
81+ static private function addtab($type,$key1,$key2=false,$key3=false){
82+ if (isset(self::$templates[$key1])) $text=self::$templates[$key1];
83+ else $text='';
84+ if ($key2 && isset(self::$templates[$key2])) $text.=self::$templates[$key2];
85+ if ($key3 && isset(self::$templates[$key3])) $text.=self::$templates[$key3];
86+ if (strlen($text)==0) return '';
87+ $text=preg_replace('/(^|\r|\n)([^\r\n])/','$1'."\t".'$2',$text);
88+ return "<%case($type)%>\n$text\n";
89+ }
90+ static private function template_item($skin,$prefix){
91+ $script='';
92+ $script.=self::addtab('body','ITEM_HEADER','ITEM','ITEM_FOOTER');
93+ $script.=self::addtab('more','MORELINK');
94+ $script.=self::addtab('edit','EDITLINK');
95+ $script.=self::addtab('new','NEW');
96+ $script.=self::addtab('date','DATE_HEADER','FORMAT_DATE','DATE_FOOTER');
97+ $script.=self::addtab('time','FORMAT_TIME');
98+ if (strlen($script)==0) return;
99+ $script="<%select(template)%>\n$script<%endselect%>";
100+ file_put_contents(_DIR_SKINS.$skin.'/templates/'.$prefix.'item.inc',$script);
101+ }
102+ static private function template_comment($skin,$prefix){
103+ $script='';
104+ $script.=self::addtab('head','COMMENTS_HEADER');
105+ $script.=self::addtab('body','COMMENTS_BODY');
106+ $script.=self::addtab('foot','COMMENTS_FOOTER');
107+ $script.=self::addtab('none','COMMENTS_NONE');
108+ $script.=self::addtab('one','COMMENTS_ONE');
109+ $script.=self::addtab('two','COMMENTS_CONTINUED');
110+ $script.=self::addtab('many','COMMENTS_TOOMUCH');
111+ $script.=self::addtab('auth','COMMENTS_AUTH');
112+ if (strlen($script)==0) return;
113+ $script="<%select(template)%>\n$script<%endselect%>";
114+ file_put_contents(_DIR_SKINS.$skin.'/templates/'.$prefix.'comment.inc',$script);
115+ }
116+ static private function template_archivelist($skin,$prefix){
117+ $script='';
118+ $script.=self::addtab('head','ARCHIVELIST_HEADER');
119+ $script.=self::addtab('body','ARCHIVELIST_LISTITEM');
120+ $script.=self::addtab('foot','ARCHIVELIST_FOOTER');
121+ if (strlen($script)==0) return;
122+ $script="<%select(template)%>\n$script<%endselect%>";
123+ file_put_contents(_DIR_SKINS.$skin.'/templates/'.$prefix.'archivelist.inc',$script);
124+ }
125+ static private function template_bloglist($skin,$prefix){
126+ $script='';
127+ $script.=self::addtab('head','BLOGLIST_HEADER');
128+ $script.=self::addtab('body','BLOGLIST_LISTITEM');
129+ $script.=self::addtab('foot','BLOGLIST_FOOTER');
130+ if (strlen($script)==0) return;
131+ $script="<%select(template)%>\n$script<%endselect%>";
132+ file_put_contents(_DIR_SKINS.$skin.'/templates/'.$prefix.'bloglist.inc',$script);
133+ }
134+ static private function template_catlist($skin,$prefix){
135+ $script='';
136+ $script.=self::addtab('head','CATLIST_HEADER');
137+ $script.=self::addtab('body','CATLIST_LISTITEM');
138+ $script.=self::addtab('foot','CATLIST_FOOTER');
139+ if (strlen($script)==0) return;
140+ $script="<%select(template)%>\n$script<%endselect%>";
141+ file_put_contents(_DIR_SKINS.$skin.'/templates/'.$prefix.'catlist.inc',$script);
142+ }
143+
144+ static private function skin_inc($skin){
145+ $script=
146+'<%using(jp.nucleus.skin,jp.nucleus.template)%>
147+<%select(template)%>
148+<%case(item)%>
149+<%view.parse(jitem.inc)%>
150+<%case(archive)%>
151+<%view.parse(jarchive.inc)%>
152+<%case(archivelist)%>
153+<%view.parse(jarchivelist.inc)%>
154+<%case(search)%>
155+<%view.parse(jsearch.inc)%>
156+<%case(member)%>
157+<%view.parse(jmember.inc)%>
158+<%case(imagepopup)%>
159+<%view.parse(jimagepopup.inc)%>
160+<%case(error)%>
161+<%view.parse(jerror.inc)%>
162+<%case.else%>
163+<%view.parse(jindex.inc)%>
164+<%endselect%>';
165+ file_put_contents(_DIR_SKINS.$skin.'/skin.inc',$script);
166+ }
167+}
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- plugins/Nucleus/tags/v021/nucleus/language/english.php (nonexistent)
+++ plugins/Nucleus/tags/v021/nucleus/language/english.php (revision 349)
@@ -0,0 +1,10 @@
1+<?php
2+define('_JP_NUCLEUS_DESC','This is to support Nucleus skins.');
3+define('_JP_NUCLEUS_NOTHING_TO_CONVERT','Nothing to convert');
4+define('_JP_NUCLEUS_CONVERT_TO_JEANS_SKIN','Convert Nucleus skin to Jeans skin');
5+define('_JP_NUCLEUS_CONVERT','Convert');
6+define('_JP_NUCLEUS_CONVERETED','<%0%> was convereted to Jeans skin.');
7+define('_JP_NUCLEUS_FAILED','Conversion of <%0%> was failed. Please confirm that the permission of directory is writable value.');
8+define('_JP_NUCLEUS_SKINBACKUP_DOES_NOT_EXIST','skinbackup.xml does not exist.');
9+define('_JP_NUCLEUS_NOTE','If the Nucleus skin to be convereted does not appear in the selection list, please confirm that skinbackup.xml exists in the skin directory and that skin.inc does not exist in the directory');
10+define('_JP_NUCLEUS_CHECK_PERMISSION','Need to change permission of <%0> directory.');
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
--- plugins/Nucleus/tags/v021/nucleus/language/japanese.php (nonexistent)
+++ plugins/Nucleus/tags/v021/nucleus/language/japanese.php (revision 349)
@@ -0,0 +1,10 @@
1+<?php
2+define('_JP_NUCLEUS_DESC','このプラグインは、Nucleusのスキンをサポートするためのものです。');
3+define('_JP_NUCLEUS_NOTHING_TO_CONVERT','変換するものは何もありません');
4+define('_JP_NUCLEUS_CONVERT_TO_JEANS_SKIN','NucleusのスキンをJeansのスキンに変換');
5+define('_JP_NUCLEUS_CONVERT','変換');
6+define('_JP_NUCLEUS_CONVERETED','<%0%>をJeans用のスキンに変換しました。');
7+define('_JP_NUCLEUS_FAILED','<%0%>の変換に失敗しました。ディレクトリのパーミッションが読み書き可能な値になっているかどうかを、確認してください。');
8+define('_JP_NUCLEUS_SKINBACKUP_DOES_NOT_EXIST','skinbackup.xmlが見つかりません。');
9+define('_JP_NUCLEUS_NOTE','変換すべきNucleusスキンが選択肢に現れない場合は、そのスキンのディレクトリにskinbackup.xmlが存在していることと、skin.incが無いことを確認してください。');
10+define('_JP_NUCLEUS_CHECK_PERMISSION','<%0>ディレクトリのパーミションを書き込み可にして下さい。');
Added: svn:eol-style
## -0,0 +1 ##
+CRLF
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Id HeadURL LastChangedDate LastChangedBy LastChangedRevision
\ No newline at end of property
旧リポジトリブラウザで表示