@@ -9,25 +9,25 @@ discard block |
||
9 | 9 | |
10 | 10 | var $handler; |
11 | 11 | |
12 | - function __construct($fields) |
|
13 | - { |
|
14 | - $this->initVar('sid', XOBJ_DTYPE_INT, null, true); |
|
12 | + function __construct($fields) |
|
13 | + { |
|
14 | + $this->initVar('sid', XOBJ_DTYPE_INT, null, true); |
|
15 | 15 | $this->init($fields); |
16 | - } |
|
17 | - |
|
18 | - |
|
19 | - /** |
|
20 | - * Initiate variables |
|
21 | - * @param array $fields field information array of {@link XoopsObjectsField} objects |
|
22 | - */ |
|
23 | - function init($fields) |
|
24 | - { |
|
25 | - if (is_array($fields) && count($fields) > 0) { |
|
26 | - foreach (array_keys($fields) as $key ) { |
|
27 | - $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength')); |
|
28 | - } |
|
29 | - } |
|
30 | - } |
|
16 | + } |
|
17 | + |
|
18 | + |
|
19 | + /** |
|
20 | + * Initiate variables |
|
21 | + * @param array $fields field information array of {@link XoopsObjectsField} objects |
|
22 | + */ |
|
23 | + function init($fields) |
|
24 | + { |
|
25 | + if (is_array($fields) && count($fields) > 0) { |
|
26 | + foreach (array_keys($fields) as $key ) { |
|
27 | + $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength')); |
|
28 | + } |
|
29 | + } |
|
30 | + } |
|
31 | 31 | } |
32 | 32 | /** |
33 | 33 | * @package kernel |
@@ -35,79 +35,79 @@ discard block |
||
35 | 35 | */ |
36 | 36 | class SonglistExtrasHandler extends XoopsPersistableObjectHandler |
37 | 37 | { |
38 | - /** |
|
39 | - * holds reference to {@link ObjectsFieldHandler} object |
|
40 | - */ |
|
41 | - var $_fHandler; |
|
42 | - |
|
43 | - /** |
|
44 | - * Array of {@link XoopsObjectsField} objects |
|
45 | - * @var array |
|
46 | - */ |
|
47 | - var $_fields = array(); |
|
48 | - |
|
49 | - function __construct($db) |
|
50 | - { |
|
51 | - parent::__construct($db, "songlist_extra", 'SonglistExtras', "sid"); |
|
52 | - $this->_fHandler = xoops_getmodulehandler('field', 'songlist'); |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * create a new {@link SonglistExtras} |
|
57 | - * |
|
58 | - * @param bool $isNew Flag the new objects as "new"? |
|
59 | - * |
|
60 | - * @return object {@link SonglistExtras} |
|
61 | - */ |
|
62 | - function &create($isNew = true) |
|
63 | - { |
|
64 | - $obj = new $this->className( $this->loadFields() ); |
|
65 | - $obj->handler = $this; |
|
66 | - $obj->setNew(); |
|
67 | - return $obj; |
|
68 | - } |
|
69 | - |
|
70 | - /** |
|
71 | - * Get a {@link SonglistExtras} |
|
72 | - * |
|
73 | - * @param boolean $createOnFailure create a new {@link SonglistExtras} if none is feteched |
|
74 | - * |
|
75 | - * @return object {@link SonglistExtras} |
|
76 | - */ |
|
77 | - function &get($uid, $createOnFailure = true) |
|
78 | - { |
|
79 | - $obj = parent::get($uid); |
|
80 | - if (!is_object($obj) && $createOnFailure) { |
|
81 | - $obj = $this->create(); |
|
82 | - } |
|
83 | - return $obj; |
|
84 | - } |
|
85 | - |
|
86 | - /** |
|
87 | - * Create new {@link ObjectsField} object |
|
88 | - * |
|
89 | - * @param bool $isNew |
|
90 | - * |
|
91 | - * @return object |
|
92 | - */ |
|
93 | - function &createField($isNew = true) |
|
94 | - { |
|
95 | - $return = $this->_fHandler->create($isNew); |
|
96 | - return $return; |
|
97 | - } |
|
98 | - |
|
99 | - /** |
|
100 | - * Load field information |
|
101 | - * |
|
102 | - * @return array |
|
103 | - */ |
|
104 | - function loadFields() |
|
105 | - { |
|
106 | - if (count($this->_fields) == 0) { |
|
107 | - $this->_fields = $this->_fHandler->loadFields(); |
|
108 | - } |
|
109 | - return ($this->_fields==0||empty($this->_fields)?false:$this->_fields); |
|
110 | - } |
|
38 | + /** |
|
39 | + * holds reference to {@link ObjectsFieldHandler} object |
|
40 | + */ |
|
41 | + var $_fHandler; |
|
42 | + |
|
43 | + /** |
|
44 | + * Array of {@link XoopsObjectsField} objects |
|
45 | + * @var array |
|
46 | + */ |
|
47 | + var $_fields = array(); |
|
48 | + |
|
49 | + function __construct($db) |
|
50 | + { |
|
51 | + parent::__construct($db, "songlist_extra", 'SonglistExtras', "sid"); |
|
52 | + $this->_fHandler = xoops_getmodulehandler('field', 'songlist'); |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * create a new {@link SonglistExtras} |
|
57 | + * |
|
58 | + * @param bool $isNew Flag the new objects as "new"? |
|
59 | + * |
|
60 | + * @return object {@link SonglistExtras} |
|
61 | + */ |
|
62 | + function &create($isNew = true) |
|
63 | + { |
|
64 | + $obj = new $this->className( $this->loadFields() ); |
|
65 | + $obj->handler = $this; |
|
66 | + $obj->setNew(); |
|
67 | + return $obj; |
|
68 | + } |
|
69 | + |
|
70 | + /** |
|
71 | + * Get a {@link SonglistExtras} |
|
72 | + * |
|
73 | + * @param boolean $createOnFailure create a new {@link SonglistExtras} if none is feteched |
|
74 | + * |
|
75 | + * @return object {@link SonglistExtras} |
|
76 | + */ |
|
77 | + function &get($uid, $createOnFailure = true) |
|
78 | + { |
|
79 | + $obj = parent::get($uid); |
|
80 | + if (!is_object($obj) && $createOnFailure) { |
|
81 | + $obj = $this->create(); |
|
82 | + } |
|
83 | + return $obj; |
|
84 | + } |
|
85 | + |
|
86 | + /** |
|
87 | + * Create new {@link ObjectsField} object |
|
88 | + * |
|
89 | + * @param bool $isNew |
|
90 | + * |
|
91 | + * @return object |
|
92 | + */ |
|
93 | + function &createField($isNew = true) |
|
94 | + { |
|
95 | + $return = $this->_fHandler->create($isNew); |
|
96 | + return $return; |
|
97 | + } |
|
98 | + |
|
99 | + /** |
|
100 | + * Load field information |
|
101 | + * |
|
102 | + * @return array |
|
103 | + */ |
|
104 | + function loadFields() |
|
105 | + { |
|
106 | + if (count($this->_fields) == 0) { |
|
107 | + $this->_fields = $this->_fHandler->loadFields(); |
|
108 | + } |
|
109 | + return ($this->_fields==0||empty($this->_fields)?false:$this->_fields); |
|
110 | + } |
|
111 | 111 | |
112 | 112 | function getPostVars() |
113 | 113 | { |
@@ -115,118 +115,118 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | - function getFields($criteria, $id_as_key = true, $as_object = true) |
|
119 | - { |
|
120 | - return $this->_fHandler->getObjects($criteria, $id_as_key, $as_object); |
|
121 | - } |
|
122 | - |
|
123 | - /** |
|
124 | - * Insert a field in the database |
|
125 | - * |
|
126 | - * @param object $field |
|
127 | - * @param bool $force |
|
128 | - * |
|
129 | - * @return bool |
|
130 | - */ |
|
131 | - function insertField($field, $force = false) |
|
132 | - { |
|
133 | - return $this->_fHandler->insert($field, $force); |
|
134 | - } |
|
135 | - |
|
136 | - /** |
|
137 | - * Delete a field from the database |
|
138 | - * |
|
139 | - * @param object $field |
|
140 | - * @param bool $force |
|
141 | - * |
|
142 | - * @return bool |
|
143 | - */ |
|
144 | - function deleteField($field, $force = false) |
|
145 | - { |
|
146 | - return $this->_fHandler->delete($field, $force); |
|
147 | - } |
|
148 | - |
|
149 | - /** |
|
150 | - * Save a new field in the database |
|
151 | - * |
|
152 | - * @param array $vars array of variables, taken from $module->loadInfo('Extras')['field'] |
|
153 | - * @param int $categoryid ID of the category to add it to |
|
154 | - * @param int $type valuetype of the field |
|
155 | - * @param int $moduleid ID of the module, this field belongs to |
|
156 | - * @param int $weight |
|
157 | - * |
|
158 | - * @return string |
|
159 | - **/ |
|
160 | - function saveField($vars, $weight = 0) |
|
161 | - { |
|
162 | - $field = $this->createField(); |
|
163 | - $field->setVar('field_name', $vars['name']); |
|
164 | - $field->setVar('field_valuetype', $vars['valuetype']); |
|
165 | - $field->setVar('field_type', $vars['type']); |
|
166 | - $field->setVar('field_weight', $weight); |
|
167 | - if (isset($vars['title'])) { |
|
168 | - $field->setVar('field_title', $vars['title']); |
|
169 | - } |
|
170 | - if (isset($vars['description'])) { |
|
171 | - $field->setVar('field_description', $vars['description']); |
|
172 | - } |
|
173 | - if (isset($vars['required'])) { |
|
174 | - $field->setVar('field_required', $vars['required']); //0 = no, 1 = yes |
|
175 | - } |
|
176 | - if (isset($vars['maxlength'])) { |
|
177 | - $field->setVar('field_maxlength', $vars['maxlength']); |
|
178 | - } |
|
179 | - if (isset($vars['default'])) { |
|
180 | - $field->setVar('field_default', $vars['default']); |
|
181 | - } |
|
182 | - if (isset($vars['notnull'])) { |
|
183 | - $field->setVar('field_notnull', $vars['notnull']); |
|
184 | - } |
|
185 | - if (isset($vars['show'])) { |
|
186 | - $field->setVar('field_show', $vars['show']); |
|
187 | - } |
|
188 | - if (isset($vars['edit'])) { |
|
189 | - $field->setVar('field_edit', $vars['edit']); |
|
190 | - } |
|
191 | - if (isset($vars['config'])) { |
|
192 | - $field->setVar('field_config', $vars['config']); |
|
193 | - } |
|
194 | - if (isset($vars['options'])) { |
|
195 | - $field->setVar('field_options', $vars['options']); |
|
196 | - } else { |
|
197 | - $field->setVar('field_options', array() ); |
|
198 | - } |
|
199 | - if ($this->insertField($field)) { |
|
200 | - $msg = ' Field <b>' . $vars['name'] . '</b> added to the database'; |
|
201 | - } else { |
|
202 | - $msg = ' <span style="color:#ff0000;">ERROR: Could not insert field <b>' . $vars['name'] . '</b> into the database. '.implode(' ', $field->getErrors()) . $this->db->error() . '</span>'; |
|
203 | - } |
|
204 | - unset($field); |
|
205 | - return $msg; |
|
206 | - } |
|
207 | - |
|
208 | - /** |
|
209 | - * insert a new object in the database |
|
210 | - * |
|
211 | - * @param object $obj reference to the object |
|
212 | - * @param bool $force whether to force the query execution despite security settings |
|
213 | - * @param bool $checkObject check if the object is dirty and clean the attributes |
|
214 | - * |
|
215 | - * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
|
216 | - */ |
|
217 | - |
|
218 | - function insert($obj, $force = false, $checkObject = true) |
|
219 | - { |
|
220 | - $uservars = $this->getPostVars(); |
|
221 | - foreach ($uservars as $var) { |
|
118 | + function getFields($criteria, $id_as_key = true, $as_object = true) |
|
119 | + { |
|
120 | + return $this->_fHandler->getObjects($criteria, $id_as_key, $as_object); |
|
121 | + } |
|
122 | + |
|
123 | + /** |
|
124 | + * Insert a field in the database |
|
125 | + * |
|
126 | + * @param object $field |
|
127 | + * @param bool $force |
|
128 | + * |
|
129 | + * @return bool |
|
130 | + */ |
|
131 | + function insertField($field, $force = false) |
|
132 | + { |
|
133 | + return $this->_fHandler->insert($field, $force); |
|
134 | + } |
|
135 | + |
|
136 | + /** |
|
137 | + * Delete a field from the database |
|
138 | + * |
|
139 | + * @param object $field |
|
140 | + * @param bool $force |
|
141 | + * |
|
142 | + * @return bool |
|
143 | + */ |
|
144 | + function deleteField($field, $force = false) |
|
145 | + { |
|
146 | + return $this->_fHandler->delete($field, $force); |
|
147 | + } |
|
148 | + |
|
149 | + /** |
|
150 | + * Save a new field in the database |
|
151 | + * |
|
152 | + * @param array $vars array of variables, taken from $module->loadInfo('Extras')['field'] |
|
153 | + * @param int $categoryid ID of the category to add it to |
|
154 | + * @param int $type valuetype of the field |
|
155 | + * @param int $moduleid ID of the module, this field belongs to |
|
156 | + * @param int $weight |
|
157 | + * |
|
158 | + * @return string |
|
159 | + **/ |
|
160 | + function saveField($vars, $weight = 0) |
|
161 | + { |
|
162 | + $field = $this->createField(); |
|
163 | + $field->setVar('field_name', $vars['name']); |
|
164 | + $field->setVar('field_valuetype', $vars['valuetype']); |
|
165 | + $field->setVar('field_type', $vars['type']); |
|
166 | + $field->setVar('field_weight', $weight); |
|
167 | + if (isset($vars['title'])) { |
|
168 | + $field->setVar('field_title', $vars['title']); |
|
169 | + } |
|
170 | + if (isset($vars['description'])) { |
|
171 | + $field->setVar('field_description', $vars['description']); |
|
172 | + } |
|
173 | + if (isset($vars['required'])) { |
|
174 | + $field->setVar('field_required', $vars['required']); //0 = no, 1 = yes |
|
175 | + } |
|
176 | + if (isset($vars['maxlength'])) { |
|
177 | + $field->setVar('field_maxlength', $vars['maxlength']); |
|
178 | + } |
|
179 | + if (isset($vars['default'])) { |
|
180 | + $field->setVar('field_default', $vars['default']); |
|
181 | + } |
|
182 | + if (isset($vars['notnull'])) { |
|
183 | + $field->setVar('field_notnull', $vars['notnull']); |
|
184 | + } |
|
185 | + if (isset($vars['show'])) { |
|
186 | + $field->setVar('field_show', $vars['show']); |
|
187 | + } |
|
188 | + if (isset($vars['edit'])) { |
|
189 | + $field->setVar('field_edit', $vars['edit']); |
|
190 | + } |
|
191 | + if (isset($vars['config'])) { |
|
192 | + $field->setVar('field_config', $vars['config']); |
|
193 | + } |
|
194 | + if (isset($vars['options'])) { |
|
195 | + $field->setVar('field_options', $vars['options']); |
|
196 | + } else { |
|
197 | + $field->setVar('field_options', array() ); |
|
198 | + } |
|
199 | + if ($this->insertField($field)) { |
|
200 | + $msg = ' Field <b>' . $vars['name'] . '</b> added to the database'; |
|
201 | + } else { |
|
202 | + $msg = ' <span style="color:#ff0000;">ERROR: Could not insert field <b>' . $vars['name'] . '</b> into the database. '.implode(' ', $field->getErrors()) . $this->db->error() . '</span>'; |
|
203 | + } |
|
204 | + unset($field); |
|
205 | + return $msg; |
|
206 | + } |
|
207 | + |
|
208 | + /** |
|
209 | + * insert a new object in the database |
|
210 | + * |
|
211 | + * @param object $obj reference to the object |
|
212 | + * @param bool $force whether to force the query execution despite security settings |
|
213 | + * @param bool $checkObject check if the object is dirty and clean the attributes |
|
214 | + * |
|
215 | + * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
|
216 | + */ |
|
217 | + |
|
218 | + function insert($obj, $force = false, $checkObject = true) |
|
219 | + { |
|
220 | + $uservars = $this->getPostVars(); |
|
221 | + foreach ($uservars as $var) { |
|
222 | 222 | if ($var!='sid') |
223 | - unset($obj->vars[$var]); |
|
224 | - } |
|
225 | - if (count($obj->vars) == 0) { |
|
226 | - return true; |
|
227 | - } |
|
228 | - return parent::insert($obj, $force, $checkObject); |
|
229 | - } |
|
223 | + unset($obj->vars[$var]); |
|
224 | + } |
|
225 | + if (count($obj->vars) == 0) { |
|
226 | + return true; |
|
227 | + } |
|
228 | + return parent::insert($obj, $force, $checkObject); |
|
229 | + } |
|
230 | 230 | |
231 | 231 | } |
232 | 232 | ?> |
233 | 233 | \ No newline at end of file |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function init($fields) |
24 | 24 | { |
25 | - if (is_array($fields) && count($fields) > 0) { |
|
26 | - foreach (array_keys($fields) as $key ) { |
|
25 | + if (is_array($fields) && count($fields)>0) { |
|
26 | + foreach (array_keys($fields) as $key) { |
|
27 | 27 | $this->initVar($key, $fields[$key]->getVar('field_valuetype'), $fields[$key]->getVar('field_default', 'n'), $fields[$key]->getVar('field_required'), $fields[$key]->getVar('field_maxlength')); |
28 | 28 | } |
29 | 29 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function &create($isNew = true) |
63 | 63 | { |
64 | - $obj = new $this->className( $this->loadFields() ); |
|
64 | + $obj = new $this->className($this->loadFields()); |
|
65 | 65 | $obj->handler = $this; |
66 | 66 | $obj->setNew(); |
67 | 67 | return $obj; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | */ |
104 | 104 | function loadFields() |
105 | 105 | { |
106 | - if (count($this->_fields) == 0) { |
|
106 | + if (count($this->_fields)==0) { |
|
107 | 107 | $this->_fields = $this->_fHandler->loadFields(); |
108 | 108 | } |
109 | - return ($this->_fields==0||empty($this->_fields)?false:$this->_fields); |
|
109 | + return ($this->_fields==0 || empty($this->_fields) ?false:$this->_fields); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | function getPostVars() |
@@ -194,12 +194,12 @@ discard block |
||
194 | 194 | if (isset($vars['options'])) { |
195 | 195 | $field->setVar('field_options', $vars['options']); |
196 | 196 | } else { |
197 | - $field->setVar('field_options', array() ); |
|
197 | + $field->setVar('field_options', array()); |
|
198 | 198 | } |
199 | 199 | if ($this->insertField($field)) { |
200 | - $msg = ' Field <b>' . $vars['name'] . '</b> added to the database'; |
|
200 | + $msg = ' Field <b>'.$vars['name'].'</b> added to the database'; |
|
201 | 201 | } else { |
202 | - $msg = ' <span style="color:#ff0000;">ERROR: Could not insert field <b>' . $vars['name'] . '</b> into the database. '.implode(' ', $field->getErrors()) . $this->db->error() . '</span>'; |
|
202 | + $msg = ' <span style="color:#ff0000;">ERROR: Could not insert field <b>'.$vars['name'].'</b> into the database. '.implode(' ', $field->getErrors()).$this->db->error().'</span>'; |
|
203 | 203 | } |
204 | 204 | unset($field); |
205 | 205 | return $msg; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | if ($var!='sid') |
223 | 223 | unset($obj->vars[$var]); |
224 | 224 | } |
225 | - if (count($obj->vars) == 0) { |
|
225 | + if (count($obj->vars)==0) { |
|
226 | 226 | return true; |
227 | 227 | } |
228 | 228 | return parent::insert($obj, $force, $checkObject); |
@@ -219,8 +219,9 @@ |
||
219 | 219 | { |
220 | 220 | $uservars = $this->getPostVars(); |
221 | 221 | foreach ($uservars as $var) { |
222 | - if ($var!='sid') |
|
223 | - unset($obj->vars[$var]); |
|
222 | + if ($var!='sid') { |
|
223 | + unset($obj->vars[$var]); |
|
224 | + } |
|
224 | 225 | } |
225 | 226 | if (count($obj->vars) == 0) { |
226 | 227 | return true; |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | class SonglistUtf8map extends XoopsObject |
11 | 11 | { |
12 | 12 | |
13 | - function SonglistUtf8map($fid = null) |
|
14 | - { |
|
15 | - $this->initVar('utfid', XOBJ_DTYPE_INT, 0, false); |
|
13 | + function SonglistUtf8map($fid = null) |
|
14 | + { |
|
15 | + $this->initVar('utfid', XOBJ_DTYPE_INT, 0, false); |
|
16 | 16 | $this->initVar('from', XOBJ_DTYPE_TXTBOX, null, false, 2); |
17 | 17 | $this->initVar('to', XOBJ_DTYPE_TXTBOX, null, false, 2); |
18 | 18 | $this->initVar('created', XOBJ_DTYPE_INT, 0, false); |
@@ -43,57 +43,57 @@ discard block |
||
43 | 43 | |
44 | 44 | class SonglistUtf8mapHandler extends XoopsPersistableObjectHandler |
45 | 45 | { |
46 | - function __construct(&$db) |
|
47 | - { |
|
48 | - parent::__construct($db, "songlist_utf8map", 'SonglistUtf8map', "utfid", "from"); |
|
49 | - } |
|
46 | + function __construct(&$db) |
|
47 | + { |
|
48 | + parent::__construct($db, "songlist_utf8map", 'SonglistUtf8map', "utfid", "from"); |
|
49 | + } |
|
50 | 50 | |
51 | 51 | function filterFields() { |
52 | 52 | return array('utfid', 'from', 'to', 'created', 'updated'); |
53 | 53 | } |
54 | 54 | |
55 | - function getFilterCriteria($filter) { |
|
56 | - $parts = explode('|', $filter); |
|
57 | - $criteria = new CriteriaCompo(); |
|
58 | - foreach($parts as $part) { |
|
59 | - $var = explode(',', $part); |
|
60 | - if (!empty($var[1])&&!is_numeric($var[0])) { |
|
61 | - $object = $this->create(); |
|
62 | - if ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTBOX || |
|
63 | - $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTAREA) { |
|
64 | - $criteria->add(new Criteria('`'.$var[0].'`', '%'.$var[1].'%', (isset($var[2])?$var[2]:'LIKE'))); |
|
65 | - } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_INT || |
|
66 | - $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_DECIMAL || |
|
67 | - $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_FLOAT ) { |
|
68 | - $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
55 | + function getFilterCriteria($filter) { |
|
56 | + $parts = explode('|', $filter); |
|
57 | + $criteria = new CriteriaCompo(); |
|
58 | + foreach($parts as $part) { |
|
59 | + $var = explode(',', $part); |
|
60 | + if (!empty($var[1])&&!is_numeric($var[0])) { |
|
61 | + $object = $this->create(); |
|
62 | + if ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTBOX || |
|
63 | + $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTAREA) { |
|
64 | + $criteria->add(new Criteria('`'.$var[0].'`', '%'.$var[1].'%', (isset($var[2])?$var[2]:'LIKE'))); |
|
65 | + } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_INT || |
|
66 | + $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_DECIMAL || |
|
67 | + $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_FLOAT ) { |
|
68 | + $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
69 | 69 | } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ENUM ) { |
70 | - $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
70 | + $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
71 | 71 | } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ARRAY ) { |
72 | - $criteria->add(new Criteria('`'.$var[0].'`', '%"'.$var[1].'";%', (isset($var[2])?$var[2]:'LIKE'))); |
|
72 | + $criteria->add(new Criteria('`'.$var[0].'`', '%"'.$var[1].'";%', (isset($var[2])?$var[2]:'LIKE'))); |
|
73 | 73 | } |
74 | - } elseif (!empty($var[1])&&is_numeric($var[0])) { |
|
75 | - $criteria->add(new Criteria($var[0], $var[1])); |
|
76 | - } |
|
77 | - } |
|
78 | - return $criteria; |
|
79 | - } |
|
74 | + } elseif (!empty($var[1])&&is_numeric($var[0])) { |
|
75 | + $criteria->add(new Criteria($var[0], $var[1])); |
|
76 | + } |
|
77 | + } |
|
78 | + return $criteria; |
|
79 | + } |
|
80 | 80 | |
81 | - function getFilterForm($filter, $field, $sort='created', $op = 'dashboard', $fct='list') { |
|
82 | - $ele = songlist_getFilterElement($filter, $field, $sort, $op, $fct); |
|
83 | - if (is_object($ele)) |
|
84 | - return $ele->render(); |
|
85 | - else |
|
86 | - return ' '; |
|
87 | - } |
|
81 | + function getFilterForm($filter, $field, $sort='created', $op = 'dashboard', $fct='list') { |
|
82 | + $ele = songlist_getFilterElement($filter, $field, $sort, $op, $fct); |
|
83 | + if (is_object($ele)) |
|
84 | + return $ele->render(); |
|
85 | + else |
|
86 | + return ' '; |
|
87 | + } |
|
88 | 88 | |
89 | 89 | function insert($obj, $force=true) { |
90 | - if ($obj->isNew()) { |
|
91 | - $obj->setVar('created', time()); |
|
92 | - } else { |
|
93 | - $obj->setVar('updated', time()); |
|
94 | - } |
|
95 | - return parent::insert($obj, $force); |
|
96 | - } |
|
90 | + if ($obj->isNew()) { |
|
91 | + $obj->setVar('created', time()); |
|
92 | + } else { |
|
93 | + $obj->setVar('updated', time()); |
|
94 | + } |
|
95 | + return parent::insert($obj, $force); |
|
96 | + } |
|
97 | 97 | |
98 | 98 | function convert($phrase = '', $criteria = NULL) { |
99 | 99 | foreach($this->getObjects($criteria, true) as $utfid => $utf8) { |
@@ -26,10 +26,10 @@ discard block |
||
26 | 26 | function toArray() { |
27 | 27 | $ret = parent::toArray(); |
28 | 28 | $form = $this->getForm(true); |
29 | - foreach($form as $key => $element) { |
|
29 | + foreach ($form as $key => $element) { |
|
30 | 30 | $ret['form'][$key] = $form[$key]->render(); |
31 | 31 | } |
32 | - foreach(array('created', 'updated') as $key) { |
|
32 | + foreach (array('created', 'updated') as $key) { |
|
33 | 33 | if ($this->getVar($key)>0) { |
34 | 34 | $ret['form'][$key] = date(_DATESTRING, $this->getVar($key)); |
35 | 35 | $ret[$key] = date(_DATESTRING, $this->getVar($key)); |
@@ -55,30 +55,30 @@ discard block |
||
55 | 55 | function getFilterCriteria($filter) { |
56 | 56 | $parts = explode('|', $filter); |
57 | 57 | $criteria = new CriteriaCompo(); |
58 | - foreach($parts as $part) { |
|
58 | + foreach ($parts as $part) { |
|
59 | 59 | $var = explode(',', $part); |
60 | - if (!empty($var[1])&&!is_numeric($var[0])) { |
|
60 | + if (!empty($var[1]) && !is_numeric($var[0])) { |
|
61 | 61 | $object = $this->create(); |
62 | - if ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTBOX || |
|
63 | - $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTAREA) { |
|
64 | - $criteria->add(new Criteria('`'.$var[0].'`', '%'.$var[1].'%', (isset($var[2])?$var[2]:'LIKE'))); |
|
65 | - } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_INT || |
|
62 | + if ($object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTBOX || |
|
63 | + $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_TXTAREA) { |
|
64 | + $criteria->add(new Criteria('`'.$var[0].'`', '%'.$var[1].'%', (isset($var[2]) ? $var[2] : 'LIKE'))); |
|
65 | + } elseif ($object->vars[$var[0]]['data_type']==XOBJ_DTYPE_INT || |
|
66 | 66 | $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_DECIMAL || |
67 | - $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_FLOAT ) { |
|
68 | - $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
69 | - } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ENUM ) { |
|
70 | - $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2])?$var[2]:'='))); |
|
71 | - } elseif ( $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ARRAY ) { |
|
72 | - $criteria->add(new Criteria('`'.$var[0].'`', '%"'.$var[1].'";%', (isset($var[2])?$var[2]:'LIKE'))); |
|
67 | + $object->vars[$var[0]]['data_type']==XOBJ_DTYPE_FLOAT) { |
|
68 | + $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2]) ? $var[2] : '='))); |
|
69 | + } elseif ($object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ENUM) { |
|
70 | + $criteria->add(new Criteria('`'.$var[0].'`', $var[1], (isset($var[2]) ? $var[2] : '='))); |
|
71 | + } elseif ($object->vars[$var[0]]['data_type']==XOBJ_DTYPE_ARRAY) { |
|
72 | + $criteria->add(new Criteria('`'.$var[0].'`', '%"'.$var[1].'";%', (isset($var[2]) ? $var[2] : 'LIKE'))); |
|
73 | 73 | } |
74 | - } elseif (!empty($var[1])&&is_numeric($var[0])) { |
|
74 | + } elseif (!empty($var[1]) && is_numeric($var[0])) { |
|
75 | 75 | $criteria->add(new Criteria($var[0], $var[1])); |
76 | 76 | } |
77 | 77 | } |
78 | 78 | return $criteria; |
79 | 79 | } |
80 | 80 | |
81 | - function getFilterForm($filter, $field, $sort='created', $op = 'dashboard', $fct='list') { |
|
81 | + function getFilterForm($filter, $field, $sort = 'created', $op = 'dashboard', $fct = 'list') { |
|
82 | 82 | $ele = songlist_getFilterElement($filter, $field, $sort, $op, $fct); |
83 | 83 | if (is_object($ele)) |
84 | 84 | return $ele->render(); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return ' '; |
87 | 87 | } |
88 | 88 | |
89 | - function insert($obj, $force=true) { |
|
89 | + function insert($obj, $force = true) { |
|
90 | 90 | if ($obj->isNew()) { |
91 | 91 | $obj->setVar('created', time()); |
92 | 92 | } else { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | function convert($phrase = '', $criteria = NULL) { |
99 | - foreach($this->getObjects($criteria, true) as $utfid => $utf8) { |
|
99 | + foreach ($this->getObjects($criteria, true) as $utfid => $utf8) { |
|
100 | 100 | $phrase = str_replace(strtolower($utf8->getVar('from')), strtolower($utf8->getVar('to')), $phrase); |
101 | 101 | $phrase = str_replace(strtoupper($utf8->getVar('from')), strtoupper($utf8->getVar('to')), $phrase); |
102 | 102 | } |
@@ -77,10 +77,11 @@ |
||
77 | 77 | |
78 | 78 | function getFilterForm($filter, $field, $sort='created', $op = 'dashboard', $fct='list') { |
79 | 79 | $ele = songlist_getFilterElement($filter, $field, $sort, $op, $fct); |
80 | - if (is_object($ele)) |
|
81 | - return $ele->render(); |
|
82 | - else |
|
83 | - return ' '; |
|
80 | + if (is_object($ele)) { |
|
81 | + return $ele->render(); |
|
82 | + } else { |
|
83 | + return ' '; |
|
84 | + } |
|
84 | 85 | } |
85 | 86 | |
86 | 87 | function insert($obj, $force=true) { |
@@ -56,86 +56,86 @@ discard block |
||
56 | 56 | default: |
57 | 57 | case "item": |
58 | 58 | switch ($fct) { |
59 | - default: |
|
60 | - case "list": |
|
59 | + default: |
|
60 | + case "list": |
|
61 | 61 | |
62 | - $pagenav = new XoopsPageNav($songs_handler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
62 | + $pagenav = new XoopsPageNav($songs_handler->getCount($criteria_cat), $limit, $start, 'start', "op=$op&fct=$fct&id=$id&value=$value&limit=$limit"); |
|
63 | 63 | |
64 | - $criteria_cat->setLimit($limit); |
|
65 | - $criteria_cat->setStart($start); |
|
64 | + $criteria_cat->setLimit($limit); |
|
65 | + $criteria_cat->setStart($start); |
|
66 | 66 | |
67 | - $songs = $songs_handler->getObjects($criteria_cat, false); |
|
67 | + $songs = $songs_handler->getObjects($criteria_cat, false); |
|
68 | 68 | |
69 | - $url = $songs_handler->getURL(); |
|
70 | - if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
|
71 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
72 | - header('Location: '.$url); |
|
73 | - exit(0); |
|
74 | - } |
|
69 | + $url = $songs_handler->getURL(); |
|
70 | + if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
|
71 | + header( "HTTP/1.1 301 Moved Permanently" ); |
|
72 | + header('Location: '.$url); |
|
73 | + exit(0); |
|
74 | + } |
|
75 | 75 | |
76 | - $xoopsOption['template_main'] = 'songlist_songs_index.html'; |
|
77 | - include($GLOBALS['xoops']->path('/header.php')); |
|
78 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
79 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
80 | - $GLOBALS['loaded_jquery']=true; |
|
81 | - } |
|
82 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
83 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
84 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
85 | - foreach($songs as $song) |
|
86 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
87 | - $GLOBALS['xoopsTpl']->assign('songs', true); |
|
88 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
89 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
90 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
91 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
92 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
93 | - $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
94 | - if ($_SESSION['cid']!=0) { |
|
95 | - $category = $category_handler->get($_SESSION['cid']); |
|
96 | - if (is_object($category)) |
|
97 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
98 | - } |
|
99 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
100 | - include($GLOBALS['xoops']->path('/footer.php')); |
|
101 | - break; |
|
102 | - case "item": |
|
103 | - $song = $songs_handler->get($id); |
|
76 | + $xoopsOption['template_main'] = 'songlist_songs_index.html'; |
|
77 | + include($GLOBALS['xoops']->path('/header.php')); |
|
78 | + if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
79 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
80 | + $GLOBALS['loaded_jquery']=true; |
|
81 | + } |
|
82 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
83 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
84 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
85 | + foreach($songs as $song) |
|
86 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
87 | + $GLOBALS['xoopsTpl']->assign('songs', true); |
|
88 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
89 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
|
90 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
91 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
92 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
93 | + $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
|
94 | + if ($_SESSION['cid']!=0) { |
|
95 | + $category = $category_handler->get($_SESSION['cid']); |
|
96 | + if (is_object($category)) |
|
97 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
98 | + } |
|
99 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
100 | + include($GLOBALS['xoops']->path('/footer.php')); |
|
101 | + break; |
|
102 | + case "item": |
|
103 | + $song = $songs_handler->get($id); |
|
104 | 104 | |
105 | - $url = $song->getURL(true); |
|
106 | - if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
|
107 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
108 | - header('Location: '.$url); |
|
109 | - exit(0); |
|
110 | - } |
|
105 | + $url = $song->getURL(true); |
|
106 | + if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
|
107 | + header( "HTTP/1.1 301 Moved Permanently" ); |
|
108 | + header('Location: '.$url); |
|
109 | + exit(0); |
|
110 | + } |
|
111 | 111 | |
112 | - $xoopsOption['template_main'] = 'songlist_songs_item.html'; |
|
113 | - include($GLOBALS['xoops']->path('/header.php')); |
|
114 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
115 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
116 | - $GLOBALS['loaded_jquery']=true; |
|
117 | - } |
|
118 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
119 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
120 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
121 | - $GLOBALS['xoopsTpl']->assign('songs', false); |
|
122 | - $GLOBALS['xoopsTpl']->assign('song', $song->toArray(true)); |
|
123 | - $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
124 | - $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
125 | - $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
126 | - $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
127 | - $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
128 | - include($GLOBALS['xoops']->path('/footer.php')); |
|
129 | - break; |
|
112 | + $xoopsOption['template_main'] = 'songlist_songs_item.html'; |
|
113 | + include($GLOBALS['xoops']->path('/header.php')); |
|
114 | + if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
115 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
116 | + $GLOBALS['loaded_jquery']=true; |
|
117 | + } |
|
118 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
119 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
120 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
121 | + $GLOBALS['xoopsTpl']->assign('songs', false); |
|
122 | + $GLOBALS['xoopsTpl']->assign('song', $song->toArray(true)); |
|
123 | + $GLOBALS['xoopsTpl']->assign('categories', $cat); |
|
124 | + $GLOBALS['xoopsTpl']->assign('category_element', $category_element->render()); |
|
125 | + $GLOBALS['xoopsTpl']->assign('genre_element', $genre_element->render()); |
|
126 | + $GLOBALS['xoopsTpl']->assign('voice_element', $voice_element->render()); |
|
127 | + $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
|
128 | + include($GLOBALS['xoops']->path('/footer.php')); |
|
129 | + break; |
|
130 | 130 | } |
131 | 131 | break; |
132 | 132 | case "browseby": |
133 | 133 | switch ($fct) { |
134 | - default: |
|
135 | - case "title": |
|
134 | + default: |
|
135 | + case "title": |
|
136 | 136 | |
137 | - $browse_criteria = new CriteriaCompo(); |
|
138 | - switch ($value) { |
|
137 | + $browse_criteria = new CriteriaCompo(); |
|
138 | + switch ($value) { |
|
139 | 139 | case '0': |
140 | 140 | for($u=0;$u<10;$u++) { |
141 | 141 | $browse_criteria->add(new Criteria('`title`', $u.'%', 'LIKE'), 'OR'); |
@@ -145,15 +145,15 @@ discard block |
||
145 | 145 | $browse_criteria->add(new Criteria('`title`', strtoupper($value).'%', 'LIKE'), 'OR'); |
146 | 146 | $browse_criteria->add(new Criteria('`title`', strtolower($value).'%', 'LIKE'), 'OR'); |
147 | 147 | break; |
148 | - } |
|
148 | + } |
|
149 | 149 | $criteria = new CriteriaCompo($criteria_cat, 'AND'); |
150 | 150 | $criteria->add($browse_criteria); |
151 | 151 | break; |
152 | 152 | |
153 | - case "lyrics": |
|
153 | + case "lyrics": |
|
154 | 154 | |
155 | - $browse_criteria = new CriteriaCompo(); |
|
156 | - switch ($value) { |
|
155 | + $browse_criteria = new CriteriaCompo(); |
|
156 | + switch ($value) { |
|
157 | 157 | case '0': |
158 | 158 | for($u=0;$u<10;$u++) { |
159 | 159 | $browse_criteria->add(new Criteria('`lyrics`', $u.'%', 'LIKE'), 'OR'); |
@@ -163,15 +163,15 @@ discard block |
||
163 | 163 | $browse_criteria->add(new Criteria('`lyrics`', strtoupper($value).'%', 'LIKE'), 'OR'); |
164 | 164 | $browse_criteria->add(new Criteria('`lyrics`', strtolower($value).'%', 'LIKE'), 'OR'); |
165 | 165 | break; |
166 | - } |
|
166 | + } |
|
167 | 167 | $criteria = new CriteriaCompo($criteria_cat, 'AND'); |
168 | 168 | $criteria->add($browse_criteria); |
169 | 169 | break; |
170 | 170 | |
171 | - case "artist": |
|
171 | + case "artist": |
|
172 | 172 | |
173 | - $browse_criteria = new CriteriaCompo(); |
|
174 | - switch ($value) { |
|
173 | + $browse_criteria = new CriteriaCompo(); |
|
174 | + switch ($value) { |
|
175 | 175 | case '0': |
176 | 176 | for($u=0;$u<10;$u++) { |
177 | 177 | $browse_criteria->add(new Criteria('`name`', $u.'%', 'LIKE'), 'OR'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $browse_criteria->add(new Criteria('`name`', strtoupper($value).'%', 'LIKE'), 'OR'); |
182 | 182 | $browse_criteria->add(new Criteria('`name`', strtolower($value).'%', 'LIKE'), 'OR'); |
183 | 183 | break; |
184 | - } |
|
184 | + } |
|
185 | 185 | $artists_handler = xoops_getmodulehandler('artists', 'songlist'); |
186 | 186 | $browse_criteriab = new CriteriaCompo(); |
187 | 187 | foreach($artists_handler->getObjects($browse_criteria, true) as $aid => $obj) { |
@@ -192,10 +192,10 @@ discard block |
||
192 | 192 | $criteria->add($browse_criteriab); |
193 | 193 | break; |
194 | 194 | |
195 | - case "album": |
|
195 | + case "album": |
|
196 | 196 | |
197 | - $browse_criteria = new CriteriaCompo(); |
|
198 | - switch ($value) { |
|
197 | + $browse_criteria = new CriteriaCompo(); |
|
198 | + switch ($value) { |
|
199 | 199 | case '0': |
200 | 200 | for($u=0;$u<10;$u++) { |
201 | 201 | $browse_criteria->add(new Criteria('`title`', $u.'%', 'LIKE'), 'OR'); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $browse_criteria->add(new Criteria('`title`', strtoupper($value).'%', 'LIKE'), 'OR'); |
206 | 206 | $browse_criteria->add(new Criteria('`title`', strtolower($value).'%', 'LIKE'), 'OR'); |
207 | 207 | break; |
208 | - } |
|
208 | + } |
|
209 | 209 | $ids=array(); |
210 | 210 | $albums_handler = xoops_getmodulehandler('albums', 'songlist'); |
211 | 211 | foreach($albums_handler->getObjects($browse_criteria, true) as $id => $obj) { |
@@ -365,13 +365,13 @@ discard block |
||
365 | 365 | |
366 | 366 | case "category": |
367 | 367 | switch ($fct) { |
368 | - default: |
|
369 | - case "set": |
|
370 | - $_SESSION['cid'] = $id; |
|
371 | - break; |
|
372 | - case "home": |
|
373 | - unset($_SESSION['cid']); |
|
374 | - break; |
|
368 | + default: |
|
369 | + case "set": |
|
370 | + $_SESSION['cid'] = $id; |
|
371 | + break; |
|
372 | + case "home": |
|
373 | + unset($_SESSION['cid']); |
|
374 | + break; |
|
375 | 375 | } |
376 | 376 | redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit&cid=".$_SESSION['cid'], 10, _MN_SONGLIST_MSG_CATEGORYCHANGED); |
377 | 377 | exit; |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | |
3 | 3 | include (dirname(__FILE__).'/header.php'); |
4 | 4 | |
5 | - global $file, $op, $fct, $id, $value, $gid, $cid, $vcid,$start, $limit, $singer; |
|
5 | + global $file, $op, $fct, $id, $value, $gid, $cid, $vcid, $start, $limit, $singer; |
|
6 | 6 | |
7 | 7 | $category_handler = xoops_getmodulehandler('category', 'songlist'); |
8 | 8 | $criteria_cat = new CriteriaCompo(); |
9 | 9 | $cids = $category_handler->GetCatAndSubCat($_SESSION['cid']); |
10 | 10 | if ($_SESSION['cid']>0) |
11 | 11 | $cids[$_SESSION['cid']] = $_SESSION['cid']; |
12 | - if (count($cids)>0&&$_SESSION['cid']!=0) { |
|
13 | - $criteria_cat->add(new Criteria('`cid`', '('.implode(',', $cids).')', 'IN'), 'OR'); |
|
12 | + if (count($cids)>0 && $_SESSION['cid']!=0) { |
|
13 | + $criteria_cat->add(new Criteria('`cid`', '('.implode(',', $cids).')', 'IN'), 'OR'); |
|
14 | 14 | } else { |
15 | 15 | $criteria_cat->add(new Criteria('1', '1'), 'OR'); |
16 | 16 | } |
@@ -25,24 +25,24 @@ discard block |
||
25 | 25 | $cat = array(); |
26 | 26 | $col = 1; |
27 | 27 | $row = 1; |
28 | - foreach($categories as $category) { |
|
28 | + foreach ($categories as $category) { |
|
29 | 29 | $cat[$row][$col] = $category->toArray(true); |
30 | 30 | $cat[$row][$col]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
31 | 31 | $col++; |
32 | 32 | if ($col>$GLOBALS['songlistModuleConfig']['cols']) { |
33 | 33 | $row++; |
34 | - $col=1; |
|
34 | + $col = 1; |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | if ($col!=1) { |
38 | 38 | $col--; |
39 | - for($j=$col;$j<=$GLOBALS['songlistModuleConfig']['cols'];$j++) { |
|
39 | + for ($j = $col; $j<=$GLOBALS['songlistModuleConfig']['cols']; $j++) { |
|
40 | 40 | $cat[$row][$j][$category_handler->keyName] = 0; |
41 | 41 | $cat[$row][$j]['width'] = floor(100/$GLOBALS['songlistModuleConfig']['cols']).'%'; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | - $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid'])?($_GET['cid']):$cid)); |
|
45 | + $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid']) ? ($_GET['cid']) : $cid)); |
|
46 | 46 | $genre_element = new SonglistFormSelectGenre('', 'gid', $gid); |
47 | 47 | $voice_element = new SonglistFormSelectVoice('', 'vcid', $vcid); |
48 | 48 | |
@@ -68,21 +68,21 @@ discard block |
||
68 | 68 | |
69 | 69 | $url = $songs_handler->getURL(); |
70 | 70 | if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
71 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
71 | + header("HTTP/1.1 301 Moved Permanently"); |
|
72 | 72 | header('Location: '.$url); |
73 | 73 | exit(0); |
74 | 74 | } |
75 | 75 | |
76 | 76 | $xoopsOption['template_main'] = 'songlist_songs_index.html'; |
77 | 77 | include($GLOBALS['xoops']->path('/header.php')); |
78 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
78 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
79 | 79 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
80 | - $GLOBALS['loaded_jquery']=true; |
|
80 | + $GLOBALS['loaded_jquery'] = true; |
|
81 | 81 | } |
82 | 82 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
83 | 83 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
84 | 84 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
85 | - foreach($songs as $song) |
|
85 | + foreach ($songs as $song) |
|
86 | 86 | $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
87 | 87 | $GLOBALS['xoopsTpl']->assign('songs', true); |
88 | 88 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | |
105 | 105 | $url = $song->getURL(true); |
106 | 106 | if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
107 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
107 | + header("HTTP/1.1 301 Moved Permanently"); |
|
108 | 108 | header('Location: '.$url); |
109 | 109 | exit(0); |
110 | 110 | } |
111 | 111 | |
112 | 112 | $xoopsOption['template_main'] = 'songlist_songs_item.html'; |
113 | 113 | include($GLOBALS['xoops']->path('/header.php')); |
114 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
114 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
115 | 115 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
116 | - $GLOBALS['loaded_jquery']=true; |
|
116 | + $GLOBALS['loaded_jquery'] = true; |
|
117 | 117 | } |
118 | 118 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
119 | 119 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $browse_criteria = new CriteriaCompo(); |
138 | 138 | switch ($value) { |
139 | 139 | case '0': |
140 | - for($u=0;$u<10;$u++) { |
|
140 | + for ($u = 0; $u<10; $u++) { |
|
141 | 141 | $browse_criteria->add(new Criteria('`title`', $u.'%', 'LIKE'), 'OR'); |
142 | 142 | } |
143 | 143 | break; |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $browse_criteria = new CriteriaCompo(); |
156 | 156 | switch ($value) { |
157 | 157 | case '0': |
158 | - for($u=0;$u<10;$u++) { |
|
158 | + for ($u = 0; $u<10; $u++) { |
|
159 | 159 | $browse_criteria->add(new Criteria('`lyrics`', $u.'%', 'LIKE'), 'OR'); |
160 | 160 | } |
161 | 161 | break; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $browse_criteria = new CriteriaCompo(); |
174 | 174 | switch ($value) { |
175 | 175 | case '0': |
176 | - for($u=0;$u<10;$u++) { |
|
176 | + for ($u = 0; $u<10; $u++) { |
|
177 | 177 | $browse_criteria->add(new Criteria('`name`', $u.'%', 'LIKE'), 'OR'); |
178 | 178 | } |
179 | 179 | break; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | $artists_handler = xoops_getmodulehandler('artists', 'songlist'); |
186 | 186 | $browse_criteriab = new CriteriaCompo(); |
187 | - foreach($artists_handler->getObjects($browse_criteria, true) as $aid => $obj) { |
|
187 | + foreach ($artists_handler->getObjects($browse_criteria, true) as $aid => $obj) { |
|
188 | 188 | $browse_criteriab->add(new Criteria('`aids`', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
189 | 189 | |
190 | 190 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $browse_criteria = new CriteriaCompo(); |
198 | 198 | switch ($value) { |
199 | 199 | case '0': |
200 | - for($u=0;$u<10;$u++) { |
|
200 | + for ($u = 0; $u<10; $u++) { |
|
201 | 201 | $browse_criteria->add(new Criteria('`title`', $u.'%', 'LIKE'), 'OR'); |
202 | 202 | } |
203 | 203 | break; |
@@ -206,9 +206,9 @@ discard block |
||
206 | 206 | $browse_criteria->add(new Criteria('`title`', strtolower($value).'%', 'LIKE'), 'OR'); |
207 | 207 | break; |
208 | 208 | } |
209 | - $ids=array(); |
|
209 | + $ids = array(); |
|
210 | 210 | $albums_handler = xoops_getmodulehandler('albums', 'songlist'); |
211 | - foreach($albums_handler->getObjects($browse_criteria, true) as $id => $obj) { |
|
211 | + foreach ($albums_handler->getObjects($browse_criteria, true) as $id => $obj) { |
|
212 | 212 | $ids[$id] = $id; |
213 | 213 | |
214 | 214 | } |
@@ -227,21 +227,21 @@ discard block |
||
227 | 227 | |
228 | 228 | $url = $songs_handler->getURL(); |
229 | 229 | if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
230 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
230 | + header("HTTP/1.1 301 Moved Permanently"); |
|
231 | 231 | header('Location: '.$url); |
232 | 232 | exit(0); |
233 | 233 | } |
234 | 234 | |
235 | 235 | $xoopsOption['template_main'] = 'songlist_songs_index.html'; |
236 | 236 | include($GLOBALS['xoops']->path('/header.php')); |
237 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
237 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
238 | 238 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
239 | - $GLOBALS['loaded_jquery']=true; |
|
239 | + $GLOBALS['loaded_jquery'] = true; |
|
240 | 240 | } |
241 | 241 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
242 | 242 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
243 | 243 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
244 | - foreach($songs as $song) |
|
244 | + foreach ($songs as $song) |
|
245 | 245 | $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
246 | 246 | $GLOBALS['xoopsTpl']->assign('songs', true); |
247 | 247 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | |
270 | 270 | $url = $songs_handler->getSearchURL(); |
271 | 271 | if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
272 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
272 | + header("HTTP/1.1 301 Moved Permanently"); |
|
273 | 273 | header('Location: '.$url); |
274 | 274 | exit(0); |
275 | 275 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | default: |
279 | 279 | case "titleandlyrics": |
280 | 280 | $criteria = new CriteriaCompo(); |
281 | - foreach(explode(' ' , $value) as $keyword) { |
|
281 | + foreach (explode(' ', $value) as $keyword) { |
|
282 | 282 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
283 | 283 | $criteria->add(new Criteria('`lyrics`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
284 | 284 | } |
@@ -286,52 +286,52 @@ discard block |
||
286 | 286 | |
287 | 287 | case "albums": |
288 | 288 | $criteria = new CriteriaCompo(); |
289 | - foreach(explode(' ' , $value) as $keyword) { |
|
289 | + foreach (explode(' ', $value) as $keyword) { |
|
290 | 290 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
291 | 291 | } |
292 | 292 | $albums = $albums_handler->getObject($criteria, true); |
293 | 293 | $criteria = new CriteriaCompo(); |
294 | - foreach($albums as $abid=> $album) { |
|
294 | + foreach ($albums as $abid=> $album) { |
|
295 | 295 | $criteria->add(new Criteria('`abid`', $abid), 'OR'); |
296 | 296 | } |
297 | 297 | break; |
298 | 298 | |
299 | 299 | case "artists": |
300 | 300 | $criteria = new CriteriaCompo(); |
301 | - foreach(explode(' ' , $value) as $keyword) { |
|
301 | + foreach (explode(' ', $value) as $keyword) { |
|
302 | 302 | $criteria->add(new Criteria('`name`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
303 | 303 | } |
304 | 304 | $artists = $artists_handler->getObject($criteria, true); |
305 | 305 | $criteria = new CriteriaCompo(); |
306 | - foreach($artists as $aid=> $artist) { |
|
306 | + foreach ($artists as $aid=> $artist) { |
|
307 | 307 | $criteria->add(new Criteria('`aids`', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
308 | 308 | } |
309 | 309 | break; |
310 | 310 | |
311 | 311 | case "lyrics": |
312 | 312 | $criteria = new CriteriaCompo(); |
313 | - foreach(explode(' ' , $value) as $keyword) { |
|
313 | + foreach (explode(' ', $value) as $keyword) { |
|
314 | 314 | $criteria->add(new Criteria('`lyrics`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
315 | 315 | } |
316 | 316 | break; |
317 | 317 | case "title": |
318 | 318 | $criteria = new CriteriaCompo(); |
319 | - foreach(explode(' ' , $value) as $keyword) { |
|
319 | + foreach (explode(' ', $value) as $keyword) { |
|
320 | 320 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
321 | 321 | } |
322 | 322 | break; |
323 | 323 | } |
324 | 324 | |
325 | - if ($gid != 0 && $GLOBALS['songlistModuleConfig']['genre']) { |
|
325 | + if ($gid!=0 && $GLOBALS['songlistModuleConfig']['genre']) { |
|
326 | 326 | $criteria->add(new Criteria('`gids`', '%"'.$gid.'"%', 'LIKE')); |
327 | 327 | } |
328 | 328 | |
329 | - if ($vcid != 0 && $GLOBALS['songlistModuleConfig']['voice']) { |
|
329 | + if ($vcid!=0 && $GLOBALS['songlistModuleConfig']['voice']) { |
|
330 | 330 | $criteria->add(new Criteria('`vcid`', $vcid)); |
331 | 331 | } |
332 | 332 | |
333 | - if ((isset($_GET['cid'])?($_GET['cid']):$cid) != 0) { |
|
334 | - $criteria->add(new Criteria('`cid`', (isset($_GET['cid'])?($_GET['cid']):$cid))); |
|
333 | + if ((isset($_GET['cid']) ? ($_GET['cid']) : $cid)!=0) { |
|
334 | + $criteria->add(new Criteria('`cid`', (isset($_GET['cid']) ? ($_GET['cid']) : $cid))); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | $pagenav = new XoopsPageNav($songs_handler->getCount($criteria), $limit, $start, 'start', "op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
@@ -343,14 +343,14 @@ discard block |
||
343 | 343 | |
344 | 344 | $xoopsOption['template_main'] = 'songlist_search_index.html'; |
345 | 345 | include($GLOBALS['xoops']->path('/header.php')); |
346 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
346 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
347 | 347 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
348 | - $GLOBALS['loaded_jquery']=true; |
|
348 | + $GLOBALS['loaded_jquery'] = true; |
|
349 | 349 | } |
350 | 350 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
351 | 351 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
352 | 352 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
353 | - foreach($songs as $song) { |
|
353 | + foreach ($songs as $song) { |
|
354 | 354 | $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
355 | 355 | } |
356 | 356 | $GLOBALS['xoopsTpl']->assign('songs', true); |
@@ -7,8 +7,9 @@ discard block |
||
7 | 7 | $category_handler = xoops_getmodulehandler('category', 'songlist'); |
8 | 8 | $criteria_cat = new CriteriaCompo(); |
9 | 9 | $cids = $category_handler->GetCatAndSubCat($_SESSION['cid']); |
10 | - if ($_SESSION['cid']>0) |
|
11 | - $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
10 | + if ($_SESSION['cid']>0) { |
|
11 | + $cids[$_SESSION['cid']] = $_SESSION['cid']; |
|
12 | + } |
|
12 | 13 | if (count($cids)>0&&$_SESSION['cid']!=0) { |
13 | 14 | $criteria_cat->add(new Criteria('`cid`', '('.implode(',', $cids).')', 'IN'), 'OR'); |
14 | 15 | } else { |
@@ -82,8 +83,9 @@ discard block |
||
82 | 83 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
83 | 84 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
84 | 85 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
85 | - foreach($songs as $song) |
|
86 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
86 | + foreach($songs as $song) { |
|
87 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
88 | + } |
|
87 | 89 | $GLOBALS['xoopsTpl']->assign('songs', true); |
88 | 90 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
89 | 91 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
@@ -93,8 +95,9 @@ discard block |
||
93 | 95 | $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
94 | 96 | if ($_SESSION['cid']!=0) { |
95 | 97 | $category = $category_handler->get($_SESSION['cid']); |
96 | - if (is_object($category)) |
|
97 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
98 | + if (is_object($category)) { |
|
99 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
100 | + } |
|
98 | 101 | } |
99 | 102 | $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
100 | 103 | include($GLOBALS['xoops']->path('/footer.php')); |
@@ -213,8 +216,9 @@ discard block |
||
213 | 216 | |
214 | 217 | } |
215 | 218 | $criteria = new CriteriaCompo($criteria_cat, 'AND'); |
216 | - if (count($ids)>0) |
|
217 | - $criteria->add(new Criteria('abid', '('.implode(',', $ids).')', 'IN')); |
|
219 | + if (count($ids)>0) { |
|
220 | + $criteria->add(new Criteria('abid', '('.implode(',', $ids).')', 'IN')); |
|
221 | + } |
|
218 | 222 | break; |
219 | 223 | } |
220 | 224 | |
@@ -241,8 +245,9 @@ discard block |
||
241 | 245 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
242 | 246 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
243 | 247 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
244 | - foreach($songs as $song) |
|
245 | - $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
248 | + foreach($songs as $song) { |
|
249 | + $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
|
250 | + } |
|
246 | 251 | $GLOBALS['xoopsTpl']->assign('songs', true); |
247 | 252 | $GLOBALS['xoopsTpl']->assign('categories', $cat); |
248 | 253 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav()); |
@@ -252,8 +257,9 @@ discard block |
||
252 | 257 | $GLOBALS['xoopsTpl']->assign('cid', $_SESSION['cid']); |
253 | 258 | if ($_SESSION['cid']!=0) { |
254 | 259 | $category = $category_handler->get($_SESSION['cid']); |
255 | - if (is_object($category)) |
|
256 | - $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
260 | + if (is_object($category)) { |
|
261 | + $GLOBALS['xoopsTpl']->assign('category', $category->toArray(true)); |
|
262 | + } |
|
257 | 263 | } |
258 | 264 | $GLOBALS['xoopsTpl']->assign('uri', $_SERVER['REQUEST_URI']); |
259 | 265 | include($GLOBALS['xoops']->path('/footer.php')); |
@@ -1,103 +1,103 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // XOOPS Version |
4 | - define('_MI_SONGLIST_NAME','Songlist'); |
|
5 | - define('_MI_SONGLIST_DESC','Karioki Songlist - a module for keeping karioki song lists and ranking of them.'); |
|
6 | - define('_MI_SONGLIST_DIRNAME','songlist'); |
|
4 | + define('_MI_SONGLIST_NAME', 'Songlist'); |
|
5 | + define('_MI_SONGLIST_DESC', 'Karioki Songlist - a module for keeping karioki song lists and ranking of them.'); |
|
6 | + define('_MI_SONGLIST_DIRNAME', 'songlist'); |
|
7 | 7 | |
8 | 8 | // Form langauges |
9 | - define('_MI_SONGLIST_NONE','None'); |
|
10 | - define('_MI_SONGLIST_ALL','All'); |
|
11 | - define('_MI_SONGLIST_OFTEN',' of 10.00'); |
|
9 | + define('_MI_SONGLIST_NONE', 'None'); |
|
10 | + define('_MI_SONGLIST_ALL', 'All'); |
|
11 | + define('_MI_SONGLIST_OFTEN', ' of 10.00'); |
|
12 | 12 | |
13 | 13 | // Javascripts and style sheets |
14 | - define('_MI_SONGLIST_JQUERY','/browse.php?Frameworks/jquery/jquery.js'); |
|
15 | - define('_MI_SONGLIST_STYLESHEET','/modules/songlist/css/songlist.css'); |
|
14 | + define('_MI_SONGLIST_JQUERY', '/browse.php?Frameworks/jquery/jquery.js'); |
|
15 | + define('_MI_SONGLIST_STYLESHEET', '/modules/songlist/css/songlist.css'); |
|
16 | 16 | |
17 | 17 | // Admin Menus |
18 | - define('_MI_SONGLIST_ADMENU_DASHBOARD','Dashboard'); |
|
19 | - define('_MI_SONGLIST_ADMENU_CATEGORY','Category\'s'); |
|
20 | - define('_MI_SONGLIST_ADMENU_ALBUMS','Albums'); |
|
21 | - define('_MI_SONGLIST_ADMENU_ARTISTS','Artists'); |
|
22 | - define('_MI_SONGLIST_ADMENU_SONGS','Songs'); |
|
23 | - define('_MI_SONGLIST_ADMENU_GENRE','Genre'); |
|
24 | - define('_MI_SONGLIST_ADMENU_VOICE','Voice'); |
|
25 | - define('_MI_SONGLIST_ADMENU_VOTE','Votes'); |
|
26 | - define('_MI_SONGLIST_ADMENU_PERMISSIONS','Permissions'); |
|
27 | - define('_MI_SONGLIST_ADMENU_REQUESTS','Requests'); |
|
28 | - define('_MI_SONGLIST_ADMENU_UTF8MAP','UTF8 Map'); |
|
29 | - define('_MI_SONGLIST_ADMENU_IMPORT','Import'); |
|
30 | - define('_MI_SONGLIST_ADMENU_FIELDS','Fields'); |
|
31 | - define('_MI_SONGLIST_ADMENU_FIELDSPERMS','Field Permissions'); |
|
32 | - define('_MI_SONGLIST_ADMENU_ABOUT','About Songlist'); |
|
18 | + define('_MI_SONGLIST_ADMENU_DASHBOARD', 'Dashboard'); |
|
19 | + define('_MI_SONGLIST_ADMENU_CATEGORY', 'Category\'s'); |
|
20 | + define('_MI_SONGLIST_ADMENU_ALBUMS', 'Albums'); |
|
21 | + define('_MI_SONGLIST_ADMENU_ARTISTS', 'Artists'); |
|
22 | + define('_MI_SONGLIST_ADMENU_SONGS', 'Songs'); |
|
23 | + define('_MI_SONGLIST_ADMENU_GENRE', 'Genre'); |
|
24 | + define('_MI_SONGLIST_ADMENU_VOICE', 'Voice'); |
|
25 | + define('_MI_SONGLIST_ADMENU_VOTE', 'Votes'); |
|
26 | + define('_MI_SONGLIST_ADMENU_PERMISSIONS', 'Permissions'); |
|
27 | + define('_MI_SONGLIST_ADMENU_REQUESTS', 'Requests'); |
|
28 | + define('_MI_SONGLIST_ADMENU_UTF8MAP', 'UTF8 Map'); |
|
29 | + define('_MI_SONGLIST_ADMENU_IMPORT', 'Import'); |
|
30 | + define('_MI_SONGLIST_ADMENU_FIELDS', 'Fields'); |
|
31 | + define('_MI_SONGLIST_ADMENU_FIELDSPERMS', 'Field Permissions'); |
|
32 | + define('_MI_SONGLIST_ADMENU_ABOUT', 'About Songlist'); |
|
33 | 33 | |
34 | 34 | //User Menus |
35 | - define('_MI_SONGLIST_MENU_ARTISTS','Browse Artists'); |
|
36 | - define('_MI_SONGLIST_MENU_ALBUMS','Browse Albums'); |
|
37 | - define('_MI_SONGLIST_MENU_SEARCH','Search for a song'); |
|
38 | - define('_MI_SONGLIST_MENU_REQUEST','Request a Listing'); |
|
35 | + define('_MI_SONGLIST_MENU_ARTISTS', 'Browse Artists'); |
|
36 | + define('_MI_SONGLIST_MENU_ALBUMS', 'Browse Albums'); |
|
37 | + define('_MI_SONGLIST_MENU_SEARCH', 'Search for a song'); |
|
38 | + define('_MI_SONGLIST_MENU_REQUEST', 'Request a Listing'); |
|
39 | 39 | |
40 | 40 | // Blocks |
41 | - define('_MI_SONGLIST_BLOCK_TOP_ARTIST','Top Artist'); |
|
42 | - define('_MI_SONGLIST_BLOCK_POPULAR_ARTISTS','Top Popular Artists'); |
|
43 | - define('_MI_SONGLIST_BLOCK_TOP_ALBUM','Top Album'); |
|
44 | - define('_MI_SONGLIST_BLOCK_POPULAR_ALBUMS','Top Popular Albums'); |
|
45 | - define('_MI_SONGLIST_BLOCK_TOP_GENRE','Top Genre'); |
|
46 | - define('_MI_SONGLIST_BLOCK_POPULAR_GENRES','Top Popular Genre\'s'); |
|
47 | - define('_MI_SONGLIST_BLOCK_TOP_SONG','Top Song'); |
|
48 | - define('_MI_SONGLIST_BLOCK_POPULAR_SONGS','Top Popular Songs'); |
|
41 | + define('_MI_SONGLIST_BLOCK_TOP_ARTIST', 'Top Artist'); |
|
42 | + define('_MI_SONGLIST_BLOCK_POPULAR_ARTISTS', 'Top Popular Artists'); |
|
43 | + define('_MI_SONGLIST_BLOCK_TOP_ALBUM', 'Top Album'); |
|
44 | + define('_MI_SONGLIST_BLOCK_POPULAR_ALBUMS', 'Top Popular Albums'); |
|
45 | + define('_MI_SONGLIST_BLOCK_TOP_GENRE', 'Top Genre'); |
|
46 | + define('_MI_SONGLIST_BLOCK_POPULAR_GENRES', 'Top Popular Genre\'s'); |
|
47 | + define('_MI_SONGLIST_BLOCK_TOP_SONG', 'Top Song'); |
|
48 | + define('_MI_SONGLIST_BLOCK_POPULAR_SONGS', 'Top Popular Songs'); |
|
49 | 49 | |
50 | 50 | // Preferences |
51 | - define('_MI_SONGLIST_EDITORS','Editor to Use'); |
|
52 | - define('_MI_SONGLIST_EDITORS_DESC',''); |
|
53 | - define('_MI_SONGLIST_SALT','Encryption Salt'); |
|
54 | - define('_MI_SONGLIST_SALT_DESC',''); |
|
55 | - define('_MI_SONGLIST_EMAIL','Email to send requests to'); |
|
56 | - define('_MI_SONGLIST_EMAIL_DESC','Seperated with a pipe symbol ie. <em>[email protected]|[email protected]|[email protected]</em>'); |
|
57 | - define('_MI_SONGLIST_FILESIZEUPLD','Filesize Upload Allowed'); |
|
58 | - define('_MI_SONGLIST_FILESIZEUPLD_DESC',''); |
|
59 | - define('_MI_SONGLIST_ALLOWEDMIMETYPE','File mimetypes Allowed'); |
|
60 | - define('_MI_SONGLIST_ALLOWEDMIMETYPE_DESC',''); |
|
61 | - define('_MI_SONGLIST_ALLOWEDEXTENSIONS','File Extensions Allowed'); |
|
62 | - define('_MI_SONGLIST_ALLOWEDEXTENSIONS_DESC',''); |
|
63 | - define('_MI_SONGLIST_UPLOADAREAS','Upload path'); |
|
64 | - define('_MI_SONGLIST_UPLOADAREAS_DESC',''); |
|
65 | - define('_MI_SONGLIST_ALBUM','Support Albums?'); |
|
66 | - define('_MI_SONGLIST_ALBUM_DESC',''); |
|
67 | - define('_MI_SONGLIST_GENRE','Support Genre?'); |
|
68 | - define('_MI_SONGLIST_GENRE_DESC',''); |
|
69 | - define('_MI_SONGLIST_VOICE','Support Voice?'); |
|
70 | - define('_MI_SONGLIST_VOICE_DESC',''); |
|
71 | - define('_MI_SONGLIST_SINGER','Allow Singer Type in Search?'); |
|
72 | - define('_MI_SONGLIST_SINGER_DESC',''); |
|
73 | - define('_MI_SONGLIST_HTACCESS','SEO Supported (see doc/.htaccess)'); |
|
74 | - define('_MI_SONGLIST_HTACCESS_DESC',''); |
|
75 | - define('_MI_SONGLIST_HTACCESS_BASEOFURL','Base of SEO URL'); |
|
76 | - define('_MI_SONGLIST_HTACCESS_BASEOFURL_DESC',''); |
|
77 | - define('_MI_SONGLIST_HTACCESS_ENDOFURL','End of SEO URL'); |
|
78 | - define('_MI_SONGLIST_HTACCESS_ENDOFURL_DESC',''); |
|
79 | - define('_MI_SONGLIST_TAGS','Support Tag 2.3 Module?'); |
|
80 | - define('_MI_SONGLIST_TAGS_DESC',''); |
|
81 | - define('_MI_SONGLIST_FORCE_JQUERY','For JQuery Loading'); |
|
82 | - define('_MI_SONGLIST_FORCE_JQUERY_DESC','For themes without JQuery!'); |
|
83 | - define('_MI_SONGLIST_COLS','Columns in table'); |
|
84 | - define('_MI_SONGLIST_COLS_DESC','Columns in table before pagination.'); |
|
85 | - define('_MI_SONGLIST_ROWS','Rows in table'); |
|
86 | - define('_MI_SONGLIST_ROWS_DESC','Rows in table before pagination.'); |
|
51 | + define('_MI_SONGLIST_EDITORS', 'Editor to Use'); |
|
52 | + define('_MI_SONGLIST_EDITORS_DESC', ''); |
|
53 | + define('_MI_SONGLIST_SALT', 'Encryption Salt'); |
|
54 | + define('_MI_SONGLIST_SALT_DESC', ''); |
|
55 | + define('_MI_SONGLIST_EMAIL', 'Email to send requests to'); |
|
56 | + define('_MI_SONGLIST_EMAIL_DESC', 'Seperated with a pipe symbol ie. <em>[email protected]|[email protected]|[email protected]</em>'); |
|
57 | + define('_MI_SONGLIST_FILESIZEUPLD', 'Filesize Upload Allowed'); |
|
58 | + define('_MI_SONGLIST_FILESIZEUPLD_DESC', ''); |
|
59 | + define('_MI_SONGLIST_ALLOWEDMIMETYPE', 'File mimetypes Allowed'); |
|
60 | + define('_MI_SONGLIST_ALLOWEDMIMETYPE_DESC', ''); |
|
61 | + define('_MI_SONGLIST_ALLOWEDEXTENSIONS', 'File Extensions Allowed'); |
|
62 | + define('_MI_SONGLIST_ALLOWEDEXTENSIONS_DESC', ''); |
|
63 | + define('_MI_SONGLIST_UPLOADAREAS', 'Upload path'); |
|
64 | + define('_MI_SONGLIST_UPLOADAREAS_DESC', ''); |
|
65 | + define('_MI_SONGLIST_ALBUM', 'Support Albums?'); |
|
66 | + define('_MI_SONGLIST_ALBUM_DESC', ''); |
|
67 | + define('_MI_SONGLIST_GENRE', 'Support Genre?'); |
|
68 | + define('_MI_SONGLIST_GENRE_DESC', ''); |
|
69 | + define('_MI_SONGLIST_VOICE', 'Support Voice?'); |
|
70 | + define('_MI_SONGLIST_VOICE_DESC', ''); |
|
71 | + define('_MI_SONGLIST_SINGER', 'Allow Singer Type in Search?'); |
|
72 | + define('_MI_SONGLIST_SINGER_DESC', ''); |
|
73 | + define('_MI_SONGLIST_HTACCESS', 'SEO Supported (see doc/.htaccess)'); |
|
74 | + define('_MI_SONGLIST_HTACCESS_DESC', ''); |
|
75 | + define('_MI_SONGLIST_HTACCESS_BASEOFURL', 'Base of SEO URL'); |
|
76 | + define('_MI_SONGLIST_HTACCESS_BASEOFURL_DESC', ''); |
|
77 | + define('_MI_SONGLIST_HTACCESS_ENDOFURL', 'End of SEO URL'); |
|
78 | + define('_MI_SONGLIST_HTACCESS_ENDOFURL_DESC', ''); |
|
79 | + define('_MI_SONGLIST_TAGS', 'Support Tag 2.3 Module?'); |
|
80 | + define('_MI_SONGLIST_TAGS_DESC', ''); |
|
81 | + define('_MI_SONGLIST_FORCE_JQUERY', 'For JQuery Loading'); |
|
82 | + define('_MI_SONGLIST_FORCE_JQUERY_DESC', 'For themes without JQuery!'); |
|
83 | + define('_MI_SONGLIST_COLS', 'Columns in table'); |
|
84 | + define('_MI_SONGLIST_COLS_DESC', 'Columns in table before pagination.'); |
|
85 | + define('_MI_SONGLIST_ROWS', 'Rows in table'); |
|
86 | + define('_MI_SONGLIST_ROWS_DESC', 'Rows in table before pagination.'); |
|
87 | 87 | |
88 | 88 | // Version 1.11 |
89 | 89 | // Preferences |
90 | - define('_MI_SONGLIST_MEMORY_ADMIN','Memory Limit for Admin'); |
|
91 | - define('_MI_SONGLIST_MEMORY_ADMIN_DESC','This is the memory limit in megabytes for the admin of songlist, you may have to increase this over a certain amount of records.'); |
|
92 | - define('_MI_SONGLIST_MEMORY_USER','Memory Limit for User Interface'); |
|
93 | - define('_MI_SONGLIST_MEMORY_USER_DESC','This is the memory limit in megabytes for the user interface of songlist, you may have to increase this over a certain amount of records.'); |
|
94 | - define('_MI_SONGLIST_TIME_ADMIN','Second Limit of Execution for Admin'); |
|
95 | - define('_MI_SONGLIST_TIME_ADMIN_DESC','This is the time limit in megabytes for the admin of songlist, you may have to increase this over a certain amount of records.'); |
|
96 | - define('_MI_SONGLIST_TIME_USER','Second Limit of Execution for User Interface'); |
|
97 | - define('_MI_SONGLIST_TIME_USER_DESC','This is the time limit in megabytes for the user interface of songlist, you may have to increase this over a certain amount of records.'); |
|
90 | + define('_MI_SONGLIST_MEMORY_ADMIN', 'Memory Limit for Admin'); |
|
91 | + define('_MI_SONGLIST_MEMORY_ADMIN_DESC', 'This is the memory limit in megabytes for the admin of songlist, you may have to increase this over a certain amount of records.'); |
|
92 | + define('_MI_SONGLIST_MEMORY_USER', 'Memory Limit for User Interface'); |
|
93 | + define('_MI_SONGLIST_MEMORY_USER_DESC', 'This is the memory limit in megabytes for the user interface of songlist, you may have to increase this over a certain amount of records.'); |
|
94 | + define('_MI_SONGLIST_TIME_ADMIN', 'Second Limit of Execution for Admin'); |
|
95 | + define('_MI_SONGLIST_TIME_ADMIN_DESC', 'This is the time limit in megabytes for the admin of songlist, you may have to increase this over a certain amount of records.'); |
|
96 | + define('_MI_SONGLIST_TIME_USER', 'Second Limit of Execution for User Interface'); |
|
97 | + define('_MI_SONGLIST_TIME_USER_DESC', 'This is the time limit in megabytes for the user interface of songlist, you may have to increase this over a certain amount of records.'); |
|
98 | 98 | |
99 | 99 | // version 1.12 |
100 | - define('_MI_SONGLIST_LYRICS','Display Lyrics in Results?'); |
|
101 | - define('_MI_SONGLIST_LYRICS_DESC','If you enable this the lyrics will be displayed in the search results!'); |
|
100 | + define('_MI_SONGLIST_LYRICS', 'Display Lyrics in Results?'); |
|
101 | + define('_MI_SONGLIST_LYRICS_DESC', 'If you enable this the lyrics will be displayed in the search results!'); |
|
102 | 102 | |
103 | 103 | ?> |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | include "header.php"; |
3 | -include XOOPS_ROOT_PATH . "/modules/tag/list.tag.php"; |
|
3 | +include XOOPS_ROOT_PATH."/modules/tag/list.tag.php"; |
|
4 | 4 | ?> |
5 | 5 | \ No newline at end of file |
@@ -116,13 +116,13 @@ |
||
116 | 116 | |
117 | 117 | case "category": |
118 | 118 | switch ($fct) { |
119 | - default: |
|
120 | - case "set": |
|
121 | - $_SESSION['cid'] = $id; |
|
122 | - break; |
|
123 | - case "home": |
|
124 | - unset($_SESSION['cid']); |
|
125 | - break; |
|
119 | + default: |
|
120 | + case "set": |
|
121 | + $_SESSION['cid'] = $id; |
|
122 | + break; |
|
123 | + case "home": |
|
124 | + unset($_SESSION['cid']); |
|
125 | + break; |
|
126 | 126 | } |
127 | 127 | redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MN_SONGLIST_MSG_CATEGORYCHANGED); |
128 | 128 | exit; |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | global $file, $op, $fct, $id, $value, $gid, $cid, $start, $limit, $singer; |
6 | 6 | |
7 | - $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid'])?($_GET['cid']):$cid)); |
|
7 | + $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid']) ? ($_GET['cid']) : $cid)); |
|
8 | 8 | $genre_element = new SonglistFormSelectGenre('', 'gid', $gid); |
9 | 9 | $voice_element = new SonglistFormSelectVoice('', 'vcid', $vcid); |
10 | 10 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $url = $songs_handler->getSearchURL(); |
21 | 21 | if (!strpos($url, $_SERVER['REQUEST_URI'])) { |
22 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
22 | + header("HTTP/1.1 301 Moved Permanently"); |
|
23 | 23 | header('Location: '.$url); |
24 | 24 | exit(0); |
25 | 25 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | default: |
29 | 29 | case "titleandlyrics": |
30 | 30 | $criteria = new CriteriaCompo(); |
31 | - foreach(explode(' ' , $value) as $keyword) { |
|
31 | + foreach (explode(' ', $value) as $keyword) { |
|
32 | 32 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
33 | 33 | $criteria->add(new Criteria('`lyrics`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
34 | 34 | } |
@@ -36,52 +36,52 @@ discard block |
||
36 | 36 | |
37 | 37 | case "albums": |
38 | 38 | $criteria = new CriteriaCompo(); |
39 | - foreach(explode(' ' , $value) as $keyword) { |
|
39 | + foreach (explode(' ', $value) as $keyword) { |
|
40 | 40 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
41 | 41 | } |
42 | 42 | $albums = $albums_handler->getObject($criteria, true); |
43 | 43 | $criteria = new CriteriaCompo(); |
44 | - foreach($albums as $abid=> $album) { |
|
44 | + foreach ($albums as $abid=> $album) { |
|
45 | 45 | $criteria->add(new Criteria('`abid`', $abid), 'OR'); |
46 | 46 | } |
47 | 47 | break; |
48 | 48 | |
49 | 49 | case "artists": |
50 | 50 | $criteria = new CriteriaCompo(); |
51 | - foreach(explode(' ' , $value) as $keyword) { |
|
51 | + foreach (explode(' ', $value) as $keyword) { |
|
52 | 52 | $criteria->add(new Criteria('`name`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
53 | 53 | } |
54 | 54 | $artists = $artists_handler->getObject($criteria, true); |
55 | 55 | $criteria = new CriteriaCompo(); |
56 | - foreach($artists as $aid=> $artist) { |
|
56 | + foreach ($artists as $aid=> $artist) { |
|
57 | 57 | $criteria->add(new Criteria('`aids`', '%"'.$aid.'"%', 'LIKE'), 'OR'); |
58 | 58 | } |
59 | 59 | break; |
60 | 60 | |
61 | 61 | case "lyrics": |
62 | 62 | $criteria = new CriteriaCompo(); |
63 | - foreach(explode(' ' , $value) as $keyword) { |
|
63 | + foreach (explode(' ', $value) as $keyword) { |
|
64 | 64 | $criteria->add(new Criteria('`lyrics`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
65 | 65 | } |
66 | 66 | break; |
67 | 67 | case "title": |
68 | 68 | $criteria = new CriteriaCompo(); |
69 | - foreach(explode(' ' , $value) as $keyword) { |
|
69 | + foreach (explode(' ', $value) as $keyword) { |
|
70 | 70 | $criteria->add(new Criteria('`title`', '%'.$utf8map_handler->convert($keyword).'%', 'LIKE')); |
71 | 71 | } |
72 | 72 | break; |
73 | 73 | } |
74 | 74 | |
75 | - if ($gid != 0 && $GLOBALS['songlistModuleConfig']['genre']) { |
|
75 | + if ($gid!=0 && $GLOBALS['songlistModuleConfig']['genre']) { |
|
76 | 76 | $criteria->add(new Criteria('`gids`', '%"'.$gid.'"%', 'LIKE')); |
77 | 77 | } |
78 | 78 | |
79 | - if ($vcid != 0 && $GLOBALS['songlistModuleConfig']['voice']) { |
|
79 | + if ($vcid!=0 && $GLOBALS['songlistModuleConfig']['voice']) { |
|
80 | 80 | $criteria->add(new Criteria('`vcid`', $vcid)); |
81 | 81 | } |
82 | 82 | |
83 | - if ((isset($_GET['cid'])?($_GET['cid']):$cid) != 0) { |
|
84 | - $criteria->add(new Criteria('`cid`', (isset($_GET['cid'])?($_GET['cid']):$cid))); |
|
83 | + if ((isset($_GET['cid']) ? ($_GET['cid']) : $cid)!=0) { |
|
84 | + $criteria->add(new Criteria('`cid`', (isset($_GET['cid']) ? ($_GET['cid']) : $cid))); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | $pagenav = new XoopsPageNav($songs_handler->getCount($criteria), $limit, $start, 'start', "?op=$op&fct=$fct&gid=$gid&vcid=$vcid&value=$value&limit=$limit"); |
@@ -93,14 +93,14 @@ discard block |
||
93 | 93 | |
94 | 94 | $xoopsOption['template_main'] = 'songlist_search_index.html'; |
95 | 95 | include($GLOBALS['xoops']->path('/header.php')); |
96 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
96 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
97 | 97 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
98 | - $GLOBALS['loaded_jquery']=true; |
|
98 | + $GLOBALS['loaded_jquery'] = true; |
|
99 | 99 | } |
100 | 100 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
101 | 101 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
102 | 102 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
103 | - foreach($songs as $song) { |
|
103 | + foreach ($songs as $song) { |
|
104 | 104 | $GLOBALS['xoopsTpl']->append('results', $song->toArray(true)); |
105 | 105 | } |
106 | 106 | $GLOBALS['xoopsTpl']->assign('songs', true); |
@@ -23,37 +23,37 @@ |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | switch ($fct) { |
26 | - case "save": |
|
27 | - if (checkEmail($_POST[0]['email'], true)&&!empty($_POST[0]['email'])) { |
|
28 | - $request = $requests_handler->create(); |
|
29 | - $request->setVars($_POST[0]); |
|
30 | - if ($rid = $requests_handler->insert($request)) { |
|
31 | - redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MN_SONGLIST_MSG_REQUESTSENT); |
|
26 | + case "save": |
|
27 | + if (checkEmail($_POST[0]['email'], true)&&!empty($_POST[0]['email'])) { |
|
28 | + $request = $requests_handler->create(); |
|
29 | + $request->setVars($_POST[0]); |
|
30 | + if ($rid = $requests_handler->insert($request)) { |
|
31 | + redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MN_SONGLIST_MSG_REQUESTSENT); |
|
32 | + } else { |
|
33 | + redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MN_SONGLIST_MSG_REQUESTNOTSENT); |
|
34 | + } |
|
35 | + exit; |
|
36 | + break; |
|
32 | 37 | } else { |
33 | - redirect_header($_SERVER["PHP_SELF"]."?op=item&fct=list&id=$id&value=$value&start=$start&limit=$limit", 10, _MN_SONGLIST_MSG_REQUESTNOTSENT); |
|
38 | + $error = _MN_SONGLIST_MSG_EMAILNOTSET; |
|
34 | 39 | } |
35 | - exit; |
|
36 | - break; |
|
37 | - } else { |
|
38 | - $error = _MN_SONGLIST_MSG_EMAILNOTSET; |
|
39 | - } |
|
40 | - default: |
|
41 | - case "list": |
|
40 | + default: |
|
41 | + case "list": |
|
42 | 42 | |
43 | - $xoopsOption['template_main'] = 'songlist_requests_index.html'; |
|
44 | - include($GLOBALS['xoops']->path('/header.php')); |
|
45 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
46 | - $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
47 | - $GLOBALS['loaded_jquery']=true; |
|
48 | - } |
|
49 | - $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
50 | - $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
51 | - $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
52 | - $GLOBALS['xoopsTpl']->assign('form', songlist_requests_get_form(false, false)); |
|
53 | - if (strlen($error)) |
|
54 | - xoops_error($error); |
|
55 | - include($GLOBALS['xoops']->path('/footer.php')); |
|
56 | - break; |
|
43 | + $xoopsOption['template_main'] = 'songlist_requests_index.html'; |
|
44 | + include($GLOBALS['xoops']->path('/header.php')); |
|
45 | + if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
46 | + $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
|
47 | + $GLOBALS['loaded_jquery']=true; |
|
48 | + } |
|
49 | + $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
|
50 | + $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
|
51 | + $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
|
52 | + $GLOBALS['xoopsTpl']->assign('form', songlist_requests_get_form(false, false)); |
|
53 | + if (strlen($error)) |
|
54 | + xoops_error($error); |
|
55 | + include($GLOBALS['xoops']->path('/footer.php')); |
|
56 | + break; |
|
57 | 57 | |
58 | 58 | |
59 | 59 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | global $file, $op, $fct, $id, $value, $gid, $cid, $singer, $start, $limit; |
6 | 6 | |
7 | - $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid'])?($_GET['cid']):$cid)); |
|
7 | + $category_element = new SonglistFormSelectCategory('', 'cid', (isset($_GET['cid']) ? ($_GET['cid']) : $cid)); |
|
8 | 8 | $genre_element = new SonglistFormSelectGenre('', 'gid', $gid); |
9 | 9 | $genre_element = new SonglistFormSelectGenre('', 'vid', $vid); |
10 | 10 | //$singer_element = new SonglistFormSelectSinger('', 'singer', $singer); |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | case "request": |
17 | 17 | |
18 | 18 | $url = $requests_handler->getURL(); |
19 | - if (!strpos($url, $_SERVER['REQUEST_URI'])&&empty($_POST)) { |
|
20 | - header( "HTTP/1.1 301 Moved Permanently" ); |
|
19 | + if (!strpos($url, $_SERVER['REQUEST_URI']) && empty($_POST)) { |
|
20 | + header("HTTP/1.1 301 Moved Permanently"); |
|
21 | 21 | header('Location: '.$url); |
22 | 22 | exit(0); |
23 | 23 | } |
24 | 24 | |
25 | 25 | switch ($fct) { |
26 | 26 | case "save": |
27 | - if (checkEmail($_POST[0]['email'], true)&&!empty($_POST[0]['email'])) { |
|
27 | + if (checkEmail($_POST[0]['email'], true) && !empty($_POST[0]['email'])) { |
|
28 | 28 | $request = $requests_handler->create(); |
29 | 29 | $request->setVars($_POST[0]); |
30 | 30 | if ($rid = $requests_handler->insert($request)) { |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | |
43 | 43 | $xoopsOption['template_main'] = 'songlist_requests_index.html'; |
44 | 44 | include($GLOBALS['xoops']->path('/header.php')); |
45 | - if ($GLOBALS['songlistModuleConfig']['force_jquery']&&!isset($GLOBALS['loaded_jquery'])) { |
|
45 | + if ($GLOBALS['songlistModuleConfig']['force_jquery'] && !isset($GLOBALS['loaded_jquery'])) { |
|
46 | 46 | $GLOBALS['xoTheme']->addScript(XOOPS_URL._MI_SONGLIST_JQUERY, array('type'=>'text/javascript')); |
47 | - $GLOBALS['loaded_jquery']=true; |
|
47 | + $GLOBALS['loaded_jquery'] = true; |
|
48 | 48 | } |
49 | 49 | $GLOBALS['xoTheme']->addStylesheet(XOOPS_URL._MI_SONGLIST_STYLESHEET, array('type'=>'text/css')); |
50 | 50 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
@@ -50,8 +50,9 @@ |
||
50 | 50 | $GLOBALS['xoopsTpl']->assign('xoConfig', $GLOBALS['songlistModuleConfig']); |
51 | 51 | $GLOBALS['xoopsTpl']->assign('php_self', $_SERVER['PHP_SELF']); |
52 | 52 | $GLOBALS['xoopsTpl']->assign('form', songlist_requests_get_form(false, false)); |
53 | - if (strlen($error)) |
|
54 | - xoops_error($error); |
|
53 | + if (strlen($error)) { |
|
54 | + xoops_error($error); |
|
55 | + } |
|
55 | 56 | include($GLOBALS['xoops']->path('/footer.php')); |
56 | 57 | break; |
57 | 58 |
@@ -3,37 +3,37 @@ discard block |
||
3 | 3 | |
4 | 4 | function songlist_tag_iteminfo(&$items) |
5 | 5 | { |
6 | - if (empty($items) || !is_array($items)) { |
|
7 | - return false; |
|
8 | - } |
|
6 | + if (empty($items) || !is_array($items)) { |
|
7 | + return false; |
|
8 | + } |
|
9 | 9 | |
10 | - $items_id = array(); |
|
11 | - foreach (array_keys($items) as $cat_id) { |
|
12 | - // Some handling here to build the link upon catid |
|
13 | - // catid is not used in songlist, so just skip it |
|
14 | - foreach (array_keys($items[$cat_id]) as $item_id) { |
|
15 | - // In songlist, the item_id is "topic_id" |
|
16 | - $items_id[] = intval($item_id); |
|
17 | - } |
|
18 | - } |
|
19 | - $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
20 | - $items_obj = $item_handler->getObjects(new Criteria("sid", "(" . implode(", ", $items_id) . ")", "IN"), true); |
|
21 | - $myts = MyTextSanitizer::getInstance(); |
|
22 | - foreach (array_keys($items) as $cat_id) { |
|
23 | - foreach (array_keys($items[$cat_id]) as $item_id) { |
|
24 | - $item_obj =& $items_obj[$item_id]; |
|
25 | - if (is_object($item_obj)) |
|
10 | + $items_id = array(); |
|
11 | + foreach (array_keys($items) as $cat_id) { |
|
12 | + // Some handling here to build the link upon catid |
|
13 | + // catid is not used in songlist, so just skip it |
|
14 | + foreach (array_keys($items[$cat_id]) as $item_id) { |
|
15 | + // In songlist, the item_id is "topic_id" |
|
16 | + $items_id[] = intval($item_id); |
|
17 | + } |
|
18 | + } |
|
19 | + $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
20 | + $items_obj = $item_handler->getObjects(new Criteria("sid", "(" . implode(", ", $items_id) . ")", "IN"), true); |
|
21 | + $myts = MyTextSanitizer::getInstance(); |
|
22 | + foreach (array_keys($items) as $cat_id) { |
|
23 | + foreach (array_keys($items[$cat_id]) as $item_id) { |
|
24 | + $item_obj =& $items_obj[$item_id]; |
|
25 | + if (is_object($item_obj)) |
|
26 | 26 | $items[$cat_id][$item_id] = array( |
27 | - "title" => $item_obj->getVar("title"), |
|
28 | - "uid" => $item_obj->getVar("uid"), |
|
29 | - "link" => 'index.php?op=item&fct=item&id='.$item_obj->getVar("sid").'&cid='.$item_obj->getVar("cid"), |
|
30 | - "time" => $item_obj->getVar("date"), |
|
31 | - "tags" => tag_parse_tag($item_obj->getVar("tags", "n")), |
|
32 | - "content" => $myts->displayTarea($item_obj->getVar("lyrics"),true,true,true,true,true,true) |
|
33 | - ); |
|
34 | - } |
|
35 | - } |
|
36 | - unset($items_obj); |
|
27 | + "title" => $item_obj->getVar("title"), |
|
28 | + "uid" => $item_obj->getVar("uid"), |
|
29 | + "link" => 'index.php?op=item&fct=item&id='.$item_obj->getVar("sid").'&cid='.$item_obj->getVar("cid"), |
|
30 | + "time" => $item_obj->getVar("date"), |
|
31 | + "tags" => tag_parse_tag($item_obj->getVar("tags", "n")), |
|
32 | + "content" => $myts->displayTarea($item_obj->getVar("lyrics"),true,true,true,true,true,true) |
|
33 | + ); |
|
34 | + } |
|
35 | + } |
|
36 | + unset($items_obj); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -44,33 +44,33 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function songlist_tag_synchronization($mid) |
46 | 46 | { |
47 | - $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
48 | - $link_handler =& xoops_getmodulehandler("link", "tag"); |
|
47 | + $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
48 | + $link_handler =& xoops_getmodulehandler("link", "tag"); |
|
49 | 49 | |
50 | - /* clear tag-item links */ |
|
51 | - if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )): |
|
52 | - $sql = " DELETE FROM {$link_handler->table}" . |
|
53 | - " WHERE " . |
|
54 | - " tag_modid = {$mid}" . |
|
55 | - " AND " . |
|
56 | - " ( tag_itemid NOT IN " . |
|
57 | - " ( SELECT DISTINCT {$item_handler->keyName} " . |
|
58 | - " FROM {$item_handler->table} " . |
|
59 | - " WHERE {$item_handler->table}.approved > 0" . |
|
60 | - " ) " . |
|
61 | - " )"; |
|
62 | - else: |
|
63 | - $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" . |
|
64 | - " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} " . |
|
65 | - " WHERE " . |
|
66 | - " tag_modid = {$mid}" . |
|
67 | - " AND " . |
|
68 | - " ( aa.{$item_handler->keyName} IS NULL" . |
|
69 | - " OR aa.approved < 1" . |
|
70 | - " )"; |
|
71 | - endif; |
|
72 | - if (!$result = $link_handler->db->queryF($sql)) { |
|
73 | - //xoops_error($link_handler->db->error()); |
|
74 | - } |
|
50 | + /* clear tag-item links */ |
|
51 | + if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )): |
|
52 | + $sql = " DELETE FROM {$link_handler->table}" . |
|
53 | + " WHERE " . |
|
54 | + " tag_modid = {$mid}" . |
|
55 | + " AND " . |
|
56 | + " ( tag_itemid NOT IN " . |
|
57 | + " ( SELECT DISTINCT {$item_handler->keyName} " . |
|
58 | + " FROM {$item_handler->table} " . |
|
59 | + " WHERE {$item_handler->table}.approved > 0" . |
|
60 | + " ) " . |
|
61 | + " )"; |
|
62 | + else: |
|
63 | + $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" . |
|
64 | + " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} " . |
|
65 | + " WHERE " . |
|
66 | + " tag_modid = {$mid}" . |
|
67 | + " AND " . |
|
68 | + " ( aa.{$item_handler->keyName} IS NULL" . |
|
69 | + " OR aa.approved < 1" . |
|
70 | + " )"; |
|
71 | + endif; |
|
72 | + if (!$result = $link_handler->db->queryF($sql)) { |
|
73 | + //xoops_error($link_handler->db->error()); |
|
74 | + } |
|
75 | 75 | } |
76 | 76 | ?> |
77 | 77 | \ No newline at end of file |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | $items_id[] = intval($item_id); |
17 | 17 | } |
18 | 18 | } |
19 | - $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
20 | - $items_obj = $item_handler->getObjects(new Criteria("sid", "(" . implode(", ", $items_id) . ")", "IN"), true); |
|
19 | + $item_handler = & xoops_getmodulehandler('songs', 'songlist'); |
|
20 | + $items_obj = $item_handler->getObjects(new Criteria("sid", "(".implode(", ", $items_id).")", "IN"), true); |
|
21 | 21 | $myts = MyTextSanitizer::getInstance(); |
22 | 22 | foreach (array_keys($items) as $cat_id) { |
23 | 23 | foreach (array_keys($items[$cat_id]) as $item_id) { |
24 | - $item_obj =& $items_obj[$item_id]; |
|
24 | + $item_obj = & $items_obj[$item_id]; |
|
25 | 25 | if (is_object($item_obj)) |
26 | 26 | $items[$cat_id][$item_id] = array( |
27 | 27 | "title" => $item_obj->getVar("title"), |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | "link" => 'index.php?op=item&fct=item&id='.$item_obj->getVar("sid").'&cid='.$item_obj->getVar("cid"), |
30 | 30 | "time" => $item_obj->getVar("date"), |
31 | 31 | "tags" => tag_parse_tag($item_obj->getVar("tags", "n")), |
32 | - "content" => $myts->displayTarea($item_obj->getVar("lyrics"),true,true,true,true,true,true) |
|
32 | + "content" => $myts->displayTarea($item_obj->getVar("lyrics"), true, true, true, true, true, true) |
|
33 | 33 | ); |
34 | 34 | } |
35 | 35 | } |
@@ -44,29 +44,29 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function songlist_tag_synchronization($mid) |
46 | 46 | { |
47 | - $item_handler =& xoops_getmodulehandler('songs', 'songlist'); |
|
48 | - $link_handler =& xoops_getmodulehandler("link", "tag"); |
|
47 | + $item_handler = & xoops_getmodulehandler('songs', 'songlist'); |
|
48 | + $link_handler = & xoops_getmodulehandler("link", "tag"); |
|
49 | 49 | |
50 | 50 | /* clear tag-item links */ |
51 | - if (version_compare( mysql_get_server_info(), "4.1.0", "ge" )): |
|
52 | - $sql = " DELETE FROM {$link_handler->table}" . |
|
53 | - " WHERE " . |
|
54 | - " tag_modid = {$mid}" . |
|
55 | - " AND " . |
|
56 | - " ( tag_itemid NOT IN " . |
|
57 | - " ( SELECT DISTINCT {$item_handler->keyName} " . |
|
58 | - " FROM {$item_handler->table} " . |
|
59 | - " WHERE {$item_handler->table}.approved > 0" . |
|
60 | - " ) " . |
|
51 | + if (version_compare(mysql_get_server_info(), "4.1.0", "ge")): |
|
52 | + $sql = " DELETE FROM {$link_handler->table}". |
|
53 | + " WHERE ". |
|
54 | + " tag_modid = {$mid}". |
|
55 | + " AND ". |
|
56 | + " ( tag_itemid NOT IN ". |
|
57 | + " ( SELECT DISTINCT {$item_handler->keyName} ". |
|
58 | + " FROM {$item_handler->table} ". |
|
59 | + " WHERE {$item_handler->table}.approved > 0". |
|
60 | + " ) ". |
|
61 | 61 | " )"; |
62 | 62 | else: |
63 | - $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" . |
|
64 | - " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} " . |
|
65 | - " WHERE " . |
|
66 | - " tag_modid = {$mid}" . |
|
67 | - " AND " . |
|
68 | - " ( aa.{$item_handler->keyName} IS NULL" . |
|
69 | - " OR aa.approved < 1" . |
|
63 | + $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}". |
|
64 | + " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} ". |
|
65 | + " WHERE ". |
|
66 | + " tag_modid = {$mid}". |
|
67 | + " AND ". |
|
68 | + " ( aa.{$item_handler->keyName} IS NULL". |
|
69 | + " OR aa.approved < 1". |
|
70 | 70 | " )"; |
71 | 71 | endif; |
72 | 72 | if (!$result = $link_handler->db->queryF($sql)) { |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | foreach (array_keys($items) as $cat_id) { |
23 | 23 | foreach (array_keys($items[$cat_id]) as $item_id) { |
24 | 24 | $item_obj =& $items_obj[$item_id]; |
25 | - if (is_object($item_obj)) |
|
26 | - $items[$cat_id][$item_id] = array( |
|
25 | + if (is_object($item_obj)) { |
|
26 | + $items[$cat_id][$item_id] = array( |
|
27 | 27 | "title" => $item_obj->getVar("title"), |
28 | 28 | "uid" => $item_obj->getVar("uid"), |
29 | 29 | "link" => 'index.php?op=item&fct=item&id='.$item_obj->getVar("sid").'&cid='.$item_obj->getVar("cid"), |
@@ -31,6 +31,7 @@ discard block |
||
31 | 31 | "tags" => tag_parse_tag($item_obj->getVar("tags", "n")), |
32 | 32 | "content" => $myts->displayTarea($item_obj->getVar("lyrics"),true,true,true,true,true,true) |
33 | 33 | ); |
34 | + } |
|
34 | 35 | } |
35 | 36 | } |
36 | 37 | unset($items_obj); |
@@ -59,7 +60,8 @@ discard block |
||
59 | 60 | " WHERE {$item_handler->table}.approved > 0" . |
60 | 61 | " ) " . |
61 | 62 | " )"; |
62 | - else: |
|
63 | + else { |
|
64 | + : |
|
63 | 65 | $sql = " DELETE {$link_handler->table} FROM {$link_handler->table}" . |
64 | 66 | " LEFT JOIN {$item_handler->table} AS aa ON {$link_handler->table}.tag_itemid = aa.{$item_handler->keyName} " . |
65 | 67 | " WHERE " . |
@@ -68,6 +70,7 @@ discard block |
||
68 | 70 | " ( aa.{$item_handler->keyName} IS NULL" . |
69 | 71 | " OR aa.approved < 1" . |
70 | 72 | " )"; |
73 | + } |
|
71 | 74 | endif; |
72 | 75 | if (!$result = $link_handler->db->queryF($sql)) { |
73 | 76 | //xoops_error($link_handler->db->error()); |
@@ -8,19 +8,19 @@ discard block |
||
8 | 8 | */ |
9 | 9 | function b_songlist_popular_albums_show($options): ?array |
10 | 10 | { |
11 | - xoops_loadLanguage('blocks', 'songlist'); |
|
12 | - $handler = Helper::getInstance()->getHandler('Albums'); |
|
13 | - $objects = $handler->getTop($options[0]); |
|
14 | - if (count($objects) > 0) { |
|
15 | - $ret = []; |
|
16 | - foreach ($objects as $id => $object) { |
|
17 | - $ret[$id] = $object->toArray(true); |
|
18 | - } |
|
11 | + xoops_loadLanguage('blocks', 'songlist'); |
|
12 | + $handler = Helper::getInstance()->getHandler('Albums'); |
|
13 | + $objects = $handler->getTop($options[0]); |
|
14 | + if (count($objects) > 0) { |
|
15 | + $ret = []; |
|
16 | + foreach ($objects as $id => $object) { |
|
17 | + $ret[$id] = $object->toArray(true); |
|
18 | + } |
|
19 | 19 | |
20 | - return $ret; |
|
21 | - } |
|
20 | + return $ret; |
|
21 | + } |
|
22 | 22 | |
23 | - return null; |
|
23 | + return null; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | */ |
30 | 30 | function b_songlist_popular_albums_edit($options): string |
31 | 31 | { |
32 | - xoops_load('XoopsFormLoader'); |
|
33 | - xoops_loadLanguage('blocks', 'songlist'); |
|
34 | - $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
32 | + xoops_load('XoopsFormLoader'); |
|
33 | + xoops_loadLanguage('blocks', 'songlist'); |
|
34 | + $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
|
35 | 35 | |
36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
36 | + return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
37 | 37 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | xoops_loadLanguage('blocks', 'songlist'); |
12 | 12 | $handler = Helper::getInstance()->getHandler('Albums'); |
13 | 13 | $objects = $handler->getTop($options[0]); |
14 | - if (count($objects) > 0) { |
|
14 | + if (count($objects)>0) { |
|
15 | 15 | $ret = []; |
16 | 16 | foreach ($objects as $id => $object) { |
17 | 17 | $ret[$id] = $object->toArray(true); |
@@ -33,5 +33,5 @@ discard block |
||
33 | 33 | xoops_loadLanguage('blocks', 'songlist'); |
34 | 34 | $num = new \XoopsformText('', 'options[0]', 10, 10, $options[0]); |
35 | 35 | |
36 | - return _BL_SONGLIST_NUMBEROFITEMS . $num->render(); |
|
36 | + return _BL_SONGLIST_NUMBEROFITEMS.$num->render(); |
|
37 | 37 | } |