- Add ranking block
- Add Support WYSIWIG Editor on index description
@@ -19,3 +19,5 @@ | ||
19 | 19 | // load item type list block |
20 | 20 | require_once dirname(__FILE__) . '/xoonips_itemtypes.php'; |
21 | 21 | |
22 | +// load ranking block | |
23 | +require_once dirname( __FILE__ ).'/xoonips_ranking.php'; |
@@ -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 | +} |
@@ -7,22 +7,25 @@ | ||
7 | 7 | |
8 | 8 | class Xoonips_ListAction extends Xoonips_ActionBase { |
9 | 9 | |
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(); | |
13 | 13 | |
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( | |
24 | 27 | 'op' => array('s', ''), |
25 | - 'isPrint' => array('s', ''), | |
28 | + 'isPrint' => array('s', ''), | |
26 | 29 | 'page' => array('i', 1), |
27 | 30 | 'orderby' => array('s', $sess_orderby), |
28 | 31 | 'order_dir' => array('i', $sess_orderdir), |
@@ -30,52 +33,53 @@ | ||
30 | 33 | 'selected' => array('i', array()), |
31 | 34 | 'num_of_items' => array('i', null), |
32 | 35 | '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 | + } | |
41 | 44 | |
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 | + } | |
48 | 51 | |
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 | + } | |
54 | 57 | |
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; | |
57 | 60 | |
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 | + ); | |
62 | 67 | |
63 | - $export_enabled = true; | |
68 | + $export_enabled = true; | |
64 | 69 | |
65 | - // index info | |
66 | - $detailed_title = ''; | |
67 | - $detailed_description = ''; | |
70 | + // index info | |
71 | + $detailed_title = ''; | |
72 | + $detailed_description = ''; | |
68 | 73 | $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 | + } | |
71 | 80 | |
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); | |
79 | 83 | $icon = sprintf('%s/modules/%s/image.php/index/%u/%s', XOOPS_URL, $this->dirname, $index_id, $indexInfo['icon']); |
80 | 84 | $index_upload_dir = Xoonips_Utils::getXooNIpsConfig($this->dirname, 'index_upload_dir'); |
81 | 85 | $file_path = $index_upload_dir . '/index/' . $index_id; |
@@ -82,186 +86,184 @@ | ||
82 | 86 | if (file_exists($file_path)) { |
83 | 87 | $response->setViewDataByKey('icon', $icon); |
84 | 88 | } |
85 | - } | |
89 | + } | |
86 | 90 | |
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); | |
90 | 94 | |
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); | |
94 | 98 | |
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 | + } | |
105 | 109 | |
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; | |
127 | 131 | |
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 | + } | |
137 | 141 | |
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 | + } | |
150 | 154 | |
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 | + ); | |
157 | 161 | |
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)); | |
160 | 164 | |
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))); | |
163 | 167 | |
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 | + } | |
186 | 190 | |
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); | |
192 | 196 | |
193 | - $response->setForward('init_success'); | |
194 | - return true; | |
195 | - } | |
197 | + $response->setForward('init_success'); | |
198 | + return true; | |
199 | + } | |
196 | 200 | |
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 | + } | |
205 | 209 | |
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; | |
209 | 213 | |
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; | |
213 | 217 | |
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 | + } | |
219 | 223 | |
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 | + } | |
226 | 230 | |
227 | - // index info | |
228 | - $indexInfo = $indexBean->getIndex($index_id); | |
231 | + // index info | |
232 | + $indexInfo = $indexBean->getIndex($index_id); | |
229 | 233 | |
230 | - // can view items | |
231 | - $itemIds = $indexBean->getCanViewItemIds($index_id, $uid); | |
234 | + // can view items | |
235 | + $itemIds = $indexBean->getCanViewItemIds($index_id, $uid); | |
232 | 236 | |
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 | + } | |
237 | 241 | |
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'); | |
241 | 245 | |
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 | + } | |
247 | 251 | |
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 | + ); | |
258 | 262 | |
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 | + } | |
266 | 269 | } |
267 | - |
@@ -447,5 +447,140 @@ | ||
447 | 447 | global $xoopsModule; |
448 | 448 | return $xoopsModule->getVar('trust_dirname'); |
449 | 449 | } |
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 | + '"', '&', ''', '<', '>', | |
459 | + ' ', '¡', '¢', '£', '¤', | |
460 | + '¥', '¦', '§', '¨', '©', | |
461 | + 'ª', '«', '¬', '­', '®', | |
462 | + '¯', '°', '±', '²', '³', | |
463 | + '´', 'µ', '¶', '·', '¸', | |
464 | + '¹', 'º', '»', '¼', '½', | |
465 | + '¾', '¿', 'À', 'Á', 'Â', | |
466 | + 'Ã', 'Ä', 'Å', 'Æ', 'Ç', | |
467 | + 'È', 'É', 'Ê', 'Ë', 'Ì', | |
468 | + 'Í', 'Î', 'Ï', 'Ð', 'Ñ', | |
469 | + 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', | |
470 | + '×', 'Ø', 'Ù', 'Ú', 'Û', | |
471 | + 'Ü', 'Ý', 'Þ', 'ß', 'à', | |
472 | + 'á', 'â', 'ã', 'ä', 'å', | |
473 | + 'æ', 'ç', 'è', 'é', 'ê', | |
474 | + 'ë', 'ì', 'í', 'î', 'ï', | |
475 | + 'ð', 'ñ', 'ò', 'ó', 'ô', | |
476 | + 'õ', 'ö', '÷', 'ø', 'ù', | |
477 | + 'ú', 'û', 'ü', 'ý', 'þ', | |
478 | + 'ÿ', 'Œ', 'œ', 'Š', 'š', | |
479 | + 'Ÿ', 'ƒ', 'ˆ', '˜', 'Α', | |
480 | + 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', | |
481 | + 'Η', 'Θ', 'Ι', 'Κ', 'Λ', | |
482 | + 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', | |
483 | + 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', | |
484 | + 'Χ', 'Ψ', 'Ω', 'α', 'β', | |
485 | + 'γ', 'δ', 'ε', 'ζ', 'η', | |
486 | + 'θ', 'ι', 'κ', 'λ', 'μ', | |
487 | + 'ν', 'ξ', 'ο', 'π', 'ρ', | |
488 | + 'ς', 'σ', 'τ', 'υ', 'φ', | |
489 | + 'χ', 'ψ', 'ω', 'ϑ', 'ϒ', | |
490 | + 'ϖ', ' ', ' ', ' ', '‌', | |
491 | + '‍', '‎', '‏', '–', '—', | |
492 | + '‘', '’', '‚', '“', '”', | |
493 | + '„', '†', '‡', '•', '…', | |
494 | + '‰', '′', '″', '‹', '›', | |
495 | + '‾', '⁄', '€', 'ℑ', '℘', | |
496 | + 'ℜ', '™', 'ℵ', '←', '↑', | |
497 | + '→', '↓', '↔', '↵', '⇐', | |
498 | + '⇑', '⇒', '⇓', '⇔', '∀', | |
499 | + '∂', '∃', '∅', '∇', '∈', | |
500 | + '∉', '∋', '∏', '∑', '−', | |
501 | + '∗', '√', '∝', '∞', '∠', | |
502 | + '∧', '∨', '∩', '∪', '∫', | |
503 | + '∴', '∼', '≅', '≈', '≠', | |
504 | + '≡', '≤', '≥', '⊂', '⊃', | |
505 | + '⊄', '⊆', '⊇', '⊕', '⊗', | |
506 | + '⊥', '⋅', '⌈', '⌉', '⌊', | |
507 | + '⌋', '⟨', '⟩', '◊', '♠', | |
508 | + '♣', '♥', '♦', | |
509 | + ); | |
510 | + | |
511 | + /** | |
512 | + * escape html special characters | |
513 | + * this function will convert text to follow some rules: | |
514 | + * - '&' => '&' | |
515 | + * - '"' => '"' | |
516 | + * - ''' => ''' | |
517 | + * - '<' => '<' | |
518 | + * - '>' => '>' | |
519 | + * - numeric entity reference => (pass) | |
520 | + * - character entity reference => (pass) | |
521 | + * - ' ' => '&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 | + '/&#([xX][0-9a-fA-F]+|[0-9]+);/', | |
531 | + '/&([a-zA-Z][0-9a-zA-Z]+);/e', | |
532 | + '/ /', | |
533 | + ); | |
534 | + static $r = array( | |
535 | + '&#\\1;', | |
536 | + 'in_array( "&$1;", $this->_html_char_entity_ref ) ? "&$1;" : "&$1;"', | |
537 | + '&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 | + } | |
450 | 585 | } |
451 | 586 |
@@ -104,4 +104,41 @@ | ||
104 | 104 | } |
105 | 105 | return $ret; |
106 | 106 | } |
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 | + } | |
107 | 144 | } |
@@ -114,4 +114,41 @@ | ||
114 | 114 | } |
115 | 115 | return $ret; |
116 | 116 | } |
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 | + } | |
117 | 154 | } |
@@ -26,3 +26,12 @@ | ||
26 | 26 | define('XOONIPS_CONFIG_DOI_FIELD_PARAM_NAME', 'id'); |
27 | 27 | define('XOONIPS_CONFIG_DOI_FIELD_PARAM_MAXLEN', 35); |
28 | 28 | 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 | + |
@@ -32,3 +32,10 @@ | ||
32 | 32 | define($constpref . '_SEARCH_QUICK', 'Search'); |
33 | 33 | define($constpref . '_SEARCH_ADVANCED', 'Advanced'); |
34 | 34 | |
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 | + |
@@ -375,4 +375,5 @@ | ||
375 | 375 | define('_MI_XOONIPS_CONF_AUTO_PUBLIC_ADMIT', 'Auto-approve to publish the group'); |
376 | 376 | define('_MI_XOONIPS_CONF_MODERATOR_PUBLIC_ADMIT', 'Moderator-approve to publish the group'); |
377 | 377 | |
378 | - | |
378 | +// ranking | |
379 | +define('_MI_XOONIPS_RANKING', 'XooNIps Ranking'); |
@@ -32,3 +32,10 @@ | ||
32 | 32 | define($constpref . '_SEARCH_QUICK', '検索'); |
33 | 33 | define($constpref . '_SEARCH_ADVANCED', '詳細検索'); |
34 | 34 | |
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 | + |
@@ -375,4 +375,9 @@ | ||
375 | 375 | define('_MI_XOONIPS_CONF_AUTO_PUBLIC_ADMIT', '自動的にグループの公開を承認する'); |
376 | 376 | define('_MI_XOONIPS_CONF_MODERATOR_PUBLIC_ADMIT', 'モデレータが確認してグループの公開を承認する'); |
377 | 377 | |
378 | +// ranking | |
379 | +define('_MI_XOONIPS_RANKING', 'ランキング'); | |
378 | 380 | |
381 | + | |
382 | + | |
383 | + |
@@ -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}> |
@@ -80,7 +80,7 @@ | ||
80 | 80 | <tr> |
81 | 81 | <td class="head"><{$smarty.const._MD_XOONIPS_INDEX_DETAILED_DESCRIPTION_DESCRIPTION}></td> |
82 | 82 | <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 }> | |
84 | 84 | </td> |
85 | 85 | </tr> |
86 | 86 | </table> |
@@ -53,7 +53,7 @@ | ||
53 | 53 | <h3><{$detailed_title|xoops_escape}></h3> |
54 | 54 | <{/if}> |
55 | 55 | <{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}> | |
57 | 57 | <{/if}> |
58 | 58 | </td> |
59 | 59 | </tr> |
@@ -20,21 +20,21 @@ | ||
20 | 20 | $modversion['dirname'] = $myDirName; |
21 | 21 | $modversion['trust_dirname'] = 'xoonips'; |
22 | 22 | $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 | + ) | |
38 | 38 | ); |
39 | 39 | $modversion['disable_legacy_2nd_installer'] = false; |
40 | 40 | // Sql file (must contain sql generated by phpMyAdmin or phpPgAdmin) |
@@ -43,44 +43,44 @@ | ||
43 | 43 | $modversion['sqlfile']['mysql'] = 'sql/mysql.sql'; |
44 | 44 | $modversion['sqlfile']['mysql_alter'] = 'sql/mysql_alter.sql'; |
45 | 45 | $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', | |
84 | 84 | ); |
85 | 85 | |
86 | 86 | // Admin things |
@@ -437,6 +437,12 @@ | ||
437 | 437 | $modversion['blocks'][5]['template'] = 'block_itemtypes.html'; |
438 | 438 | $modversion['blocks'][5]['can_clone'] = true; |
439 | 439 | |
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 | + | |
440 | 446 | // $modversion['onInstall'] = 'include/oninstall.inc.php'; |
441 | 447 | // $modversion['onUpdate'] = 'include/onupdate.inc.php'; |
442 | 448 | // $modversion['onUninstall'] = 'include/onuninstall.inc.php'; |