• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-plugins: Commit

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


Commit MetaInfo

Revision86d2bd89fc39cc90befd89a1ea2135a306b3bc2b (tree)
Time2006-10-02 23:16:07
Authorshizuki <shizuki@1ca2...>
Commitershizuki

Log Message

動作テスト 未

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

Change Summary

Incremental Difference

--- a/trunk/NP_BlogList/NP_BlogList.php
+++ b/trunk/NP_BlogList/NP_BlogList.php
@@ -1,10 +1,4 @@
11 <?
2-// plugin needs to work on Nucleus versions <=2.0 as well
3-if (!function_exists('sql_table')){
4- function sql_table($name) {
5- return 'nucleus_' . $name;
6- }
7-}
82
93 /*
104 Version history:
@@ -12,15 +6,34 @@ if (!function_exists('sql_table')){
126 */
137 class NP_BlogList extends NucleusPlugin {
148
15- function getName() { return 'Blog List'; }
16- function getAuthor() { return 'Ben Osman + nakahara21'; }
17- function getURL() { return 'http://www.justletgo.org/'; }
18- function getVersion() { return '0.2'; }
19- function getDescription() {
9+ function getName()
10+ {
11+ return 'Blog List';
12+ }
13+
14+ function getAuthor()
15+ {
16+ return 'Ben Osman + nakahara21 + shizuki';
17+ }
18+
19+ function getURL()
20+ {
21+ return 'http://www.justletgo.org/';
22+ }
23+
24+ function getVersion()
25+ {
26+ return '0.3';
27+ }
28+
29+ function getDescription()
30+ {
2031 return 'List can be shown using &lt;%BlogList%&gt; OR &lt;%BlogList(bpublic = 1)%&gt;. <br /> It has following parameters : filter, header, list, footer)';
2132 }
22- function supportsFeature($what) {
23- switch($what){
33+
34+ function supportsFeature($what)
35+ {
36+ switch ($what) {
2437 case 'SqlTablePrefix':
2538 return 1;
2639 default:
@@ -28,43 +41,44 @@ class NP_BlogList extends NucleusPlugin {
2841 }
2942 }
3043
31- function install() {
32- $this->createOption('OrderBy','Field that list is sorted by','text','bnumber ASC');
33- $this->createOption('Header','Header Template','text','<ul class="nobullets">');
34- $this->createOption('List','List Template ','text','<li><a href="<%bloglink%>"><%blogname%></a><%flag%></li>');
35- $this->createOption('Footer','Footer Template','text','</ul>');
36- }
37-
38- function unInstall() {
39- }
40-
41- function init() {
44+ function install()
45+ {
46+ $this->createOption('OrderBy', 'Field that list is sorted by', 'text', 'bnumber ASC');
47+ $this->createOption('Header', 'Header Template', 'text', '<ul class="nobullets">');
48+ $this->createOption('List', 'List Template ', 'text', '<li><a href="<%bloglink%>"><%blogname%></a><%flag%></li>');
49+ $this->createOption('Footer', 'Footer Template', 'text', '</ul>');
4250 }
4351
4452 function doSkinVar($skinType, $filter ='', $header ='', $list='', $footer='')
4553 {
46- global $CONF, $blog;
47-
54+// global $CONF, $blog;
55+ global $CONF, $blogid;
56+ if (is_numeric($blogid)) {
57+ $blogid = intval($blogid);
58+ } else {
59+ $blog_id = getBlogIDFromName($blogid);
60+ $blogid = intval($blogid);
61+ }
4862 // determine arguments next to catids
4963 // I guess this can be done in a better way, but it works
50- if (!$header) {
64+ if (empty($header)) {
5165 $header = $this->getOption('Header');
5266 }
53- if (!$list) {
67+ if (empty($list)) {
5468 $list = $this->getOption('List');
5569 }
56- if (!$footer) {
70+ if (empty($footer)) {
5771 $footer = $this->getOption('Footer');
5872 }
5973
6074 //$blogurl = $this->getURL() . $qargs;
61- $blogurl = createBlogLink($this->getURL(), $linkparams);
75+ //$blogurl = createBlogLink($this->getURL(), $linkparams);
76+ $blogurl = createBlogLink($blogid);
6277
6378 $template = TEMPLATE::read($template);
6479
65- echo TEMPLATE::fill($header,
66- array(
67- ));
80+// echo TEMPLATE::fill($header, array());
81+ echo $header;
6882
6983 $where = '';
7084 if ($filter <> '') {
@@ -72,27 +86,33 @@ class NP_BlogList extends NucleusPlugin {
7286 }
7387
7488 // $query = 'SELECT *,b.bnumber as blogid, b.bname as blogname, b.burl as bloglink FROM nucleus_blog as b ' . $where . ' ORDER BY ' . $this->getOption('OrderBy');
75- $query = 'SELECT *,b.bnumber as blogid, b.bname as blogname FROM '.sql_table('blog').' as b ' . $where . ' ORDER BY ' . $this->getOption('OrderBy');
89+// $query = 'SELECT *,b.bnumber as blogid, b.bname as blogname FROM '.sql_table('blog').' as b ' . $where . ' ORDER BY ' . $this->getOption('OrderBy');
90+ $query = 'SELECT bnumber, bname FROM ' . sql_table('blog') . ' ORDER BY ' . $this->getOption('OrderBy');
7691
7792 $res = sql_query($query);
7893 while ($data = mysql_fetch_assoc($res)) {
79- $data['self'] = $CONF['Self'];
80- $data['bloglink'] = createBlogidLink($data['blogid'], '');
81-
82- if( $data['blogid'] == $blog->getID() ){
83- $data['flag'] = " &laquo;"; //mark this blog!
94+// $data['self'] = $CONF['Self'];
95+// $data['bloglink'] = createBlogidLink($data['blogid'], '');
96+ $listdata = array(
97+ bloglink => createBlogLink($data['bnumber']),
98+ blogname => $data['bname']
99+ );
100+// if ( $data['blogid'] == $blog->getID() ){
101+ if ($data['bnumber'] == $blogid) {
102+// $data['flag'] = " &laquo;"; //mark this blog!
103+ $listdata['flag'] = " &laquo;"; //mark this blog!
84104 }
85105
86- $temp = TEMPLATE::fill($list,$data);
87- echo strftime($temp,$current->itime);
106+// $temp = TEMPLATE::fill($list, $data);
107+ echo TEMPLATE::fill($list, $listdata);
108+// echo strftime($temp, $current->itime);
88109
89110 }
90111
91112 mysql_free_result($res);
92113
93- echo TEMPLATE::fill($footer,
94- array(
95- ));
114+// echo TEMPLATE::fill($footer, array());
115+ echo $footer;
96116 }
97117 }
98118 ?>
\ No newline at end of file
Show on old repository browser