Nucleus CMS日本語版用プラグインのうち、日本語版開発者がサポートしているもの
Revision | 40ef5eae1beca1052cb7f4d7bc5da82ecb179d76 (tree) |
---|---|
Time | 2006-11-29 15:04:27 |
Author | shizuki <shizuki@1ca2...> |
Commiter | shizuki |
fix short open tag
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@505 1ca29b6e-896d-4ea0-84a5-967f57386b96
@@ -1,4 +1,4 @@ | ||
1 | -<? | |
1 | +<?php | |
2 | 2 | /** |
3 | 3 | * |
4 | 4 | * 0.94 bug fix |
@@ -1,4 +1,4 @@ | ||
1 | -<? | |
1 | +<?php | |
2 | 2 | /** |
3 | 3 | * |
4 | 4 | * SHOW RECENT ITEMS PLUG-IN FOR NucleusCMS |
@@ -65,44 +65,55 @@ class NP_RecentItems extends NucleusPlugin | ||
65 | 65 | $query = 'SELECT bshortname as result FROM %s WHERE bnumber = %d'; |
66 | 66 | $blogname = quickQuery(sprintf($query, sql_table('blog'), intval($blogName))); |
67 | 67 | } |
68 | - if (!BLOG::exists($blogName)) return; | |
69 | - if (!TEMPLATE::exists($templateName)) return; | |
70 | - if ($amountEntries=='') $amountEntries = 5; | |
71 | - | |
72 | - $tempBid = getBlogIDFromName($blogName); | |
73 | - $b =& $manager->getBlog($tempBid); | |
68 | + if (!BLOG::exists($blogName)) { | |
69 | + return; | |
70 | + } | |
71 | + if (!TEMPLATE::exists($templateName)) { | |
72 | + return; | |
73 | + } | |
74 | + if ($amountEntries=='') { | |
75 | + $amountEntries = 5; | |
76 | + } | |
74 | 77 | |
75 | - $query = $this->_getsqlquery($b, $amountEntries, ''); | |
78 | + $tempBid = getBlogIDFromName($blogName); | |
79 | + $b =& $manager->getBlog($tempBid); | |
80 | + $query = $this->_getsqlquery($b, $amountEntries, ''); | |
76 | 81 | $b->showUsingQuery($templateName, $query, 0, 1, 0); |
77 | 82 | } |
78 | 83 | |
79 | 84 | function _getsqlquery($blogObj, $amountEntries, $extraQuery) |
80 | 85 | { |
81 | - $query = 'SELECT i.inumber as itemid, i.ititle as title, i.ibody as body,' . | |
82 | - ' m.mname as author, m.mrealname as authorname, i.itime, i.imore as more,' . | |
83 | - ' m.mnumber as authorid, m.memail as authormail, m.murl as authorurl,' . | |
84 | - ' c.cname as category, i.icat as catid, i.iclosed as closed'; | |
85 | - | |
86 | - $query .= ' FROM ' . // <mod by shizuki corresponds MySQL 5.0.x or later /> | |
87 | - sql_table('member') . ' as m, ' . | |
88 | - sql_table('category') . ' as c,' . | |
89 | - sql_table('item') . ' as i' . | |
90 | - ' WHERE i.iblog = ' . intval($blogObj->getID()) . | |
91 | - ' AND i.iauthor = m.mnumber' . | |
92 | - ' AND i.icat = c.catid' . | |
93 | - ' AND i.idraft = 0' . // exclude drafts | |
86 | + $query = 'SELECT' | |
87 | + . ' i.inumber as itemid,' | |
88 | + . ' i.ititle as title,' | |
89 | + . ' i.ibody as body,' | |
90 | + . ' m.mname as author,' | |
91 | + . ' m.mrealname as authorname,' | |
92 | + . ' i.itime,' | |
93 | + . ' i.imore as more,' | |
94 | + . ' m.mnumber as authorid,' | |
95 | + . ' m.memail as authormail,' | |
96 | + . ' m.murl as authorurl,' | |
97 | + . ' c.cname as category,' | |
98 | + . ' i.icat as catid,' | |
99 | + . ' i.iclosed as closed' | |
100 | + . ' FROM ' // <mod by shizuki corresponds MySQL 5.0.x or later /> | |
101 | + . sql_table('member') . ' as m, ' | |
102 | + . sql_table('category') . ' as c,' | |
103 | + . sql_table('item') . ' as i' | |
104 | + . ' WHERE i.iblog = ' . intval($blogObj->getID()) | |
105 | + . ' AND i.iauthor = m.mnumber' | |
106 | + . ' AND i.icat = c.catid' | |
107 | + . ' AND i.idraft = 0' // exclude drafts | |
94 | 108 | // don't show future items |
95 | - ' AND i.itime <= ' . mysqldate($blogObj->getCorrectTime()); | |
109 | + . ' AND i.itime <= ' . mysqldate($blogObj->getCorrectTime()); | |
96 | 110 | |
97 | 111 | // if ($blogObj->getSelectedCategory()) |
98 | 112 | // $query .= ' and i.icat=' . $blogObj->getSelectedCategory() . ' '; |
99 | 113 | |
100 | - $query .= $extraQuery; | |
101 | - | |
102 | - $query .= ' ORDER BY i.itime DESC'; | |
103 | - $query .= ' LIMIT ' . intval($amountEntries); | |
104 | - | |
114 | + $query .= $extraQuery | |
115 | + . ' ORDER BY i.itime DESC' | |
116 | + . ' LIMIT ' . intval($amountEntries); | |
105 | 117 | return $query; |
106 | 118 | } |
107 | 119 | } |
108 | -?> | |
\ No newline at end of file |