• R/O
  • SSH
  • HTTPS

xoonips: Commit


Commit MetaInfo

Revision651 (tree)
Zeit2017-03-27 11:30:23
Autorkimusho

Log Message

- Add ranking block
- Add Support WYSIWIG Editor on index description

Ändern Zusammenfassung

Diff

--- trunk/xoonips/xoops_trust_path/modules/xoonips/blocks/xoonips_blocks.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/blocks/xoonips_blocks.php (revision 651)
@@ -19,3 +19,5 @@
1919 // load item type list block
2020 require_once dirname(__FILE__) . '/xoonips_itemtypes.php';
2121
22+// load ranking block
23+require_once dirname( __FILE__ ).'/xoonips_ranking.php';
--- trunk/xoonips/xoops_trust_path/modules/xoonips/blocks/xoonips_ranking.php (nonexistent)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/blocks/xoonips_ranking.php (revision 651)
@@ -0,0 +1,128 @@
1+<?php
2+
3+if (!defined('XOOPS_ROOT_PATH')) exit();
4+
5+// xoonips ranking block
6+function b_xoonips_ranking_show($options)
7+{
8+
9+ $dirname = empty($options[0]) ? 'xoonips' : $options[0];
10+ $module_handler =& xoops_gethandler('module');
11+ $module =& $module_handler->getByDirname($dirname);
12+ if (!is_object($module)) {
13+ exit('Access Denied');
14+ }
15+ $trustDirname = $module->getVar('trust_dirname');
16+
17+ $etc = '...';
18+ // decide maximum string length by block position
19+ if ( defined( 'XOOPS_CUBE_LEGACY' ) ) {
20+ // get xoonips module id
21+ $mid = $module->getVar( 'mid', 's' );
22+ // get block array
23+ $block_arr =& XoopsBlock::getByModule( $mid );
24+ } else {
25+ global $block_arr;
26+ }
27+ $maxlen = 56;
28+ // default
29+ foreach ( $block_arr as $b ) {
30+ $func = $b->getVar( 'show_func', 'n' );
31+ if ( $func == 'b_xoonips_ranking_show' ) {
32+ $side = $b->getVar( 'side', 'n' );
33+ if ( $side == XOOPS_SIDEBLOCK_LEFT || $side == XOOPS_SIDEBLOCK_RIGHT ) {
34+ $maxlen = 16;
35+ break;
36+ } elseif ( $side == XOOPS_CENTERBLOCK_LEFT || $side == XOOPS_CENTERBLOCK_RIGHT ) {
37+ $maxlen = 24;
38+ break;
39+ }
40+ }
41+ }
42+
43+ // get configs
44+ $config = array();
45+ $config['num_rows'] = XOONIPS_BLOCK_RANKING_NUM_ROWS;
46+ $config['visible'] = explode(',', XOONIPS_BLOCK_RANKING_VISIBLE);
47+ $config['order'] = explode(',', XOONIPS_BLOCK_RANKING_ORDER);
48+ $config['days_enabled'] = XOONIPS_BLOCK_RANKING_DAYS_ENABLED;
49+ $config['days'] = XOONIPS_BLOCK_RANKING_DAYS;
50+
51+ $visible = false;
52+ foreach ($config['visible'] as $v) {
53+ if ($v != 0) {
54+ $visible = true;
55+ }
56+ }
57+ if (!$visible)
58+ return;
59+
60+ $term = 0;
61+ if ($config['days_enabled'] == 'on') {
62+ if (is_numeric($config['days'])) {
63+ $term = time() - (int)$config['days'] * 86400;
64+ }
65+ }
66+
67+ // - set ranking number label
68+ $rank_tmp = explode(',', _MB_XOONIPS_RANKING_RANK_STR);
69+ $rank_str = array();
70+ for ( $i = 0; $i < $config['num_rows']; $i++ ) {
71+ $rank_str[] = ( $i + 1 ).$rank_tmp[min( $i, count( $rank_tmp ) - 1 )];
72+ }
73+
74+ $block['rankings'] = array();
75+
76+ // ranking block
77+ // ranking viewed item
78+ if ($config['visible'][0]) {
79+ $items = array();
80+ $itemHandler = Xoonips_Utils::getTrustModuleHandler('Item', $dirname, $trustDirname);
81+ $itemObjs = $itemHandler->getMostViewedItems($config['num_rows'], $term);
82+ $i = 0;
83+ foreach ($itemObjs as $itemObj) {
84+ $title = Xoonips_Utils::getHtmlSpecialChars($itemObj['title']);
85+ $title = Xoonips_Utils::getTruncate($title, $maxlen, $etc);
86+ $items[] = array(
87+ 'title' => $title,
88+ 'url' => $itemObj['url'],
89+ 'num' => $itemObj['view_count'],
90+ 'rank_str' => $rank_str[$i],
91+ );
92+ $i++;
93+ }
94+
95+ $block['rankings'][$config['order'][0]] = array(
96+ 'items' => $items,
97+ 'title' => _MB_XOONIPS_RANKING_VIEWED_ITEM,
98+ );
99+ unset($items);
100+ }
101+
102+ // ranking downloaded item
103+ if ($config['visible'][1]) {
104+ $items = array();
105+ $itemFileHandler = Xoonips_Utils::getTrustModuleHandler('ItemFile', $dirname, $trustDirname);
106+ $itemFileObjs = $itemFileHandler->getMostDownloadedItems($config['num_rows'], $term);
107+ $i = 0;
108+ foreach ($itemFileObjs as $itemFileObj) {
109+ $title = Xoonips_Utils::getHtmlSpecialChars($itemFileObj['title']);
110+ $title = Xoonips_Utils::getTruncate($title, $maxlen, $etc);
111+ $items[] = array(
112+ 'title' => $title,
113+ 'url' => $itemFileObj['url'],
114+ 'num' => $itemFileObj['download_count'],
115+ 'rank_str' => $rank_str[$i],
116+ );
117+ $i++;
118+ }
119+ $block['rankings'][$config['order'][1]] = array(
120+ 'items' => $items,
121+ 'title' => _MB_XOONIPS_RANKING_DOWNLOADED_ITEM,
122+ );
123+ unset($items);
124+ }
125+
126+ ksort( $block['rankings'] );
127+ return $block;
128+}
--- trunk/xoonips/xoops_trust_path/modules/xoonips/class/action/ListAction.class.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/class/action/ListAction.class.php (revision 651)
@@ -7,22 +7,25 @@
77
88 class Xoonips_ListAction extends Xoonips_ActionBase {
99
10- protected function doInit(&$request,&$response) {
11- global $xoopsUser;
12- $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : XOONIPS_UID_GUEST;
10+ protected function doInit(&$request,&$response) {
11+ $root =& XCube_Root::getSingleton();
12+ $textFilter =& $root->getTextFilter();
1313
14- // get order by select
15- $defalut_orderby = '0';
16- $sortHandler = Xoonips_Utils::getModuleHandler('ItemSort', $this->dirname);
17- $sortTitles = $sortHandler->getSortTitles();
18- $sortIds = array_keys($sortTitles);
19- if (!empty($sortIds))
20- $defalut_orderby = $sortIds[0];
21- $sess_orderby = isset($_SESSION[$this->dirname . '_order_by']) ? $_SESSION[$this->dirname . '_order_by'] : $defalut_orderby;
22- $sess_orderdir = isset($_SESSION[$this->dirname . '_order_dir']) ? $_SESSION[$this->dirname . '_order_dir'] : XOONIPS_ASC;
23- $request_vars = array(
14+ global $xoopsUser;
15+ $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : XOONIPS_UID_GUEST;
16+
17+ // get order by select
18+ $defalut_orderby = '0';
19+ $sortHandler = Xoonips_Utils::getModuleHandler('ItemSort', $this->dirname);
20+ $sortTitles = $sortHandler->getSortTitles();
21+ $sortIds = array_keys($sortTitles);
22+ if (!empty($sortIds))
23+ $defalut_orderby = $sortIds[0];
24+ $sess_orderby = isset($_SESSION[$this->dirname . '_order_by']) ? $_SESSION[$this->dirname . '_order_by'] : $defalut_orderby;
25+ $sess_orderdir = isset($_SESSION[$this->dirname . '_order_dir']) ? $_SESSION[$this->dirname . '_order_dir'] : XOONIPS_ASC;
26+ $request_vars = array(
2427 'op' => array('s', ''),
25- 'isPrint' => array('s', ''),
28+ 'isPrint' => array('s', ''),
2629 'page' => array('i', 1),
2730 'orderby' => array('s', $sess_orderby),
2831 'order_dir' => array('i', $sess_orderdir),
@@ -30,52 +33,53 @@
3033 'selected' => array('i', array()),
3134 'num_of_items' => array('i', null),
3235 'index_id' => array('i', null),
33- );
34- foreach ($request_vars as $key => $meta) {
35- list($type, $default) = $meta;
36- $$key = $request->getParameter($key);
37- if ($$key == '') {
38- $$key = $default;
39- }
40- }
36+ );
37+ foreach ($request_vars as $key => $meta) {
38+ list($type, $default) = $meta;
39+ $$key = $request->getParameter($key);
40+ if ($$key == '') {
41+ $$key = $default;
42+ }
43+ }
4144
42- // if has not index id then set public index id
43- $indexBean = Xoonips_BeanFactory::getBean('IndexBean', $this->dirname, $this->trustDirname);
44- if (!isset($index_id)) {
45- $public_idx = $indexBean->getPublicIndex();
46- $index_id = $public_idx['index_id'];
47- }
45+ // if has not index id then set public index id
46+ $indexBean = Xoonips_BeanFactory::getBean('IndexBean', $this->dirname, $this->trustDirname);
47+ if (!isset($index_id)) {
48+ $public_idx = $indexBean->getPublicIndex();
49+ $index_id = $public_idx['index_id'];
50+ }
4851
49- // check can view index id
50- if (!$indexBean->canView($index_id, $uid)) {
51- redirect_header(XOOPS_URL . '/', 3, _MD_XOONIPS_ITEM_FORBIDDEN);
52- exit();
53- }
52+ // check can view index id
53+ if (!$indexBean->canView($index_id, $uid)) {
54+ redirect_header(XOOPS_URL . '/', 3, _MD_XOONIPS_ITEM_FORBIDDEN);
55+ exit();
56+ }
5457
55- $_SESSION[$this->dirname . '_order_by' ] = $orderby;
56- $_SESSION[$this->dirname . '_order_dir'] = $order_dir;
58+ $_SESSION[$this->dirname . '_order_by' ] = $orderby;
59+ $_SESSION[$this->dirname . '_order_dir'] = $order_dir;
5760
58- $cri = array('start' => ($page - 1) * $itemcount,
59- 'rows' => $itemcount,
60- 'orderby' => $orderby,
61- 'orderdir' => $order_dir);
61+ $cri = array(
62+ 'start' => ($page - 1) * $itemcount,
63+ 'rows' => $itemcount,
64+ 'orderby' => $orderby,
65+ 'orderdir' => $order_dir
66+ );
6267
63- $export_enabled = true;
68+ $export_enabled = true;
6469
65- // index info
66- $detailed_title = '';
67- $detailed_description = '';
70+ // index info
71+ $detailed_title = '';
72+ $detailed_description = '';
6873 $icon = "";
69- $indexInfo = $indexBean->getIndex($index_id);
70- if ($indexInfo) {
74+ $indexInfo = $indexBean->getIndex($index_id);
75+ if ($indexInfo) {
76+ $userBean = Xoonips_BeanFactory::getBean('UsersBean', $this->dirname);
77+ if (!$userBean->isModerator($uid) && $indexInfo['open_level'] == XOONIPS_OL_PUBLIC) {
78+ $export_enabled = false;
79+ }
7180
72- $userBean = Xoonips_BeanFactory::getBean('UsersBean', $this->dirname);
73- if (!$userBean->isModerator($uid) && $indexInfo['open_level'] == XOONIPS_OL_PUBLIC) {
74- $export_enabled = false;
75- }
76-
77- $detailed_title = $indexInfo['detailed_title'];
78- $detailed_description = $indexInfo['detailed_description'];
81+ $detailed_title = $indexInfo['detailed_title'];
82+ $detailed_description = $textFilter->toShowTarea($indexInfo['detailed_description'], 0, 1, 1, 1, 1);
7983 $icon = sprintf('%s/modules/%s/image.php/index/%u/%s', XOOPS_URL, $this->dirname, $index_id, $indexInfo['icon']);
8084 $index_upload_dir = Xoonips_Utils::getXooNIpsConfig($this->dirname, 'index_upload_dir');
8185 $file_path = $index_upload_dir . '/index/' . $index_id;
@@ -82,186 +86,184 @@
8286 if (file_exists($file_path)) {
8387 $response->setViewDataByKey('icon', $icon);
8488 }
85- }
89+ }
8690
87- // can view items
88- $itemIds = $indexBean->getCanViewItemIds($index_id, $uid);
89- $num_of_items =count($itemIds);
91+ // can view items
92+ $itemIds = $indexBean->getCanViewItemIds($index_id, $uid);
93+ $num_of_items =count($itemIds);
9094
91- // retrieve items
92- $itemBean = Xoonips_BeanFactory::getBean('ItemVirtualBean', $this->dirname, $this->trustDirname);
93- $itemIds = $itemBean->getItemsList($itemIds, $cri);
95+ // retrieve items
96+ $itemBean = Xoonips_BeanFactory::getBean('ItemVirtualBean', $this->dirname, $this->trustDirname);
97+ $itemIds = $itemBean->getItemsList($itemIds, $cri);
9498
95- $item_htmls = array();
96- if ($itemIds) {
97- foreach ($itemIds as $itemId) {
98- $itemInfo = $itemBean->getItem2($itemId);
99- $item_html = array();
100- $item_html['item_id'] = $itemId;
101- $item_html['html'] = $itemBean->getItemListHtml($itemInfo);
102- $item_htmls[] = $item_html;
103- }
104- }
99+ $item_htmls = array();
100+ if ($itemIds) {
101+ foreach ($itemIds as $itemId) {
102+ $itemInfo = $itemBean->getItem2($itemId);
103+ $item_html = array();
104+ $item_html['item_id'] = $itemId;
105+ $item_html['html'] = $itemBean->getItemListHtml($itemInfo);
106+ $item_htmls[] = $item_html;
107+ }
108+ }
105109
106- // add index list
107- $my_indexes = array();
108- $childIndexes = $indexBean->getChildIndexes($index_id);
109- if (count($childIndexes ) > 0) {
110- foreach ($childIndexes as $index) {
111- $cid = $index['index_id'];
112- $cicnt = count($indexBean->getChildIndexes($cid));
113- $cnt = $indexBean->countCanViewItem($cid, $uid);
114- $my_index = array (
115- 'index_id' => $cid,
116- 'title' => $index['title'],
117- 'child_index_num' => $cicnt,
118- 'child_item_num' => $cnt
119- );
120- $index_tpl = new XoopsTpl();
121- $index_tpl->assign('index', $my_index);
122- $index_tpl->assign('dirname', $this->dirname);
123- $my_indexes[] = $index_tpl->fetch('db:' . $this->dirname . '_list_index_block.html');
124- }
125- }
126- $export_select = (count($my_indexes) > 0) ? 1 : 0;
110+ // add index list
111+ $my_indexes = array();
112+ $childIndexes = $indexBean->getChildIndexes($index_id);
113+ if (count($childIndexes ) > 0) {
114+ foreach ($childIndexes as $index) {
115+ $cid = $index['index_id'];
116+ $cicnt = count($indexBean->getChildIndexes($cid));
117+ $cnt = $indexBean->countCanViewItem($cid, $uid);
118+ $my_index = array (
119+ 'index_id' => $cid,
120+ 'title' => $index['title'],
121+ 'child_index_num' => $cicnt,
122+ 'child_item_num' => $cnt
123+ );
124+ $index_tpl = new XoopsTpl();
125+ $index_tpl->assign('index', $my_index);
126+ $index_tpl->assign('dirname', $this->dirname);
127+ $my_indexes[] = $index_tpl->fetch('db:' . $this->dirname . '_list_index_block.html');
128+ }
129+ }
130+ $export_select = (count($my_indexes) > 0) ? 1 : 0;
127131
128- // get index full path
129- $fullpathInfo = $indexBean->getFullPathIndexes($index_id);
130- $fullPathIndexes = array();
131- foreach ($fullpathInfo as $index) {
132- if ($index['parent_index_id'] == 1 && $index['open_level'] == XOONIPS_OL_PRIVATE) {
133- $index['html_title'] = 'Private';
134- }
135- $fullPathIndexes[] = $index;
136- }
132+ // get index full path
133+ $fullpathInfo = $indexBean->getFullPathIndexes($index_id);
134+ $fullPathIndexes = array();
135+ foreach ($fullpathInfo as $index) {
136+ if ($index['parent_index_id'] == 1 && $index['open_level'] == XOONIPS_OL_PRIVATE) {
137+ $index['html_title'] = 'Private';
138+ }
139+ $fullPathIndexes[] = $index;
140+ }
137141
138- // get page_no_label
139- if ($num_of_items == 0) {
140- $page_no_label = _MD_XOONIPS_ITEM_NO_ITEM_LISTED;
141- } else {
142- $_pMin = min(($page - 1) * $itemcount + 1, $num_of_items);
143- $_pMax = min($page * $itemcount, $num_of_items);
144- if ($_pMin == 1 && $_pMax == $num_of_items && $num_of_items == 1) {
145- $page_no_label = '';
146- } else {
147- $page_no_label = $_pMin . ' - ' . $_pMax . ' of ' . $num_of_items .' Items';
148- }
149- }
142+ // get page_no_label
143+ if ($num_of_items == 0) {
144+ $page_no_label = _MD_XOONIPS_ITEM_NO_ITEM_LISTED;
145+ } else {
146+ $_pMin = min(($page - 1) * $itemcount + 1, $num_of_items);
147+ $_pMax = min($page * $itemcount, $num_of_items);
148+ if ($_pMin == 1 && $_pMax == $num_of_items && $num_of_items == 1) {
149+ $page_no_label = '';
150+ } else {
151+ $page_no_label = $_pMin . ' - ' . $_pMax . ' of ' . $num_of_items .' Items';
152+ }
153+ }
150154
151- // breadcrumbs
152- $breadcrumbs = array(
153- array(
154- 'name' => _MD_XOONIPS_ITEM_LISTING_ITEM
155- )
156- );
155+ // breadcrumbs
156+ $breadcrumbs = array(
157+ array(
158+ 'name' => _MD_XOONIPS_ITEM_LISTING_ITEM
159+ )
160+ );
157161
158- // check that index is editable
159- $response->setViewDataByKey('edit_index', $indexBean->checkWriteRight($index_id,$uid));
162+ // check that index is editable
163+ $response->setViewDataByKey('edit_index', $indexBean->checkWriteRight($index_id,$uid));
160164
161- //centering current page number(5th of $pages)
162- $response->setViewDataByKey('pages', $this->getSelectablePageNumber($page, ceil($num_of_items / $itemcount)));
165+ //centering current page number(5th of $pages)
166+ $response->setViewDataByKey('pages', $this->getSelectablePageNumber($page, ceil($num_of_items / $itemcount)));
163167
164- $response->setViewDataByKey('xoops_breadcrumbs', $breadcrumbs);
165- $response->setViewDataByKey('detailed_title', $detailed_title);
166- $response->setViewDataByKey('detailed_description', $detailed_description);
167- $response->setViewDataByKey('item_htmls', $item_htmls);
168- $response->setViewDataByKey('my_indexes', $my_indexes);
169- $response->setViewDataByKey('index_path', $fullPathIndexes);
170- $response->setViewDataByKey('maxpage', ceil($num_of_items / $itemcount));
171- $response->setViewDataByKey('orderby', $orderby);
172- $response->setViewDataByKey('order_dir', $order_dir);
173- $response->setViewDataByKey('page', $page);
174- $response->setViewDataByKey('itemcount', intval($itemcount));
175- $response->setViewDataByKey('num_of_items', $num_of_items);
176- $response->setViewDataByKey('page_no_label', $page_no_label);
177- $response->setViewDataByKey('index_id', $index_id);
178- $response->setViewDataByKey('order_by_select', $sortTitles);
179- $response->setViewDataByKey('item_count_select', array('20', '50', '100'));
180- $response->setViewDataByKey('dirname', $this->dirname);
181- if ($isPrint == 'print') {
182- $response->setViewDataByKey('isPrintPage', true);
183- } else {
184- $response->setViewDataByKey('isPrintPage', false);
185- }
168+ $response->setViewDataByKey('xoops_breadcrumbs', $breadcrumbs);
169+ $response->setViewDataByKey('detailed_title', $detailed_title);
170+ $response->setViewDataByKey('detailed_description', $detailed_description);
171+ $response->setViewDataByKey('item_htmls', $item_htmls);
172+ $response->setViewDataByKey('my_indexes', $my_indexes);
173+ $response->setViewDataByKey('index_path', $fullPathIndexes);
174+ $response->setViewDataByKey('maxpage', ceil($num_of_items / $itemcount));
175+ $response->setViewDataByKey('orderby', $orderby);
176+ $response->setViewDataByKey('order_dir', $order_dir);
177+ $response->setViewDataByKey('page', $page);
178+ $response->setViewDataByKey('itemcount', intval($itemcount));
179+ $response->setViewDataByKey('num_of_items', $num_of_items);
180+ $response->setViewDataByKey('page_no_label', $page_no_label);
181+ $response->setViewDataByKey('index_id', $index_id);
182+ $response->setViewDataByKey('order_by_select', $sortTitles);
183+ $response->setViewDataByKey('item_count_select', array('20', '50', '100'));
184+ $response->setViewDataByKey('dirname', $this->dirname);
185+ if ($isPrint == 'print') {
186+ $response->setViewDataByKey('isPrintPage', true);
187+ } else {
188+ $response->setViewDataByKey('isPrintPage', false);
189+ }
186190
187- // assign export_enable variable if permitted
188- if (count($itemIds) > 0 && $export_enabled) {
189- $response->setViewDataByKey('export_enabled', 1);
190- }
191- $response->setViewDataByKey('export_select', $export_select);
191+ // assign export_enable variable if permitted
192+ if (count($itemIds) > 0 && $export_enabled) {
193+ $response->setViewDataByKey('export_enabled', 1);
194+ }
195+ $response->setViewDataByKey('export_select', $export_select);
192196
193- $response->setForward('init_success');
194- return true;
195- }
197+ $response->setForward('init_success');
198+ return true;
199+ }
196200
197- private function getSelectablePageNumber($page, $maxpage) {
198- //centering current page number(5th of $pages)
199- $pages = array(min(max(1, $page - 4), max(1, $maxpage - 9)));
200- for ($i = 1 ; $i < 10 && $pages[$i - 1] < $maxpage; $i++) {
201- $pages[$i] = $pages[$i - 1] + 1;
202- }
203- return $pages;
204- }
201+ private function getSelectablePageNumber($page, $maxpage) {
202+ //centering current page number(5th of $pages)
203+ $pages = array(min(max(1, $page - 4), max(1, $maxpage - 9)));
204+ for ($i = 1 ; $i < 10 && $pages[$i - 1] < $maxpage; $i++) {
205+ $pages[$i] = $pages[$i - 1] + 1;
206+ }
207+ return $pages;
208+ }
205209
206- protected function doExport(&$request,&$response) {
207- global $xoopsUser;
208- $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : XOONIPS_UID_GUEST;
210+ protected function doExport(&$request,&$response) {
211+ global $xoopsUser;
212+ $uid = is_object($xoopsUser) ? $xoopsUser->getVar('uid') : XOONIPS_UID_GUEST;
209213
210- // get request
211- $index_id = $request->getParameter('index_id');
212- $subindex = $request->getParameter('subindex') ? 1 : 0;
214+ // get request
215+ $index_id = $request->getParameter('index_id');
216+ $subindex = $request->getParameter('subindex') ? 1 : 0;
213217
214- // if has not index id
215- if (!$index_id) {
216- redirect_header(XOOPS_URL . '/', 3, 'ERROR ');
217- exit();
218- }
218+ // if has not index id
219+ if (!$index_id) {
220+ redirect_header(XOOPS_URL . '/', 3, 'ERROR ');
221+ exit();
222+ }
219223
220- // check can view index id
221- $indexBean = Xoonips_BeanFactory::getBean('IndexBean', $this->dirname, $this->trustDirname);
222- if (!$indexBean->canView($index_id, $uid)) {
223- redirect_header(XOOPS_URL . '/', 3, _MD_XOONIPS_ITEM_FORBIDDEN);
224- exit();
225- }
224+ // check can view index id
225+ $indexBean = Xoonips_BeanFactory::getBean('IndexBean', $this->dirname, $this->trustDirname);
226+ if (!$indexBean->canView($index_id, $uid)) {
227+ redirect_header(XOOPS_URL . '/', 3, _MD_XOONIPS_ITEM_FORBIDDEN);
228+ exit();
229+ }
226230
227- // index info
228- $indexInfo = $indexBean->getIndex($index_id);
231+ // index info
232+ $indexInfo = $indexBean->getIndex($index_id);
229233
230- // can view items
231- $itemIds = $indexBean->getCanViewItemIds($index_id, $uid);
234+ // can view items
235+ $itemIds = $indexBean->getCanViewItemIds($index_id, $uid);
232236
233- // do export
234- $xmlexport = new XmlItemExport();
235- $xmlexport->export_zip($itemIds, $index_id);
236- }
237+ // do export
238+ $xmlexport = new XmlItemExport();
239+ $xmlexport->export_zip($itemIds, $index_id);
240+ }
237241
238- protected function doExportselect(&$request,&$response) {
239- // get request
240- $index_id = $request->getParameter('index_id');
242+ protected function doExportselect(&$request,&$response) {
243+ // get request
244+ $index_id = $request->getParameter('index_id');
241245
242- // if has not index id
243- if (!isset($index_id)) {
244- redirect_header(XOOPS_URL . '/', 3, 'ERROR ');
245- exit();
246- }
246+ // if has not index id
247+ if (!isset($index_id)) {
248+ redirect_header(XOOPS_URL . '/', 3, 'ERROR ');
249+ exit();
250+ }
247251
248- // breadcrumbs
249- $breadcrumbs = array(
250- array(
251- 'name' => _MD_XOONIPS_ITEM_LISTING_ITEM,
252- 'url' => XOOPS_URL.'/modules/'.$this->dirname.'/list.php?index_id='.$index_id
253- ),
254- array(
255- 'name' => _MD_XOONIPS_ITEM_EXPORT_SELECT
256- )
257- );
252+ // breadcrumbs
253+ $breadcrumbs = array(
254+ array(
255+ 'name' => _MD_XOONIPS_ITEM_LISTING_ITEM,
256+ 'url' => XOOPS_URL.'/modules/'.$this->dirname.'/list.php?index_id='.$index_id
257+ ),
258+ array(
259+ 'name' => _MD_XOONIPS_ITEM_EXPORT_SELECT
260+ )
261+ );
258262
259- $response->setViewDataByKey('xoops_breadcrumbs', $breadcrumbs);
260- $response->setViewDataByKey('index_id', $index_id);
261- $response->setViewDataByKey('dirname', $this->dirname);
262- $response->setForward('exportselect_success');
263- return true;
264- }
265-
263+ $response->setViewDataByKey('xoops_breadcrumbs', $breadcrumbs);
264+ $response->setViewDataByKey('index_id', $index_id);
265+ $response->setViewDataByKey('dirname', $this->dirname);
266+ $response->setForward('exportselect_success');
267+ return true;
268+ }
266269 }
267-
--- trunk/xoonips/xoops_trust_path/modules/xoonips/class/core/Utils.class.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/class/core/Utils.class.php (revision 651)
@@ -447,5 +447,140 @@
447447 global $xoopsModule;
448448 return $xoopsModule->getVar('trust_dirname');
449449 }
450+
451+ // php-indent: disable
452+ /**
453+ * html character entity references
454+ * @access private
455+ * @var array strings of html character entity reference
456+ */
457+ var $_html_char_entity_ref = array(
458+ '&quot;', '&amp;', '&apos;', '&lt;', '&gt;',
459+ '&nbsp;', '&iexcl;', '&cent;', '&pound;', '&curren;',
460+ '&yen;', '&brvbar;', '&sect;', '&uml;', '&copy;',
461+ '&ordf;', '&laquo;', '&not;', '&shy;', '&reg;',
462+ '&macr;', '&deg;', '&plusmn;', '&sup2;', '&sup3;',
463+ '&acute;', '&micro;', '&para;', '&middot;', '&cedil;',
464+ '&sup1;', '&ordm;', '&raquo;', '&frac14;', '&frac12;',
465+ '&frac34;', '&iquest;', '&Agrave;', '&Aacute;', '&Acirc;',
466+ '&Atilde;', '&Auml;', '&Aring;', '&AElig;', '&Ccedil;',
467+ '&Egrave;', '&Eacute;', '&Ecirc;', '&Euml;', '&Igrave;',
468+ '&Iacute;', '&Icirc;', '&Iuml;', '&ETH;', '&Ntilde;',
469+ '&Ograve;', '&Oacute;', '&Ocirc;', '&Otilde;', '&Ouml;',
470+ '&times;', '&Oslash;', '&Ugrave;', '&Uacute;', '&Ucirc;',
471+ '&Uuml;', '&Yacute;', '&THORN;', '&szlig;', '&agrave;',
472+ '&aacute;', '&acirc;', '&atilde;', '&auml;', '&aring;',
473+ '&aelig;', '&ccedil;', '&egrave;', '&eacute;', '&ecirc;',
474+ '&euml;', '&igrave;', '&iacute;', '&icirc;', '&iuml;',
475+ '&eth;', '&ntilde;', '&ograve;', '&oacute;', '&ocirc;',
476+ '&otilde;', '&ouml;', '&divide;', '&oslash;', '&ugrave;',
477+ '&uacute;', '&ucirc;', '&uuml;', '&yacute;', '&thorn;',
478+ '&yuml;', '&OElig;', '&oelig;', '&Scaron;', '&scaron;',
479+ '&Yuml;', '&fnof;', '&circ;', '&tilde;', '&Alpha;',
480+ '&Beta;', '&Gamma;', '&Delta;', '&Epsilon;', '&Zeta;',
481+ '&Eta;', '&Theta;', '&Iota;', '&Kappa;', '&Lambda;',
482+ '&Mu;', '&Nu;', '&Xi;', '&Omicron;', '&Pi;',
483+ '&Rho;', '&Sigma;', '&Tau;', '&Upsilon;', '&Phi;',
484+ '&Chi;', '&Psi;', '&Omega;', '&alpha;', '&beta;',
485+ '&gamma;', '&delta;', '&epsilon;', '&zeta;', '&eta;',
486+ '&theta;', '&iota;', '&kappa;', '&lambda;', '&mu;',
487+ '&nu;', '&xi;', '&omicron;', '&pi;', '&rho;',
488+ '&sigmaf;', '&sigma;', '&tau;', '&upsilon;', '&phi;',
489+ '&chi;', '&psi;', '&omega;', '&thetasym;', '&upsih;',
490+ '&piv;', '&ensp;', '&emsp;', '&thinsp;', '&zwnj;',
491+ '&zwj;', '&lrm;', '&rlm;', '&ndash;', '&mdash;',
492+ '&lsquo;', '&rsquo;', '&sbquo;', '&ldquo;', '&rdquo;',
493+ '&bdquo;', '&dagger;', '&Dagger;', '&bull;', '&hellip;',
494+ '&permil;', '&prime;', '&Prime;', '&lsaquo;', '&rsaquo;',
495+ '&oline;', '&frasl;', '&euro;', '&image;', '&weierp;',
496+ '&real;', '&trade;', '&alefsym;', '&larr;', '&uarr;',
497+ '&rarr;', '&darr;', '&harr;', '&crarr;', '&lArr;',
498+ '&uArr;', '&rArr;', '&dArr;', '&hArr;', '&forall;',
499+ '&part;', '&exist;', '&empty;', '&nabla;', '&isin;',
500+ '&notin;', '&ni;', '&prod;', '&sum;', '&minus;',
501+ '&lowast;', '&radic;', '&prop;', '&infin;', '&ang;',
502+ '&and;', '&or;', '&cap;', '&cup;', '&int;',
503+ '&there4;', '&sim;', '&cong;', '&asymp;', '&ne;',
504+ '&equiv;', '&le;', '&ge;', '&sub;', '&sup;',
505+ '&nsub;', '&sube;', '&supe;', '&oplus;', '&otimes;',
506+ '&perp;', '&sdot;', '&lceil;', '&rceil;', '&lfloor;',
507+ '&rfloor;', '&lang;', '&rang;', '&loz;', '&spades;',
508+ '&clubs;', '&hearts;', '&diams;',
509+ );
510+
511+ /**
512+ * escape html special characters
513+ * this function will convert text to follow some rules:
514+ * - '&' => '&amp;'
515+ * - '"' => '&quot;'
516+ * - ''' => '&#039;'
517+ * - '<' => '&lt;'
518+ * - '>' => '&gt;'
519+ * - numeric entity reference => (pass)
520+ * - character entity reference => (pass)
521+ * - '&nbsp;' => '&amp;nbsp;'
522+ *
523+ * @access public
524+ * @param string $text text string
525+ * @return string escaped text string
526+ */
527+ function getHtmlSpecialChars($text)
528+ {
529+ static $s = array(
530+ '/&amp;#([xX][0-9a-fA-F]+|[0-9]+);/',
531+ '/&amp;([a-zA-Z][0-9a-zA-Z]+);/e',
532+ '/&nbsp;/',
533+ );
534+ static $r = array(
535+ '&#\\1;',
536+ 'in_array( "&$1;", $this->_html_char_entity_ref ) ? "&$1;" : "&amp;$1;"',
537+ '&amp;nbsp;',
538+ );
539+ return preg_replace($s, $r, htmlspecialchars($text, ENT_QUOTES));
540+ }
541+
542+ /**
543+ * truncate text
544+ *
545+ * @access public
546+ * @param string $text src
547+ * @param int $length maximum char width
548+ * @param string $etc appending text if $text truncated
549+ * @return string dist
550+ */
551+ function getTruncate($text, $length, $etc = '...' )
552+ {
553+ // multi language extension support - strip ml tags
554+ if (defined('XOOPS_CUBE_LEGACY')) {
555+ // cubeutil module
556+ if (isset($GLOBALS['cubeUtilMlang'])) {
557+ $text = $GLOBALS['cubeUtilMlang']->obFilter($text);
558+ }
559+ } else {
560+ // sysutil module
561+ if (function_exists('sysutil_get_xoops_option')) {
562+ if (sysutil_get_xoops_option('sysutil', 'sysutil_use_ml')) {
563+ if (function_exists('sysutil_ml_filter')) {
564+ $text = sysutil_ml_filter($text);
565+ }
566+ }
567+ }
568+ }
569+
570+ $olen = strlen($text);
571+ // trim width
572+ if (XOOPS_USE_MULTIBYTES) {
573+ $text = mb_strimwidth($text, 0, $length, '', mb_detect_encoding($text));
574+ } else {
575+ $text = substr($text, 0, $length);
576+ }
577+ // remove broken html entity from trimed strig
578+ $text = preg_replace('/&#[^;]*$/s', '', $text);
579+ // append $etc char if text is trimed
580+ if ($olen != strlen($text)) {
581+ $text .= $etc;
582+ }
583+ return $text;
584+ }
450585 }
451586
--- trunk/xoonips/xoops_trust_path/modules/xoonips/class/handler/Item.class.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/class/handler/Item.class.php (revision 651)
@@ -104,4 +104,41 @@
104104 }
105105 return $ret;
106106 }
107+
108+ /**
109+ * get most viewed item object
110+ *
111+ * @param int $limit
112+ * @param int $term
113+ * @return $ret
114+ */
115+ public function &getMostViewedItems($limit = 0, $term)
116+ {
117+ $ret = array();
118+ $tableItemTitle = $this->db->prefix($this->mDirname . '_item_title');
119+ $tableIndex = $this->db->prefix($this->mDirname . '_index');
120+ $tableIndexItemLink = $this->db->prefix($this->mDirname . '_index_item_link');
121+ if ($limit < 1)
122+ return;
123+
124+ $sql = sprintf('SELECT * FROM `%1$s` INNER JOIN `%2$s` ON `%1$s`.`item_id` = `%2$s`.`item_id` WHERE `%1$s`.`item_id` IN (SELECT DISTINCT `%4$s`.`item_id` FROM `%4$s` WHERE (`%4$s`.`certify_state` = %6$d OR `%4$s`.`certify_state` = %7$d) AND `%4$s`.`index_id` IN (SELECT `%3$s`.`index_id` FROM `%3$s` WHERE `%3$s`.`open_level` = %5$d)) AND ', $this->mTable, $tableItemTitle, $tableIndex, $tableIndexItemLink, XOONIPS_OL_PUBLIC, XOONIPS_CERTIFIED, XOONIPS_WITHDRAW_REQUIRED);
125+ if ($term != 0)
126+ $sql .= sprintf('`%1$s`.`last_update_date` >= %2$d AND ', $this->mTable, $term);
127+ $sql .= sprintf('`%1$s`.`view_count` != 0 ORDER BY `%1$s`.`view_count` DESC limit %2$d', $this->mTable, $limit);
128+
129+ if ($result = $this->db->query($sql)) {
130+ while ($row = $this->db->fetchArray($result)) {
131+ $r = array();
132+ $r['title'] = $row['title'];
133+ $r['view_count'] = $row['view_count'];
134+ $obj = new $this->mClass();
135+ $obj->mDirname = $this->getDirname();
136+ $obj->assignVars($row);
137+ $r['url'] = $obj->getUrl();
138+ unset($obj);
139+ $ret[] = $r;
140+ }
141+ }
142+ return $ret;
143+ }
107144 }
--- trunk/xoonips/xoops_trust_path/modules/xoonips/class/handler/ItemFile.class.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/class/handler/ItemFile.class.php (revision 651)
@@ -114,4 +114,41 @@
114114 }
115115 return $ret;
116116 }
117+
118+ /**
119+ * get most downloaded item object
120+ *
121+ * @param int $limit
122+ * @param int $term
123+ * @return $ret
124+ */
125+ public function &getMostDownloadedItems($limit = 0, $term)
126+ {
127+ $ret = array();
128+ $tableItem = $this->db->prefix($this->mDirname . '_item');
129+ $tableItemTitle = $this->db->prefix($this->mDirname . '_item_title');
130+ $tableIndex = $this->db->prefix($this->mDirname . '_index');
131+ $tableIndexItemLink = $this->db->prefix($this->mDirname . '_index_item_link');
132+ if ($limit < 1)
133+ return;
134+
135+ $sql = sprintf('SELECT * FROM `%1$s` INNER JOIN `%2$s` ON `%1$s`.`item_id` = `%2$s`.`item_id` INNER JOIN `%3$s` ON `%1$s`.`item_id` = `%3$s`.`item_id` WHERE `%1$s`.`item_id` IN (SELECT DISTINCT `%5$s`.`item_id` FROM `%5$s` WHERE (`%5$s`.`certify_state` = %7$d OR `%5$s`.`certify_state` = %8$d) AND `%5$s`.`index_id` IN (SELECT `%4$s`.`index_id` FROM `%4$s` WHERE `%4$s`.`open_level` = %6$d)) AND ', $this->mTable, $tableItem, $tableItemTitle, $tableIndex, $tableIndexItemLink, XOONIPS_OL_PUBLIC, XOONIPS_CERTIFIED, XOONIPS_WITHDRAW_REQUIRED);
136+ if ($term != 0)
137+ $sql .= sprintf('`%1$s`.`last_update_date` >= %2$d AND ', $tableItem, $term);
138+ $sql .= sprintf('`%1$s`.`download_count` != 0 ORDER BY `%1$s`.`download_count` DESC limit %2$d', $this->mTable, $limit);
139+
140+ if ($result = $this->db->query($sql)) {
141+ while ($row = $this->db->fetchArray($result)) {
142+ $r = array();
143+ $r['title'] = $row['title'];
144+ $r['download_count'] = $row['download_count'];
145+ $itemHandler = Xoonips_Utils::getModuleHandler('item', $this->mDirname);
146+ $itemObj =& $itemHandler->get($row['item_id']);
147+ $r['url'] = $itemObj->getUrl();
148+ unset($itemObj);
149+ $ret[] = $r;
150+ }
151+ }
152+ return $ret;
153+ }
117154 }
--- trunk/xoonips/xoops_trust_path/modules/xoonips/include/condefs.inc.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/include/condefs.inc.php (revision 651)
@@ -26,3 +26,12 @@
2626 define('XOONIPS_CONFIG_DOI_FIELD_PARAM_NAME', 'id');
2727 define('XOONIPS_CONFIG_DOI_FIELD_PARAM_MAXLEN', 35);
2828 define('XOONIPS_CONFIG_DOI_FIELD_PARAM_PATTERN', '[\-_0-9A-Za-z\.]+');
29+
30+// xoonips ranking
31+define('XOONIPS_BLOCK_RANKING_NUM_ROWS', '5');
32+define('XOONIPS_BLOCK_RANKING_ORDER', '0,1');
33+define('XOONIPS_BLOCK_RANKING_VISIBLE', '1,1');
34+define('XOONIPS_BLOCK_RANKING_DAYS_ENABLED', 'on');
35+define('XOONIPS_BLOCK_RANKING_DAYS', '14');
36+
37+
--- trunk/xoonips/xoops_trust_path/modules/xoonips/language/english/blocks.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/language/english/blocks.php (revision 651)
@@ -32,3 +32,10 @@
3232 define($constpref . '_SEARCH_QUICK', 'Search');
3333 define($constpref . '_SEARCH_ADVANCED', 'Advanced');
3434
35+// ranking block
36+define($constpref . '_RANKING_VIEWED_ITEM', 'most accessed items');
37+define($constpref . '_RANKING_DOWNLOADED_ITEM', 'most downloaded items');
38+
39+define($constpref . '_RANKING_EMPTY', 'ranking is empty.');
40+define($constpref . '_RANKING_RANK_STR', 'st,nd,rd,th');
41+
--- trunk/xoonips/xoops_trust_path/modules/xoonips/language/english/modinfo.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/language/english/modinfo.php (revision 651)
@@ -375,4 +375,5 @@
375375 define('_MI_XOONIPS_CONF_AUTO_PUBLIC_ADMIT', 'Auto-approve to publish the group');
376376 define('_MI_XOONIPS_CONF_MODERATOR_PUBLIC_ADMIT', 'Moderator-approve to publish the group');
377377
378-
378+// ranking
379+define('_MI_XOONIPS_RANKING', 'XooNIps Ranking');
--- trunk/xoonips/xoops_trust_path/modules/xoonips/language/ja_utf8/blocks.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/language/ja_utf8/blocks.php (revision 651)
@@ -32,3 +32,10 @@
3232 define($constpref . '_SEARCH_QUICK', '検索');
3333 define($constpref . '_SEARCH_ADVANCED', '詳細検索');
3434
35+// ranking block
36+define($constpref . '_RANKING_VIEWED_ITEM', '最も多く閲覧されたアイテム');
37+define($constpref . '_RANKING_DOWNLOADED_ITEM', '最も多くダウンロードされたアイテム');
38+
39+define($constpref . '_RANKING_EMPTY', 'ランキングが空です');
40+define($constpref . '_RANKING_RANK_STR', '位');
41+
--- trunk/xoonips/xoops_trust_path/modules/xoonips/language/ja_utf8/modinfo.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/language/ja_utf8/modinfo.php (revision 651)
@@ -375,4 +375,9 @@
375375 define('_MI_XOONIPS_CONF_AUTO_PUBLIC_ADMIT', '自動的にグループの公開を承認する');
376376 define('_MI_XOONIPS_CONF_MODERATOR_PUBLIC_ADMIT', 'モデレータが確認してグループの公開を承認する');
377377
378+// ranking
379+define('_MI_XOONIPS_RANKING', 'ランキング');
378380
381+
382+
383+
--- trunk/xoonips/xoops_trust_path/modules/xoonips/templates/blocks/block_ranking.html (nonexistent)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/templates/blocks/block_ranking.html (revision 651)
@@ -0,0 +1,22 @@
1+<{foreach item=ranking from=$block.rankings name=rankings}>
2+ <{$ranking.title}><br />
3+ <{if count($ranking.items) }>
4+ <{foreach item=item from=$ranking.items name=rank}>
5+ <{$item.rank_str}>
6+ <{if $item.url}>
7+ <a href="<{$item.url}>"><{$item.title}></a> (<{$item.num}>)
8+ <{else}>
9+ <{$item.title}> <{$item.num}>
10+ <{/if}>
11+ <{if $smarty.foreach.rank.iteration == 1}>
12+ <span style='background-image: url(<{$smarty.const.XOOPS_URL}>/uploads/rank3dbf8edf15093.gif); background-repeat: no-repeat; background-position: 0% 100%;'><img src='<{$smarty.const.XOOPS_URL}>/uploads/blank.gif' width='15' height='14' alt='1st' /></span>
13+ <{/if}>
14+ <br />
15+ <{/foreach}>
16+ <{else }>
17+ <{$smarty.const._MB_XOONIPS_RANKING_EMPTY}>
18+ <{/if}>
19+ <{if !$smarty.foreach.rankings.last}>
20+ <hr />
21+ <{/if}>
22+<{/foreach}>
--- trunk/xoonips/xoops_trust_path/modules/xoonips/templates/index_description.html (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/templates/index_description.html (revision 651)
@@ -80,7 +80,7 @@
8080 <tr>
8181 <td class="head"><{$smarty.const._MD_XOONIPS_INDEX_DETAILED_DESCRIPTION_DESCRIPTION}></td>
8282 <td class="<{cycle name="oddeven"}>">
83- <textarea id="<{$dirname}>_detailed_description" name="detailed_description" rows="5" cols="50" style="width:400px;"><{$detailed_description|xoops_escape}></textarea>
83+ <{xoops_dhtmltarea id="`$dirname`_detailed_description" name="detailed_description" value=$detailed_description }>
8484 </td>
8585 </tr>
8686 </table>
--- trunk/xoonips/xoops_trust_path/modules/xoonips/templates/list.html (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/templates/list.html (revision 651)
@@ -53,7 +53,7 @@
5353 <h3><{$detailed_title|xoops_escape}></h3>
5454 <{/if}>
5555 <{if !empty($detailed_description)}>
56- <pre style="font-size:14px;word-wrap:break-word;white-space:pre-wrap;overflow:auto;"><{$detailed_description|xoops_escape}></pre>
56+ <{$detailed_description}>
5757 <{/if}>
5858 </td>
5959 </tr>
--- trunk/xoonips/xoops_trust_path/modules/xoonips/xoops_version.php (revision 650)
+++ trunk/xoonips/xoops_trust_path/modules/xoonips/xoops_version.php (revision 651)
@@ -20,21 +20,21 @@
2020 $modversion['dirname'] = $myDirName;
2121 $modversion['trust_dirname'] = 'xoonips';
2222 $modversion['legacy_installer'] = array(
23- 'installer' => array(
24- 'class' => 'Installer',
25- 'namespace' => 'Xoonips',
26- 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Installer.class.php'
27- ),
28- 'uninstaller' => array(
29- 'class' => 'Uninstaller',
30- 'namespace' => 'Xoonips',
31- 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Uninstaller.class.php'
32- ),
33- 'updater' => array(
34- 'class' => 'Updater',
35- 'namespace' => 'Xoonips',
36- 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Updater.class.php'
37- )
23+ 'installer' => array(
24+ 'class' => 'Installer',
25+ 'namespace' => 'Xoonips',
26+ 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Installer.class.php'
27+ ),
28+ 'uninstaller' => array(
29+ 'class' => 'Uninstaller',
30+ 'namespace' => 'Xoonips',
31+ 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Uninstaller.class.php'
32+ ),
33+ 'updater' => array(
34+ 'class' => 'Updater',
35+ 'namespace' => 'Xoonips',
36+ 'filepath' => XOONIPS_TRUST_PATH . '/admin/class/installer/Updater.class.php'
37+ )
3838 );
3939 $modversion['disable_legacy_2nd_installer'] = false;
4040 // Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin)
@@ -43,44 +43,44 @@
4343 $modversion['sqlfile']['mysql'] = 'sql/mysql.sql';
4444 $modversion['sqlfile']['mysql_alter'] = 'sql/mysql_alter.sql';
4545 $modversion['tables'] = array(
46- '{prefix}_{dirname}_item',
47- '{prefix}_{dirname}_index_item_link',
48- '{prefix}_{dirname}_index',
49- '{prefix}_{dirname}_item_changelog',
50- '{prefix}_{dirname}_item_type',
51- '{prefix}_{dirname}_item_file',
52- '{prefix}_{dirname}_config',
53- '{prefix}_{dirname}_event_log',
54- '{prefix}_{dirname}_oaipmh_item_status',
55- '{prefix}_{dirname}_oaipmh_resumption_token',
56- '{prefix}_{dirname}_item_related_to',
57- '{prefix}_{dirname}_search_text',
58- '{prefix}_{dirname}_item_title',
59- '{prefix}_{dirname}_item_keyword',
60- '{prefix}_{dirname}_data_type',
61- '{prefix}_{dirname}_item_type_sort',
62- '{prefix}_{dirname}_view_type',
63- '{prefix}_{dirname}_view_data_relation',
64- '{prefix}_{dirname}_default_item_field_group',
65- '{prefix}_{dirname}_default_item_field_detail',
66- '{prefix}_{dirname}_complement',
67- '{prefix}_{dirname}_complement_detail',
68- '{prefix}_{dirname}_item_field_value_set',
69- '{prefix}_{dirname}_item_field_group',
70- '{prefix}_{dirname}_item_field_detail',
71- '{prefix}_{dirname}_item_field_detail_complement_link',
72- '{prefix}_{dirname}_item_type_sort_detail',
73- '{prefix}_{dirname}_item_users_link',
74- '{prefix}_{dirname}_item_type_search_condition',
75- '{prefix}_{dirname}_oaipmh_schema_item_type_link',
76- '{prefix}_{dirname}_item_type_search_condition_detail',
77- '{prefix}_{dirname}_oaipmh_schema_value_set',
78- '{prefix}_{dirname}_oaipmh_schema',
79- '{prefix}_{dirname}_oaipmh_schema_link',
80- '{prefix}_{dirname}_item_type_field_group_link',
81- '{prefix}_{dirname}_item_field_group_field_detail_link',
82- '{prefix}_{dirname}_item_import_log',
83- '{prefix}_{dirname}_item_import_link',
46+ '{prefix}_{dirname}_item',
47+ '{prefix}_{dirname}_index_item_link',
48+ '{prefix}_{dirname}_index',
49+ '{prefix}_{dirname}_item_changelog',
50+ '{prefix}_{dirname}_item_type',
51+ '{prefix}_{dirname}_item_file',
52+ '{prefix}_{dirname}_config',
53+ '{prefix}_{dirname}_event_log',
54+ '{prefix}_{dirname}_oaipmh_item_status',
55+ '{prefix}_{dirname}_oaipmh_resumption_token',
56+ '{prefix}_{dirname}_item_related_to',
57+ '{prefix}_{dirname}_search_text',
58+ '{prefix}_{dirname}_item_title',
59+ '{prefix}_{dirname}_item_keyword',
60+ '{prefix}_{dirname}_data_type',
61+ '{prefix}_{dirname}_item_type_sort',
62+ '{prefix}_{dirname}_view_type',
63+ '{prefix}_{dirname}_view_data_relation',
64+ '{prefix}_{dirname}_default_item_field_group',
65+ '{prefix}_{dirname}_default_item_field_detail',
66+ '{prefix}_{dirname}_complement',
67+ '{prefix}_{dirname}_complement_detail',
68+ '{prefix}_{dirname}_item_field_value_set',
69+ '{prefix}_{dirname}_item_field_group',
70+ '{prefix}_{dirname}_item_field_detail',
71+ '{prefix}_{dirname}_item_field_detail_complement_link',
72+ '{prefix}_{dirname}_item_type_sort_detail',
73+ '{prefix}_{dirname}_item_users_link',
74+ '{prefix}_{dirname}_item_type_search_condition',
75+ '{prefix}_{dirname}_oaipmh_schema_item_type_link',
76+ '{prefix}_{dirname}_item_type_search_condition_detail',
77+ '{prefix}_{dirname}_oaipmh_schema_value_set',
78+ '{prefix}_{dirname}_oaipmh_schema',
79+ '{prefix}_{dirname}_oaipmh_schema_link',
80+ '{prefix}_{dirname}_item_type_field_group_link',
81+ '{prefix}_{dirname}_item_field_group_field_detail_link',
82+ '{prefix}_{dirname}_item_import_log',
83+ '{prefix}_{dirname}_item_import_link',
8484 );
8585
8686 // Admin things
@@ -437,6 +437,12 @@
437437 $modversion['blocks'][5]['template'] = 'block_itemtypes.html';
438438 $modversion['blocks'][5]['can_clone'] = true;
439439
440+$modversion['blocks'][6]['file'] = "xoonips_blocks.php";
441+$modversion['blocks'][6]['name'] = _MI_XOONIPS_RANKING;
442+$modversion['blocks'][6]['description'] = "Ranking";
443+$modversion['blocks'][6]['show_func'] = "b_xoonips_ranking_show";
444+$modversion['blocks'][6]['template'] = 'block_ranking.html';
445+
440446 // $modversion['onInstall'] = 'include/oninstall.inc.php';
441447 // $modversion['onUpdate'] = 'include/onupdate.inc.php';
442448 // $modversion['onUninstall'] = 'include/onuninstall.inc.php';
Show on old repository browser